Skip to content

Commit

Permalink
Fix native track conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
tvanlaerhoven committed Dec 23, 2024
1 parent f49d999 commit 8ef7b23
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/internal/adapter/WebEventForwarder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import type {
VolumeChangeEvent as NativeVolumeChangeEvent,
DimensionChangeEvent as NativeDimensionChangeEvent,
} from 'theoplayer';
import type { AdEvent, MediaTrack, TextTrack, TimeRange } from 'react-native-theoplayer';
import type { AdEvent, MediaTrack, TimeRange } from 'react-native-theoplayer';
import {
AdEventType,
CastState,
Expand Down Expand Up @@ -267,7 +267,7 @@ export class WebEventForwarder {
track.addEventListener('removecue', this.onRemoveTextTrackCue(track));
track.addEventListener('entercue', this.onEnterTextTrackCue(track));
track.addEventListener('exitcue', this.onExitTextTrackCue(track));
this._facade.dispatchEvent(new DefaultTextTrackListEvent(TrackListEventType.ADD_TRACK, track as TextTrack));
this._facade.dispatchEvent(new DefaultTextTrackListEvent(TrackListEventType.ADD_TRACK, fromNativeTextTrack(track)));
};

private readonly onRemoveTextTrack = (event: RemoveTrackEvent) => {
Expand All @@ -276,11 +276,11 @@ export class WebEventForwarder {
track.removeEventListener('removecue', this.onRemoveTextTrackCue(track));
track.removeEventListener('entercue', this.onEnterTextTrackCue(track));
track.removeEventListener('exitcue', this.onExitTextTrackCue(track));
this._facade.dispatchEvent(new DefaultTextTrackListEvent(TrackListEventType.REMOVE_TRACK, track as NativeTextTrack as TextTrack));
this._facade.dispatchEvent(new DefaultTextTrackListEvent(TrackListEventType.REMOVE_TRACK, fromNativeTextTrack(track)));
};

private readonly onChangeTextTrack = (event: TrackChangeEvent) => {
this._facade.dispatchEvent(new DefaultTextTrackListEvent(TrackListEventType.CHANGE_TRACK, event.track as NativeTextTrack as TextTrack));
this._facade.dispatchEvent(new DefaultTextTrackListEvent(TrackListEventType.CHANGE_TRACK, fromNativeTextTrack(event.track as NativeTextTrack)));
};

private readonly onAddAudioTrack = (event: AddTrackEvent) => {
Expand Down

0 comments on commit 8ef7b23

Please sign in to comment.