Hello All,
I'm a non-programmer trying to get the player to automatically exit fullscreen mode when the playlist ends. I've tried to work with the scripts from a couple different posts but have had no success. Not sure what I'm missing.
Can anybody help?
<script type="text/javascript">var player = null;
var playlist = null;
var currentItem = null;
function playerReady(obj)
{
player = gid(obj.id);
addListeners();
};
function addListeners()
{
playlist = player.getPlaylist();
if((playlist !== null) && (playlist.length > 0))
{
player.addModelListener('STATE', 'stateMonitor');
player.addControllerListener('ITEM', 'itemMonitor');
}
else
{
setTimeout("addListeners()", 100);
}
};
function itemMonitor(obj)
{
currentItem = obj.index;
};
function stateMonitor(obj)
{
if((obj.newstate == 'COMPLETED') && ((currentItem + 1) == (player.getPlaylist().length)))
{
document.location.href = 'http://www.someredirecturl.com';
}
};
function gid(name)
{
return document.getElementById(name);
};
</script>
If you're still having trouble, post a link to your Test Page so someone can help ou further.