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
215816b5
Commit
215816b5
authored
Jan 15, 2014
by
Valera Rozuvan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Start-end time range always shown, even before video plays.
BLD-529.
parent
33031b76
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
11 deletions
+47
-11
common/lib/xmodule/xmodule/js/src/video/03_video_player.js
+26
-8
common/lib/xmodule/xmodule/js/src/video/06_video_progress_slider.js
+21
-3
No files found.
common/lib/xmodule/xmodule/js/src/video/03_video_player.js
View file @
215816b5
...
...
@@ -60,7 +60,7 @@ function (HTML5Video, Resizer) {
// via the 'state' object. Much easier to work this way - you don't
// have to do repeated jQuery element selects.
function
_initialize
(
state
)
{
var
youTubeId
,
player
;
var
youTubeId
,
player
,
duration
;
// The function is called just once to apply pre-defined configurations
// by student before video starts playing. Waits until the video's
...
...
@@ -134,11 +134,20 @@ function (HTML5Video, Resizer) {
_resize
(
state
,
videoWidth
,
videoHeight
);
duration
=
state
.
videoPlayer
.
duration
();
state
.
trigger
(
'videoControl.updateVcrVidTime'
,
{
time
:
0
,
duration
:
state
.
videoPlayer
.
duration
()
duration
:
duration
}
);
state
.
trigger
(
'videoProgressSlider.updateStartEndTimeRegion'
,
{
duration
:
duration
}
);
},
false
);
...
...
@@ -167,10 +176,11 @@ function (HTML5Video, Resizer) {
_resize
(
state
,
videoWidth
,
videoHeight
);
// We wait for metdata to arrive, before we request the update
// of the VCR video time. Metadata contains duration of the
// video. We wait for 2 seconds, and then abandon our attempts
// to update the VCR video time using metadata.
// We wait for metadata to arrive, before we request the update
// of the VCR video time, and of the start-end time region.
// Metadata contains duration of the video. We wait for 2
// seconds, and then abandon our attempts to update the VCR
// video time (and the start-end time region) using metadata.
(
function
()
{
var
checkInterval
=
window
.
setInterval
(
checkForMetadata
,
50
...
...
@@ -181,7 +191,8 @@ function (HTML5Video, Resizer) {
function
checkForMetadata
()
{
if
(
state
.
metadata
&&
state
.
metadata
[
state
.
youtubeId
()])
{
console
.
log
(
'[_initialize]: (youtube) .duration'
);
duration
=
state
.
videoPlayer
.
duration
();
// After initialization, update the VCR with total time.
// At this point only the metadata duration is available (not
// very precise), but it is better than having 00:00:00 for
...
...
@@ -190,7 +201,14 @@ function (HTML5Video, Resizer) {
'videoControl.updateVcrVidTime'
,
{
time
:
0
,
duration
:
state
.
videoPlayer
.
duration
()
duration
:
duration
}
);
state
.
trigger
(
'videoProgressSlider.updateStartEndTimeRegion'
,
{
duration
:
duration
}
);
...
...
common/lib/xmodule/xmodule/js/src/video/06_video_progress_slider.js
View file @
215816b5
...
...
@@ -113,10 +113,28 @@ function () {
duration
=
params
.
duration
;
}
start
=
this
.
videoPlayer
.
startTime
;
start
=
this
.
config
.
startTime
;
end
=
this
.
config
.
endTime
;
// If end is set to null, then we set it to the end of the video.
end
=
this
.
videoPlayer
.
endTime
||
duration
;
if
(
start
>
duration
)
{
start
=
0
;
}
else
{
if
(
this
.
currentPlayerMode
===
'flash'
)
{
start
/=
Number
(
this
.
speed
);
}
}
// If end is set to null, or it is greater than the duration of the
// video, then we set it to the end of the video.
if
(
end
===
null
||
end
>
duration
)
{
end
=
duration
;
}
else
if
(
end
!==
null
)
{
if
(
this
.
currentPlayerMode
===
'flash'
)
{
end
/=
Number
(
this
.
speed
);
}
}
// Don't build a range if it takes up the whole slider.
if
(
start
===
0
&&
end
===
duration
)
{
...
...
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