Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(FEC-12539): Shaka text displayer font size too small on TVs #208

Merged
merged 3 commits into from
Sep 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions src/assets/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,3 @@
:-ms-fullscreen .shaka-text-container {
font-size: 4.4vmin;
}

@media screen and (min-width: 1240px) {
.shaka-text-container {
font-size: 4.4vmin;
}
}
16 changes: 12 additions & 4 deletions src/dash-adapter.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// @flow
import shaka from 'shaka-player';
import {
Env,
AudioTrack,
BaseMediaSourceAdapter,
Error,
Expand Down Expand Up @@ -398,17 +399,24 @@ export default class DashAdapter extends BaseMediaSourceAdapter {
//Need to call this again cause we are uninstalling the VTTCue polyfill to avoid collisions with other libs
shaka.polyfill.installAll();
this._shaka = new shaka.Player();
// This will force the player to use shaka UITextDisplayer plugin to render text tracks.
if (this._config.useShakaTextTrackDisplay) {
this._shaka.setVideoContainer(Utils.Dom.getElementBySelector('.playkit-subtitles'));
}
this._setTextDisplayer();
this._maybeSetFilters();
this._maybeSetDrmConfig();
this._maybeBreakStalls();
this._shaka.configure(this._config.shakaConfig);
this._addBindings();
}

_setTextDisplayer() {
// This will force the player to use shaka UITextDisplayer plugin to render text tracks.
if (this._config.useShakaTextTrackDisplay) {
this._shaka.setVideoContainer(Utils.Dom.getElementBySelector('.playkit-subtitles'));
if (Env.isSmartTV) {
document.querySelector('.shaka-text-container').style.fontsize = '4.4vmin';
}
}
}

_clearStallInterval(): void {
if (this._stallInterval) {
clearInterval(this._stallInterval);
Expand Down