S
S
strify_252020-04-10 12:02:42
JavaScript
strify_25, 2020-04-10 12:02:42

How to make round-the-clock playback of video files on the site?

Hello. We want to make a semblance of television on the site - there are many videos, you need them to be played on the site according to a certain schedule (we can set it ourselves). The problem is that when you go to the page with the player, the video plays from the very beginning. How can I make the playback continue continuously even if I close the video page?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
nekipelov, 2020-04-16
@nekipelov

A page is made on which the HLS player is placed (the simplest one: https://videojs.com/ ).
On the server, the following command is run at the required frequency:

ffmpeg -i ИМЯ_ВИДЕО_ФАЙЛА -ar 44100 -acodec aac -ac 1 -strict -2 -crf 18 -c:v h264 -preset ultrafast -flags -global_header -fflags flush_packets -tune zerolatency -hls_time 1 -hls_list_size 3 -hls_wrap 4 -hls_flags delete_segments -start_number 0 /tmp/www/video/video.m3u8

The ffmpeg program will read VIDEO_FILE_NAME and write video fragments to the /tmp/www/video/ directory, along with a playlist in HLS format. This playlist is specified in the html page (of course, the http server should be able to serve the file from the /tmp/www/video/ directory .

V
ValdikSS, 2020-05-15
@ValdikSS

How can I make the playback continue continuously even if I close the video page?
Make a global "playlist" and go to the current file and playing time when you enter the site.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question