Skip to content

Commit

Permalink
fix(player): avoid re-appending trigger event on abort
Browse files Browse the repository at this point in the history
  • Loading branch information
mihar-22 committed Nov 7, 2023
1 parent 6c2a99a commit 11ade5c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/vidstack/src/core/state/media-state-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -308,8 +308,11 @@ export class MediaStateManager extends MediaPlayerController {
}

['abort'](event: ME.MediaAbortEvent) {
appendTriggerEvent(event, this._trackedEvents.get('source-change'));
appendTriggerEvent(event, this._trackedEvents.get('can-load'));
const sourceChangeEvent = this._trackedEvents.get('source-change');
appendTriggerEvent(event, sourceChangeEvent);
if (!sourceChangeEvent?.trigger) {
appendTriggerEvent(event, this._trackedEvents.get('can-load'));
}
}

['load-start'](event: ME.MediaLoadStartEvent) {
Expand Down

0 comments on commit 11ade5c

Please sign in to comment.