From 0f774107c505064a92d8641a58020760edca3b2d Mon Sep 17 00:00:00 2001 From: yairansbacher Date: Sun, 9 Jan 2022 19:51:32 +0200 Subject: [PATCH] feat(FEC-11854): add support for ima-dai dash stream --- src/dash-adapter.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/dash-adapter.js b/src/dash-adapter.js index 86802225..11e528c5 100644 --- a/src/dash-adapter.js +++ b/src/dash-adapter.js @@ -36,7 +36,8 @@ const ShakaEvent: ShakaEventType = { ADAPTATION: 'adaptation', BUFFERING: 'buffering', DRM_SESSION_UPDATE: 'drmsessionupdate', - EMSG: 'emsg' + EMSG: 'emsg', + TIMELINE_REGION_ENTER: 'timelineregionenter' }; /** @@ -131,6 +132,7 @@ export default class DashAdapter extends BaseMediaSourceAdapter { [ShakaEvent.BUFFERING]: event => this._onBuffering(event), [ShakaEvent.DRM_SESSION_UPDATE]: () => this._onDrmSessionUpdate(), [ShakaEvent.EMSG]: event => this._onEmsg(event), + [ShakaEvent.TIMELINE_REGION_ENTER]: event => this.onTimelineRegionEnter(event), [EventType.WAITING]: () => this._onWaiting(), [EventType.PLAYING]: () => this._onPlaying() }; @@ -725,6 +727,7 @@ export default class DashAdapter extends BaseMediaSourceAdapter { this._eventManager.listen(this._shaka, ShakaEvent.ERROR, this._adapterEventsBindings.error); this._eventManager.listen(this._shaka, ShakaEvent.DRM_SESSION_UPDATE, this._adapterEventsBindings.drmsessionupdate); this._eventManager.listen(this._shaka, ShakaEvent.EMSG, this._adapterEventsBindings.emsg); + this._eventManager.listen(this._shaka, ShakaEvent.TIMELINE_REGION_ENTER, this._adapterEventsBindings.timelineregionenter); this._eventManager.listen(this._videoElement, EventType.WAITING, this._adapterEventsBindings.waiting); this._eventManager.listen(this._videoElement, EventType.PLAYING, this._adapterEventsBindings.playing); this._eventManager.listen(this._videoElement, EventType.LOADED_DATA, () => this._onLoadedData()); @@ -1309,6 +1312,10 @@ export default class DashAdapter extends BaseMediaSourceAdapter { this._trigger(EventType.TIMED_METADATA_ADDED, {cues: [cue]}); } + onTimelineRegionEnter(event): void { + this._trigger('timelineregionenter', event); + } + /** * An handler to HTMLVideoElement waiting event * @function _onWaiting