I need to stream an flv file.
Streaming should look like live streaming,
and I there should be a way to change the target file.
Sorry for my poor English.
I need to stream an flv file. Streaming should look like live streaming, and
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If by “streaming” you mean “showing a flash-video clip”, flv-streaming isn’t really streaming, but it’s a normal file transfer, with the flash player starting playback even if the file isn’t completely downloaded to the client. Time seeking is implemented in a standard HTTP way, with a file download offset – if you scroll the video halfway on the timeline and it hasn’t downloaded yet, the current download is (most often) aborted, and restarted with an offset of filesize/2 bytes.
So, you could be fine with just using plain old
readfile()and fixing the HTTP mime-type headers appropriately withheader(). But, since you’d need seeking, you need to parse the HTTP request and instead ofreadfile(), usefpassthru(), seeking the right place, instead.tl;dr: Avoid handling this on the PHP side, and let Apache (or the httpd of your choice) handle this instead.