mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-18 03:18:19 -07:00
support notifications in firefox
This commit is contained in:
parent
1ac0f71d1e
commit
d4ba64d07a
@ -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 () {
|
||||
});
|
||||
}
|
||||
|
@ -884,13 +884,12 @@ var Dashboard = {
|
||||
else if (msg.MessageType === "Play") {
|
||||
|
||||
ApiClient.getItems(Dashboard.getCurrentUserId(), {
|
||||
|
||||
Ids: msg.Data.ItemIds.join(','),
|
||||
|
||||
Fields: 'MediaStreams,UserData,DisplayMediaType,SeriesInfo,AudioInfo,Chapters'
|
||||
|
||||
}).done(function(result) {
|
||||
|
||||
Ids: msg.Data.ItemIds.join(','),
|
||||
|
||||
Fields: 'MediaStreams,UserData,DisplayMediaType,SeriesInfo,AudioInfo,Chapters,Path'
|
||||
|
||||
}).done(function (result) {
|
||||
MediaPlayer.play(result.Items, msg.Data.StartPositionTicks);
|
||||
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user