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:
commit
bcca18bfd8
1 changed files with 7 additions and 1 deletions
|
@ -593,11 +593,17 @@ function onYouTubeIframeAPIReady() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function startYouTubePlayer(videoId) {
|
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) {
|
if (youTubePlayer == null) {
|
||||||
youTubePlayer = new YT.Player('youTubePlayer', {
|
youTubePlayer = new YT.Player('youTubePlayer', {
|
||||||
height: '529',
|
height: '529',
|
||||||
width: '940',
|
width: '940',
|
||||||
videoId: videoId,
|
videoId: idAndHash[0],
|
||||||
|
playerVars: {start: startTime},
|
||||||
events: {
|
events: {
|
||||||
'onReady': onPlayerReady,
|
'onReady': onPlayerReady,
|
||||||
'onStateChange': onPlayerStateChange
|
'onStateChange': onPlayerStateChange
|
||||||
|
|
Loading…
Reference in a new issue