From 1041b0a8c6cd54fecfacdb1831f54ed2805703e4 Mon Sep 17 00:00:00 2001 From: JonathanTGold <62672270+JonathanTGold@users.noreply.github.com> Date: Sun, 2 Oct 2022 15:13:00 +0200 Subject: [PATCH] fix(FEC-12539): Shaka text displayer font size too small on TVs - Regression (#210) solves: FEC-12539 - Regression **issue:** the previous fix is incorrect since the media query refers to the screen size and not the player size **fix:** The :fullscreen [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) [pseudo-class](https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-classes) is not applied in samrtTvs, so instead i relying on the Env.IsSmartTv env variable --- src/dash-adapter.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/dash-adapter.js b/src/dash-adapter.js index e5ef5b3a..0e2dfc76 100644 --- a/src/dash-adapter.js +++ b/src/dash-adapter.js @@ -412,7 +412,9 @@ export default class DashAdapter extends BaseMediaSourceAdapter { if (this._config.useShakaTextTrackDisplay) { this._shaka.setVideoContainer(Utils.Dom.getElementBySelector('.playkit-subtitles')); if (Env.isSmartTV) { - document.querySelector('.shaka-text-container').style.fontsize = '4.4vmin'; + this._eventManager.listenOnce(this._videoElement, EventType.DURATION_CHANGE, () => { + document.querySelector('.shaka-text-container').style.fontSize = '4.4vmin'; + }); } } }