Skip to content

Commit

Permalink
fix(captions): Added new styles to deal with iOS native captions when…
Browse files Browse the repository at this point in the history
… using fullscreen and removed unnecessary ones
  • Loading branch information
rafa8626 committed Jan 13, 2020
1 parent fca7fa1 commit 044c5f0
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 18 deletions.
27 changes: 20 additions & 7 deletions dist/openplayer.css
Original file line number Diff line number Diff line change
Expand Up @@ -688,13 +688,6 @@
.op-player video::-webkit-media-text-track-container {
display: none !important;
}
.op-player.op-player__ios--iphone video::-webkit-media-controls,
.op-player.op-player__ios--iphone video::-webkit-media-text-track-container {
display: block !important;
}
.op-fullscreen-native .op-captions {
display: none !important;
}

/* == Captions =============== */
.op-captions {
Expand Down Expand Up @@ -874,3 +867,23 @@ video:-webkit-media-text-track-display {
.op-player__ios--iphone .op-player__play {
margin-top: -5px;
}
.op-player.op-player__ios--iphone video::-webkit-media-controls,
.op-player.op-player__ios--iphone video::-webkit-media-text-track-container {
display: block !important;
}
.op-player.op-player__ios--iphone video::cue {
color: transparent;
font-size: 0.001px;
}
.op-player.op-player__ios--iphone video::-webkit-media-text-track-display-backdrop {
background: transparent !important;
}
.op-player[data-fullscreen='true'].op-player__ios--iphone video::cue {
color: #fff;
font-size: medium;
font-size: initial;
}
.op-player[data-fullscreen='true'].op-player.op-player__ios--iphone video::-webkit-media-text-track-display-backdrop {
background: #000000 !important;
background: rgba(0, 0, 0, .498039) !important;
}
2 changes: 1 addition & 1 deletion dist/openplayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -5589,7 +5589,7 @@ var Fullscreen = function () {

_this._setFullscreenData(true);

document.body.classList.add('op-fullscreen__on', 'op-fullscreen-native');
document.body.classList.add('op-fullscreen__on');
});
this.player.getElement().addEventListener('webkitendfullscreen', function () {
_this.isFullscreen = false;
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.

25 changes: 18 additions & 7 deletions src/css/player.css
Original file line number Diff line number Diff line change
Expand Up @@ -618,13 +618,6 @@
.op-player video::-webkit-media-text-track-container {
display: none !important;
}
.op-player.op-player__ios--iphone video::-webkit-media-controls,
.op-player.op-player__ios--iphone video::-webkit-media-text-track-container {
display: block !important;
}
.op-fullscreen-native .op-captions {
display: none !important;
}

/* == Captions =============== */
.op-captions {
Expand Down Expand Up @@ -796,3 +789,21 @@ video:-webkit-media-text-track-display {
.op-player__ios--iphone .op-player__play {
margin-top: -5px;
}
.op-player.op-player__ios--iphone video::-webkit-media-controls,
.op-player.op-player__ios--iphone video::-webkit-media-text-track-container {
display: block !important;
}
.op-player.op-player__ios--iphone video::cue {
color: transparent;
font-size: 0.001px;
}
.op-player.op-player__ios--iphone video::-webkit-media-text-track-display-backdrop {
background: transparent !important;
}
.op-player[data-fullscreen='true'].op-player__ios--iphone video::cue {
color: #fff;
font-size: initial;
}
.op-player[data-fullscreen='true'].op-player.op-player__ios--iphone video::-webkit-media-text-track-display-backdrop {
background: rgba(0, 0, 0, 0.498039) !important;
}
2 changes: 1 addition & 1 deletion src/js/controls/fullscreen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ class Fullscreen implements PlayerComponent {
this.player.getElement().addEventListener('webkitbeginfullscreen', () => {
this.isFullscreen = true;
this._setFullscreenData(true);
document.body.classList.add('op-fullscreen__on', 'op-fullscreen-native');
document.body.classList.add('op-fullscreen__on');
});
this.player.getElement().addEventListener('webkitendfullscreen', () => {
this.isFullscreen = false;
Expand Down

0 comments on commit 044c5f0

Please sign in to comment.