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
47490d4e
Commit
47490d4e
authored
Apr 25, 2017
by
muhammad-ammar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
video player js cleanup
EDUCATOR-114
parent
cc98111d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 additions
and
36 deletions
+1
-36
common/lib/xmodule/xmodule/js/src/video/02_html5_video.js
+1
-36
No files found.
common/lib/xmodule/xmodule/js/src/video/02_html5_video.js
View file @
47490d4e
...
...
@@ -61,17 +61,6 @@ function(_) {
function
Player
(
el
,
config
)
{
var
errorMessage
,
lastSource
,
sourceList
;
// A simple test to see that the 'config' is a normal object.
if
(
$
.
isPlainObject
(
config
)
===
false
)
{
return
;
}
// We should have at least one video source. Otherwise there is no
// point to continue.
if
(
!
config
.
videoSources
&&
!
config
.
videoSources
.
length
)
{
return
;
}
// Create HTML markup for individual sources of the HTML5 <video> element.
sourceList
=
$
.
map
(
config
.
videoSources
,
function
(
source
)
{
return
[
...
...
@@ -87,9 +76,7 @@ function(_) {
});
// do common initialization independent of player type
if
(
this
.
init
(
el
,
config
)
===
false
)
{
return
;
}
this
.
init
(
el
,
config
);
// Create HTML markup for the <video> element, populating it with
// sources from previous step. Set playback not supported error message.
...
...
@@ -261,28 +248,8 @@ function(_) {
this
.
config
=
config
;
this
.
logs
=
[];
// Initially we assume that el is a DOM element. If jQuery selector
// fails to select something, we assume that el is an ID of a DOM
// element. We try to select by ID. If jQuery fails this time, we
// return. Nothing breaks because the player 'onReady' event will
// never be fired.
this
.
el
=
$
(
el
);
if
(
this
.
el
.
length
===
0
)
{
this
.
el
=
$
(
'#'
+
el
);
if
(
this
.
el
.
length
===
0
)
{
errorMessage
=
gettext
(
'VideoPlayer: Element corresponding to the given selector was not found.'
);
if
(
window
.
console
&&
console
.
log
)
{
console
.
log
(
errorMessage
);
}
else
{
throw
new
Error
(
errorMessage
);
}
return
false
;
}
}
// Because of problems with creating video element via jquery
// (http://bugs.jquery.com/ticket/9174) we create it using native JS.
this
.
video
=
document
.
createElement
(
'video'
);
...
...
@@ -346,8 +313,6 @@ function(_) {
// Place the <video> element on the page.
this
.
videoEl
.
appendTo
(
el
.
find
(
'.video-player > div:first-child'
));
return
true
;
};
return
Player
;
...
...
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