Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HtmlVideoPlayer fix and cleanup #5718

Merged
merged 2 commits into from
Jun 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 2 additions & 17 deletions src/plugins/htmlVideoPlayer/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,6 @@ export class HtmlVideoPlayer {
* @type {number | null}
*/
#audioTrackIndexToSetOnPlaying;
/**
* @type {null | undefined}
*/
#currentClock;
/**
* @type {any | null | undefined}
*/
Expand Down Expand Up @@ -862,6 +858,8 @@ export class HtmlVideoPlayer {
videoElement.parentNode.removeChild(videoElement);
}

this._currentAspectRatio = null;

const dlg = this.#videoDialog;
if (dlg) {
this.#videoDialog = null;
Expand Down Expand Up @@ -1169,9 +1167,6 @@ export class HtmlVideoPlayer {
this.destroyNativeTracks(videoElement, targetTrackIndex);
this.destroyStoredTrackInfo(targetTrackIndex);

this.#currentClock = null;
this._currentAspectRatio = null;

const octopus = this.#currentAssRenderer;
if (octopus) {
octopus.dispose();
Expand Down Expand Up @@ -1499,16 +1494,6 @@ export class HtmlVideoPlayer {
* @private
*/
updateSubtitleText(timeMs) {
const clock = this.#currentClock;
if (clock) {
try {
clock.seek(timeMs / 1000);
} catch (err) {
console.error(`error in libjass: ${err}`);
}
return;
}

const allTrackEvents = [this.#currentTrackEvents, this.#currentSecondaryTrackEvents];
const subtitleTextElements = [this.#videoSubtitlesElem, this.#videoSecondarySubtitlesElem];

Expand Down
Loading