I’m having a problem loading a large video into the browser. I have a video.php
file, which creates a $token
to access the product specified in $_GET['product']
and then video.js
requests access to the video files.
<video id="viewer" class="video-js vjs-default-skin vjs-big-play-centered" data-setup='{ "controls": true, "autoplay": false, "preload": "metadata" }' height="500" width="1000" disablePictureInPicture controls="disabled"> <source src="videostream?type=m3u8&path=<?php echo $token; ?>/prog_index.m3u8" type="application/x-mpegURL"> </video>
The server should then return the chunks of the video. The videos are stored like this:
private - products -- 1 --- prog_index.m3u8 --- fileSequence0.ts --- fileSequence1.ts --- fileSequence2.ts --- and so on...
It duplicates the folder to tmp
with the name of the folder is the token. Let’s say the token was 1234123412341234
:
private - tmp -- 1234123412341234 --- prog_index.m3u8 --- fileSequence0.ts --- fileSequence1.ts --- fileSequence2.ts --- and so on...
And the files get deleted as they are loaded.
When I try to access mysite.com/video.php?product=1
, I get 503 Service Unavailable.
The total size of the video files are about 1-2GB big and I’m using GoDaddy hosting.
Thanks!
Advertisement
Answer
I found out that my PHP was timing out. My php.ini
file had a max_execution_time
of 600
(5 minutes), so when I changed the max_execution_time
to -1
, it fixed the problem.