本文介绍了Youtube iframe Embed是否已停止为某些视频工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为此在这里创建了一个JS小提琴:





状态报告:此YouTube API错误不再是问题。


I created a JS fiddle for this here:

http://jsfiddle.net/lindseymysse/6C65Y/1/

The error:

Starting Yesterday evening, a few videos on the site I'm working on stopped loading for users. We are using the iframe embed, and attempting to do as much stuff with html5 as possible.

To reproduce this error:

If user is either

  1. Unenrolled/has not made a decision to turn html5 video on or

  2. User has turned html5 trial on, the video will not play on MacBookChrome, Firefox or Safari.

If user either turns html5 trial on and then off, or (if they are already signed up for the html5 trial) just off, the embed will work

Some Clues:

The debug from a broken video looks like this:

  • debug playbackQuality=small
  • scoville=1
  • cfps=0
  • pd=0
  • mos=0
  • debug flashVersion=MAC 11%2C2%2C202%2C235
  • fs=0
  • hl=en US
  • debug date=Thu May 10 14%3A40%3A14 GMT%2D0700 2012
  • iframe=1
  • lact=null
  • videoFps=0
  • vq=auto
  • h=355
  • stageFps=24
  • debug error=Not specified
  • tpmt=0
  • framer=http%253A%252F%252Ffiddle%2Ejshell%2Enet%252FunPrz%252F5%252Fshow%252F
  • volume=100
  • droppedFrames=0
  • w=473
  • el=detailpage
  • screenw=1440
  • screenh=900
  • debug videoId=
  • playerw=640
  • debug sourceData=

Some More:

  • Mozilla gives the error: -- Unexpected value align parsing preserveAspectRatio attribute.
  • The videos we have found that this embed is broken on are ones that play as Flash videos even in the html5 trial.

Please see my jsFiddle to reproduce the error.

What is causing this? This error is not throwing an error in the youtube api onError call, is there a way to spot it so we can deal with this?

解决方案

YouTube indeed has changed their API over the last couple of days and flash fallback from their HTML5 Video Player fails. Other users report a black or blank YouTube Player Screen and a video duration of 0:00 which are other symptoms of this bug once the SWF player is presented.

I updated your jsfiddle.net with a workaround to only use the flash player from the initial start, which then prevents fallback from flash issue until it's resolved.

It retains your /embed/ scheme so any custom API that's used will still be valid.

The workaround adds the playlist param with no other video values and a comma, normally used to separate videos in the playlist, so that a playlist of 1 is realized.

Of course if your were already using a playlist, then you would not be subject to this bug since the playlist is the only flash exclusive item that forces the flash player to be rendered correctly in the /embed/ URL at the present time.

Here's the update:

http://jsfiddle.net/6C65Y/3/

Status Report: This YouTube API bug is not an issue any longer.

这篇关于Youtube iframe Embed是否已停止为某些视频工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-14 15:24