Order Now AdSolution Sign Up | Login » Bits on the Run Sign Up | Login »

Forums

/

Bugs in Screenshoot plugins

9 replies [Last post]

Snapshot v1.0: should be snapshot.bitmap, not snapshot.data. Cool plugin, thanks to LongTail Video!

http://www.longtailvideo.com/addons/plugins/96/get-plugin.html?addon=96&q=

Screenshoot v1.0 is not working at all. It is not connecting to script.
http://www.longtailvideo.com/AddOns/get-plugin.html?addon=102&q=

I downloaded the latest player (5.2) but I cannot get it to work with snapshot-1. The php script manage to save the image but all I have is just a black image with the play button. The crossdomain.xml is set to allow access for all. When I set 'snapshot.bitmap' to false , it is also not working, i.e I 'm not getting the file and position values (from POST).

Has anyone tested the this plugin with the latest player???

@Nug - Can you provide a link to where you are running this?

I cannot post the link bec it is inside our firewall, but here is the code snippet
Both the web & streaming server are running on the same m/c.

The html:

<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript">

var currentPosition = 0;
var currentVolume = 80;
var protocol = "rtmp";
var streamingServer = "ev0025b3c02131";
var streamingPort = 1934;
var vodFolder = "/flash";
var videoFile = "/video/Mpeg4HD_7.5Mbps.mp4";

function createPlayer() {

var flashvars= new Array();

flashvars['file'] = videoFile;
flashvars['type'] = protocol;
flashvars['streamer'] = protocol + "://" + streamingServer + ":" + streamingPort + vodFolder;
flashvars['autostart'] = "false";
flashvars['stretching'] = "fill";

flashvars['plugins'] = "snapshot-1";
flashvars['snapshot.script'] = "http://ev0025b3c02131:88/snapshot.php";
flashvars['snapshot.bitmap'] = "true ";

flashvars['frontcolor']= "86C29D"; // text & icons (green)
flashvars['backcolor'] = "003367"; // playlist background (blue)
flashvars['lightcolor'] = "C286BA"; // selected text/track highlight (red)

var params = {
allowfullscreen:"true",
allowscriptaccess:"always",
wmode:"opaque"
}

var attributes = {
id:"player1",
name:"player1"
}

swfobject.embedSWF("player.swf", "placeholder1", "470", "290", "9.0.115", false, flashvars, params, attributes);
}
</script>

snapshot.php:
<?php

if(isset ($GLOBALS["HTTP_RAW_POST_DATA"])) {
$im = $GLOBALS["HTTP_RAW_POST_DATA"];
$rn = rand();
$fp = fopen('snapshot/'.$rn.'.jpg', 'wb');
fwrite($fp, $im);
fclose($fp);
if (exif_imagetype($rn.'.jpg') == IMAGETYPE_JPEG) {
echo 'http://ev0025b3c02131:88/snapshot/'.$rn.'.jpg';
exit();
}
}

echo "There has been an error";
?>

 
You can't perform low-level operations on a video file that is served from a RTMP server because there would need to be a cross-domain policy file on the root of the RTMP server, which is impossible (RTMP servers can't serve data files from the exact same domain as the video file is served from).

In other words:

Video Source:rtmp://ev0025b3c02131:1934/flash/video/Mpeg4HD_7.5Mbps.mp4

Cross-Domain Policy File Source:rtmp://ev0025b3c02131:1934/crossdomain.xml(This won't work because the RTMP server can't serve the crossdomain.xml file using the RTMP protocol.)
 
 
However, if you are using an Adobe Flash Media Server, you can specify the directories that you want to allow data from streams to be accessed from in the Client.videoSampleAccess property.

See:  http://forums.adobe.com/thread/422391  as well as other Adobe documentation.

 
Your player code and PHP script work fine if the video file is served from a HTTP server.

Your code with a few tweaks:

    http://willswonders.myip.org:8074/player5/Nug.html

Your snapshot.php script as I'm using it:

<?php

if(isset($HTTP_RAW_POST_DATA))
{
 
$rn = rand();
 
$fp = fopen("./snapshot/" . $rn . ".jpg", "wb");

  fwrite($fp, $HTTP_RAW_POST_DATA);
 
fclose($fp);

  if(exif_imagetype("./snapshot/" . $rn . ".jpg") == IMAGETYPE_JPEG)
  {
 
//echo "http://ev0025b3c02131:88/snapshot/" . $rn . ".jpg";
   
echo "http://willswonders.myip.org:8074/snapshot/" . $rn . ".jpg";
    exit();
  }
}

echo "There has been an error";

?>

I noticed you are using 'snapshot.swf' for your plugin and 'player-5.2.1036.swf' for your player. Where can I download these files?

Thanks.

 
The latest snapshot plugin is automatically downloaded by the player from:

    http://plugins.longtailvideo.com/4/snapshot.swf

All of the player releases are here:

    http://developer.longtailvideo.com/trac/log/trunk/fl5/player.swf

Click on the release number in the Rev column to download a release.

I understand the problem of using rtmp protocol with snapshot plugin. I tried the plugin with http and it seems to work with player version 1036. It does not work with version 1065 (version that I was using). It also does not work with the latest version, i.e 1151.

BTW, how do I get the plugin to pass the file name or other parameters to the server(php script)?

 
I found that v5.2.1036 was the latest release that would work with the snapshot plugin — don't know why.

I modified the snapshot plugin to send the file and position to the serverside PHP script, so I load the modified plugin from my server.

http://willswonders.myip.org:8074/player5/snapshot-14.swf