mirror of
https://github.com/videojs/video.js.git
synced 2025-01-17 10:46:00 +02:00
fix: Disable all time tooltips in IE8, as they are broken (#4029)
This commit is contained in:
parent
da2a1e07f4
commit
60bcc99302
@ -2,10 +2,8 @@
|
||||
* @file mouse-time-display.js
|
||||
*/
|
||||
import Component from '../../component.js';
|
||||
// import * as Dom from '../../utils/dom.js';
|
||||
import * as Fn from '../../utils/fn.js';
|
||||
import formatTime from '../../utils/format-time.js';
|
||||
// import computedStyle from '../../utils/computed-style.js';
|
||||
|
||||
import './time-tooltip';
|
||||
|
||||
@ -34,7 +32,7 @@ class MouseTimeDisplay extends Component {
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the the DOM element for this class.
|
||||
* Create the DOM element for this class.
|
||||
*
|
||||
* @return {Element}
|
||||
* The element that was created.
|
||||
|
@ -2,6 +2,7 @@
|
||||
* @file play-progress-bar.js
|
||||
*/
|
||||
import Component from '../../component.js';
|
||||
import {IE_VERSION} from '../../utils/browser.js';
|
||||
import formatTime from '../../utils/format-time.js';
|
||||
|
||||
import './time-tooltip';
|
||||
@ -77,10 +78,12 @@ class PlayProgressBar extends Component {
|
||||
* @private
|
||||
*/
|
||||
PlayProgressBar.prototype.options_ = {
|
||||
children: [
|
||||
'timeTooltip'
|
||||
]
|
||||
children: []
|
||||
};
|
||||
|
||||
if (!IE_VERSION || IE_VERSION > 8) {
|
||||
PlayProgressBar.prototype.options_.children.push('timeTooltip');
|
||||
}
|
||||
|
||||
Component.registerComponent('PlayProgressBar', PlayProgressBar);
|
||||
export default PlayProgressBar;
|
||||
|
@ -2,7 +2,6 @@
|
||||
* @file progress-control.js
|
||||
*/
|
||||
import Component from '../../component.js';
|
||||
import * as Fn from '../../utils/fn.js';
|
||||
import * as Dom from '../../utils/dom.js';
|
||||
import {throttle, bind} from '../../utils/fn.js';
|
||||
|
||||
@ -27,7 +26,7 @@ class ProgressControl extends Component {
|
||||
*/
|
||||
constructor(player, options) {
|
||||
super(player, options);
|
||||
this.handleMouseMove = Fn.throttle(Fn.bind(this, this.handleMouseMove), 25);
|
||||
this.handleMouseMove = throttle(bind(this, this.handleMouseMove), 25);
|
||||
this.on(this.el_, 'mousemove', this.handleMouseMove);
|
||||
|
||||
this.throttledHandleMouseSeek = throttle(bind(this, this.handleMouseSeek), 25);
|
||||
@ -57,6 +56,7 @@ class ProgressControl extends Component {
|
||||
*/
|
||||
handleMouseMove(event) {
|
||||
const seekBar = this.getChild('seekBar');
|
||||
const mouseTimeDisplay = seekBar.getChild('mouseTimeDisplay');
|
||||
const seekBarEl = seekBar.el();
|
||||
const seekBarRect = Dom.getBoundingClientRect(seekBarEl);
|
||||
let seekBarPoint = Dom.getPointerPosition(seekBarEl, event).x;
|
||||
@ -70,7 +70,9 @@ class ProgressControl extends Component {
|
||||
seekBarPoint = 0;
|
||||
}
|
||||
|
||||
seekBar.getChild('mouseTimeDisplay').update(seekBarRect, seekBarPoint);
|
||||
if (mouseTimeDisplay) {
|
||||
mouseTimeDisplay.update(seekBarRect, seekBarPoint);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -3,6 +3,7 @@
|
||||
*/
|
||||
import Slider from '../../slider/slider.js';
|
||||
import Component from '../../component.js';
|
||||
import {IE_VERSION} from '../../utils/browser.js';
|
||||
import * as Dom from '../../utils/dom.js';
|
||||
import * as Fn from '../../utils/fn.js';
|
||||
import formatTime from '../../utils/format-time.js';
|
||||
@ -177,12 +178,15 @@ class SeekBar extends Slider {
|
||||
SeekBar.prototype.options_ = {
|
||||
children: [
|
||||
'loadProgressBar',
|
||||
'mouseTimeDisplay',
|
||||
'playProgressBar'
|
||||
],
|
||||
barName: 'playProgressBar'
|
||||
};
|
||||
|
||||
if (!IE_VERSION || IE_VERSION > 8) {
|
||||
SeekBar.prototype.options_.children.splice(1, 0, 'mouseTimeDisplay');
|
||||
}
|
||||
|
||||
/**
|
||||
* Call the update event for this Slider when this event happens on the player.
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user