mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Merge branch 'master' into enable-airplay-audioplayer
This commit is contained in:
commit
9a69156487
264 changed files with 53855 additions and 48500 deletions
|
@ -1,4 +1,4 @@
|
|||
/* eslint-disable indent */
|
||||
|
||||
import ServerConnections from '../../components/ServerConnections';
|
||||
import { PluginType } from '../../types/plugin.ts';
|
||||
|
||||
|
@ -9,44 +9,43 @@ class BackdropScreensaver {
|
|||
this.id = 'backdropscreensaver';
|
||||
this.supportsAnonymous = false;
|
||||
}
|
||||
show() {
|
||||
const query = {
|
||||
ImageTypes: 'Backdrop',
|
||||
EnableImageTypes: 'Backdrop',
|
||||
IncludeItemTypes: 'Movie,Series,MusicArtist',
|
||||
SortBy: 'Random',
|
||||
Recursive: true,
|
||||
Fields: 'Taglines',
|
||||
ImageTypeLimit: 1,
|
||||
StartIndex: 0,
|
||||
Limit: 200
|
||||
};
|
||||
show() {
|
||||
const query = {
|
||||
ImageTypes: 'Backdrop',
|
||||
EnableImageTypes: 'Backdrop',
|
||||
IncludeItemTypes: 'Movie,Series,MusicArtist',
|
||||
SortBy: 'Random',
|
||||
Recursive: true,
|
||||
Fields: 'Taglines',
|
||||
ImageTypeLimit: 1,
|
||||
StartIndex: 0,
|
||||
Limit: 200
|
||||
};
|
||||
|
||||
const apiClient = ServerConnections.currentApiClient();
|
||||
apiClient.getItems(apiClient.getCurrentUserId(), query).then((result) => {
|
||||
if (result.Items.length) {
|
||||
import('../../components/slideshow/slideshow').then(({ default: Slideshow }) => {
|
||||
const newSlideShow = new Slideshow({
|
||||
showTitle: true,
|
||||
cover: true,
|
||||
items: result.Items
|
||||
});
|
||||
const apiClient = ServerConnections.currentApiClient();
|
||||
apiClient.getItems(apiClient.getCurrentUserId(), query).then((result) => {
|
||||
if (result.Items.length) {
|
||||
import('../../components/slideshow/slideshow').then(({ default: Slideshow }) => {
|
||||
const newSlideShow = new Slideshow({
|
||||
showTitle: true,
|
||||
cover: true,
|
||||
items: result.Items
|
||||
});
|
||||
|
||||
newSlideShow.show();
|
||||
this.currentSlideshow = newSlideShow;
|
||||
}).catch(console.error);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
hide() {
|
||||
if (this.currentSlideshow) {
|
||||
this.currentSlideshow.hide();
|
||||
this.currentSlideshow = null;
|
||||
newSlideShow.show();
|
||||
this.currentSlideshow = newSlideShow;
|
||||
}).catch(console.error);
|
||||
}
|
||||
return Promise.resolve();
|
||||
}
|
||||
});
|
||||
}
|
||||
/* eslint-enable indent */
|
||||
|
||||
hide() {
|
||||
if (this.currentSlideshow) {
|
||||
this.currentSlideshow.hide();
|
||||
this.currentSlideshow = null;
|
||||
}
|
||||
return Promise.resolve();
|
||||
}
|
||||
}
|
||||
|
||||
export default BackdropScreensaver;
|
||||
|
|
|
@ -7,6 +7,7 @@ import ServerConnections from '../../components/ServerConnections';
|
|||
import alert from '../../components/alert';
|
||||
import { PluginType } from '../../types/plugin.ts';
|
||||
import Events from '../../utils/events.ts';
|
||||
import { getItems } from '../../utils/jellyfin-apiclient/getItems.ts';
|
||||
|
||||
// Based on https://github.com/googlecast/CastVideos-chrome/blob/master/CastVideos.js
|
||||
|
||||
|
@ -482,7 +483,7 @@ function getItemsForPlayback(apiClient, query) {
|
|||
query.ExcludeLocationTypes = 'Virtual';
|
||||
query.EnableTotalRecordCount = false;
|
||||
|
||||
return apiClient.getItems(userId, query);
|
||||
return getItems(apiClient, userId, query);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ function supportsFade() {
|
|||
}
|
||||
|
||||
function requireHlsPlayer(callback) {
|
||||
import('hls.js').then(({ default: hls }) => {
|
||||
import('hls.js/dist/hls.js').then(({ default: hls }) => {
|
||||
hls.DefaultConfig.lowLatencyMode = false;
|
||||
hls.DefaultConfig.backBufferLength = Infinity;
|
||||
hls.DefaultConfig.liveBackBufferLength = 90;
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -17,7 +17,7 @@
|
|||
z-index: 1000;
|
||||
}
|
||||
|
||||
.videoPlayerContainer .libassjs-canvas-parent {
|
||||
.videoPlayerContainer .JASSUB {
|
||||
order: -1;
|
||||
}
|
||||
|
||||
|
|
|
@ -279,16 +279,22 @@ export class PdfPlayer {
|
|||
|
||||
renderPage(canvas, number) {
|
||||
this.book.getPage(number).then(page => {
|
||||
const original = page.getViewport({ scale: 1 });
|
||||
const width = dom.getWindowSize().innerWidth;
|
||||
const height = dom.getWindowSize().innerHeight;
|
||||
const scale = Math.ceil(window.devicePixelRatio || 1);
|
||||
const viewport = page.getViewport({ scale });
|
||||
const context = canvas.getContext('2d');
|
||||
|
||||
const widthRatio = dom.getWindowSize().innerWidth / original.width;
|
||||
const heightRatio = dom.getWindowSize().innerHeight / original.height;
|
||||
const scale = Math.min(heightRatio, widthRatio);
|
||||
const viewport = page.getViewport({ scale: scale });
|
||||
|
||||
canvas.width = viewport.width;
|
||||
canvas.height = viewport.height;
|
||||
|
||||
if (width < height) {
|
||||
canvas.style.width = '100%';
|
||||
canvas.style.height = 'auto';
|
||||
} else {
|
||||
canvas.style.height = '100%';
|
||||
canvas.style.width = 'auto';
|
||||
}
|
||||
|
||||
const renderContext = {
|
||||
canvasContext: context,
|
||||
viewport: viewport
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
*/
|
||||
|
||||
import Events from '../../../utils/events.ts';
|
||||
import { getItems } from '../../../utils/jellyfin-apiclient/getItems.ts';
|
||||
|
||||
/**
|
||||
* Constants
|
||||
|
@ -88,7 +89,7 @@ export function getItemsForPlayback(apiClient, query) {
|
|||
query.EnableTotalRecordCount = false;
|
||||
query.CollapseBoxSetItems = false;
|
||||
|
||||
return apiClient.getItems(apiClient.getCurrentUserId(), query);
|
||||
return getItems(apiClient, apiClient.getCurrentUserId(), query);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue