-
Notifications
You must be signed in to change notification settings - Fork 3
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-7935): fix text selection logic #55
Conversation
…ording to `useNativeTextTrack` config flag
@@ -493,6 +495,7 @@ export default class DashAdapter extends BaseMediaSourceAdapter { | |||
*/ | |||
selectTextTrack(textTrack: TextTrack): void { | |||
if (this._shaka && (textTrack instanceof TextTrack) && !textTrack.active && (textTrack.kind === 'subtitles' || textTrack.kind === 'captions')) { | |||
this._shaka.setTextTrackVisibility(this._config.textTrackVisibile); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better to set it on init
as before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need it here, because for when calling hideTextTracks, e.g. setting them OFF
, we call setTextTrackVisibility(false)
so we need to always toggle it back.
There's no option in Shaka API to set subtitle OFF, just setting the display mode, so we have to call it when setting text track display of selectTextTrack
Description of the Changes
use shaka
setTextTrackVisibility
to set text track display mode according touseNativeTextTrack
config flag.This change is part of kaltura/playkit-js-hls#65 and kaltura/playkit-js#263 - removing the overhead of handling in playkit-js is possible by using the Shaka APIs to set track visibility.
CheckLists