Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 43fbdb2a authored by smain@google.com's avatar smain@google.com Committed by Android Git Automerger
Browse files

am dc8a05ca: am 570c2210: add support for shadowbox videos with start time...

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

* commit 'dc8a05ca':
  add support for shadowbox videos with start time specified with #t= in video url
parents d020c517 dc8a05ca
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -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