Y
Y
yurygolikov2016-07-21 18:43:29
PHP
yurygolikov, 2016-07-21 18:43:29

How to stream video using php (rewind not working)?

Server: apache, shared hosting.
How to upload videos using php?
So far I'm doing this

if (ob_get_level()) {
            ob_end_clean();
        }
        header('Content-Description: File Transfer');
        header('Content-Type: video/mp4');
        header('Content-Disposition: attachment; filename=' . basename($file));
        header('Content-Transfer-Encoding: binary');
        header('Content-Length: ' . filesize($file));
        readfile($file);

BUT the video is not loaded "in advance", and rewind does not work. I don't really understand how to make it work. Tell me, please, in which direction to dig. As I understand it, in the direction of php streaming, Content-range, but I can’t find the necessary information. Please give some links, read or describe in detail, if not difficult. Thanks in advance!
Directly, without php, everything works.
But I need to run a script through PHP to restrict user access to the file!
ps Don't hit too hard

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
ThunderCat, 2016-07-21
@ThunderCat

here to read , here a little, in general, do not be shy to use Google.
PS: Here , too, on the topic like

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question