am b2eaef29: am bcca18bf: am 43fbdb2a: am dc8a05ca: am 570c2210: add support for shadowbox videos with start time specified with #t= in video url

* commit 'b2eaef295633a3be2809c8040215f266e42d3a15':
  add support for shadowbox videos with start time specified with #t= in video url
This commit is contained in:
smain@google.com 2014-12-01 19:44:27 +00:00 committed by Android Git Automerger
commit 7fcb9209ac
1 changed files with 7 additions and 1 deletions

View File

@ -593,11 +593,17 @@ function onYouTubeIframeAPIReady() {
}
function startYouTubePlayer(videoId) {
var idAndHash = videoId.split("#");
var startTime = 0;
if (idAndHash.length > 1) {
startTime = idAndHash[1].split("t=")[1] != undefined ? idAndHash[1].split("t=")[1] : 0;
}
if (youTubePlayer == null) {
youTubePlayer = new YT.Player('youTubePlayer', {
height: '529',
width: '940',
videoId: videoId,
videoId: idAndHash[0],
playerVars: {start: startTime},
events: {
'onReady': onPlayerReady,
'onStateChange': onPlayerStateChange