YouTube的API - setShuffle不工作 [英] youtube API - setShuffle don't work

查看:199
本文介绍了YouTube的API - setShuffle不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的网站加入这个脚本重现视频播放列表。

I added this script in my site to reproduce video playlist.

<script type="text/javascript" src="swfobject.js"></script>  
<div id="ytapiplayer">
You need Flash player 8+ and JavaScript enabled to view this video.
</div>
<script type="text/javascript">
var params = { allowScriptAccess: 'always',
allowFullScreen: 'true' };
var atts = { id: 'myytplayer' };
swfobject.embedSWF("https://www.youtube.com/v/videoseries?listType=playlist&list=PLBA9E733B5C8314DE&autoplay=1&modestbranding=1&enablejsapi=1&playerapiid=ytplayer&version=3", "ytapiplayer", "640", "360", "8", null, null, params, atts);
function onYouTubePlayerReady(myytplayer) {
        ytSwfPlayer = document.getElementById( 'myytplayer' );
        ytSwfPlayer.setShuffle(1);
}
</script>

在setShuffle功能不起作用!
你可以建议我一个解决方案吗?

the setShuffle function don't work!!! You can suggest me a solution?

推荐答案

这似乎是在播放器中的错​​误。我报这个bug的团队。在未来,你可以在的https://$c$c.google.com/p/gdata-issues/issues/entry?template=YouTube%20(Defect%20Report)

This appears to be a bug in the player. I've reported this bug to the team. In the future you can report bugs at https://code.google.com/p/gdata-issues/issues/entry?template=YouTube%20(Defect%20Report)

作为变通,你可以使用JS API给自己洗切。当视频结束时,你可以叫 playVideoAt 并传递一个随机数。

As a work around you could use the JS api to shuffle it yourself. When a video ends you can call playVideoAt and pass a random number.

这篇关于YouTube的API - setShuffle不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆