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

Remove mustDestroy and fix currentSrc in mpv video player.

This commit is contained in:
Ian Walton 2021-04-07 19:52:16 -04:00
parent 156303d9c0
commit 466098aaec
3 changed files with 5 additions and 12 deletions

View file

@ -68,7 +68,6 @@ class HtmlAudioPlayer {
self.type = 'mediaplayer'; self.type = 'mediaplayer';
self.id = 'htmlaudioplayer'; self.id = 'htmlaudioplayer';
self.useServerPlaybackInfoForAudio = true; self.useServerPlaybackInfoForAudio = true;
self.mustDestroy = true;
self._duration = undefined; self._duration = undefined;
self._currentTime = undefined; self._currentTime = undefined;

View file

@ -60,7 +60,6 @@ async function getApi() {
*/ */
id = 'htmlvideoplayer'; id = 'htmlvideoplayer';
useFullSubtitleUrls = true; useFullSubtitleUrls = true;
mustDestroy = true;
/** /**
* @type {boolean} * @type {boolean}
*/ */
@ -196,6 +195,7 @@ async function getApi() {
setCurrentSrc(elem, options) { setCurrentSrc(elem, options) {
return new Promise((resolve) => { return new Promise((resolve) => {
const val = options.url; const val = options.url;
this.#currentSrc = val;
console.debug(`playing url: ${val}`); console.debug(`playing url: ${val}`);
// Convert to seconds // Convert to seconds
@ -284,13 +284,13 @@ async function getApi() {
onEndedInternal() { onEndedInternal() {
const stopInfo = { const stopInfo = {
src: this._currentSrc src: this.#currentSrc
}; };
Events.trigger(this, 'stopped', [stopInfo]); Events.trigger(this, 'stopped', [stopInfo]);
this._currentTime = null; this.#currentTime = null;
this._currentSrc = null; this.#currentSrc = null;
this._currentPlayOptions = null; this._currentPlayOptions = null;
} }

View file

@ -76,14 +76,8 @@ import Headroom from 'headroom.js';
} }
function onBackClick() { function onBackClick() {
// If playing on a player that can't be destroyed with navigation, stop it manually.
const player = playbackManager.getCurrentPlayer();
if (player && player.mustDestroy && skinHeader.classList.contains('osdHeader')) {
playbackManager.stop();
} else {
appRouter.back(); appRouter.back();
} }
}
function retranslateUi() { function retranslateUi() {
if (headerSyncButton) { if (headerSyncButton) {