Having windows media player stream an AVI.
Posted: Sun Feb 15, 2009 11:30 am
Hey Guys,
I have this big AVI file that I want to stream to the user.
I tried the basic:
This seems to make the whole avi download first before opening it in windows media player, I just want to stream it to the player instead.
Since the files in questions are on my local network, I then tried to do:
Now the funny part is that if I put "file://///networkspace/movies/file.avi" in my address bar and push enter, the movie is then streamed to my player.
But clicking on the <a> tag does not do anything, its like firefox ignores that click.
Any idea(s) how to make this work?
Cheers.
I have this big AVI file that I want to stream to the user.
I tried the basic:
Code: Select all
if (file_exists($file)) {
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename='.basename($file));
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
header('Content-Length: ' . filesize($file));
ob_clean();
flush();
readfile($file);
exit;
}
?>
Since the files in questions are on my local network, I then tried to do:
Code: Select all
<a href="file://///networkspace/movies/file.avi">click</a>
But clicking on the <a> tag does not do anything, its like firefox ignores that click.
Any idea(s) how to make this work?
Cheers.