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
a2dcf9aa
Commit
a2dcf9aa
authored
Aug 16, 2013
by
polesye
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #689 from edx/anton/fix_video_speed_button
Video: disable speed controls for unsupported browsers.
parents
346fb7b4
9b76b492
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
0 deletions
+35
-0
common/lib/xmodule/xmodule/js/src/video/08_video_speed_control.js
+35
-0
No files found.
common/lib/xmodule/xmodule/js/src/video/08_video_speed_control.js
View file @
a2dcf9aa
...
...
@@ -10,6 +10,12 @@ function () {
return
function
(
state
)
{
state
.
videoSpeedControl
=
{};
if
(
state
.
videoType
===
'html5'
&&
!
(
_checkPlaybackRates
()))
{
_hideSpeedControl
(
state
);
return
;
}
_makeFunctionsPublic
(
state
);
_renderElements
(
state
);
_bindHandlers
(
state
);
...
...
@@ -62,6 +68,35 @@ function () {
}
/**
* @desc Check if playbackRate supports by browser.
*
* @type {function}
* @access private
*
* @param {object} state The object containg the state of the video player.
* All other modules, their parameters, public variables, etc. are
* available via this object.
*
* @this {object} The global window object.
*
* @returns {Boolean}
* true: Browser support playbackRate functionality.
* false: Browser doesn't support playbackRate functionality.
*/
function
_checkPlaybackRates
()
{
var
video
=
document
.
createElement
(
'video'
);
// If browser supports, 1.0 should be returned by playbackRate property.
// In this case, function return True. Otherwise, False will be returned.
return
Boolean
(
video
.
playbackRate
);
}
// Hide speed control.
function
_hideSpeedControl
(
state
)
{
state
.
el
.
find
(
'div.speeds'
).
hide
();
}
/**
* @desc Bind any necessary function callbacks to DOM events (click,
* mousemove, etc.).
*
...
...
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