Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
0d580d00
Commit
0d580d00
authored
11 years ago
by
Valera Rozuvan
Browse files
Options
Downloads
Patches
Plain Diff
Fine grain control of when to show the range.
Also moved all static styling to SCSS.
parent
d0fbd502
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
common/lib/xmodule/xmodule/css/video/display.scss
+18
-0
18 additions, 0 deletions
common/lib/xmodule/xmodule/css/video/display.scss
common/lib/xmodule/xmodule/js/src/video/06_video_progress_slider.js
+46
-33
46 additions, 33 deletions
.../xmodule/xmodule/js/src/video/06_video_progress_slider.js
with
64 additions
and
33 deletions
common/lib/xmodule/xmodule/css/video/display.scss
+
18
−
0
View file @
0d580d00
...
...
@@ -139,6 +139,24 @@ div.video {
box-shadow
:
inset
0
1px
0
#999
;
}
div
.ui-corner-all.slider-range
{
background-color
:
#1e91d3
;
/* We add opacity so that we can discern the amount of video that has
* been played. The progress will advance as a gray-shaded area. When
* it will overlap with the range, you will see a different shade of
* the range for part that has been played, and for part that is
* still to be played.
*
* For CSS opacity, different browsers are handled differently.
*/
-ms-filter
:
"progid:DXImageTransform.Microsoft.Alpha(Opacity=30)"
;
filter
:
alpha
(
opacity
=
30
);
-moz-opacity
:
0
.3
;
-khtml-opacity
:
0
.3
;
opacity
:
0
.3
;
}
a
.ui-slider-handle
{
background
:
$pink
url(../images/slider-handle.png)
center
center
no-repeat
;
background-size
:
50%
;
...
...
This diff is collapsed.
Click to expand it.
common/lib/xmodule/xmodule/js/src/video/06_video_progress_slider.js
+
46
−
33
View file @
0d580d00
...
...
@@ -86,8 +86,6 @@ function () {
// ***************************************************************
function
buildSlider
(
state
)
{
console
.
log
(
'
state =
'
,
state
);
state
.
videoProgressSlider
.
slider
=
state
.
videoProgressSlider
.
el
.
slider
({
range
:
'
min
'
,
...
...
@@ -101,37 +99,52 @@ function () {
}
function
updateStartEndTimeRegion
(
params
)
{
var
left
,
width
;
if
(
this
.
config
.
end
&&
params
.
duration
)
{
left
=
parseInt
(
100
*
(
this
.
config
.
start
/
params
.
duration
),
10
);
width
=
parseInt
(
100
*
(
(
this
.
config
.
end
-
this
.
config
.
start
)
/
params
.
duration
),
10
);
if
(
!
this
.
videoProgressSlider
.
sliderRange
)
{
this
.
videoProgressSlider
.
sliderRange
=
$
(
'
<div />
'
)
.
addClass
(
'
ui-slider-range
'
)
.
addClass
(
'
ui-widget-header
'
)
.
addClass
(
'
ui-corner-all
'
)
.
css
({
left
:
left
+
'
%
'
,
width
:
width
+
'
%
'
,
'
background-color
'
:
'
blue
'
});
this
.
videoProgressSlider
.
sliderProgress
.
after
(
this
.
videoProgressSlider
.
sliderRange
);
}
else
{
this
.
videoProgressSlider
.
sliderRange
.
css
({
left
:
left
+
'
%
'
,
width
:
width
+
'
%
'
});
}
var
left
,
width
,
start
,
end
;
// We must have a duration in order to determine the area of range.
// It also must be non-zero.
if
(
!
params
.
duration
)
{
return
;
}
// If the range spans the entire length of video, we don't do anything.
if
(
!
this
.
config
.
start
&&
!
this
.
config
.
end
)
{
return
;
}
start
=
this
.
config
.
start
;
// If end is set to null, then we set it to the end of the video. We
// know that start is not a the beginning, therefore we must build a
// range.
if
(
!
this
.
config
.
end
)
{
end
=
params
.
duration
;
}
else
{
end
=
this
.
config
.
end
;
}
left
=
parseInt
(
100
*
(
start
/
params
.
duration
),
10
);
width
=
parseInt
(
100
*
((
end
-
start
)
/
params
.
duration
),
10
);
if
(
!
this
.
videoProgressSlider
.
sliderRange
)
{
this
.
videoProgressSlider
.
sliderRange
=
$
(
'
<div />
'
)
.
addClass
(
'
ui-slider-range
'
)
.
addClass
(
'
ui-widget-header
'
)
.
addClass
(
'
ui-corner-all
'
)
.
addClass
(
'
slider-range
'
)
.
css
({
left
:
left
+
'
%
'
,
width
:
width
+
'
%
'
});
this
.
videoProgressSlider
.
sliderProgress
.
after
(
this
.
videoProgressSlider
.
sliderRange
);
}
else
{
this
.
videoProgressSlider
.
sliderRange
.
css
({
left
:
left
+
'
%
'
,
width
:
width
+
'
%
'
});
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment