Moved hashlink test in embed

This commit is contained in:
Kasper Rynning-Tønnesen
2018-05-07 14:31:42 +02:00
parent 800731f09f
commit c5a79e718a
2 changed files with 7 additions and 9 deletions

View File

@@ -76,14 +76,15 @@ function receiveMessage(event) {
}
}
if(hash.length >= 3 && hash[2] == "autoplay"){
autoplay = true;
Helper.css("#player", "visibility", "hidden");
} else {
paused = true;
}
window.addEventListener("message", receiveMessage, false);
window.addEventListener("DOMContentLoaded", function() {
if(hash.length >= 3 && hash[2] == "autoplay"){
autoplay = true;
Helper.css("#player", "visibility", "hidden");
} else {
paused = true;
}
if(hash.indexOf("videoonly") > -1) {
Helper.addClass("#wrapper", "hide");

View File

@@ -13,7 +13,6 @@ var Player = {
},
now_playing_listener: function(obj) {
console.log(offline && (video_id == "" || video_id == undefined) && !client);
if(obj.np != undefined) {
if(offline && (video_id == "" || video_id == undefined) && !client){
video_id = obj.np[0].id;
@@ -41,7 +40,6 @@ var Player = {
Player.getTitle(song_title, viewers);
Player.loadVideoById(Player.np.id, duration, Player.np.start, Player.np.end);
} else {
console.log("here");
video_id = obj.np[0].id;
Player.np = obj.np[0];
Player.np.start = obj.np[0].start;
@@ -410,7 +408,6 @@ var Player = {
},
cueVideoById: function(id, this_duration, start, end){
console.log("cueVideoById");
var s;
var e;
if(start) s = start;