Fixed some minor things on mobile

This commit is contained in:
Kasper Rynning-Tønnesen
2016-05-10 14:30:37 +02:00
parent f1e52ced03
commit b26a8ea716
5 changed files with 12 additions and 10 deletions

View File

@@ -139,7 +139,7 @@ function init(){
socket = io.connect(''+add+':8880', connection_options);
}
if($("#alreadychannel").length == 0){
if($("#alreadychannel").length == 0 || window.mobilecheck()){
Player.setup_youtube_listener(chan);
socket.on("get_list", function(){
@@ -187,7 +187,7 @@ function init(){
$("#channel-load").css("display", "none");
} else {
window.onYouTubeIframeAPIReady = Player.onYouTubeIframeAPIReady;
if(Player.ytplayer == "" || Player.ytplayer == undefined) Player.loadPlayer();
if(Player.ytplayer == "" || Player.ytplayer == undefined || window.mobilecheck()) Player.loadPlayer();
}
if(window.mobilecheck()) Mobile_remote.initiate_volume();
@@ -596,7 +596,8 @@ function onepage_load(){
$("#player").addClass("player_bottom");
$("#main-row").addClass("frontpage_modified_heights");
} else {
if(!/iPad|iPhone|iPod/.test(navigator.userAgent)) Player.ytplayer.destroy();
console.log("destroying video");
Player.ytplayer.destroy();
Player.ytplayer = "";
}

View File

@@ -250,7 +250,7 @@ var Nochan = {
$("main").attr("class", "container center-align main");
$("body").attr("id", "channelpage");
$("header").html($($(e)[61]).html());
if($("#alreadychannel").length == 0) $("main").html($($(e)[65]).html());
if($("#alreadychannel").length == 0 || window.mobilecheck()) $("main").html($($(e)[65]).html());
else {
var main = $($($($($(e)[65]).html())[0]).html());
$("#main-row").append($(main[2]).clone().wrap("<div>").parent().html());
@@ -325,8 +325,8 @@ function initfp(){
if(window.location.hostname == "zoff.no") add = "https://zoff.no";
else add = window.location.hostname;
if(socket == undefined) socket = io.connect(''+add+':8880', connection_options);
if($("#alreadyfp").length == 0){
if(socket == undefined || window.mobilecheck()) socket = io.connect(''+add+':8880', connection_options);
if($("#alreadyfp").length == 0 || window.mobilecheck()){
socket.on('playlists', function(msg){
$("#channels").empty();
frontpage = true;

View File

@@ -187,7 +187,8 @@ var Player = {
$("#controls").css("opacity", "1");
$(".playlist").css("opacity", "1");
Player.ytplayer.loadVideoById(video_id);
if(autoplay && !window.mobilecheck()) Player.ytplayer.playVideo();
if(autoplay && !window.mobilecheck())
Player.ytplayer.playVideo();
if(!durationBegun)
Player.durationSetter();
if(embed){