IFrame Player APIの関数を利用する(動画の読込・再生等:cueVideoById)

CGI'sトップページ > Youtube API メモ > IFrame Player APIの関数を利用する(動画の読込・再生等:cueVideoById)

IFrame Player APIの関数を利用する(動画の読込・再生等:cueVideoById)

関数名 機能概要/構文/パラメータ
cueVideoById 動画を再生する準備をする。
player.cueVideoById({videoId:String, startSeconds:Number, endSeconds:Number, suggestedQuality:String}):Void
videoId(必須) VIDEO_ID
startSeconds 再生開始位置(秒数)
endSeconds 再生終了位置(秒数)
suggestedQuality 推奨再生画質(small,medium,large,hd720,hd1080,highres,default)

以下のサンプルでは onReadyイベント内でcueVideoByIdを使用しています。 VIDEO_IDのほか、再生開始位置5秒、再生終了位置を8秒、推奨再生画質を small として準備をしています。


サンプルコード


サンプル



Youtube API メモ Indexへ戻る