Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
4938601c
Commit
4938601c
authored
Jan 20, 2016
by
Muhammad Ammar
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #11177 from edx/ammar/fix-play-video-event
Avoid emitting play_video event during buffering
parents
68d77011
83be42ed
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
4 deletions
+20
-4
common/lib/xmodule/xmodule/js/spec/video/video_events_plugin_spec.js
+13
-2
common/lib/xmodule/xmodule/js/src/video/09_events_plugin.js
+7
-1
common/test/acceptance/tests/video/test_video_events.py
+0
-1
No files found.
common/lib/xmodule/xmodule/js/spec/video/video_events_plugin_spec.js
View file @
4938601c
(
function
(
undefined
)
{
'use strict'
;
describe
(
'VideoPlayer Events plugin'
,
function
()
{
var
state
,
oldOTBD
;
var
state
,
oldOTBD
,
Logger
=
window
.
Logger
;
beforeEach
(
function
()
{
oldOTBD
=
window
.
onTouchBasedDevice
;
...
...
@@ -32,13 +32,21 @@
});
});
it
(
'can emit "play_video" event'
,
function
()
{
it
(
'can emit "play_video" event when emitPlayVideoEvent is true'
,
function
()
{
state
.
videoEventsPlugin
.
emitPlayVideoEvent
=
true
;
state
.
el
.
trigger
(
'play'
);
expect
(
Logger
.
log
).
toHaveBeenCalledWith
(
'play_video'
,
{
id
:
'id'
,
code
:
'html5'
,
currentTime
:
10
});
expect
(
state
.
videoEventsPlugin
.
emitPlayVideoEvent
).
toBeFalsy
();
});
it
(
'can not emit "play_video" event when emitPlayVideoEvent is false'
,
function
()
{
state
.
videoEventsPlugin
.
emitPlayVideoEvent
=
false
;
state
.
el
.
trigger
(
'play'
);
expect
(
Logger
.
log
).
not
.
toHaveBeenCalled
();
});
it
(
'can emit "pause_video" event'
,
function
()
{
...
...
@@ -48,6 +56,7 @@
code
:
'html5'
,
currentTime
:
10
});
expect
(
state
.
videoEventsPlugin
.
emitPlayVideoEvent
).
toBeTruthy
();
});
it
(
'can emit "speed_change_video" event'
,
function
()
{
...
...
@@ -79,6 +88,7 @@
code
:
'html5'
,
currentTime
:
10
});
expect
(
state
.
videoEventsPlugin
.
emitPlayVideoEvent
).
toBeTruthy
();
Logger
.
log
.
reset
();
state
.
el
.
trigger
(
'stop'
);
...
...
@@ -87,6 +97,7 @@
code
:
'html5'
,
currentTime
:
10
});
expect
(
state
.
videoEventsPlugin
.
emitPlayVideoEvent
).
toBeTruthy
();
});
it
(
'can emit "skip_video" event'
,
function
()
{
...
...
common/lib/xmodule/xmodule/js/src/video/09_events_plugin.js
View file @
4938601c
...
...
@@ -50,6 +50,7 @@ define('video/09_events_plugin.js', [], function() {
'destroy'
:
this
.
destroy
};
this
.
bindHandlers
();
this
.
emitPlayVideoEvent
=
true
;
},
bindHandlers
:
function
()
{
...
...
@@ -61,15 +62,20 @@ define('video/09_events_plugin.js', [], function() {
},
onPlay
:
function
()
{
this
.
log
(
'play_video'
,
{
currentTime
:
this
.
getCurrentTime
()});
if
(
this
.
emitPlayVideoEvent
)
{
this
.
log
(
'play_video'
,
{
currentTime
:
this
.
getCurrentTime
()});
this
.
emitPlayVideoEvent
=
false
;
}
},
onPause
:
function
()
{
this
.
log
(
'pause_video'
,
{
currentTime
:
this
.
getCurrentTime
()});
this
.
emitPlayVideoEvent
=
true
;
},
onEnded
:
function
()
{
this
.
log
(
'stop_video'
,
{
currentTime
:
this
.
getCurrentTime
()});
this
.
emitPlayVideoEvent
=
true
;
},
onSkip
:
function
(
event
,
doNotShowAgain
)
{
...
...
common/test/acceptance/tests/video/test_video_events.py
View file @
4938601c
...
...
@@ -61,7 +61,6 @@ class VideoEventsTestMixin(EventsTestMixin, VideoBaseTest):
class
VideoEventsTest
(
VideoEventsTestMixin
):
""" Test video player event emission """
@unittest.skip
(
'AN-5867'
)
def
test_video_control_events
(
self
):
"""
Scenario: Video component is rendered in the LMS in Youtube mode without HTML5 sources
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment