onError イベント ハンドラーは、YouTube IFrame API リファレンス ( https://developers.google. com/youtube/iframe_api_reference#Events )
onError
このイベントは、プレーヤーでエラーが発生した場合に発生します。API は、イベント オブジェクトをイベント リスナー関数に渡します。そのオブジェクトのデータ プロパティは、発生したエラーの種類を識別する整数を指定します。可能な値は次のとおりです。
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
このビデオを Player API Demo でテストしても 0 が返されます (AS3 プレーヤーの場合、IFrame を選択すると返さ[object Object]
れ、検査できません)。
予想されるエラー コードは 100 以上です。