Skip to content

Commit

Permalink
Fixed key events for Chrome
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex committed Jan 29, 2018
1 parent f1a307c commit 65f4627
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion dist/css/pure_player.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions dist/js/pure_player.js
Original file line number Diff line number Diff line change
Expand Up @@ -378,10 +378,10 @@
progressWrapper.appendChild(hovered);
progressWrapper.appendChild(progressCommon);
progressWrapper.on('click', function (e) {
video.currentTime = video.duration * e.layerX / (e.target.offsetWidth - e.target.offsetLeft);
video.currentTime = video.duration * (e.offsetX / (this.offsetWidth - e.target.offsetLeft));
}).on('mousemove', function (e) {
hovered.innerText = fn.convertTime((video.duration || 0) * e.layerX / (e.target.offsetWidth - e.target.offsetLeft));
hovered.style.left = ((e.layerX + e.target.offsetLeft) - hovered.offsetWidth / 2) + 'px';
hovered.innerText = fn.convertTime((video.duration || 0) * e.offsetX / (this.offsetWidth - this.offsetLeft));
hovered.style.left = ((e.offsetX + e.target.offsetLeft) - hovered.offsetWidth / 2) + 'px';
});

controlsBar.appendChild(progressWrapper);
Expand All @@ -390,6 +390,7 @@
controlsBar.appendChild(controlButtons);

player.className = 'pure-player';
player.setAttribute('tabindex', '0');
player.appendChild(preloader);
player.appendChild(video);
player.appendChild(controlsBar);
Expand Down
Loading

0 comments on commit 65f4627

Please sign in to comment.