Skip to content

Commit

Permalink
Have an internal bar in MouseTimeDisplay.
Browse files Browse the repository at this point in the history
  • Loading branch information
gkatsev committed Sep 10, 2015
1 parent 6a9ad29 commit 16616ff
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 49 deletions.
43 changes: 0 additions & 43 deletions src/js/control-bar/progress-control/mouse-display-bar.js

This file was deleted.

17 changes: 11 additions & 6 deletions src/js/control-bar/progress-control/mouse-time-display.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ class MouseTimeDisplay extends SeekBar {
player.on('ready', () => {
this.on(player.controlBar.progressControl.el(), 'mousemove', throttle(Fn.bind(this, this.handleMouseMove), 50));
});

this.bar_ = this.el().querySelector('.vjs-mouse-display-bar')
this.bar = {
el: () => this.bar_
};
}

/**
Expand All @@ -35,7 +40,8 @@ class MouseTimeDisplay extends SeekBar {
*/
createEl() {
return super.createEl('div', {
className: 'vjs-mouse-display'
className: 'vjs-mouse-display',
innerHTML: `<div class="vjs-mouse-display-bar vjs-play-progress"></div>`
});
}

Expand All @@ -55,15 +61,14 @@ class MouseTimeDisplay extends SeekBar {
}

updateDataAttr() {
this.mouseDisplayBar.updateDataAttr(formatTime(this.newTime, this.player_.duration()));
//this.mouseDisplayBar.updateDataAttr(formatTime(this.newTime, this.player_.duration()));
let time = formatTime(this.newTime, this.player_.duration());
this.bar && this.bar.el().setAttribute('data-current-time', time);
}
}

MouseTimeDisplay.prototype.options_ = {
children: {
'mouseDisplayBar': {}
},
'barName': 'mouseDisplayBar'
'barName': 'mouseTimeDisplay'
};
MouseTimeDisplay.prototype.handleMouseDown = MouseTimeDisplay.prototype.handleMouseMove;

Expand Down

0 comments on commit 16616ff

Please sign in to comment.