我有一个简单的Youtube API代码,可以在播放列表中播放视频。突然我开始收到如下错误:发生错误,请稍后再试播放ID:2yVtrSo5yT1rs1EY
我进行了一些搜索,主要是为PC用户找到了解决方案,例如刷新缓存/ dns等(顺便说一下,我在Windows笔记本电脑上)。
问题:我想知道是否可以在脚本中为此错误(代码)创建解决方案以使其转到下一首歌曲?还是这仅仅是基于用户的问题?我有一个<?php
$yt_id='PLFgquLnL59anYA8FwzqNFMp3KMcbKwMaT';
$mymaxcounter = 100;
?>
<div id="player"></div>
<script>
// 2. This code loads the IFrame Player API code asynchronously.
var tag = document.createElement('script');
tag.src = "//www.youtube.com/iframe_api";
var firstScriptTag = document.getElementsByTagName('script')[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
var player;
var numPl = Math.floor((Math.random() * <?php echo $mymaxcounter;?>) + 1);
var playlistId = "<?php echo $yt_id; ?>";
// 3. This function creates an <iframe> (and YouTube player)
function onYouTubeIframeAPIReady() {
player = new YT.Player("player", {
height: '390',
width: '640',
playerVars: {
autoplay: 1,
loop: 1
},
events: {
'onReady': onPlayerReady,
'onError': onPlayerError
}
});
}
// onPlayerReady
function onPlayerReady(event){
//More player vars
player.loadPlaylist( {
listType: 'playlist',
list: playlistId,
index: numPl
} );
//Set shuffle
setTimeout(function() {
player.setShuffle({'shufflePlaylist' : true});
}, 1000);
}
// onPlayerError
function onPlayerError(){
player.nextVideo();
}
</script>
函数,无论发生什么错误,它都能使播放器转到下一首歌曲。但是对于上面提到的错误,它什么也不做,只显示错误。
FROM ((((dbo.Operators AS OP
INNER JOIN dbo.vwProductionDataForTouchReporting VT
ON OP.Operator = VT.Opr)
INNER JOIN dbo.DataInput DI
ON VT.JobID = DI.JobID)
INNER JOIN dbo.jobs JO
ON DI.JobID = JO.ID)
INNER JOIN dbo.Machines MA
ON DI.MachNo = MA.MachNo)
INNER JOIN dbo.JobTypes JT
ON DI.JobTypeID = JT.JobTypeID