Chromcast listener

This commit is contained in:
Kasper Rynning-Tønnesen
2017-01-27 15:41:38 +01:00
parent a4a06838c2
commit ee34c88276
2 changed files with 11 additions and 3 deletions

File diff suppressed because one or more lines are too long

View File

@@ -396,10 +396,18 @@ function chromecastListener(evt, data){
var json_parsed = JSON.parse(data); var json_parsed = JSON.parse(data);
switch(json_parsed.type){ switch(json_parsed.type){
case -1: case -1:
socket.emit("end", {id: json_parsed.videoId, channel: chan.toLowerCase()}); if(offline){
Player.playNext();
} else {
socket.emit("end", {id: json_parsed.videoId, channel: chan.toLowerCase()});
}
break; break;
case 0: case 0:
socket.emit("skip", {error: json_parsed.data_code, id: json_parsed.videoId, pass: adminpass, channel: chan.toLowerCase}); if(offline){
Player.playNext();
} else {
socket.emit("skip", {error: json_parsed.data_code, id: json_parsed.videoId, pass: adminpass, channel: chan.toLowerCase});
}
break; break;
} }
} }