Skip to content

Commit

Permalink
FLUID-4632: Fixed two issues: 1. In IE9, the buffer progress bar sits…
Browse files Browse the repository at this point in the history
… on top of the scrubber instead of overlay; 2. In Chrom or IE9, the buffer progress replays when the controller bar is shown from the hidden state.
  • Loading branch information
cindyli committed Mar 8, 2012
1 parent 4ff1d84 commit 96315d0
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 8 deletions.
2 changes: 1 addition & 1 deletion css/VideoPlayer.css
Expand Up @@ -249,7 +249,6 @@ ul.fl-videoPlayer-transcripts-languageList li {
*********************/

.fl-videoPlayer-buffered-progress {
float: left;
height: 1em;
left: 0;
top: 0;
Expand Down Expand Up @@ -294,6 +293,7 @@ ul.fl-videoPlayer-transcripts-languageList li {
width: 100%;
text-align: center;
margin-bottom: -0.4em;
position: relative;
}
.fl-videoPlayer-scrubberContainer * {
margin: auto;
Expand Down
4 changes: 4 additions & 0 deletions js/VideoPlayer.js
Expand Up @@ -580,6 +580,10 @@ https://github.com/fluid-project/infusion/raw/master/Infusion-LICENSE.txt

// Set the width of the overlay to be the width of the video, otherwise, the controller bar spreads into transcript area
overlay.css({width: videoWidth});

// Save the video width/height in the model so they are accessible by the sub-components
that.model.videoWidth = videoWidth;
that.model.videoHeight = videoHeight;
};

/*********************************************************************************
Expand Down
22 changes: 15 additions & 7 deletions js/VideoPlayer_controllers.js
Expand Up @@ -48,12 +48,7 @@ https://github.com/fluid-project/infusion/raw/master/Infusion-LICENSE.txt
components: {
bufferedProgress: {
type: "fluid.progress",
container: "{scrubber}.dom.bufferedProgress",
options: {
initiallyHidden: false,
speed: 1000,
minWidth: 0
}
container: "{scrubber}.dom.bufferedProgress"
},
},
events: {
Expand Down Expand Up @@ -275,6 +270,15 @@ https://github.com/fluid-project/infusion/raw/master/Infusion-LICENSE.txt
gradeNames: ["fluid.viewComponent", "autoInit"],
finalInitFunction: "fluid.videoPlayer.controllers.scrubber.finalInit",
postInitFunction: "fluid.videoPlayer.controllers.scrubber.postInit",
components: {
bufferedProgress: {
type: "fluid.progress",
options: {
initiallyHidden: false,
minWidth: 0
}
},
},
events: {
afterScrub: null,
onScrub: null,
Expand All @@ -286,7 +290,8 @@ https://github.com/fluid-project/infusion/raw/master/Infusion-LICENSE.txt
currentTime: ".flc-videoPlayer-current",
scrubber: ".flc-videoPlayer-scrubber",
handle: ".ui-slider-handle",
bufferedProgress: ".flc-videoPlayer-buffered-progress"
bufferedProgress: ".flc-videoPlayer-buffered-progress",
bufferedProgressBar: ".flc-progress-bar"
},
// TODO: Strings should be moved out into a single top-level bundle (FLUID-4590)
strings: {
Expand Down Expand Up @@ -334,6 +339,9 @@ https://github.com/fluid-project/infusion/raw/master/Infusion-LICENSE.txt
if (totalTime && lastBufferedTime && !bufferCompleted) {
var percent = Math.round(lastBufferedTime / totalTime * 100);

// Explicitly setting the width of .flc-progress-bar is a work-around for the Chrome/IE9 issue
// that the width of the progress div is reduced at the controller bar slide-up
that.locate("bufferedProgressBar").width(that.model.videoWidth);
that.bufferedProgress.update(percent);

// Stops the buffer progress from being kept updated once the progress reaches 100%
Expand Down

0 comments on commit 96315d0

Please sign in to comment.