From 46797666556566bb16d05e3914087c274323aaa6 Mon Sep 17 00:00:00 2001 From: noraiz-anwar Date: Mon, 23 Jan 2017 17:36:43 +0500 Subject: [PATCH] Emit play_video event after seek_video event --- .../xmodule/js/spec/video/video_events_plugin_spec.js | 7 +++++++ .../lib/xmodule/xmodule/js/src/video/09_events_plugin.js | 1 + 2 files changed, 8 insertions(+) diff --git a/common/lib/xmodule/xmodule/js/spec/video/video_events_plugin_spec.js b/common/lib/xmodule/xmodule/js/spec/video/video_events_plugin_spec.js index 27d260c931..98722843a9 100644 --- a/common/lib/xmodule/xmodule/js/spec/video/video_events_plugin_spec.js +++ b/common/lib/xmodule/xmodule/js/spec/video/video_events_plugin_spec.js @@ -78,6 +78,13 @@ new_time: 1, type: 'any' }); + expect(state.videoEventsPlugin.emitPlayVideoEvent).toBeTruthy(); + }); + + it('can emit "play_video" event after "seek_video" event ', function() { + state.videoEventsPlugin.emitPlayVideoEvent = false; + state.el.trigger('seek', [1, 0, 'any']); + expect(state.videoEventsPlugin.emitPlayVideoEvent).toBeTruthy(); }); it('can emit "stop_video" event', function() { diff --git a/common/lib/xmodule/xmodule/js/src/video/09_events_plugin.js b/common/lib/xmodule/xmodule/js/src/video/09_events_plugin.js index 39818d899b..1ffeb49e04 100644 --- a/common/lib/xmodule/xmodule/js/src/video/09_events_plugin.js +++ b/common/lib/xmodule/xmodule/js/src/video/09_events_plugin.js @@ -94,6 +94,7 @@ new_time: time, type: type }); + this.emitPlayVideoEvent = true; }, onSpeedChange: function(event, newSpeed, oldSpeed) {