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