mirror of
https://github.com/goodtube4u/goodtube.git
synced 2025-11-22 10:16:11 +00:00
Fix time start get variable
This commit is contained in:
21
goodtube.js
21
goodtube.js
@@ -546,27 +546,26 @@
|
||||
|
||||
// If we're not in picture in picture mode
|
||||
if (!goodTube_pip) {
|
||||
// Ensure we're still viewing a video (sometimes you can browse to another page before the iframe loads)
|
||||
if (window.location.href.indexOf('.com/watch') !== -1) {
|
||||
// If a restore time exists, skip to it
|
||||
if (typeof goodTube_getParams['t'] !== 'undefined') {
|
||||
goodTube_player_skipTo(goodTube_getParams['t'].replace('s', ''));
|
||||
}
|
||||
}
|
||||
// If we're not still viewing a video
|
||||
else {
|
||||
// If we're not viewing a video
|
||||
if (window.location.href.indexOf('.com/watch') === -1) {
|
||||
// Clear and hide the player
|
||||
goodTube_player_clear();
|
||||
}
|
||||
|
||||
|
||||
// Set the video source
|
||||
// This also tells the embed if it's mobile or not
|
||||
let mobileText = 'false';
|
||||
if (goodTube_mobile) {
|
||||
mobileText = 'true';
|
||||
}
|
||||
goodTube_player.contentWindow.postMessage('goodTube_src_https://www.youtube.com/embed/' + goodTube_getParams['v'] + '?autoplay=1&mobile=' + mobileText + '&goodTube_autoplay=' + goodTube_autoplay, '*');
|
||||
|
||||
// Include the skip to time if it exists
|
||||
let skipToGetVar = '';
|
||||
if (typeof goodTube_getParams['t'] !== 'undefined') {
|
||||
skipToGetVar = '&start=' + goodTube_getParams['t'].replace('s', '');
|
||||
}
|
||||
|
||||
goodTube_player.contentWindow.postMessage('goodTube_src_https://www.youtube.com/embed/' + goodTube_getParams['v'] + '?autoplay=1&mobile=' + mobileText + '&goodTube_autoplay=' + goodTube_autoplay + skipToGetVar, '*');
|
||||
}
|
||||
// If we are in picture in picture mode
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user