我发现在你钻研玩家时没有SHUFFLE的功能。我正在尝试使用delve player的javascript api来实现这样的功能。一些奇怪的原因我们无法获得此功能,因为DelvePlayer.doSetMedia函数在onMediaComplete事件下无法正常工作。虽然DelvePlayer.doSetMedia正在处理按钮单击
请参阅下面的代码段
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;
} }
请告知
答案 0 :(得分:3)
我在咨询了limelight网络团队后解决了这个问题
他们建议稍微延迟调用doSetMedia()
这是代码段
switch (eventName)
{
case 'onMediaComplete':
t=setTimeout("DelvePlayer.doSetMedia('90ab7c3144c94337a8b94cf2c5c56407',true)",500);
break ;
}
感谢LimeLight的Huw Morgan
欢呼声
答案 1 :(得分:0)