Commit fb658cce authored by Benoît Simonneaux's avatar Benoît Simonneaux

Remove unecessary content.

parent ce9e94f9
Pipeline #896 passed with stage
in 1 minute and 15 seconds
function Content_DisplayRoomList() {
let content = $('<div class="content roomlist">');
}
let vm = new Vue({
el: '#app',
data: {}
});
......@@ -33,7 +33,7 @@ function MWS_onClose(evt) {
function MWS_onMessage(evt) {
console.log(`[MWS] Message :`);
let res = JSON.parse(String_UTF8Decode(evt.data));
console.log(res);
......@@ -49,20 +49,16 @@ function MWS_onMessage(evt) {
}
} else {
let data = res.data;
switch(res.type) {
case "feedPlaylist":
MusicPlaylist_feed(data);
break;
case "playNext":
MusicPlayer_PutVideo(data.video);
break;
case "removeVideo":
MusicPlaylist_RemoveDiv(data.video);
break;
case "stream.key":
SWS_StreamKey = data;
if(typeof SWS !== 'undefined' && SWS.readyState === SWS.OPEN) {
......
var Music_player;
var Music_playerReady = false;
var Music_playerReady_call = [];
var Music_playlist = [];
var Music_currentRoom = 0;
function Music_GetVideoCode(url) { //changer un url en Id lisible par l'API
var regex = new RegExp("[?&]v(=([^&#]*)|&|#|$)", "i"),
results = regex.exec(url);
if (!results) return null;
if (!results[2]) return '';
return decodeURIComponent(results[2].replace(/\+/g, " "));
}
function onYouTubeIframeAPIReady() {
MusicPlayer_init();
}
function MusicPlayer_init() {// initialiser le player
Music_player = new YT.Player('player', {
height: '390',
width: '640',
videoId: 'sjFoMgxUmVU',
events: {
'onReady': MusicPlayer_onPlayerReady
}
});
}
function MusicPlayer_onPlayerReady(event) {// mettre le player en lecture sans son quand il est pret
var p = event.target;
Music_playerReady = true;
p.setVolume(100);
Music_playerReady_call.forEach(function(e, i, a) {
e.apply();
})
}
function MusicPlayer_PutVideo(id) { // mettre une vidéo sur le player
if(!Music_playerReady) {
Music_playerReady_call.push(function() { MusicPlayer_PutVideo(id); });
return;
}
$('.playlist li').removeClass('active');
Music_player.loadVideoById(Music_playlist[id].ytId);
$('.playlist li[music_id="' + id +'"]').addClass('active');
}
function MusicPlaylist_feed(data) { // remplir la playlist
Music_playlist[data.id] = data;
MusicPlaylist_CreateDiv(data);
if(false)
MusicPlayer_PutVideo(data.id);
if(typeof atTime !== 'undefined') {
if(!Music_playerReady)
Music_playerReady_call.push(function() { Music_player.seekTo(atTime, true); });
else
Music_player.seekTo(atTime, true);
}
}
function MusicPlaylist_CreateDiv(data) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment