Skip to content

Commit

Permalink
Merge remote-tracking branch 'alexn/FLUID-4570' into demo
Browse files Browse the repository at this point in the history
* alexn/FLUID-4570:
  FLUID-4570: Removing transcript height configuration from the fullscreen function.
  • Loading branch information
michelled committed Feb 28, 2012
2 parents 35b9996 + 141712a commit 5e8007d
Showing 1 changed file with 30 additions and 45 deletions.
75 changes: 30 additions & 45 deletions js/VideoPlayer.js
Expand Up @@ -363,10 +363,37 @@ https://github.com/fluid-project/infusion/raw/master/Infusion-LICENSE.txt
});

video.bind("loadedmetadata", function () {
var videoContainer = that.locate("videoContainer");
var video = that.locate("video");
var videoControllersContainer = that.locate("videoControllersContainer");
//that shouldn't be usefull but the video is too big if it's not used
videoControllersContainer.css("width", video[0].videoWidth);
var videoWidth, videoHeight;

videoWidth = video[0].videoWidth;
videoHeight = video[0].videoHeight;

// Set the width/height of each container
videoContainer.css({
width: videoWidth,
height: videoHeight
});

videoControllersContainer.css({width: videoWidth});

that.locate("transcript").css("height", videoControllersContainer.height());

var transcriptWidth = that.locate("transcript").width();
if (!that.model.displayTranscripts) {
transcriptWidth = 0;
}

// ToDo: A hacky way by adding 3px onto the videoPlayer full container width,
// otherwise, the transcript area gets showed up underneath the controller bar.
// Need a better solution.
that.container.css({
width: videoWidth + transcriptWidth + 3,
height: videoControllersContainer.height()
});

bindKeyboardControl(that);
});
};
Expand Down Expand Up @@ -406,16 +433,9 @@ https://github.com/fluid-project/infusion/raw/master/Infusion-LICENSE.txt

fluid.videoPlayer.preInit = function (that) {

/**
* Adjust the sizes of various video player containers based on these factors:
* 1. on/off of "full screen"
* 2. show/hide transcript
*/
that.fullscreen = function () {
var videoContainer = that.locate("videoContainer");

var video = that.locate("video");
var videoControllersContainer = that.locate("videoControllersContainer");
var videoWidth, videoHeight;
var videoEl = video[0];

if (that.model.fullscreen === true) {
Expand All @@ -427,40 +447,6 @@ https://github.com/fluid-project/infusion/raw/master/Infusion-LICENSE.txt
// else {
// TODO: Fallback to other versions of browsers
// }
} else {

////
// This MUST be fixed!
//
// Line 563 should not be on the first place but we still keep it to make transcripts render properly
// This whole block of code must be moved somewhere else
////

videoWidth = video[0].videoWidth;
videoHeight = video[0].videoHeight;

// Set the width/height of each container
videoContainer.css({
width: videoWidth,
height: videoHeight
});

videoControllersContainer.css({width: videoWidth});

that.locate("transcript").css("height", videoControllersContainer.height());

var transcriptWidth = that.locate("transcript").width();
if (!that.model.displayTranscripts) {
transcriptWidth = 0;
}

// ToDo: A hacky way by adding 3px onto the videoPlayer full container width,
// otherwise, the transcript area gets showed up underneath the controller bar.
// Need a better solution.
that.container.css({
width: videoWidth + transcriptWidth + 3,
height: videoControllersContainer.height()
});
}
};
};
Expand Down Expand Up @@ -560,7 +546,6 @@ https://github.com/fluid-project/infusion/raw/master/Infusion-LICENSE.txt
// not need to do this.
if (fluid.hasFeature("fluid.browser.html5")) {
that.events.onHTML5BrowserDetected.fire();
that.fullscreen();
}
}

Expand Down

0 comments on commit 5e8007d

Please sign in to comment.