0

如果 Youtube 在其 javascript/flash 播放器中实现超时(最大播放)功能,我无法找到任何文档。有没有人遇到过这个?

我的团队遇到了一个问题,我们有一个播放列表在一夜之间在电视上运行。我们发现视频在随机时间保持冻结(停止播放)。

根据我们的网络团队,我们没有任何中断、问题等;

根据我错过的一些文档,这是可能的超时/最大播放列表时间问题吗?

我们目前调用<iframe>播放列表并让它运行。

4

2 回答 2

1

I am not aware of any intentional policies that would stop playback after a certain amount of time had passed. My suggestion would be to look into the HTTP requests being generated by the player (fairly easy to do if you're running a standard web browser on a PC that's hooked up to your TV) and see whether the failure occurs when an HTTP request is made that doesn't receive a response (for some reason).

Additionally, add some logging in to your application that detects the onError and onStateChange events and try to correlate specific events with playback stopping.

Regardless of the root cause, it's possible that you could work around this by detecting PAUSED/ENDED events in the player and using the Player API to explicitly start playback.

于 2013-03-21T18:48:32.593 回答
1

我在做这样的事情(对于亚马逊电视),但只有一个视频。检测到错误时我会重新加载。此错误为 0 是异常错误(您可以在此页面中查看事件)。我还有一个问题,也许你可以帮助我。我看到黑色的视频,我没有看到解决方案。

function startVideo(player,src){
         player = new YT.Player(player, {
         height: '100%',
         width: '100%',
         videoId: src,

         playerVars: {
                controls: 0,
                showinfo: 0 ,
                modestbranding: 1,
                wmode: "opaque",
                loop: true,
               },
               events: {
                 'onReady': onPlayerReady,
                 'onStateChange': onPlayerStateChange,
                 'onError': onPlayerError,
              }
          });
}
function onPlayerError(event){
            var D = new Date();
            var d = millisToTime(D.getTime());
            $("#m").html($("#m").html()+"</br></br> <b>-Error: "+event.data+"</b> -"+d);

            var url = window.location.href;    
            if (url.indexOf('?') > -1){
                   url += '&p=1'
               }else{
                   url += '?p=1'
               }
               window.location.href = url;
            }
于 2014-11-20T16:21:37.490 回答