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
80fa9d01
Commit
80fa9d01
authored
Jan 31, 2013
by
Valera Rozuvan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added support for time line in HTML5.
parent
067f2e97
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
28 deletions
+4
-28
common/lib/xmodule/xmodule/js/src/videoalpha/display/html5_video.js
+2
-23
common/lib/xmodule/xmodule/js/src/videoalpha/display/video_player.coffee
+2
-5
No files found.
common/lib/xmodule/xmodule/js/src/videoalpha/display/html5_video.js
View file @
80fa9d01
...
...
@@ -113,50 +113,34 @@ this.HTML5Video = (function () {
this
.
video
=
this
.
videoEl
[
0
];
this
.
video
.
addEventListener
(
'canplay'
,
function
()
{
console
.
log
(
'We got a "canplay" event.'
);
_this
.
playerState
=
HTML5Video
.
PlayerState
.
PAUSED
;
if
(
$
.
isFunction
(
_this
.
config
.
events
.
onReady
)
===
true
)
{
console
.
log
(
'Callback function "onReady" is defined.'
);
_this
.
config
.
events
.
onReady
({});
}
},
false
);
this
.
video
.
addEventListener
(
'play'
,
function
()
{
console
.
log
(
'We got a "play" event.'
);
_this
.
playerState
=
HTML5Video
.
PlayerState
.
PLAYING
;
if
(
$
.
isFunction
(
_this
.
config
.
events
.
onStateChange
)
===
true
)
{
console
.
log
(
'Callback function "onStateChange" is defined.'
);
_this
.
config
.
events
.
onStateChange
({
'data'
:
_this
.
playerState
});
}
},
false
);
this
.
video
.
addEventListener
(
'pause'
,
function
()
{
console
.
log
(
'We got a "pause" event.'
);
_this
.
playerState
=
HTML5Video
.
PlayerState
.
PAUSED
;
if
(
$
.
isFunction
(
_this
.
config
.
events
.
onStateChange
)
===
true
)
{
console
.
log
(
'Callback function "onStateChange" is defined.'
);
_this
.
config
.
events
.
onStateChange
({
'data'
:
_this
.
playerState
});
}
},
false
);
this
.
video
.
addEventListener
(
'ended'
,
function
()
{
console
.
log
(
'We got a "ended" event.'
);
_this
.
playerState
=
HTML5Video
.
PlayerState
.
ENDED
;
if
(
$
.
isFunction
(
_this
.
config
.
events
.
onStateChange
)
===
true
)
{
console
.
log
(
'Callback function "onStateChange" is defined.'
);
_this
.
config
.
events
.
onStateChange
({
'data'
:
_this
.
playerState
});
...
...
@@ -201,7 +185,6 @@ this.HTML5Video = (function () {
};
Player
.
prototype
.
pauseVideo
=
function
()
{
console
.
log
(
'Player.prototype.pauseVideo'
);
this
.
video
.
pause
();
};
...
...
@@ -237,12 +220,10 @@ this.HTML5Video = (function () {
};
Player
.
prototype
.
getCurrentTime
=
function
()
{
return
this
.
video
.
currentTime
;
};
Player
.
prototype
.
playVideo
=
function
()
{
console
.
log
(
'Player.prototype.playVideo'
);
this
.
video
.
play
();
};
...
...
@@ -255,9 +236,7 @@ this.HTML5Video = (function () {
};
Player
.
prototype
.
getDuration
=
function
()
{
// TODO: Return valid video duration.
return
0
;
return
this
.
video
.
duration
;
};
return
Player
;
...
...
common/lib/xmodule/xmodule/js/src/videoalpha/display/video_player.coffee
View file @
80fa9d01
...
...
@@ -171,22 +171,19 @@ class @VideoPlayerAlpha extends SubviewAlpha
# Delegates
play
:
=>
console
.
log
'Play clicked'
console
.
log
@
player
.
playVideo
@
player
.
playVideo
()
if
@
player
.
playVideo
isPlaying
:
->
@
player
.
getPlayerState
()
==
@
PlayerState
.
PLAYING
pause
:
=>
console
.
log
'Pause clicked'
console
.
log
@
player
.
pauseVideo
@
player
.
pauseVideo
()
if
@
player
.
pauseVideo
duration
:
->
if
@
video
.
videoType
is
"youtube"
return
@
video
.
getDuration
()
else
return
@
player
.
getDuration
()
if
@
video
.
videoType
is
"html5"
else
if
@
video
.
videoType
is
"html5"
return
@
player
.
getDuration
()
0
currentSpeed
:
->
...
...
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