I'm totally new to PHP and JW player.
I have the following code that reads a video file in php and plays it as a video file in the browser:
loadfile.php
<?php
header("pragma : no-cache");
header("Expires: Thu, 19 Nov 1981 08:52:00 GMT");
header("Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0");
header("Content-Description: File Transfer");
header("Content-Type: video/mp4");
header("Content-Location: videos/testvid.mp4");
header("Content-Transfer-Encoding: binary");
header("Content-Length: ".filesize("videos/testvid.mp4"));
readfile("videos/testvid.mp4");
?>
JW player can play the video file by direct path as in here:
<div id="mediaplayer"></div>
<script type="text/javascript">
jwplayer('mediaplayer').setup({
'flashplayer': 'jwplayer/jwplayer.swf',
'file': 'videos/testvid.mp4',
'id': 'playerID',
'width': '480',
'height': '320'
});
</script>
However, I need jw player to play the video in loadfile.php and not by direct path. In other words, I need to pass the video to JW player after streaming and reading it in php. How can I do this?
Update:
I'm using JW 6