Merge branch 'master' of github.com:zoff-music/zoff

This commit is contained in:
Kasper Rynning-Tønnesen
2018-07-24 23:42:01 +02:00
9 changed files with 164 additions and 110 deletions

View File

@@ -822,7 +822,8 @@ var Player = {
notifyUser: function(id, title) {
title = title.replace(/\\\'/g, "'").replace(/"/g,"'").replace(/&/g,"&");
if (Notification.permission === "granted" && document.hidden && !embed) {
try{
if (Notification != undefined && Notification.permission === "granted" && document.hidden && !embed) {
var icon = "https://img.youtube.com/vi/"+id+"/mqdefault.jpg";
if(videoSource) icon = full_playlist[full_playlist.length - 1].thumbnail;
var notification = new Notification("Now Playing", {body: title, icon: icon, iconUrl: icon});
@@ -831,6 +832,7 @@ var Player = {
notification.close();
},5000);
}
}catch(e){}
},
setup_all_listeners: function() {