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

Forums

/

Not getting COMPLETED state when video ends

3 replies [Last post]

Hello all,

I have used javascript api for flash to play the .swf files.
The file gets played correctly. Even the state namely IDLE, BUFFERING,PLAYING, PAUSED are received. But the COMPLETED state is not received at all when the video ends.
I am using SWFObject v2.2, Browser = firefox, OS=Linux

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

<html>

<head>

<script src="swfobject.js"></script>

<script type="text/javascript">
var flashvars =
{
id: 'playerID',
file: 'TagPro.swf',
autostart: 'true',
bufferlength: '1',
controlbar: 'none',
displayclick: 'none',
icons: 'false',
quality: 'false',
//repeat: 'list',
stretching: 'exactfit'
};

var params =
{
allowfullscreen: 'false',
allowscriptaccess: 'always'
};

var attributes =
{
id: 'playerID',
name: 'playerID'
};
//9.0.124

swfobject.embedSWF('player.swf', 'player', '823', '535', '9.0.124', false, flashvars, params, attributes);
</script>

<script type="text/javascript">
var player = null;
var playlist = null;

function playerReady(obj)
{
player = gid(obj.id);
alert('Player ID: ' + player.id);
addListeners();

};

function addListeners()
{
if(player)
{
player.addModelListener('STATE', 'stateListener');

}
else
{
alert('Try Again!');
setTimeout("addListeners()", 100);
}

};

function stateListener(obj)
{
alert(obj.oldstate+'State: ' + obj.newstate);
if(obj.newstate == 'COMPLETED')
//if(obj.newstate != 'IDLE' || obj.newstate != 'BUFFERING' || obj.newstate != 'PLAYING' || obj.newstate != 'PAUSED')
{

alert("completed");
//...load a new page
//window.location = 'http://yahoo.com';
}
};

function gid(name)
{
return document.getElementById(name);
};
</script>

</head>

<body>

<div id="playercontainer" class="playercontainer"><a id="player" class="player" href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash">Get the Adobe Flash Player to see this video.</a></div>

</body>

</html>

The media file TagPro.swf is present locallly. Please help as it is very urgent.

Thanx

 
It's the JW FLV Player!

See: http://developer.longtailvideo.com/trac/wiki/FlashFormats#SingleFiles

The first bullet point under "Here's a list..."

"Though SWF files..."

Hi hobbs,
Thanks for the reply.

Now i am in big trouble. So is there any way that could get the correct dimensions and durations also the state ("COMPLETED") of .swf files.

 
I think you will have better results looking on Flash forums & using Google.