Forum Moderators: coopster

Message Too Old, No Replies

Session start and readfile with wmv video

How readfile a wmv video

         

zeuf

5:59 am on Apr 28, 2009 (gmt 0)

10+ Year Member



Hi Everybody !

Here is my problem :

I want to read videos which are outside the WWW folder.

With <object> markup I can read FLV, MOV ou MP4 videos without problems but I can't read WMV, AVI or MPG videos.

My <object> markup asks for a php file (value="video.php?file=videofile.wmv")

Here is my video.php (working with FLV, MOV, MP4 but not with WMV, AVI or MPG) :


<?php
session_start() ;
if ($_SESSION['is_connected']=='Connected')
{
header('Content-Type: video/x-ms-wmv') ;
@readfile('/Dir/outside/www/'.$_GET['file']) ;
}
?>

But when I take off session_start, everything is working fine with every kind of videos


<?php
header('Content-Type: video/x-ms-wmv') ;
@readfile('/Dir/outside/www/'.$_GET['file']) ;
?>

So I guess session_start put something in the file but I do not know why and what.

Of course I tried everything about cache things (output_buffering in php.ini, every sorts of hearders...)

Someone already meet that problem ?

Thank you very much

d40sithui

2:44 pm on Apr 28, 2009 (gmt 0)

10+ Year Member



When you took of the session stuff, you're also taking off the condition for your header() and readfile() to execute. Could this condition be returning false and thus never get to the code you want?

zeuf

2:55 pm on Apr 28, 2009 (gmt 0)

10+ Year Member



Hi d40sithui !

No... When I take off the session controls (session_start, the If and the {} condition) there is not test left so there is no problem and it works.

I forgot to say that it is working with IE678 (with or without the session) but not with FF3, Safari 3 and Chrome 1 (any case).

I also tested the file (downladed it with a link to the same file) : it is the correct file so... I guess session_start is not really the problem, it just makes it happen...

Still searching...