Play MP4 through PHP Script

All your problems with Audio, Video and Images.

Play MP4 through PHP Script

Postby rondog » Wed Mar 09, 2011 1:16 am

Hey guys,
I have some MP4s that live above web root. I use a PHP script that delivers the video to the user. The reason for this is I want them logged in in order to view the videos. I have it working on the iOS and it works great. When I try to view it on an android device, I get a "Video cannot be played" error. Any ideas what I am doing wrong? Here is my PHP script and remember this script is working great on iPhone and iPad.

http://pastie.org/1649505

Basically the script is a byte range download. That allows (at least on the iOS) you to skip ahead in a video even if it hasn't downloaded all the way
rondog
Freshman
Freshman
 
Posts: 4
Joined: Wed Mar 09, 2011 1:11 am

Top

Re: Play MP4 through PHP Script

Postby Kerbik » Wed Mar 09, 2011 11:02 am

there could be a problem ... adroid can't (at least i think right now =) ) play unfinished byte array.

But you could check this link and modify it for your purpose :)

http://blog.pocketjourney.com/2008/04/0 ... diaplayer/

Hope it will be helpfull.
Kerbik
Kerbik
Developer
Developer
 
Posts: 30
Joined: Fri May 28, 2010 6:06 am

Re: Play MP4 through PHP Script

Postby rondog » Wed Mar 09, 2011 7:42 pm

Ah I should have mentioned this was a web application, so It is accessed through the browser. I am using jQuery Mobile and when I go directly to the video on web root, it plays. If Itry and play it through my script it wont. Do you have any information on how videos are played on the android os? In the iOS docs I was able to determine that their method of streaming was through byte ranges.
rondog
Freshman
Freshman
 
Posts: 4
Joined: Wed Mar 09, 2011 1:11 am

Top

Return to Multimedia Problems

Who is online

Users browsing this forum: No registered users and 28 guests