Feature: Wait mode for live streams

This commit is contained in:
localhost_frssoft 2022-04-06 03:25:25 +03:00
parent 51326f326a
commit aff86e836d
2 changed files with 21 additions and 2 deletions

View file

@ -138,11 +138,30 @@ peertube_menu_stream()
#torrent_url=$(echo $get_video | jj streamingPlaylists.0.files.#[resolution.id=$pref_video_quality].torrentUrl)
echo "Channel: $channel"
echo "Description video:\n$desc"
menu_video_choice=$(echo "Play\nBack\nMain menu" | fzy)
menu_video_choice=$(echo "Play\nWait mode\nBack\nMain menu" | fzy)
case $menu_video_choice in
"Main menu") sub2_menu=0 && sub_menu=0 ;;
"Back") sub2_menu=0 ;;
"Play") $default_player_command $playlist_stream ;;
"Wait mode")
playlist_stream=$(echo $get_video | jj streamingPlaylists.0.playlistUrl)
echo 'Wait mode enabled...'
echo 'Stream will be played when published state'
while [ -z $playlist_stream ]; do
get_video=$(peertube_api_get_video $1)
playlist_stream=$(echo $get_video | jj streamingPlaylists.0.playlistUrl)
wait=15
while [ $wait -gt 0 ]; do
date
sleep 1
wait=$(expr $wait - 1)
done
done
clear
echo 'Stream PUBLISHED!'
$default_player_command $playlist_stream
;;
esac
done
}

View file

@ -26,7 +26,7 @@
"peer-id-ttl-hours": 6,
"peer-limit-global": 200,
"peer-limit-per-torrent": 50,
"peer-port": 59577,
"peer-port": 57468,
"peer-port-random-high": 65535,
"peer-port-random-low": 49152,
"peer-port-random-on-start": true,