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
989091d1
Commit
989091d1
authored
Jun 10, 2015
by
Awais Jibran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TNL-2165
"play_video" event emitted after seeking forward in a video contains old position
parent
9f0b5ed2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
2 deletions
+26
-2
common/lib/xmodule/xmodule/js/spec/video/video_player_spec.js
+24
-0
common/lib/xmodule/xmodule/js/src/video/03_video_player.js
+2
-2
No files found.
common/lib/xmodule/xmodule/js/spec/video/video_player_spec.js
View file @
989091d1
...
...
@@ -333,6 +333,30 @@ function (VideoPlayer) {
});
});
describe
(
'onSeek Youtube'
,
function
(){
beforeEach
(
function
()
{
state
=
jasmine
.
initializePlayerYouTube
();
state
.
videoEl
=
$
(
'video, iframe'
);
});
describe
(
'when the video is playing'
,
function
()
{
beforeEach
(
function
(){
state
.
videoPlayer
.
onStateChange
({
data
:
YT
.
PlayerState
.
PLAYING
});
});
it
(
'Video has started playing'
,
function
()
{
expect
(
$
(
'.video_control'
)).
toHaveClass
(
'pause'
);
});
it
(
'seek the player'
,
function
()
{
state
.
videoPlayer
.
seekTo
(
10
);
expect
(
state
.
videoPlayer
.
currentTime
).
toBe
(
10
);
});
});
});
describe
(
'onSeek'
,
function
()
{
beforeEach
(
function
()
{
state
=
jasmine
.
initializePlayer
();
...
...
common/lib/xmodule/xmodule/js/src/video/03_video_player.js
View file @
989091d1
...
...
@@ -493,8 +493,6 @@ function (HTML5Video, Resizer) {
if
(
this
.
videoPlayer
.
isPlaying
())
{
this
.
videoPlayer
.
stopTimer
();
}
else
{
this
.
videoPlayer
.
currentTime
=
time
;
}
var
isUnplayed
=
this
.
videoPlayer
.
isUnstarted
()
||
this
.
videoPlayer
.
isCued
();
...
...
@@ -521,6 +519,8 @@ function (HTML5Video, Resizer) {
if
(
this
.
videoPlayer
.
isPlaying
())
{
this
.
videoPlayer
.
runTimer
();
}
// Update the the current time when user seek. (YoutubePlayer)
this
.
videoPlayer
.
currentTime
=
time
;
}
function
runTimer
()
{
...
...
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