mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
support notifications in firefox
This commit is contained in:
parent
1ac0f71d1e
commit
d4ba64d07a
2 changed files with 20 additions and 13 deletions
|
@ -69,18 +69,24 @@ var WebNotifications = {
|
|||
}
|
||||
}
|
||||
else if (window.Notification) {
|
||||
if (Notification.permissionLevel() === "granted") {
|
||||
var notif = new Notification(data.title, data);
|
||||
notif.show();
|
||||
|
||||
if (data.timeout) {
|
||||
var level = Notification.permissionLevel ? Notification.permissionLevel() : Notification.permission;
|
||||
|
||||
if (level === "granted") {
|
||||
var notif = new Notification(data.title, data);
|
||||
|
||||
if (notif.show) {
|
||||
notif.show();
|
||||
}
|
||||
|
||||
if (data.timeout && notif.cancel) {
|
||||
setTimeout(function () {
|
||||
notif.cancel();
|
||||
}, data.timeout);
|
||||
}
|
||||
|
||||
return notif;
|
||||
} else if (Notification.permissionLevel() === "default") {
|
||||
} else if (level === "default") {
|
||||
Notification.requestPermission(function () {
|
||||
return WebNotifications.show(data);
|
||||
});
|
||||
|
@ -97,8 +103,10 @@ var WebNotifications = {
|
|||
}
|
||||
}
|
||||
else if (window.Notification) {
|
||||
if (Notification.permissionLevel() === "granted") {
|
||||
} else if (Notification.permissionLevel() === "default") {
|
||||
|
||||
var level = Notification.permissionLevel ? Notification.permissionLevel() : Notification.permission;
|
||||
|
||||
if (level === "default") {
|
||||
Notification.requestPermission(function () {
|
||||
});
|
||||
}
|
||||
|
|
|
@ -887,10 +887,9 @@ var Dashboard = {
|
|||
|
||||
Ids: msg.Data.ItemIds.join(','),
|
||||
|
||||
Fields: 'MediaStreams,UserData,DisplayMediaType,SeriesInfo,AudioInfo,Chapters'
|
||||
|
||||
}).done(function(result) {
|
||||
Fields: 'MediaStreams,UserData,DisplayMediaType,SeriesInfo,AudioInfo,Chapters,Path'
|
||||
|
||||
}).done(function (result) {
|
||||
MediaPlayer.play(result.Items, msg.Data.StartPositionTicks);
|
||||
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue