mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-12-08 20:48:48 +00:00
Added a rather long and not the best embed code
This commit is contained in:
52
static/js/embed.js
Normal file
52
static/js/embed.js
Normal file
@@ -0,0 +1,52 @@
|
||||
|
||||
var song_title = "";
|
||||
var paused = false;
|
||||
var player_ready = false;
|
||||
var list_html = $("#list-song-html").html();
|
||||
var w_p = true;
|
||||
var lazy_load = false;
|
||||
var embed = true;
|
||||
var vol = 100;
|
||||
var adminpass = "";
|
||||
|
||||
var seekTo;
|
||||
var socket;
|
||||
var video_id;
|
||||
var previous_video_id;
|
||||
var chan = ($("#zoffchannel").html()).toLowerCase();
|
||||
|
||||
var connection_options = {
|
||||
'sync disconnect on unload':true,
|
||||
'secure': true,
|
||||
'force new connection': true
|
||||
};
|
||||
|
||||
$(document).ready(function(){
|
||||
console.log("loadshit");
|
||||
|
||||
$("head").append('<link type="text/css" rel="stylesheet" href="/static/css/embed.css" />');
|
||||
$("head").append('<link type="text/css" rel="stylesheet" href="/static/css/materialize.min.css" />');
|
||||
|
||||
if(window.location.hostname != "zoff.no") add = "https://zoff.no";
|
||||
else add = "localhost";
|
||||
socket = io.connect(''+add+':8880', connection_options);
|
||||
|
||||
socket.on("get_list", function(){
|
||||
setTimeout(function(){socket.emit('list', chan.toLowerCase())},1000);
|
||||
});
|
||||
|
||||
Youtube.setup_youtube_listener(chan);
|
||||
List.channel_listener();
|
||||
|
||||
|
||||
window.onYouTubeIframeAPIReady = Youtube.onYouTubeIframeAPIReady;
|
||||
|
||||
Youtube.loadPlayer();
|
||||
|
||||
Playercontrols.initSlider();
|
||||
});
|
||||
|
||||
$(document).on( "click", ".vote-container", function(e){
|
||||
var id = $(this).attr("data-video-id");
|
||||
List.vote(id, "pos");
|
||||
});
|
||||
Reference in New Issue
Block a user