I figured out there is no functionality of SHUFFLE in you delve player. I am trying to implement such functionality using delve player's javascript api. Some strange reason we are not able to get this functionality because DelvePlayer.doSetMedia function is not working as it should under onMediaComplete event. Although DelvePlayer.doSetMedia is working on button click
please see code开发者_如何学Python snippet below
function delvePlayerCallback(playerId, eventName, data) {
var id = "limelight_player_20758";
if (eventName == 'onPlayerLoad' && (DelvePlayer.getPlayers() == null || DelvePlayer.getPlayers().length == 0)) {
DelvePlayer.registerPlayer(id);
}
switch (eventName) {
case 'onMediaComplete':
var playIndex = 0;
channel = DelvePlayer.doGetCurrentChannel();
media_count = channel.mediaList.length;
if(media_count > 1)
{
getRandomNum = randomFromTo(0, (media_count > 1) ? media_count - 1 : 0) ;
//alert(getRandomNum + ' ' + channel.mediaList[getRandomNum].id + ' ' + channel.mediaList[getRandomNum].title + ' current index: ' + DelvePlayer.doGetCurrentIndex());
//this function is not working
DelvePlayer.doSetMedia(channel.mediaList[getRandomNum].id,true); // this function is not working
//DelvePlayer.doPlay();
}
break;
case 'onError' :
alert ('error');
break;
} }
Please advise
I have resolved this issue after consult to limelight network team
they suggested to put slight delay on call to doSetMedia()
here is code snippet
switch (eventName)
{
case 'onMediaComplete':
t=setTimeout("DelvePlayer.doSetMedia('90ab7c3144c94337a8b94cf2c5c56407',true)",500);
break ;
}
thanks to Huw Morgan at LimeLight
cheers
are servers working? check the link. maybe it is your answer too.
http://www.longtailvideo.com/support/forums/jw-player/setup-issues-and-embedding/7211/streaming-with-limelight
精彩评论