Skip to content

Commit

Permalink
fix(player): Added missing conditionals to avoid hiding controls when…
Browse files Browse the repository at this point in the history
… paused and on regular media; fixed typo on stylesheet
  • Loading branch information
rafa8626 committed Apr 4, 2019
1 parent 88c96c4 commit 3e68e7c
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion dist/openplayer.css
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@
background: transparent;
}
.op-controls input[type='range']::-ms-ticks-before,
.op-controls input[type='range']::-ms-ticks-after, {
.op-controls input[type='range']::-ms-ticks-after {
display: none !important;
}
.op-controls--hidden .op-controls .op-controls__progress--seek::-webkit-slider-thumb {
Expand Down
10 changes: 5 additions & 5 deletions dist/openplayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1789,7 +1789,7 @@ var Player = function () {

_this3.playBtn.classList.remove('op-player__play--paused');

_this3.playBtn.setAttribute('aria-hidden', constants_1.IS_ANDROID || constants_1.IS_IOS ? 'false' : 'true');
_this3.playBtn.setAttribute('aria-hidden', 'false');

_this3.playBtn.title = _this3.options.labels.play;
};
Expand Down Expand Up @@ -4156,7 +4156,7 @@ return deepmerge_1;
/* 121 */
/***/ (function(module, exports) {

!function(e){var t=e.Element.prototype;"function"!=typeof t.matches&&(t.matches=t.msMatchesSelector||t.mozMatchesSelector||t.webkitMatchesSelector||function(e){for(var t=(o.document||o.ownerDocument).querySelectorAll(e),o=this,n=0;t[n]&&t[n]!==o;)++n;return Boolean(t[n])}),"function"!=typeof t.closest&&(t.closest=function(e){for(var t=this;t&&1===t.nodeType;){if(t.matches(e))return t;t=t.parentNode}return null})}(window);
!function(e){var t=e.Element.prototype;"function"!=typeof t.matches&&(t.matches=t.msMatchesSelector||t.mozMatchesSelector||t.webkitMatchesSelector||function(e){for(var t=(this.document||this.ownerDocument).querySelectorAll(e),o=0;t[o]&&t[o]!==this;)++o;return Boolean(t[o])}),"function"!=typeof t.closest&&(t.closest=function(e){for(var t=this;t&&1===t.nodeType;){if(t.matches(e))return t;t=t.parentNode}return null})}(window);


/***/ }),
Expand Down Expand Up @@ -4257,7 +4257,7 @@ var Controls = function () {

if (!constants_1.IS_ANDROID && !constants_1.IS_IOS) {
this.events.mouse.mouseenter = function () {
if (isMediaVideo) {
if (isMediaVideo && _this.player.isMedia() && !_this.player.activeElement().paused) {
_this._stopControlTimer();

_this.player.playBtn.setAttribute('aria-hidden', 'false');
Expand All @@ -4269,7 +4269,7 @@ var Controls = function () {
};

this.events.mouse.mousemove = function () {
if (isMediaVideo) {
if (isMediaVideo && _this.player.isMedia() && !_this.player.activeElement().paused) {
_this.player.playBtn.setAttribute('aria-hidden', 'false');

_this.player.getContainer().classList.remove('op-controls--hidden');
Expand All @@ -4279,7 +4279,7 @@ var Controls = function () {
};

this.events.mouse.mouseleave = function () {
if (isMediaVideo) {
if (isMediaVideo && _this.player.isMedia() && !_this.player.activeElement().paused) {
_this._startControlTimer(1000);
}
};
Expand Down
2 changes: 1 addition & 1 deletion dist/openplayer.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/openplayer.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package-lock.json

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

2 changes: 1 addition & 1 deletion src/css/player.css
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@
background: transparent;
}
.op-controls input[type='range']::-ms-ticks-before,
.op-controls input[type='range']::-ms-ticks-after, {
.op-controls input[type='range']::-ms-ticks-after {
display: none !important;
}
.op-controls--hidden .op-controls .op-controls__progress--seek::-webkit-slider-thumb {
Expand Down
6 changes: 3 additions & 3 deletions src/js/controls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,22 +173,22 @@ class Controls implements PlayerComponent {

if (!IS_ANDROID && !IS_IOS) {
this.events.mouse.mouseenter = () => {
if (isMediaVideo) {
if (isMediaVideo && this.player.isMedia() && !this.player.activeElement().paused) {
this._stopControlTimer();
this.player.playBtn.setAttribute('aria-hidden', 'false');
this.player.getContainer().classList.remove('op-controls--hidden');
this._startControlTimer(2500);
}
};
this.events.mouse.mousemove = () => {
if (isMediaVideo) {
if (isMediaVideo && this.player.isMedia() && !this.player.activeElement().paused) {
this.player.playBtn.setAttribute('aria-hidden', 'false');
this.player.getContainer().classList.remove('op-controls--hidden');
this._startControlTimer(2500);
}
};
this.events.mouse.mouseleave = () => {
if (isMediaVideo) {
if (isMediaVideo && this.player.isMedia() && !this.player.activeElement().paused) {
this._startControlTimer(1000);
}
};
Expand Down
2 changes: 1 addition & 1 deletion src/js/player.ts
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,7 @@ class Player {
this.events.pause = () => {
this.loader.setAttribute('aria-hidden', 'true');
this.playBtn.classList.remove('op-player__play--paused');
this.playBtn.setAttribute('aria-hidden', IS_ANDROID || IS_IOS ? 'false' : 'true');
this.playBtn.setAttribute('aria-hidden', 'false');
this.playBtn.title = this.options.labels.play;
};
}
Expand Down

0 comments on commit 3e68e7c

Please sign in to comment.