mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Fixed skipping/pause issues
This commit is contained in:
@@ -11,6 +11,7 @@ var time_regex = /P((([0-9]*\.?[0-9]*)Y)?(([0-9]*\.?[0-9]*)M)?(([0-9]*
|
||||
var conf = [];
|
||||
var private_channel = false;
|
||||
var music = 0;
|
||||
var gotten_np = false;
|
||||
var frontpage = 1;
|
||||
var empty_clear = false;
|
||||
var adminpass = "";
|
||||
@@ -161,9 +162,9 @@ $().ready(function(){
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
socket.on("name", function(data) {
|
||||
socket.on("name", function(data) {
|
||||
if(data.type == "name" && data.accepted) {
|
||||
Crypt.set_name(temp_name, temp_pass);
|
||||
temp_name = "";
|
||||
@@ -172,15 +173,15 @@ socket.on("name", function(data) {
|
||||
temp_name = "";
|
||||
temp_pass = "";
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
socket.on("self_ping", function() {
|
||||
socket.on("self_ping", function() {
|
||||
if(chan != undefined && chan.toLowerCase() != "") {
|
||||
socket.emit("self_ping", {channel: chan.toLowerCase()});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
setup_no_connection_listener();
|
||||
setup_no_connection_listener();
|
||||
});
|
||||
|
||||
function init(){
|
||||
@@ -341,46 +342,46 @@ function init(){
|
||||
delay: 5,
|
||||
position: "bottom",
|
||||
tooltip: "Skip",
|
||||
});*/
|
||||
});*/
|
||||
|
||||
$("#shuffle").tooltip({
|
||||
$("#shuffle").tooltip({
|
||||
delay: 5,
|
||||
position: "bottom",
|
||||
tooltip: "Shuffle",
|
||||
});
|
||||
});
|
||||
|
||||
$("#settings").tooltip({
|
||||
$("#settings").tooltip({
|
||||
delay: 5,
|
||||
position: "bottom",
|
||||
tooltip: "Settings",
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
window.onYouTubeIframeAPIReady = Player.onYouTubeIframeAPIReady;
|
||||
if(Player.player === "" || Player.player === undefined || Helper.mobilecheck()) Player.loadPlayer();
|
||||
//}
|
||||
window.onYouTubeIframeAPIReady = Player.onYouTubeIframeAPIReady;
|
||||
if(Player.player === "" || Player.player === undefined || Helper.mobilecheck()) Player.loadPlayer();
|
||||
//}
|
||||
|
||||
if(Helper.mobilecheck()) {
|
||||
if(Helper.mobilecheck()) {
|
||||
Mobile_remote.initiate_volume();
|
||||
} else {
|
||||
} else {
|
||||
$('input#chan_description').characterCounter();
|
||||
}
|
||||
}
|
||||
|
||||
setup_admin_listener();
|
||||
setup_list_listener();
|
||||
setup_chat_listener();
|
||||
setup_admin_listener();
|
||||
setup_list_listener();
|
||||
setup_chat_listener();
|
||||
|
||||
socket.emit("get_history", {channel: chan.toLowerCase(), all: false});
|
||||
socket.emit("get_history", {channel: chan.toLowerCase(), all: true});
|
||||
socket.emit("get_history", {channel: chan.toLowerCase(), all: false});
|
||||
socket.emit("get_history", {channel: chan.toLowerCase(), all: true});
|
||||
|
||||
if(!Helper.mobilecheck() && $("#alreadychannel").length === 0) setup_host_initialization();
|
||||
if(!Helper.mobilecheck() && $("#alreadychannel").length === 0) setup_host_initialization();
|
||||
|
||||
if(!Helper.msieversion() && !Helper.mobilecheck()) Notification.requestPermission();
|
||||
if(!Helper.msieversion() && !Helper.mobilecheck()) Notification.requestPermission();
|
||||
|
||||
$(".search_input").focus();
|
||||
$(".search_input").focus();
|
||||
|
||||
Helper.sample();
|
||||
if(!Helper.mobilecheck()) {
|
||||
Helper.sample();
|
||||
if(!Helper.mobilecheck()) {
|
||||
$('.castButton').tooltip({
|
||||
delay: 5,
|
||||
position: "top",
|
||||
@@ -403,35 +404,35 @@ function init(){
|
||||
$(".sp-cancel").addClass("btn-flat waves-effect waves-red");
|
||||
$(".sp-cancel").removeClass("sp-cancel");
|
||||
$(".sp-button-container").append("<a href='#' class='btn-flat waves-effect waves-green sp-choose-link'>CHOOSE</a>");
|
||||
}
|
||||
}
|
||||
|
||||
$(".sp-choose-link").on("click", function(e) {
|
||||
$(".sp-choose-link").on("click", function(e) {
|
||||
e.preventDefault();
|
||||
$(".sp-choose").trigger("click");
|
||||
});
|
||||
});
|
||||
|
||||
$("#results" ).hover( function() { $("div.result").removeClass("hoverResults"); i = 0; }, function(){ });
|
||||
$("#search").focus();
|
||||
$("#embed-button").css("display", "inline-block");
|
||||
$("#embed-area").val(embed_code(embed_autoplay, embed_width, embed_height, color));
|
||||
$("#search").attr("placeholder", "Find song on YouTube...");
|
||||
$("#results" ).hover( function() { $("div.result").removeClass("hoverResults"); i = 0; }, function(){ });
|
||||
$("#search").focus();
|
||||
$("#embed-button").css("display", "inline-block");
|
||||
$("#embed-area").val(embed_code(embed_autoplay, embed_width, embed_height, color));
|
||||
$("#search").attr("placeholder", "Find song on YouTube...");
|
||||
|
||||
if(!$("footer").hasClass("padding-bottom-novideo")) {
|
||||
if(!$("footer").hasClass("padding-bottom-novideo")) {
|
||||
$("footer").addClass("padding-bottom-novideo");
|
||||
}
|
||||
}
|
||||
|
||||
if(!/chrom(e|ium)/.test(navigator.userAgent.toLowerCase()) && !Helper.mobilecheck()){
|
||||
if(!/chrom(e|ium)/.test(navigator.userAgent.toLowerCase()) && !Helper.mobilecheck()){
|
||||
$(".castButton").css("display", "none");
|
||||
}
|
||||
}
|
||||
|
||||
Helper.log("chromecastAvailable" + chromecastAvailable);
|
||||
Helper.log("chromecastAvailable" + chromecastReady);
|
||||
Helper.log("chromecastAvailable" + chromecastAvailable);
|
||||
Helper.log("chromecastAvailable" + chromecastReady);
|
||||
|
||||
if(chromecastAvailable){
|
||||
if(chromecastAvailable){
|
||||
hide_native(1);
|
||||
} else if(chromecastReady) {
|
||||
} else if(chromecastReady) {
|
||||
initializeCastApi();
|
||||
} else {
|
||||
} else {
|
||||
window['__onGCastApiAvailable'] = function(loaded, errorInfo) {
|
||||
if (loaded) {
|
||||
setTimeout(function(){
|
||||
@@ -442,9 +443,9 @@ function init(){
|
||||
chromecastReady = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$.contextMenu({
|
||||
$.contextMenu({
|
||||
selector: '.playlist-element',
|
||||
reposition: true,
|
||||
autoHide: true,
|
||||
@@ -503,11 +504,11 @@ function init(){
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
if(!Helper.mobilecheck() && navigator.userAgent.match(/iPad/i) == null){
|
||||
if(!Helper.mobilecheck() && navigator.userAgent.match(/iPad/i) == null){
|
||||
setTimeout(function(){set_title_width();}, 100);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
initializeCastApi = function() {
|
||||
|
||||
@@ -22,6 +22,9 @@ var Player = {
|
||||
} catch(e) {
|
||||
state = null;
|
||||
}
|
||||
if(!paused) {
|
||||
gotten_np = true;
|
||||
}
|
||||
if((((!offline && (state != null || from_frontpage)) || (offline && (!(state != null) || from_frontpage))|| (!offline && (!(state != null) || from_frontpage)) || (offline && state == -1)) && !(offline && prev_chan_player == chan)) || (offline && video_id == undefined)){
|
||||
prev_chan_player = chan;
|
||||
from_frontpage = false;
|
||||
@@ -55,6 +58,7 @@ var Player = {
|
||||
}catch(e){}
|
||||
//List.importOldList(channel.toLowerCase());
|
||||
} else if(paused){
|
||||
|
||||
Player.getTitle(obj.np[0].title, viewers);
|
||||
//Player.setBGimage(video_id);
|
||||
if(!Helper.mobilecheck()) {
|
||||
@@ -215,9 +219,10 @@ var Player = {
|
||||
$("#playpause").css("pointer-events", "all");
|
||||
$("#channel-load").css("display", "none");
|
||||
}
|
||||
if(!empty_clear) {
|
||||
if(!empty_clear && !gotten_np) {
|
||||
paused = true;
|
||||
}
|
||||
if(gotten_np) gotten_np = false;
|
||||
if(window.location.pathname != "/") Playercontrols.play_pause_show();
|
||||
mobile_beginning = true;
|
||||
}
|
||||
@@ -252,6 +257,7 @@ var Player = {
|
||||
}
|
||||
//Playercontrols.play_pause();
|
||||
} else {
|
||||
paused = true;
|
||||
Player.player.pauseVideo();
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user