Jump to content

php streaming


baiju

Recommended Posts

any body know about php streaming in JW player.

i tried to implement but always am getting 0% in player.

i have gone through this url.

http://www.jeroenwijering.com/?thread=6523

but not getting the o/p

 

here is my code

 

<?php

$file = "C:/xampp/htdocs/ref/video.flv";

header("Content-Type: video/x-flv");

header('Content-Length: ' . filesize($file));

 

 

$pos = 2346;

 

 

if($pos > 0) {

print("FLV");

print(pack('C',1));

print(pack('C',1));

print(pack('N',9));

print(pack('N',9));

}

 

 

$fh = fopen($file,"rb");

fseek($fh, $pos);

while (!feof($fh))

{

print(fread($fh, 8192));

}

fclose($fh);

?>

i tried in both way means in javascript as well as html

1.

<script type="text/javascript">

// <![CDATA[

 

var s1 = new SWFObject("http://localhost/ref/mediaplayer.swf","iwflash","560","260","9");

// for ExpressInstall

s1.useExpressInstall("playerProductInstall.swf");

//s1.setAttribute("xiRedirectUrl", window.location.href);

// the video file or the playlist file

s1.addVariable("file","/ref/video.flv");

// the PHP script

s1.addVariable("allowscriptaccess","true");

s1.addVariable("streamscript","http://localhost/ref/streaming.php");

s1.addVariable("bufferlength","1.2");

// for playlist

s1.addVariable("thumbsinplaylist","true");

s1.addVariable("shuffle","false");

//s1.addVariable("thumbimagewidth","60");

s1.addVariable("thumbimageheight","40");

// the width and the height of the video

//s1.addVariable("displaywidth","320");

s1.addVariable("displayheight","240");

s1.addVariable("autostart","true");

s1.addVariable("showdigits","true");

// for fullscreen

s1.addParam("allowfullscreen","true");

s1.addVariable("showfsbutton","true");

 

s1.write("player");

 

 

// ]]>

</script>

 

2.

 

<embed

width="640"

height="380"

flashvars="streamscript=http://localhost/ref/streaming.php&file=/ref/video.flv&backcolor=0x333333&frontcolor=0xBBCCDD&lightcolor=0xCCDDEE&autostart=true&type=flv"

allowfullscreen="true"

quality="high"

name="video"

id="video"

style=""

src="http://localhost/ref/mediaplayer.swf"

type="application/x-shockwave-flash"/>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.