mirror of
https://github.com/videojs/video.js.git
synced 2025-07-05 00:58:52 +02:00
Fixed an offset width bug with IE that was causing player to break.
This commit is contained in:
12
src/controls.js
vendored
12
src/controls.js
vendored
@ -409,14 +409,16 @@ _V_.Slider = _V_.Component.extend({
|
|||||||
// On HTML5 browsers scrubbing is really smooth, but some flash players are slow, so we might want to utilize this later.
|
// On HTML5 browsers scrubbing is really smooth, but some flash players are slow, so we might want to utilize this later.
|
||||||
// var progress = (this.player.scrubbing) ? this.player.values.currentTime / this.player.duration() : this.player.currentTime() / this.player.duration();
|
// var progress = (this.player.scrubbing) ? this.player.values.currentTime / this.player.duration() : this.player.currentTime() / this.player.duration();
|
||||||
|
|
||||||
var progress = this.getPercent();
|
var barProgress,
|
||||||
|
progress = this.getPercent();
|
||||||
handle = this.handle,
|
handle = this.handle,
|
||||||
bar = this.bar,
|
bar = this.bar;
|
||||||
barProgress = progress;
|
|
||||||
|
|
||||||
// Protect against no duration and other division issues
|
// Protect against no duration and other division issues
|
||||||
if (isNaN(progress)) { progress = 0; }
|
if (isNaN(progress)) { progress = 0; }
|
||||||
|
|
||||||
|
barProgress = progress;
|
||||||
|
|
||||||
// If there is a handle, we need to account for the handle in our calculation for progress bar
|
// If there is a handle, we need to account for the handle in our calculation for progress bar
|
||||||
// so that it doesn't fall short of or extend past the handle.
|
// so that it doesn't fall short of or extend past the handle.
|
||||||
if (handle) {
|
if (handle) {
|
||||||
@ -424,7 +426,8 @@ _V_.Slider = _V_.Component.extend({
|
|||||||
boxWidth = box.offsetWidth,
|
boxWidth = box.offsetWidth,
|
||||||
|
|
||||||
// The width of the handle in percent of the containing box
|
// The width of the handle in percent of the containing box
|
||||||
handlePercent = handle.el.offsetWidth / boxWidth,
|
// In IE, widths may not be ready yet causing NaN
|
||||||
|
handlePercent = (handle.el.offsetWidth) ? handle.el.offsetWidth / boxWidth : 0,
|
||||||
|
|
||||||
// Get the adjusted size of the box, considering that the handle's center never touches the left or right side.
|
// Get the adjusted size of the box, considering that the handle's center never touches the left or right side.
|
||||||
// There is a margin of half the handle's width on both sides.
|
// There is a margin of half the handle's width on both sides.
|
||||||
@ -723,6 +726,7 @@ _V_.Poster = _V_.Button.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
createElement: function(){
|
createElement: function(){
|
||||||
|
_V_.log(this.player.options.poster)
|
||||||
return this._super("img", {
|
return this._super("img", {
|
||||||
className: "vjs-poster",
|
className: "vjs-poster",
|
||||||
src: this.player.options.poster,
|
src: this.player.options.poster,
|
||||||
|
@ -68,7 +68,7 @@ VideoJS.options = {
|
|||||||
|
|
||||||
// Included control sets
|
// Included control sets
|
||||||
components: [
|
components: [
|
||||||
"poster",
|
// "poster",
|
||||||
"loadingSpinner",
|
"loadingSpinner",
|
||||||
"bigPlayButton",
|
"bigPlayButton",
|
||||||
{ name: "controlBar", options: {
|
{ name: "controlBar", options: {
|
||||||
|
@ -404,8 +404,6 @@ _V_.flash.prototype.support = {
|
|||||||
|
|
||||||
_V_.flash.onSWFReady = function(currSwf){
|
_V_.flash.onSWFReady = function(currSwf){
|
||||||
|
|
||||||
// _V_.log("swfReady", currSwf)
|
|
||||||
|
|
||||||
var el = _V_.el(currSwf);
|
var el = _V_.el(currSwf);
|
||||||
|
|
||||||
// Get player from box
|
// Get player from box
|
||||||
|
Reference in New Issue
Block a user