mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
fixed some code and errors
This commit is contained in:
14
js/admin.js
14
js/admin.js
@@ -14,12 +14,12 @@ function admin()
|
||||
|
||||
function submitAdmin(form)
|
||||
{
|
||||
voting = form.vote.value,
|
||||
addsongs = form.addsongs.value,
|
||||
longsongs = form.longsongs.value,
|
||||
frontpage = form.frontpage.value,
|
||||
allvideos = form.allvideos.value,
|
||||
removeplay = form.removeplay.value,
|
||||
voting = form.vote.value;
|
||||
addsongs = form.addsongs.value;
|
||||
longsongs = form.longsongs.value;
|
||||
frontpage = form.frontpage.value;
|
||||
allvideos = form.allvideos.value;
|
||||
removeplay = form.removeplay.value;
|
||||
adminpass = form.pass.value;
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ function submitAdmin(form)
|
||||
|
||||
if(pass_corr=="correct"){
|
||||
$("#adminPanel").addClass("success");
|
||||
}else{ $("#adminPanel").addClass("fadeerror"); alert("Wrong password :(")}
|
||||
}else{ $("#adminPanel").addClass("fadeerror"); alert("Wrong password :(");}
|
||||
|
||||
console.log(pass_corr);
|
||||
updateList();
|
||||
|
||||
30
js/list.js
30
js/list.js
@@ -15,16 +15,16 @@ function updateList()
|
||||
async: false
|
||||
}).responseText;
|
||||
list = $.parseJSON(list);
|
||||
conf = list["conf"];
|
||||
if(conf.hasOwnProperty("addsongs") && conf["addsongs"] == "true") adminadd = 1;
|
||||
conf = list.conf;
|
||||
if(conf.hasOwnProperty("addsongs") && conf.addsongs == "true") adminadd = 1;
|
||||
else adminadd = 0;
|
||||
if(conf.hasOwnProperty("allvideos") && conf["allvideos"] == "true") music = 1;
|
||||
if(conf.hasOwnProperty("allvideos") && conf.allvideos == "true") music = 1;
|
||||
else music = 0;
|
||||
if(conf.hasOwnProperty("longsongs") && conf["longsongs"] == "true") longS = 1;
|
||||
if(conf.hasOwnProperty("longsongs") && conf.longsongs == "true") longS = 1;
|
||||
else longS = 0;
|
||||
if(conf.hasOwnProperty("vote") && conf["vote"] == "true") adminvote = 1;
|
||||
if(conf.hasOwnProperty("vote") && conf.vote == "true") adminvote = 1;
|
||||
else adminvote = 0;
|
||||
if(conf.hasOwnProperty("adminpass") && conf["adminpass"] != "") hasadmin = 1;
|
||||
if(conf.hasOwnProperty("adminpass") && conf.adminpass !== '') hasadmin = 1;
|
||||
else hasadmin = 0;
|
||||
/*list[0].shift();
|
||||
list[3].shift();
|
||||
@@ -35,17 +35,17 @@ function updateList()
|
||||
|
||||
$("#wrapper").empty();
|
||||
|
||||
$.each(list["songs"], function(j, listeID){
|
||||
$.each(list.songs, function(j, listeID){
|
||||
|
||||
var video_title=listeID["title"].replace(/\\\'/g, "'").replace(/"/g,"'").replace(/&/g,"&");
|
||||
var video_id = listeID["id"];
|
||||
var video_title=listeID.title.replace(/\\\'/g, "'").replace(/"/g,"'").replace(/&/g,"&");
|
||||
var video_id = listeID.id;
|
||||
var video_thumb = "http://i.ytimg.com/vi/"+video_id+"/mqdefault.jpg";
|
||||
var odd = ""; if(j%2==0)odd=" oddlist";
|
||||
var odd = ""; if(j%2===0)odd=" oddlist";
|
||||
var delsong = ""; if(pass_corr=="correct")delsong="<input id='del' title='Remove' type='button' class='button' value='X' onclick=\"vote('"+video_id+"','del')\">";
|
||||
var finalhtml="<div id='result' class='result lresult"+odd+"'>"+
|
||||
"<img src='"+video_thumb+"' class='thumb lthumb'>"+
|
||||
"<div class='ltitle'>"+video_title+"</div>"+
|
||||
"<div class='votes'>"+listeID["votes"]+
|
||||
"<div class='votes'>"+listeID.votes+
|
||||
"<a onclick=\"vote('"+video_id+"','pos');\" id='plus'>+</a>"+
|
||||
"<a onclick=\"vote('"+video_id+"','neg');\" id='minus'>-</a>"+
|
||||
delsong+
|
||||
@@ -59,7 +59,7 @@ function updateList()
|
||||
{
|
||||
$("#playlist").css({height: $("#player").height()-$("#adminPanel").outerHeight(true)+30});
|
||||
$("#playlist").css({overflow: "hidden"});
|
||||
if(scroller == false)
|
||||
if(scroller === false)
|
||||
{
|
||||
myScroll = new IScroll('#playlist', {
|
||||
mouseWheel: true,
|
||||
@@ -87,12 +87,12 @@ function updateList()
|
||||
for (var i = 0; i < names.length; i++) {
|
||||
document.getElementsByName(names[i])[0].checked = (conf[names[i]] === "true");
|
||||
document.getElementsByName(names[i])[1].checked = (conf[names[i]] === "false");
|
||||
};
|
||||
}
|
||||
|
||||
if(hasadmin)
|
||||
$("#setpass").text("Channel has admin")
|
||||
$("#setpass").text("Channel has admin");
|
||||
else
|
||||
$("#setpass").text("Channel has no admin")
|
||||
$("#setpass").text("Channel has no admin");
|
||||
}
|
||||
}, 2500);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
function initYoutubeControls(player)
|
||||
{
|
||||
if(player != undefined)
|
||||
if(player !== undefined)
|
||||
{
|
||||
ytplayer = player;
|
||||
//initSlider();
|
||||
@@ -21,9 +21,9 @@ function initYoutubeControls(player)
|
||||
container.appendChild(newElem);
|
||||
for(x = 0; x < elems.length; x++)
|
||||
{
|
||||
var newElem = document.createElement("div");
|
||||
newElem.id = elems[x];
|
||||
container.appendChild(newElem);
|
||||
var newElemFor = document.createElement("div");
|
||||
newElemFor.id = elems[x];
|
||||
container.appendChild(newElemFor);
|
||||
}
|
||||
/*elems = Array("medium", "large", "hd1080", "auto");
|
||||
newElem = document.createElement("div");
|
||||
@@ -39,7 +39,7 @@ function initYoutubeControls(player)
|
||||
newElem.appendChild(newChild);
|
||||
}
|
||||
container.appendChild(newElem);*/
|
||||
initControls()
|
||||
initControls();
|
||||
fitToScreen();
|
||||
$(window).resize(function(){
|
||||
fitToScreen();
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
var old_input="";
|
||||
var timer = 0;
|
||||
/*jshint multistr: true */
|
||||
|
||||
$(document).ready(function()
|
||||
{
|
||||
@@ -31,7 +32,7 @@ $(document).ready(function()
|
||||
|
||||
setInterval(function(){
|
||||
timer--;
|
||||
if(timer==0){
|
||||
if(timer===0){
|
||||
search($(".search_input").val());
|
||||
}
|
||||
}, 1);
|
||||
@@ -42,7 +43,7 @@ function search(search_input){
|
||||
|
||||
|
||||
$("#results").html('');
|
||||
if(search_input != ""){
|
||||
if(search_input !== ""){
|
||||
var keyword= encodeURIComponent(search_input);
|
||||
|
||||
var yt_url='http://gdata.youtube.com/feeds/api/videos?q='+keyword+'&format=5&orderby=relevance&max-results=25&v=2&alt=jsonc';
|
||||
@@ -58,8 +59,8 @@ function search(search_input){
|
||||
var wrapper = "";
|
||||
$.each(response.data.items, function(i,data)
|
||||
{
|
||||
if(data.duration > 720 && longS == 0){return;}
|
||||
if(data["category"] == "Music" || music == 1){
|
||||
if(data.duration > 720 && longS === 0){return;}
|
||||
if(data.category == "Music" || music == 1){
|
||||
var video_title=encodeURIComponent(data.title).replace(/'/g, "\\\'");
|
||||
var views=data.viewCount;
|
||||
var video_thumb = "http://i.ytimg.com/vi/"+data.id+"/default.jpg";
|
||||
|
||||
@@ -12,8 +12,8 @@ var diffVideo;
|
||||
var serverTime;
|
||||
var url;
|
||||
var response;
|
||||
var url
|
||||
var tag
|
||||
var url;
|
||||
var tag;
|
||||
var firstScriptTag;
|
||||
var ytplayer;
|
||||
var syncInterval;
|
||||
@@ -35,12 +35,11 @@ $(document).ready(function()
|
||||
{
|
||||
window.mobilecheck = function() {
|
||||
var check = false;
|
||||
(function(a){if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4)))check = true})(navigator.userAgent||navigator.vendor||window.opera);
|
||||
(function(a){if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4)))check = true;})(navigator.userAgent||navigator.vendor||window.opera);
|
||||
//(function(a){if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4)))check = true})(navigator.userAgent||navigator.vendor||window.opera);
|
||||
return check; }
|
||||
return check; };
|
||||
|
||||
updateList();
|
||||
timeDifference;
|
||||
wasPaused = false;
|
||||
beginning = true;
|
||||
diffVideo = false;
|
||||
@@ -51,11 +50,11 @@ $(document).ready(function()
|
||||
}).responseText;
|
||||
//console.log(response);
|
||||
response = $.parseJSON(response);
|
||||
console.log(response["nowPlaying"].length);
|
||||
conf = response["conf"];
|
||||
console.log(response.nowPlaying.length);
|
||||
conf = response.conf;
|
||||
console.log(conf);
|
||||
try{
|
||||
for(first in response["nowPlaying"]) break;
|
||||
for(var first in response.nowPlaying) break;
|
||||
console.log(first);
|
||||
response = first;
|
||||
}catch(err){
|
||||
@@ -80,7 +79,7 @@ $(document).ready(function()
|
||||
tag.src = "https://www.youtube.com/iframe_api";
|
||||
firstScriptTag = document.getElementsByTagName('script')[0];
|
||||
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
|
||||
if(!window.mobilecheck()){
|
||||
if(window.mobilecheck()){
|
||||
syncInterval = setInterval(getTime, 50000);
|
||||
listInterval = setInterval(updateList, 50000);
|
||||
//listKillInterval = setInterval(ks, 50000);
|
||||
@@ -97,7 +96,7 @@ function onYouTubeIframeAPIReady() {
|
||||
height: window.height*0.75,
|
||||
width: window.width*0.6,
|
||||
videoId: response,
|
||||
playerVars: { rel:"0", wmode:"transparent", controls: "0" , iv_load_policy: "3", theme:"light", rel:"0", color:"white"},
|
||||
playerVars: { rel:"0", wmode:"transparent", controls: "0" , iv_load_policy: "3", theme:"light", color:"white"},
|
||||
events: {
|
||||
'onReady': onPlayerReady,
|
||||
'onStateChange': onPlayerStateChange,
|
||||
@@ -111,7 +110,7 @@ function onPlayerStateChange(newState) {
|
||||
console.log("new state: "+newState.data);
|
||||
console.log("beginning: "+beginning);
|
||||
//ytplayer.seekTo(15);
|
||||
if((newState.data == 0 && checkEnd()) || (newState.data == 1 && checkEnd()))
|
||||
if((newState.data === 0 && checkEnd()) || (newState.data == 1 && checkEnd()))
|
||||
{
|
||||
console.log("nummer 1");
|
||||
startNextSong();
|
||||
@@ -141,11 +140,11 @@ function onPlayerStateChange(newState) {
|
||||
$("#playpause").toggleClass("pause");
|
||||
}
|
||||
}
|
||||
if(newState.data == 0)
|
||||
if(newState.data === 0)
|
||||
{
|
||||
quickFixCountdown = setTimeout(function(){
|
||||
console.log("trying quickfix");
|
||||
if(ytplayer.getPlayerState() == 0 && wasPaused){
|
||||
if(ytplayer.getPlayerState() === 0 && wasPaused){
|
||||
console.log("quickfixPlay");
|
||||
startNextSong();
|
||||
wasPaused = false;
|
||||
@@ -202,7 +201,7 @@ function startNextSong()
|
||||
|
||||
},2500);
|
||||
updateList();
|
||||
changed = true
|
||||
changed = true;
|
||||
|
||||
setTimeout(function() {
|
||||
changed = false;
|
||||
@@ -233,10 +232,10 @@ function getTime()
|
||||
});
|
||||
console.log("current song: "+response);
|
||||
console.log("song in database: "+timeDifference[1]);
|
||||
if(parseInt(timeDifference[2]) + 1> ytplayer.getCurrentTime() + parseInt(timeDifference[3]) && ytplayer.getPlayerState() == 0)
|
||||
if(parseInt(timeDifference[2]) + 1> ytplayer.getCurrentTime() + parseInt(timeDifference[3]) && ytplayer.getPlayerState() === 0)
|
||||
{
|
||||
return true;
|
||||
}else if(ytplayer.getCurrentTime() + parseInt(timeDifference[3]) > parseInt(timeDifference[2]) + 5 || (ytplayer.getCurrentTime() + parseInt(timeDifference[3]) < parseInt(timeDifference[2]) - 5 && ytplayer.getPlayerState() != 0 && ytplayer.getPlayerState() != 3))
|
||||
}else if(ytplayer.getCurrentTime() + parseInt(timeDifference[3]) > parseInt(timeDifference[2]) + 5 || (ytplayer.getCurrentTime() + parseInt(timeDifference[3]) < parseInt(timeDifference[2]) - 5 && ytplayer.getPlayerState() !== 0 && ytplayer.getPlayerState() != 3))
|
||||
{
|
||||
if(parseInt(timeDifference[0]) > ytplayer.getDuration())
|
||||
{
|
||||
@@ -341,7 +340,7 @@ function onPlayerReady(event) {
|
||||
{
|
||||
ytplayer.playVideo();
|
||||
}
|
||||
initYoutubeControls(ytplayer)
|
||||
initYoutubeControls(ytplayer);
|
||||
getTitle();
|
||||
setBGimage(response);
|
||||
initSlider();
|
||||
@@ -349,7 +348,7 @@ function onPlayerReady(event) {
|
||||
}
|
||||
|
||||
function setBGimage(id){
|
||||
if(window.mozInnerScreenX == null && !window.mobilecheck()){
|
||||
if(window.mozInnerScreenX === null && !window.mobilecheck()){
|
||||
$("#bgimage").css("background-image", "url(http://img.youtube.com/vi/"+id+"/0.jpg)");
|
||||
}else if(window.mobilecheck()){
|
||||
$("#mobile-banner").css("background-image", "url(http://img.youtube.com/vi/"+id+"/hqdefault.jpg)");
|
||||
|
||||
Reference in New Issue
Block a user