From b35b80dd3b5a22a72d682c355083dcb215a36619 Mon Sep 17 00:00:00 2001 From: Mingze Xiao Date: Tue, 10 Sep 2019 15:12:15 -0700 Subject: [PATCH 1/2] fix(preview): remove auto-preview experience --- src/lib/Preview.js | 1 - src/lib/__tests__/Preview-test.js | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/lib/Preview.js b/src/lib/Preview.js index 7ea6ec218..00a2f6390 100644 --- a/src/lib/Preview.js +++ b/src/lib/Preview.js @@ -1239,7 +1239,6 @@ class Preview extends EventEmitter { this.ui.finishProgressBar(); break; case VIEWER_EVENT.mediaEndAutoplay: - this.navigateRight(); break; case VIEWER_EVENT.error: // Do nothing since 'error' event was already caught, and will be emitted diff --git a/src/lib/__tests__/Preview-test.js b/src/lib/__tests__/Preview-test.js index 3a3f29be3..081ddf75d 100644 --- a/src/lib/__tests__/Preview-test.js +++ b/src/lib/__tests__/Preview-test.js @@ -1789,12 +1789,12 @@ describe('lib/Preview', () => { expect(preview.ui.finishProgressBar).to.be.called; }); - it('should navigate right on mediaendautoplay event', () => { + it('should not navigate right on mediaendautoplay event', () => { sandbox.stub(preview, 'navigateRight'); const data = { event: VIEWER_EVENT.mediaEndAutoplay }; preview.handleViewerEvents(data); - expect(preview.navigateRight).to.be.called; + expect(preview.navigateRight).to.not.be.called; }); it('should emit viewerevent when event does not match', () => { From 0e2d464ac49d0797f161e99e83dab403e3615762 Mon Sep 17 00:00:00 2001 From: Mingze Xiao Date: Tue, 10 Sep 2019 15:55:24 -0700 Subject: [PATCH 2/2] fix(preview): remove mediaEndAutoplay condition and test --- src/lib/Preview.js | 2 -- src/lib/__tests__/Preview-test.js | 8 -------- 2 files changed, 10 deletions(-) diff --git a/src/lib/Preview.js b/src/lib/Preview.js index 00a2f6390..6584b4a2e 100644 --- a/src/lib/Preview.js +++ b/src/lib/Preview.js @@ -1238,8 +1238,6 @@ class Preview extends EventEmitter { case VIEWER_EVENT.progressEnd: this.ui.finishProgressBar(); break; - case VIEWER_EVENT.mediaEndAutoplay: - break; case VIEWER_EVENT.error: // Do nothing since 'error' event was already caught, and will be emitted // as a 'preview_error' event diff --git a/src/lib/__tests__/Preview-test.js b/src/lib/__tests__/Preview-test.js index 081ddf75d..bd3dff543 100644 --- a/src/lib/__tests__/Preview-test.js +++ b/src/lib/__tests__/Preview-test.js @@ -1789,14 +1789,6 @@ describe('lib/Preview', () => { expect(preview.ui.finishProgressBar).to.be.called; }); - it('should not navigate right on mediaendautoplay event', () => { - sandbox.stub(preview, 'navigateRight'); - const data = { event: VIEWER_EVENT.mediaEndAutoplay }; - - preview.handleViewerEvents(data); - expect(preview.navigateRight).to.not.be.called; - }); - it('should emit viewerevent when event does not match', () => { sandbox.stub(preview, 'emit'); const data = {