diff options
author | smain@google.com <smain@google.com> | 2014-12-01 19:33:14 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-12-01 19:33:14 +0000 |
commit | b2eaef295633a3be2809c8040215f266e42d3a15 (patch) | |
tree | 223ff665f0691375364d1c6c6ff055e28a04568a | |
parent | 49d062864b0cc4211377678ba5337acb20aa86fa (diff) | |
parent | bcca18bfd87543ff8e21d9c892b3ac31bd8de82d (diff) | |
download | build-b2eaef295633a3be2809c8040215f266e42d3a15.zip build-b2eaef295633a3be2809c8040215f266e42d3a15.tar.gz build-b2eaef295633a3be2809c8040215f266e42d3a15.tar.bz2 |
am bcca18bf: am 43fbdb2a: am dc8a05ca: am 570c2210: add support for shadowbox videos with start time specified with #t= in video url
* commit 'bcca18bfd87543ff8e21d9c892b3ac31bd8de82d':
add support for shadowbox videos with start time specified with #t= in video url
-rw-r--r-- | tools/droiddoc/templates-sdk/assets/js/docs.js | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/droiddoc/templates-sdk/assets/js/docs.js b/tools/droiddoc/templates-sdk/assets/js/docs.js index 945cfa7..9a081bf 100644 --- a/tools/droiddoc/templates-sdk/assets/js/docs.js +++ b/tools/droiddoc/templates-sdk/assets/js/docs.js @@ -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 |