Skip to content

Commit

Permalink
Merge pull request #4397 from Dash-Industry-Forum/feature/playbackIni…
Browse files Browse the repository at this point in the history
…tializedEvent

Add PLAYBACK_INITIALIZED event
  • Loading branch information
dsilhavy committed Mar 2, 2024
2 parents 372d14d + 354b438 commit 46d5cb8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/streaming/MediaPlayer.js
Expand Up @@ -2583,6 +2583,7 @@ function MediaPlayer() {

if (!playbackInitialized && isReady()) {
playbackInitialized = true;
eventBus.trigger(MediaPlayerEvents.PLAYBACK_INITIALIZED)
logger.info('Playback Initialized');
}
}
Expand Down
7 changes: 7 additions & 0 deletions src/streaming/MediaPlayerEvents.js
Expand Up @@ -328,6 +328,13 @@ class MediaPlayerEvents extends EventsBase {
*/
this.PLAYBACK_ERROR = 'playbackError';

/**
* This event is fired once the playback has been initialized by MediaPlayer.js.
* After that event methods such as setTextTrack() can be used.
* @event MediaPlayerEvents#PLAYBACK_INITIALIZED
*/
this.PLAYBACK_INITIALIZED = 'playbackInitialized';

/**
* Sent when playback is not allowed (for example if user gesture is needed).
* @event MediaPlayerEvents#PLAYBACK_NOT_ALLOWED
Expand Down

0 comments on commit 46d5cb8

Please sign in to comment.