// URL, c2y8Ba3WwPY は動画の ID var youtubeUrl = 'https://youtube.googleapis.com/v/h03Sxiv6zzk?enablejsapi=1', flashvars = {}, params = { allowScriptAccess: "always" }, atts = { id: "myytplayer" }; // 500 x 262 サイズで idがytplayer-objectの要素に埋め込む. 必要なFlash Playerのバージョンは9, 背景色はnull, swfobject.embedSWF(youtubeUrl, "ytplayer-object", "465", "262", "8", null, flashvars, params, atts); // 動画の再生準備が終わったら呼ばれる fun
![YouTubeの動画再生時間取得 with Youtube JavaScript Player API - jsdo.it - Share JavaScript, HTML5 and CSS](https://cdn-ak-scissors.b.st-hatena.com/image/square/f1adbd1025d9ff373e5914efd5cebeee3e265b29/height=288;version=1;width=512/http%3A%2F%2Fjsdo-static-contents.s3.amazonaws.com%2Fimages%2Fcapture%2F3%2F0%2Fz%2F30zA.jpg%3Ft%3D1398961365)