1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

update play buttons

This commit is contained in:
Luke Pulverenti 2017-01-23 14:06:13 -05:00
parent 1730740055
commit 7f6fe0d708
9 changed files with 81 additions and 20 deletions

View file

@ -2197,25 +2197,38 @@
function showPlayMenu(item, target) {
playbackManager.play({
items: [item],
startPositionTicks: item.UserData ? item.UserData.PlaybackPositionTicks : 0
require(['playMenu'], function (playMenu) {
playMenu.show({
item: item,
positionTo: target
});
});
}
function playCurrentItem(button) {
function playCurrentItem(button, mode) {
if (currentItem.Type == 'Program') {
var item = currentItem;
ApiClient.getLiveTvChannel(currentItem.ChannelId, Dashboard.getCurrentUserId()).then(function (channel) {
if (item.Type === 'Program') {
showPlayMenu(channel, button);
ApiClient.getLiveTvChannel(item.ChannelId, Dashboard.getCurrentUserId()).then(function (channel) {
playbackManager.play({
items: [channel]
});
});
return;
}
showPlayMenu(currentItem, button);
if (mode === 'playmenu') {
showPlayMenu(item, button);
} else {
playbackManager.play({
items: [item],
startPositionTicks: item.UserData && mode === 'resume' ? item.UserData.PlaybackPositionTicks : 0
});
}
}
function deleteTimer(page, params, id) {
@ -2254,7 +2267,9 @@
window.ItemDetailPage = new itemDetailPage();
function onPlayClick() {
playCurrentItem(this);
var mode = this.getAttribute('data-mode');
playCurrentItem(this, mode);
}
function onInstantMixClick() {

View file

@ -2548,7 +2548,7 @@ var AppInfo = {};
return navigator.serviceWorker.ready;
}).then(function (reg) {
if (reg.sync) {
if (reg && reg.sync) {
// https://github.com/WICG/BackgroundSync/blob/master/explainer.md
return reg.sync.register('emby-sync').then(function () {
window.SyncRegistered = Dashboard.isConnectMode();