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

fix/SUP-42321: player crash on ios 17.5+ #798

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
20 changes: 10 additions & 10 deletions src/common/cuepoint/cuepoint-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,8 @@ export class CuePointManager {
const metadataTracks = this._getMetadataTracks();
metadataTracks.some((track) => {
try {
if (track.cues!.getCueById(cue.id)) {
track.removeCue(cue);
return true;
}
track.removeCue(cue);
return true;
} catch {
// do nothing
}
Expand All @@ -86,13 +84,15 @@ export class CuePointManager {
}
const timedMetadataArr: Array<TimedMetadata> = [];
data.forEach((cuePoint: CuePoint) => {
const textTrackCue = this._createTextTrackCue(cuePoint);
const exisedCue = this._getTextTrackCueById(cuePoint.id);
if (exisedCue) {
this._removeTextTrackCue(exisedCue);
if (cuePoint.id) {
const textTrackCue = this._createTextTrackCue(cuePoint);
const exisedCue = this._getTextTrackCueById(cuePoint.id);
if (exisedCue) {
this._removeTextTrackCue(exisedCue);
}
this._textTrack?.addCue(textTrackCue!);
timedMetadataArr.push(createTimedMetadata(textTrackCue!)!);
}
this._textTrack?.addCue(textTrackCue!);
timedMetadataArr.push(createTimedMetadata(textTrackCue!)!);
});

this._player.dispatchEvent(
Expand Down
Loading