Skip to content

Commit

Permalink
fix(FEC-10890): the captions aren't displayed for audio entry and UI …
Browse files Browse the repository at this point in the history
…doesn't clickable. (#533)

Issue: subtitles container append before poster and located under it on the DOM tree.
Solution: poster, captions, and black screen container blocking user action from UI add pointer-events: none to avoid it.
append captions container after playkit containers.
  • Loading branch information
Yuvalke authored Jan 24, 2021
1 parent 9eacc14 commit bb888b1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions src/assets/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
background-position: center center;
background-repeat: no-repeat;
background-color: #000;
pointer-events: none;
}

.playkit-subtitles {
Expand All @@ -48,13 +49,15 @@
bottom: 0;
right: 0;
left: 0;
pointer-events: none;
}

.playkit-black-cover {
position: absolute;
width: 100%;
height: 100%;
background-color: black;
pointer-events: none;
}

.playkit-size-iframe {
Expand Down
10 changes: 5 additions & 5 deletions src/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -1595,11 +1595,6 @@ export default class Player extends FakeEventTarget {
* @returns {void}
*/
_appendDomElements(): void {
// Append playkit-subtitles
this._textDisplayEl = Utils.Dom.createElement('div');
Utils.Dom.setAttribute(this._textDisplayEl, 'aria-live', 'polite');
Utils.Dom.addClassName(this._textDisplayEl, SUBTITLES_CLASS_NAME);
Utils.Dom.appendChild(this._el, this._textDisplayEl);
// Append playkit-black-cover
this._blackCoverEl = Utils.Dom.createElement('div');
Utils.Dom.addClassName(this._blackCoverEl, BLACK_COVER_CLASS_NAME);
Expand All @@ -1608,6 +1603,11 @@ export default class Player extends FakeEventTarget {
const el = this._posterManager.getElement();
Utils.Dom.addClassName(el, POSTER_CLASS_NAME);
Utils.Dom.appendChild(this._el, el);
// Append playkit-subtitles
this._textDisplayEl = Utils.Dom.createElement('div');
Utils.Dom.setAttribute(this._textDisplayEl, 'aria-live', 'polite');
Utils.Dom.addClassName(this._textDisplayEl, SUBTITLES_CLASS_NAME);
Utils.Dom.appendChild(this._el, this._textDisplayEl);
}
/**
Expand Down

0 comments on commit bb888b1

Please sign in to comment.