diff --git a/index.d.ts b/index.d.ts index 550b5842ce..fc95fb6619 100644 --- a/index.d.ts +++ b/index.d.ts @@ -739,7 +739,6 @@ declare namespace dashjs { PLAYBACK_PLAYING: 'playbackPlaying'; PLAYBACK_PROGRESS: 'playbackProgress'; PLAYBACK_RATE_CHANGED: 'playbackRateChanged'; - PLAYBACK_SEEK_ASKED: 'playbackSeekAsked'; PLAYBACK_SEEKED: 'playbackSeeked'; PLAYBACK_SEEKING: 'playbackSeeking'; PLAYBACK_STALLED: 'playbackStalled'; diff --git a/src/mss/MssHandler.js b/src/mss/MssHandler.js index a1a29fb52a..8ff21f9e0e 100644 --- a/src/mss/MssHandler.js +++ b/src/mss/MssHandler.js @@ -195,7 +195,7 @@ function MssHandler(config) { } } - function onPlaybackSeekAsked() { + function onPlaybackSeeking() { if (playbackController.getIsDynamic() && playbackController.getTime() !== 0) { startFragmentInfoControllers(); } @@ -212,7 +212,7 @@ function MssHandler(config) { function registerEvents() { eventBus.on(events.INIT_FRAGMENT_NEEDED, onInitFragmentNeeded, instance, { priority: dashjs.FactoryMaker.getSingletonFactoryByName(eventBus.getClassName()).EVENT_PRIORITY_HIGH }); /* jshint ignore:line */ eventBus.on(events.PLAYBACK_PAUSED, onPlaybackPaused, instance, { priority: dashjs.FactoryMaker.getSingletonFactoryByName(eventBus.getClassName()).EVENT_PRIORITY_HIGH }); /* jshint ignore:line */ - eventBus.on(events.PLAYBACK_SEEK_ASKED, onPlaybackSeekAsked, instance, { priority: dashjs.FactoryMaker.getSingletonFactoryByName(eventBus.getClassName()).EVENT_PRIORITY_HIGH }); /* jshint ignore:line */ + eventBus.on(events.PLAYBACK_SEEKING, onPlaybackSeeking, instance, { priority: dashjs.FactoryMaker.getSingletonFactoryByName(eventBus.getClassName()).EVENT_PRIORITY_HIGH }); /* jshint ignore:line */ eventBus.on(events.FRAGMENT_LOADING_COMPLETED, onSegmentMediaLoaded, instance, { priority: dashjs.FactoryMaker.getSingletonFactoryByName(eventBus.getClassName()).EVENT_PRIORITY_HIGH }); /* jshint ignore:line */ eventBus.on(events.TTML_TO_PARSE, onTTMLPreProcess, instance); } @@ -225,7 +225,7 @@ function MssHandler(config) { eventBus.off(events.INIT_FRAGMENT_NEEDED, onInitFragmentNeeded, this); eventBus.off(events.PLAYBACK_PAUSED, onPlaybackPaused, this); - eventBus.off(events.PLAYBACK_SEEK_ASKED, onPlaybackSeekAsked, this); + eventBus.off(events.PLAYBACK_SEEKING, onPlaybackSeeking, this); eventBus.off(events.FRAGMENT_LOADING_COMPLETED, onSegmentMediaLoaded, this); eventBus.off(events.TTML_TO_PARSE, onTTMLPreProcess, this); diff --git a/src/streaming/MediaPlayerEvents.js b/src/streaming/MediaPlayerEvents.js index f882cf209c..b1694a8d8c 100644 --- a/src/streaming/MediaPlayerEvents.js +++ b/src/streaming/MediaPlayerEvents.js @@ -334,12 +334,6 @@ class MediaPlayerEvents extends EventsBase { */ this.PLAYBACK_SEEKING = 'playbackSeeking'; - /** - * Sent when a seek operation has been asked. - * @event MediaPlayerEvents#PLAYBACK_SEEK_ASKED - */ - this.PLAYBACK_SEEK_ASKED = 'playbackSeekAsked'; - /** * Sent when the video element reports stalled * @event MediaPlayerEvents#PLAYBACK_STALLED diff --git a/src/streaming/controllers/PlaybackController.js b/src/streaming/controllers/PlaybackController.js index ec1529580d..e9158b8894 100644 --- a/src/streaming/controllers/PlaybackController.js +++ b/src/streaming/controllers/PlaybackController.js @@ -208,7 +208,6 @@ function PlaybackController() { if (!internalSeek) { seekTarget = time; - eventBus.trigger(Events.PLAYBACK_SEEK_ASKED); } logger.info('Requesting seek to time: ' + time + (internalSeek ? ' (internal)' : '')); videoModel.setCurrentTime(time, stickToBuffered); diff --git a/test/unit/streaming.controllers.PlaybackControllers.js b/test/unit/streaming.controllers.PlaybackControllers.js index 63d02c0277..cd958f4328 100644 --- a/test/unit/streaming.controllers.PlaybackControllers.js +++ b/test/unit/streaming.controllers.PlaybackControllers.js @@ -258,17 +258,6 @@ describe('PlaybackController', function () { expect(videoModelMock.time).to.equal(10); }); - it('should seek and trigger Events.PLAYBACK_SEEK_ASKED event', function (done) { - - let onSeekedAsked = function () { - eventBus.off(Events.PLAYBACK_SEEK_ASKED, onSeekedAsked); - done(); - }; - eventBus.on(Events.PLAYBACK_SEEK_ASKED, onSeekedAsked, this); - - playbackController.seek(10); - }); - it('should return if video is seeking', function () { videoModelMock.isseeking = true; expect(playbackController.isSeeking()).to.equal(videoModelMock.isseeking);