mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
catch for notificationa not existing on some devices
This commit is contained in:
@@ -817,7 +817,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});
|
||||
@@ -826,6 +827,7 @@ var Player = {
|
||||
notification.close();
|
||||
},5000);
|
||||
}
|
||||
}catch(e){}
|
||||
},
|
||||
|
||||
setup_all_listeners: function() {
|
||||
|
||||
Reference in New Issue
Block a user