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

* commit '43fbdb2acb8e4e673d963630acbc32ab2717139c':
  add support for shadowbox videos with start time specified with #t= in video url
This commit is contained in:
smain@google.com 2014-11-27 10:19:35 +00:00 committed by Android Git Automerger
commit bcca18bfd8

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