Closing player on frontpage now disconnects chromecast if chromecast is connected

This commit is contained in:
Kasper Rynning-Tønnesen
2016-11-19 12:20:56 +01:00
parent 8e738a4500
commit c09930e079
2 changed files with 6 additions and 2 deletions

File diff suppressed because one or more lines are too long

View File

@@ -507,6 +507,10 @@ $(document).on("click", "#closePlayer", function(e){
e.preventDefault();
socket.emit("change_channel");
try{
if(chromecastAvailable){
var castSession = cast.framework.CastContext.getInstance().getCurrentSession();
castSession.endSession(true);
}
Player.player.destroy();
} catch(error){}
socket.removeEventListener("np");