Fixed error with durationsetter on embed

This commit is contained in:
Kasper Rynning-Tønnesen
2016-03-04 14:28:40 +01:00
parent 7c4d1a7d74
commit 6b51534597
5 changed files with 8 additions and 8 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -9,6 +9,7 @@ var embed = true;
var vol = 100;
var adminpass = "";
var mobile_beginning = false;
var durationBegun = false;
var seekTo;
var socket;

View File

@@ -66,7 +66,7 @@ var Player = {
if(!paused){
if(!mobile_beginning)
Player.ytplayer.playVideo();
if(!durationBegun || embed)
if(!durationBegun)
Player.durationSetter();
mobile_beginning = false;
}
@@ -76,7 +76,7 @@ var Player = {
setTimeout(function(){Player.loaded = true;},500);
}catch(e){
if(!durationBegun || embed)
if(!durationBegun)
Player.durationSetter();
}
}
@@ -176,14 +176,14 @@ var Player = {
try{
beginning = true;
player_ready = true;
if(!/iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream)
if(!window.MSStream)
{
$("#player").css("opacity", "1");
$("#controls").css("opacity", "1");
$(".playlist").css("opacity", "1");
Player.ytplayer.loadVideoById(video_id);
if(autoplay && !window.mobilecheck()) Player.ytplayer.playVideo();
if(!durationBegun || embed)
if(!durationBegun)
Player.durationSetter();
if(embed){
setTimeout(function(){
@@ -277,7 +277,6 @@ var Player = {
/*try{
//duration = Player.ytplayer.getDuration();
}catch(e){};*/
console.log(duration);
if(duration != undefined){
try{
durationBegun = true;