youtube-api - YouTube IFrame API onError 值为 0 是什么意思?

标签 youtube-api

onError 事件处理程序返回 event.data = 0,通常用于已删除或私有(private)视频(尽管我尚未测试所有情况),而不是 YouTube IFrame API 引用 (https://developers.google.com/youtube/iframe_api_reference#Events) 上记录的错误值

onError

This event fires if an error occurs in the player. The API will pass an event object to the event listener function. That object's data property will specify an integer that identifies the type of error that occurred. Possible values are:

 2 – The request contains an invalid parameter value. For example, this error occurs if you specify a video ID that does not have 11 characters, or if the video ID contains invalid characters, such as exclamation points or asterisks.
 5 – The requested content cannot be played in an HTML5 player or another error related to the HTML5 player has occurred.
 100 – The video requested was not found. This error occurs when a video has been removed (for any reason) or has been marked as private.
 101 – The owner of the requested video does not allow it to be played in embedded players.
 150 – This error is the same as 101. It's just a 101 error in disguise!

这发生在 Mac OS X、Chrome、Firefox 和 Safari 的最新版本中。这是一个已删除视频的链接,该视频在使用 IFrame API 嵌入时返回此错误代码:http://www.youtube.com/watch?v=-TefH2gu9-o
在播放器API演示中测试此视频还返回0(对于AS3播放器;选择IFRAME时,它返回[object Object],并且不可检查)。
预期的错误代码将是 100 或更大。

最佳答案

视频id“-TefH2gu9-o”使用HTML5播放时返回错误码100,但是使用Flash播放时返回错误码0。我将与内部工程团队跟进此事。

关于:

Given that this is the only way to report these issues for the YouTube API now...



我们非常鼓励人们使用公共(public)问题跟踪器来获取与 YouTube API 相关的错误报告,并且只在 Stack Overflow 上询问编程/技术问题(与 Stack Overflow 的更大使命保持一致)。 http://apiblog.youtube.com/2012/09/the-youtube-api-on-stack-overflow.html 上有关于如何报告错误/功能请求的详细信息

关于youtube-api - YouTube IFrame API onError 值为 0 是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15593584/

相关文章:

api - YouTube搜索API给我的视频少于每页请求的视频,但是给了我nextPageToken

Youtube API key - accessNotConfigured 错误

android - 在 Android 库中选择 Google 帐户后,使用 Google 帐户登录 YouTube 数据 API 未显示管理或拥有的 channel 列表

youtube-api - 如何获取 YouTube "watch later"提要?

javascript - Youtube iframe API 无法加载或提示播放列表

php - YouTube API 3 获取特定用户的最后视频

php - youtube iframe API 中的 playVideoAt() 函数不起作用

android - 在 ListView 中播放 youtube 视频列表

youtube - Youtube API获取所有播放列表项,而不是每个播放列表默认默认加载的最多26个

javascript - YouTube API - 动态添加事件监听器