0

I'm trying to stream an MP4 video stored in my server.

I'm using this class in my project like this:

$vs = new VideoStream($path_to_my_file);
$vs->start();

and in my html page:

<video controls="" preload="none" poster="assets/video/bg.png" name="media" style="width:100%;">
<source src="path/to/my/page.php" type="video/mp4">
</video>

anytime I press play everything goes well, but I cannot move through the timeline. I can only play and pause the video.

Jack
  • 489
  • 1
  • 6
  • 18
  • Not sure if this will fix it, but have you tried lowering the bitrate of the video. Had some trouble with videos in the past, and got that solved by lowering the bitrate. – Peter Bode Jan 14 '19 at 08:59
  • *"I cannot move through the timeline."* That's the fate of a stream yes... Why do you serve it as a stream if you want to be able to seek in it? And if you absolutely need to serve it as a stream (because well, it is a stream like a live broadcast) then it makes also sense you can't go into future, and if you don't store anywhere what happened before, it also makes sense you can't access it either. – Kaiido Jan 14 '19 at 09:14
  • Possible duplicate of [Streaming a large file using PHP](https://stackoverflow.com/questions/6914912/streaming-a-large-file-using-php) – David Lemon Jan 14 '19 at 09:20
  • @Kaiido that's true! But, I'd like to serve my video in a "youtube like" way. I just need to display the video and be able to watch it and move through the timeline. At the same time i cannot link the absolute url, because the video is kind of private and i have to play some logic before. – Jack Jan 14 '19 at 13:00
  • 1
    https://stackoverflow.com/questions/53720558/hide-original-path-with-blob/53800040#53800040 – Kaiido Jan 14 '19 at 14:31

1 Answers1

0

I ask to my own question.

I changed way! I edited the video with "fast start" option using ffmpeg.

Uploading again the video now is working good!

Jack
  • 489
  • 1
  • 6
  • 18