You will recieve your password to this address. Address is not made public.

Your preferred username that is used when logging in.

Please help - Embed method, with autohide set to false and Pseudostreaming Created Jun 3, 2010

This thread is solved

Views: 2873     Replies: 10     Last reply Aug 5, 2011  
You must login first before you can use this feature

pooblej

Posts: 5

Registered:
May 21, 2010

Please help - Embed method, with autohide set to false and Pseudostreaming

Posted: Jun 3, 2010

Hi,

Really need some help...

The code below works correctly, and autohide is set to false. However I need to add in the plugin for Pseudostreaming...


<object data="<?php echo $Video_player ?>" type="application/x-shockwave-flash" width="<?php echo $Video_width ?>" height="<?php echo $Video_height ?>" id="flowplayer"><param name="movie" value="<?php echo $Video_player ?>" /><param name="allowfullscreen" value="true" /><param name="flashvars"value='config={"clip":"<?php echo $Video_file ?>","plugins":{"controls":{"autoHide":false}}}' /></object>

Can someone please tell me how to add Pseudostreaming in to the code above?

Nb - The php in the code above is to allow me to move the variables to outside the code.

Justin

Edge
Vizmu Media ------------------- http://vizmu.com/

Posts: 576

Registered:
Nov 29, 2008

» Please help - Embed method, with autohide set to false and Pseudostreaming

Posted: Jun 3, 2010

Reply to: Please help - Embed method, with autohide set to false and Pseudostreaming, from pooblej
Hello,
Try something like this.
Also please note I haven't test this, and I've yet to finish my first cup of coffee so...

<object data="<?php echo $Video_player ?>" type="application/x-shockwave-flash" width="<?php echo $Video_width ?>" height="<?php echo $Video_height ?>" id="flowplayer">
<param name="movie" value="<?php echo $Video_player ?>" />
<param name="allowfullscreen" value="true" />
<param name="flashvars"value='config={
    "clip":{
        "provider":"lighttpd",
        "url":"<?php echo $Video_file ?>"
        },
    "plugins":{
        "controls":{
        "autoHide":false
        },
	"lighttpd": {
		"url": "/path/to/this/plugin/flowplayer.pseudostreaming-3.2.2.swf"
	}
    }
}' /></object>

There's more info here:
http://flowplayer.org/plugins/streaming/pseudostreaming.html

Edge
Vizmu Media ------------------- http://vizmu.com/

Posts: 576

Registered:
Nov 29, 2008

» Please help - Embed method, with autohide set to false and Pseudostreaming

Posted: Jun 3, 2010

Reply to: Please help - Embed method, with autohide set to false and Pseudostreaming, from pooblej
The lighttpd in the plugin name is just a label, you can call it anything you want as long as you update the provider in the clip section to match.

To simplify the debugging you may want to eliminate all the php calls and setup direct links - at least for early testing. Just make a blank .php page with direct paths to all the swf files.

To test that the setup is working without the download.php try using this file in your clip url.
http://vod01.netdna.com/vod/demo.flowplayer/Extremists.flv

Once you know its working then start troubleshooting the php script.

Quick example:

<object data="/direct/path/flowplayer/flowplayer-3.2.1.swf" type="application/x-shockwave-flash" width="720" height="480" id="flowplayer">
<param name="movie" value="/direct/path/flowplayer/flowplayer-3.2.1.swf" />
<param name="allowfullscreen" value="true" />

<param name="flashvars" value='config={
    "clip":{
        "provider":"lighttpd",
        "url":"/direct/path/flowplayer/download.php?file=CIM_02_low.flv"
        },
    "plugins":{
        "controls":{
        "autoHide":false
        },
	"lighttpd": {
		"url": "/direct/path/flowplayer/flowplayer.pseudostreaming-3.2.1.swf"
	}
    }
}' /></object>

Which php streaming script are you using?

pooblej

Posts: 5

Registered:
May 21, 2010

» » Please help - Embed method, with autohide set to false and Pseudostreaming

Posted: Jun 3, 2010

Reply to: » Please help - Embed method, with autohide set to false and Pseudostreaming, from edge
Thanks - Retested as you suggested and that provided it works



<object data="../../../../../../../flowplayer/flowplayer-3.2.1.swf" type="application/x-shockwave-flash" width="725" height="100%" id="flowplayer">
<param name="movie" value="../../../../../../../flowplayer/flowplayer-3.2.1.swf" />
<param name="allowfullscreen" value="true" />

<param name="flashvars" value='config={
    "clip":{
        "provider":"lighttpd",
        "url":"http://vod01.netdna.com/vod/demo.flowplayer/Extremists.flv"
        },
    "plugins":{
        "controls":{
        "autoHide":false
        },
	"lighttpd": {
		"url": "../../../../../../../flowplayer/flowplayer.pseudostreaming-3.2.1.swf"
	}
    }
}' /></object>

I am using flowplayer.pseudostreaming-3.2.1.swf

However I need to store my video files outside the web root. This is why I use download.php?file=CIM_02_low.flv to load my video file.

As the code you have sent works... can you think how it could be changed to allow me to link a video outside the web root?

My original code worked (ie loaded the file correctly) hence my confusion that yours does not..


<object data="<?php echo $Video_player ?>" type="application/x-shockwave-flash" width="<?php echo $Video_width ?>" height="<?php echo $Video_height ?>" id="flowplayer"><param name="movie" value="<?php echo $Video_player ?>" /><param name="allowfullscreen" value="true" /><param name="flashvars"value='config={"clip":"<?php echo $Video_file ?>","plugins":{"controls":{"autoHide":false}}}' /></object>

pooblej

Posts: 5

Registered:
May 21, 2010

» » » Please help - Embed method, with autohide set to false and Pseudostreaming

Posted: Jun 3, 2010

Reply to: » » Please help - Embed method, with autohide set to false and Pseudostreaming, from pooblej
Further testing reveals that this works.


<object data="http://northgate-demos.com/flowplayer/flowplayer-3.2.1.swf" type="application/x-shockwave-flash" width="720" height="480" id="flowplayer">
<param name="movie" value="http://northgate-demos.com/flowplayer/flowplayer-3.2.1.swf" />
<param name="allowfullscreen" value="true" />

<param name="flashvars" value='config={
    "clip":{
        "provider":"lighttpd",
        "url":"http://vod01.netdna.com/vod/demo.flowplayer/Extremists.flv"
        },
    "plugins":{
        "controls":{
        "autoHide":false
        },
	"lighttpd": {
		"url": "http://northgate-demos.com/flowplayer/flowplayer.pseudostreaming-3.2.1.swf"
	}
    }
}' /></object>

However if I then try and use my existing code for pulling out the real URL via download.php


<?php

$file = $_GET['file'];
   $path = "/home2/northga5/xmoovStream/xmoovStream_files/video/$file"; //folder, outside webroot root

header('Content-Description: File Transfer');
header('Content-Type: video/x-flv');
header('Content-Length: ' . filesize($path));
header('Content-Disposition: attachment; filename=' . basename($path));
readfile($path);

?>


I get file not found....

If I add in the direct link to download.php it still fails.

Question is why did it work before?! when I was using



<?php $Video_player = '../../../../../../../flowplayer/flowplayer-3.2.1.swf'; ?>
<?php $Video_pseudo = '../../../../../../../flowplayer/flowplayer.pseudostreaming-3.2.1.swf'; ?>
<?php $Video_file = '../../../../../../../flowplayer/download.php?file=CIM_02_low.flv'; ?>
<?php $Video_width = '725'; ?>
<?php $Video_height = '100%'; ?>

<object data="<?php echo $Video_player ?>" type="application/x-shockwave-flash" width="<?php echo $Video_width ?>" height="<?php echo $Video_height ?>" id="flowplayer"><param name="movie" value="<?php echo $Video_player ?>" /><param name="allowfullscreen" value="true" /><param name="flashvars"value='config={"clip":"<?php echo $Video_file ?>","plugins":{"controls":{"autoHide":false}}}' /></object>

but this code does not pseudostream ...

Arrr.... any ideas

pooblej

Posts: 5

Registered:
May 21, 2010

» » » » Please help - Embed method, with autohide set to false and Pseudostreaming

Posted: Jun 4, 2010

Reply to: » » » Please help - Embed method, with autohide set to false and Pseudostreaming, from pooblej
Have given up - as it appears the problem is down to calling the file to play from outside the webroot via the Pseudostreaming plugin. I could get it to work when the file inside but not outside the web root.

Thanks for the help (Edge) but will have continue to using



<?php $Video_player = '../../../../../../../flowplayer/flowplayer-3.2.1.swf'; ?>
<?php $Video_pseudo = '../../../../../../../flowplayer/flowplayer.pseudostreaming-3.2.1.swf'; ?>
<?php $Video_file = '../../../../../../../flowplayer/download.php?file=CIM_02_low.flv'; ?>
<?php $Video_width = '725'; ?>
<?php $Video_height = '100%'; ?>

<object data="<?php echo $Video_player ?>" type="application/x-shockwave-flash" width="<?php echo $Video_width ?>" height="<?php echo $Video_height ?>" id="flowplayer"><param name="movie" value="<?php echo $Video_player ?>" /><param name="allowfullscreen" value="true" /><param name="flashvars"value='config={"clip":"<?php echo $Video_file ?>","plugins":{"controls":{"autoHide":false}}}' /></object>


Until someone can tell me how to add in the pseudostreaming part (that works when it calls a file from outside the web root).

pooblej

Posts: 5

Registered:
May 21, 2010

Solution found!

Posted: Jun 4, 2010

Reply to: » » » » Please help - Embed method, with autohide set to false and Pseudostreaming, from pooblej
Solution was to use .htaccess as the redirecter to outside the web root.

/redirect/.htaccess


<IfModule mod_rewrite.c>
 RewriteEngine on
 RewriteRule ^([^/]*)$ index.php?file=$1 [QSA]
 </IfModule>

Player code (note you have to use domain.com does NOT work with relative paths + PHP pass through redirect)



<!-- Configuration -->

<?php $Video_player = 'http://www.domain.com/flowplayer/flowplayer-3.2.2.swf'; ?>
<?php $Video_pseudo = 'http://www.domain.com/flowplayer/flowplayer.pseudostreaming-3.2.1.swf'; ?>
<?php $Video_file = 'http://www.domain.com/folder/folder/folder/folder/videos/redirect/video.flv'; ?>
<?php $Video_width = '725'; ?>
<?php $Video_height = '100%'; ?>

<!-- Player -->

<object data="<?php echo $Video_player ?>" type="application/x-shockwave-flash" width="<?php echo $Video_width ?>" height="<?php echo $Video_height ?>" id="flowplayer"><param name="movie" value="<?php echo $Video_player ?>" /><param name="allowfullscreen" value="true" /><param name="flashvars" value='config={"clip":{"provider":"lighttpd","url":"<?php echo $Video_file ?>"},"plugins":{"controls":{"autoHide":false},"lighttpd": {"url": "<?php echo $Video_pseudo ?>"}}}' /></object>


PHEW Works for me at least in IE7 + Firefox

Edge
Vizmu Media ------------------- http://vizmu.com/

Posts: 576

Registered:
Nov 29, 2008

» Please help - Embed method, with autohide set to false and Pseudostreaming

Posted: Jun 4, 2010

Reply to: Please help - Embed method, with autohide set to false and Pseudostreaming, from pooblej
Hello,
This is most likely a security limitation with your server environment.

If you have root access to your server installing lighttpd or nginx would allow the media to be stored in a different folder "root" for the web server. Then just run the new server via a different port ":8080" or something. Both lighttpd and nginx are far more efficient than php for pseudostreaming.

You may also want to try the dev flowplayer versions:
https://flowplayer-releases.s3.amazonaws.com/info/dist.html

salsa2k

Posts: 3

Registered:
Jun 23, 2010

» » Please help - Embed method, with autohide set to false and Pseudostreaming

Posted: May 4, 2011

Reply to: » Please help - Embed method, with autohide set to false and Pseudostreaming, from edge
Hi,
I trying to make this work but I dont know whats wrogn! :(

if I put the specific file with url.. like
http://vod01.netdna.com/vod/demo.flowplayer/Extremists.flv" works fine...

but if i use http://mydomain.com/script.php?id=1234"

Player dont load! :(

Anybody knows whats wrong?

my php script:

if (isset($_GET) && count($_GET) > 0){	
	require_once("../config.php");

	$users = new _users();
	$users->checkSessionAccess();
		
	$media = new _media();
	$rs = $media->getMedia($_GET);
	
	$seekat = 0;
	
	if(isset($_GET["start"])){
		$position = $_GET["start"];
		if(is_numeric ($position)){
			$seekat = intval($position);
		}
		if ($seekat < 0)
			$seekat = 0;
	}

	$file = htmlspecialchars(rtrim("/home/server/public_html/media{$rs['path']}{$rs['file']}"));

	header("Content-type: video/x-flv");
	header("Content-Disposition: attachment; filename="{$rs['file']}"");
	
	if($seekat > 0)
		header('Content-Length: ' . (filesize($file)-$seekat));
  	else
		header('Content-Length: ' . filesize($file));
		
	if($seekat != 0){
		print("FLV");
		print(pack('C', 1 ));
		print(pack('C', 1 ));
		print(pack('N', 9 ));
		print(pack('N', 9 ));
	}

	$fh = fopen($file, "rb") or die("Could not open file: " . $file . "
");
	fseek($fh, $seekat);

	while (!feof($fh)){
		print(fread($fh, 16384));
	}
	fclose($fh);
}