Skip to content

Commit

Permalink
Fix for #1435
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Sparacio committed Sep 8, 2016
1 parent 0bb213f commit 1b037ce
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 22 deletions.
9 changes: 4 additions & 5 deletions src/core/events/CoreEvents.js
Expand Up @@ -31,6 +31,9 @@
import EventsBase from './EventsBase';

/**
* These are internal events that should not be needed at the player level.
* If you find and event in here that you would like access to from MediaPlayer level
* please add an issue at https://github.com/Dash-Industry-Forum/dash.js/issues/new
* @class
* @ignore
*/
Expand All @@ -43,12 +46,9 @@ class CoreEvents extends EventsBase {
this.BYTES_APPENDED = 'bytesAppended';
this.CHECK_FOR_EXISTENCE_COMPLETED = 'checkForExistenceCompleted';
this.CHUNK_APPENDED = 'chunkAppended';
this.CURRENT_TRACK_CHANGED = 'currenttrackchanged';
this.CURRENT_TRACK_CHANGED = 'currentTrackChanged';
this.DATA_UPDATE_COMPLETED = 'dataUpdateCompleted';
this.DATA_UPDATE_STARTED = 'dataUpdateStarted';
this.FRAGMENT_LOADING_COMPLETED = 'fragmentLoadingCompleted';
this.FRAGMENT_LOADING_STARTED = 'fragmentLoadingStarted';
this.FRAGMENT_LOADING_ABANDONED = 'fragmentLoadingAbandoned';
this.INITIALIZATION_LOADED = 'initializationLoaded';
this.INIT_FRAGMENT_LOADED = 'initFragmentLoaded';
this.INIT_REQUESTED = 'initRequested';
Expand All @@ -67,7 +67,6 @@ class CoreEvents extends EventsBase {
this.STREAMS_COMPOSED = 'streamsComposed';
this.STREAM_BUFFERING_COMPLETED = 'streamBufferingCompleted';
this.STREAM_COMPLETED = 'streamCompleted';
this.STREAM_INITIALIZED = 'streaminitialized';
this.STREAM_TEARDOWN_COMPLETE = 'streamTeardownComplete';
this.TIMED_TEXT_REQUESTED = 'timedTextRequested';
this.TIME_SYNCHRONIZATION_COMPLETED = 'timeSynchronizationComplete';
Expand Down
48 changes: 32 additions & 16 deletions src/streaming/MediaPlayerEvents.js
Expand Up @@ -45,19 +45,19 @@ class MediaPlayerEvents extends EventsBase {
* as the MPD's availabilityStartTime is in the future.
* Check delay property in payload to determine time before playback will start.
*/
this.AST_IN_FUTURE = 'astinfuture';
this.AST_IN_FUTURE = 'astInFuture';
/**
* Triggered when the video element's buffer state changes to stalled.
* Check mediaType in payload to determine type (Video, Audio, FragmentedText).
* @event MediaPlayerEvents#BUFFER_EMPTY
*/
this.BUFFER_EMPTY = 'bufferstalled';
this.BUFFER_EMPTY = 'bufferStalled';
/**
* Triggered when the video element's buffer state changes to loaded.
* Check mediaType in payload to determine type (Video, Audio, FragmentedText).
* @event MediaPlayerEvents#BUFFER_LOADED
*/
this.BUFFER_LOADED = 'bufferloaded';
this.BUFFER_LOADED = 'bufferLoaded';

/**
* Triggered when the video element's buffer state changes, either stalled or loaded. Check payload for state.
Expand All @@ -66,10 +66,26 @@ class MediaPlayerEvents extends EventsBase {
this.BUFFER_LEVEL_STATE_CHANGED = 'bufferStateChanged';

/**
* Triggered when
* @event MediaPlayerEvents#ERROR
*/
* Triggered when there is an error from the element or MSE source buffer.
* @event MediaPlayerEvents#ERROR
*/
this.ERROR = 'error';

/**
* Triggered when a fragment download has completed.
* @event MediaPlayerEvents#FRAGMENT_LOADING_COMPLETED
*/
this.FRAGMENT_LOADING_COMPLETED = 'fragmentLoadingCompleted';
/**
* Triggered when a fragment download has started.
* @event MediaPlayerEvents#FRAGMENT_LOADING_STARTED
*/
this.FRAGMENT_LOADING_STARTED = 'fragmentLoadingStarted';
/**
* Triggered when a fragment download is abandoned due to detection of slow download base on the ABR abandon rule..
* @event MediaPlayerEvents#FRAGMENT_LOADING_ABANDONED
*/
this.FRAGMENT_LOADING_ABANDONED = 'fragmentLoadingAbandoned';
/**
* Triggered when {@link module:Debug} log method is called.
* @event MediaPlayerEvents#LOG
Expand All @@ -80,37 +96,37 @@ class MediaPlayerEvents extends EventsBase {
* Triggered when the manifest load is complete
* @event MediaPlayerEvents#MANIFEST_LOADED
*/
this.MANIFEST_LOADED = 'manifestloaded';
this.MANIFEST_LOADED = 'manifestLoaded';
/**
* Triggered anytime there is a change to the overall metrics.
* @event MediaPlayerEvents#METRICS_CHANGED
*/
this.METRICS_CHANGED = 'metricschanged';
this.METRICS_CHANGED = 'metricsChanged';
/**
* Triggered when an individual metric is added, updated or cleared.
* @event MediaPlayerEvents#METRIC_CHANGED
*/
this.METRIC_CHANGED = 'metricchanged';
this.METRIC_CHANGED = 'metricChanged';
/**
* Triggered every time a new metric is added.
* @event MediaPlayerEvents#METRIC_ADDED
*/
this.METRIC_ADDED = 'metricadded';
this.METRIC_ADDED = 'metricAdded';
/**
* Triggered every time a metric is updated.
* @event MediaPlayerEvents#METRIC_UPDATED
*/
this.METRIC_UPDATED = 'metricupdated';
this.METRIC_UPDATED = 'metricUpdated';
/**
* Triggered at the stream end of a period.
* @event MediaPlayerEvents#PERIOD_SWITCH_COMPLETED
*/
this.PERIOD_SWITCH_COMPLETED = 'streamswitchcompleted';
this.PERIOD_SWITCH_COMPLETED = 'periodSwitchCompleted';
/**
* Triggered when a new period starts.
* @event MediaPlayerEvents#PERIOD_SWITCH_STARTED
*/
this.PERIOD_SWITCH_STARTED = 'streamswitchstarted';
this.PERIOD_SWITCH_STARTED = 'periodSwitchStarted';

/**
* Triggered when an ABR up /down switch is initialed; either by user in manual mode or auto mode via ABR rules.
Expand All @@ -128,17 +144,17 @@ class MediaPlayerEvents extends EventsBase {
* Triggered when the stream is setup and ready.
* @event MediaPlayerEvents#STREAM_INITIALIZED
*/
this.STREAM_INITIALIZED = 'streaminitialized';
this.STREAM_INITIALIZED = 'streamInitialized';
/**
* Triggered once all text tracks detected in the MPD are added to the video element.
* @event MediaPlayerEvents#TEXT_TRACKS_ADDED
*/
this.TEXT_TRACKS_ADDED = 'alltexttracksadded';
this.TEXT_TRACKS_ADDED = 'allTextTracksAdded';
/**
* Triggered when a text track is added to the video element's TextTrackList
* @event MediaPlayerEvents#TEXT_TRACK_ADDED
*/
this.TEXT_TRACK_ADDED = 'texttrackadded';
this.TEXT_TRACK_ADDED = 'textTrackAdded';

/**
* Sent when enough data is available that the media can be played,
Expand Down
2 changes: 1 addition & 1 deletion src/streaming/protection/ProtectionEvents.js
Expand Up @@ -37,7 +37,7 @@ class ProtectionEvents extends EventsBase {
/**
* @description Public facing external events to be used when including protection package.
* All public events will be aggregated into the MediaPlayerEvents Class and can be accessed
* via MediaPlayer.events
* via MediaPlayer.events. public_ is the prefix that we use to move event names to MediaPlayerEvents.
*/
constructor () {
super();
Expand Down

0 comments on commit 1b037ce

Please sign in to comment.