Your favorite Apple, iPhone, iPad, iOS, Jailbreak, and Cydia site.
08-20-2008, 12:51 AM #1mp4 videos Streaming quicktime w/ .htaccess?
So I have mp4 videos uploaded on my web hosting service. To be safe, I have given the directory where they are located your standard username & password protection using .htaccess.
The problem is, iPhone's Safari won't stream the mp4s with the authentication in place. It streams it perfectly without the .htaccess authentication, but consistently get "movie could not be played" errors with.
They stream perfectly in every computer-based browser I throw at it regardless.
it's something about the iphone that when you try to access a video when you are logged into a pass protected area, the mp4 wont play... the phone doesnt carry your user/pass.
anyone know the fix? or another way around this?
bump,... anyone ? this is driving me nuts ive been trying to figure this out for hours!
Last edited by Persius; 08-20-2008 at 12:51 AM. Reason: Automerged Doublepost
08-20-2008, 01:29 AM #2
In order to make this work, I had to add this to my .htaccess file. This will lower your security level in that someone having a complete path to a particular media file could access it without a password, but I never found another work around.
Last edited by DaveiPhone; 08-20-2008 at 01:34 AM.
08-20-2008, 02:07 AM #3
08-20-2008, 09:34 AM #4
They are still protected this way. You still need to login to the server, and you can use many tricks to make it nearly impossible to guess a path. My security point is that if you know the EXACT path to a particular file, you can get to it without needing to login first. Most pay sites for example, are the same. There are relatively few sites that are secure once you know an interior path. But they still, for example, couldn't get a directory listing.
08-21-2008, 11:36 AM #5
Its still not ready for 22.214.171.124 firmware.It crashes in between.
08-21-2008, 09:48 PM #6
Huh? I've been using this for months, never a crash.
09-03-2008, 03:40 PM #7
Why do they need to be protected? As long as you don't tell anyone the file path or the file name, people won't find it.
09-27-2008, 08:11 AM #8
I have a fix.
Instead of htaccess/htpasswd, use php's cookie/session authorization. If you can password protect a php page, php can protect files as well.
Create a php login/authorization script (5 minutes?)
Put all protected files in a folder that has "Deny ALL" in htaccess
Create a dl.php file. If they are logged in, have it stream the files in the deny all folder (php can access this, deny all is for http only). If you want quicktime to play the file, be sure to have it send the correct mimi type in the headers. (video/mpeg?)
02-26-2009, 02:29 PM #9
Thankfully I'm a LVL 7 Necromancer and can bring this thread back from the dead!
I think this is the problem I'm having. I have videos behind a password and they just won't play. To be honest, this PHP stuff is a bit over my head. Is there a way around this, or is the PHP scripts the best way?
02-26-2009, 03:14 PM #10
Just out of curousity why are you trying to hide your files? From the server? Or you don't want public users to have access to them?
02-26-2009, 04:09 PM #11
Are we allowed to back-and-forth like this? Sorry to the mods!
I do not want public access to the files, no.