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
a077dc81
Commit
a077dc81
authored
Jan 30, 2014
by
Anton Stupak
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2352 from edx/anton/fix-persist-speed-per-video
Video: Fix speed persistence per video.
parents
ec8a86f2
642c239a
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
8 deletions
+17
-8
common/lib/xmodule/xmodule/js/src/video/01_initialize.js
+4
-2
common/lib/xmodule/xmodule/video_module.py
+2
-1
lms/djangoapps/courseware/features/video.feature
+2
-1
lms/djangoapps/courseware/tests/test_video_mongo.py
+8
-4
lms/templates/video.html
+1
-0
No files found.
common/lib/xmodule/xmodule/js/src/video/01_initialize.js
View file @
a077dc81
...
...
@@ -382,8 +382,10 @@ function (VideoPlayer, CookieStorage) {
isTouch
=
onTouchBasedDevice
()
||
''
,
storage
=
CookieStorage
(
'video_player'
),
speed
=
storage
.
getItem
(
'video_speed_'
+
id
)
||
el
.
data
(
'speed'
)
||
storage
.
getItem
(
'general_speed'
)
||
el
.
data
(
'speed'
).
toFixed
(
2
).
replace
(
/
\.
00$/
,
'.0'
)
||
'1.0'
;
el
.
data
(
'general-speed'
)
||
'1.0'
;
if
(
isTouch
)
{
el
.
addClass
(
'is-touch'
);
...
...
@@ -397,7 +399,7 @@ function (VideoPlayer, CookieStorage) {
id
:
id
,
isFullScreen
:
false
,
isTouch
:
isTouch
,
speed
:
speed
,
speed
:
Number
(
speed
).
toFixed
(
2
).
replace
(
/
\.
00$/
,
'.0'
)
,
storage
:
storage
});
...
...
common/lib/xmodule/xmodule/video_module.py
View file @
a077dc81
...
...
@@ -233,7 +233,8 @@ class VideoModule(VideoFields, XModule):
'id'
:
self
.
location
.
html_id
(),
'show_captions'
:
json
.
dumps
(
self
.
show_captions
),
'sources'
:
sources
,
'speed'
:
self
.
speed
or
self
.
global_speed
,
'speed'
:
json
.
dumps
(
self
.
speed
),
'general_speed'
:
self
.
global_speed
,
'start'
:
self
.
start_time
.
total_seconds
(),
'sub'
:
self
.
sub
,
'track'
:
track_url
,
...
...
lms/djangoapps/courseware/features/video.feature
View file @
a077dc81
...
...
@@ -62,7 +62,8 @@ Feature: LMS.Video component
And
I reload the page
When
I open video
"A"
Then
video
"A"
should start playing at speed
"2.0"
And
I select the
"1.0"
speed on video
"A"
When
I open video
"B"
Then
video
"B"
should start playing at speed
"0.50"
When
I open video
"C"
Then
video
"C"
should start playing at speed
"
0.5
0"
Then
video
"C"
should start playing at speed
"
1.
0"
lms/djangoapps/courseware/tests/test_video_mongo.py
View file @
a077dc81
...
...
@@ -66,7 +66,8 @@ class TestVideoYouTube(TestVideo):
'end'
:
3610.0
,
'id'
:
self
.
item_module
.
location
.
html_id
(),
'sources'
:
sources
,
'speed'
:
1.0
,
'speed'
:
'null'
,
'general_speed'
:
1.0
,
'start'
:
3603.0
,
'sub'
:
u'a_sub_file.srt.sjson'
,
'track'
:
None
,
...
...
@@ -120,7 +121,8 @@ class TestVideoNonYouTube(TestVideo):
'end'
:
3610.0
,
'id'
:
self
.
item_module
.
location
.
html_id
(),
'sources'
:
sources
,
'speed'
:
1.0
,
'speed'
:
'null'
,
'general_speed'
:
1.0
,
'start'
:
3603.0
,
'sub'
:
u'a_sub_file.srt.sjson'
,
'track'
:
None
,
...
...
@@ -201,7 +203,8 @@ class TestGetHtmlMethod(BaseTestXmodule):
},
'start'
:
3603.0
,
'sub'
:
u'a_sub_file.srt.sjson'
,
'speed'
:
1.0
,
'speed'
:
'null'
,
'general_speed'
:
1.0
,
'track'
:
None
,
'youtube_streams'
:
'1.00:OEoXaMPEzfM'
,
'autoplay'
:
settings
.
FEATURES
.
get
(
'AUTOPLAY_VIDEOS'
,
True
),
...
...
@@ -302,7 +305,8 @@ class TestGetHtmlMethod(BaseTestXmodule):
'end'
:
3610.0
,
'id'
:
None
,
'sources'
:
None
,
'speed'
:
1.0
,
'speed'
:
'null'
,
'general_speed'
:
1.0
,
'start'
:
3603.0
,
'sub'
:
u'a_sub_file.srt.sjson'
,
'track'
:
None
,
...
...
lms/templates/video.html
View file @
a077dc81
...
...
@@ -20,6 +20,7 @@
data-save-state-url=
"${ajax_url}"
data-caption-data-dir=
"${data_dir}"
data-show-captions=
"${show_captions}"
data-general-speed=
"${general_speed}"
data-speed=
"${speed}"
data-start=
"${start}"
data-end=
"${end}"
...
...
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