onError事件处理程序返回event.data = 0,通常用于已移除或私有的视频(尽管我尚未测试所有案例),而不是YouTube IFrame API参考(https://developers.google)上记录的错误值. com/youtube/iframe_api_reference#Events)
onerror的
如果播放器中发生错误,则会触发此事件.API将事件对象传递给事件侦听器函数.该对象的data属性将指定一个整数,用于标识发生的错误类型.可能的值是:
Run Code Online (Sandbox Code Playgroud)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 …
youtube-api ×1