mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Saving notes, moving computers
This commit is contained in:
parent
b5445515c8
commit
29b7071be7
2 changed files with 10 additions and 35 deletions
|
@ -685,6 +685,7 @@ class PlaybackManager {
|
||||||
constructor() {
|
constructor() {
|
||||||
const self = this;
|
const self = this;
|
||||||
|
|
||||||
|
// The list of players
|
||||||
const players = [];
|
const players = [];
|
||||||
let currentTargetInfo;
|
let currentTargetInfo;
|
||||||
let currentPairingId = null;
|
let currentPairingId = null;
|
||||||
|
@ -835,6 +836,7 @@ class PlaybackManager {
|
||||||
return ServerConnections.currentApiClient().getCurrentUser().then(function (user) {
|
return ServerConnections.currentApiClient().getCurrentUser().then(function (user) {
|
||||||
const targets = [];
|
const targets = [];
|
||||||
|
|
||||||
|
// Is this relevant?
|
||||||
targets.push({
|
targets.push({
|
||||||
name: globalize.translate('HeaderMyDevice'),
|
name: globalize.translate('HeaderMyDevice'),
|
||||||
id: 'localplayer',
|
id: 'localplayer',
|
||||||
|
@ -1977,9 +1979,12 @@ class PlaybackManager {
|
||||||
self.translateItemsForPlayback = translateItemsForPlayback;
|
self.translateItemsForPlayback = translateItemsForPlayback;
|
||||||
self.getItemsForPlayback = getItemsForPlayback;
|
self.getItemsForPlayback = getItemsForPlayback;
|
||||||
|
|
||||||
|
// This is the exposed function called to manage item media playback
|
||||||
self.play = function (options) {
|
self.play = function (options) {
|
||||||
normalizePlayOptions(options);
|
normalizePlayOptions(options);
|
||||||
|
console.debug('playing');
|
||||||
|
|
||||||
|
// I think this class *is* the "localpalyer", others are plugins or chromecast
|
||||||
if (self._currentPlayer) {
|
if (self._currentPlayer) {
|
||||||
if (options.enableRemotePlayers === false && !self._currentPlayer.isLocalPlayer) {
|
if (options.enableRemotePlayers === false && !self._currentPlayer.isLocalPlayer) {
|
||||||
return Promise.reject();
|
return Promise.reject();
|
||||||
|
@ -1990,11 +1995,13 @@ class PlaybackManager {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.debug('using "localplayer" (*wink*)');
|
||||||
if (options.fullscreen) {
|
if (options.fullscreen) {
|
||||||
loading.show();
|
loading.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options.items) {
|
if (options.items) {
|
||||||
|
console.debug('playing from options.items');
|
||||||
return translateItemsForPlayback(options.items, options)
|
return translateItemsForPlayback(options.items, options)
|
||||||
.then((items) => getAdditionalParts(items))
|
.then((items) => getAdditionalParts(items))
|
||||||
.then(function (allItems) {
|
.then(function (allItems) {
|
||||||
|
@ -2002,6 +2009,7 @@ class PlaybackManager {
|
||||||
return playWithIntros(flattened, options);
|
return playWithIntros(flattened, options);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
console.debug('calling getItemsForPlayback');
|
||||||
if (!options.serverId) {
|
if (!options.serverId) {
|
||||||
throw new Error('serverId required!');
|
throw new Error('serverId required!');
|
||||||
}
|
}
|
||||||
|
@ -3420,6 +3428,7 @@ class PlaybackManager {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add a player to the list of players and associate callbacks
|
||||||
function initMediaPlayer(player) {
|
function initMediaPlayer(player) {
|
||||||
players.push(player);
|
players.push(player);
|
||||||
players.sort(function (a, b) {
|
players.sort(function (a, b) {
|
||||||
|
|
|
@ -531,46 +531,11 @@ class BooksView {
|
||||||
}
|
}
|
||||||
|
|
||||||
function getTitle(item) {
|
function getTitle(item) {
|
||||||
if (params.type === 'Recordings') {
|
|
||||||
return globalize.translate('Recordings');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (params.type === 'Programs') {
|
|
||||||
if (params.IsMovie === 'true') {
|
|
||||||
return globalize.translate('Movies');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (params.IsSports === 'true') {
|
|
||||||
return globalize.translate('Sports');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (params.IsKids === 'true') {
|
|
||||||
return globalize.translate('HeaderForKids');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (params.IsAiring === 'true') {
|
|
||||||
return globalize.translate('HeaderOnNow');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (params.IsSeries === 'true') {
|
|
||||||
return globalize.translate('Shows');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (params.IsNews === 'true') {
|
|
||||||
return globalize.translate('News');
|
|
||||||
}
|
|
||||||
|
|
||||||
return globalize.translate('Programs');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (params.type === 'nextup') {
|
if (params.type === 'nextup') {
|
||||||
return globalize.translate('NextUp');
|
return globalize.translate('NextUp');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (params.type === 'favoritemovies') {
|
|
||||||
return globalize.translate('FavoriteMovies');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (item) {
|
if (item) {
|
||||||
return item.Name;
|
return item.Name;
|
||||||
}
|
}
|
||||||
|
@ -622,6 +587,7 @@ class BooksView {
|
||||||
autoplay: true
|
autoplay: true
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
// This is the call we can use for resume playback
|
||||||
getItems(self, self.params, currentItem, null, 0, 300).then(function (result) {
|
getItems(self, self.params, currentItem, null, 0, 300).then(function (result) {
|
||||||
playbackManager.play({
|
playbackManager.play({
|
||||||
items: result.Items,
|
items: result.Items,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue