-
Notifications
You must be signed in to change notification settings - Fork 7
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 with hlsjs #65
Conversation
this is basically the same as before, but hls.js run different code paths when we use it's API for selecting text track.
} | ||
}); | ||
|
||
it('should hide the active text track', function () { |
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.
why to remove this test?
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.
Previously we managed the tracks directly ourselves - so it made sense.
Now we use hlsjs API and it requires loading an actual manifest with text tracks - and we will basically be testing internals of hlsjs - which is out of scope for unit testing
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 just checking that our hideTextTrack
does its work
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.
I understand but the test doesn't reflect it - in our unit testing we inject the text tracks ourselves and not via hlsjs so we actually don't test correctly.
And now that we moved to using hlsjs API itself then the test is both irrelevant(as the testing is black boxed behind hls.js API) and not working as we are not using hlsjs to add and manage the text tracks in the test itself.
@@ -149,6 +149,9 @@ export default class HlsAdapter extends BaseMediaSourceAdapter { | |||
adapterConfig.hlsConfig.startPosition = config.playback.startTime; | |||
} | |||
} | |||
if (Utils.Object.hasPropertyPath(config, 'playback.useNativeTextTrack')) { | |||
adapterConfig.subtitleDisplay = Utils.Object.getPropertyPath(config, 'playback.useNativeTextTrack'); |
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.
add it on adapterConfig.hlsConfig
.
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.
It's not an hls.js config option - it's an API. I wanted to add it as config first but it doesn't get set on hls.js config...
@@ -202,6 +205,7 @@ export default class HlsAdapter extends BaseMediaSourceAdapter { | |||
this._config.hlsConfig['pLoader'] = pLoader; | |||
} | |||
this._hls = new Hlsjs(this._config.hlsConfig); | |||
this._hls.subtitleDisplay = this._config.subtitleDisplay; |
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.
unnecessary. see the comment above.
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.
see my comment above
due to the way hls.js manages track selection, especialy when default text track is set in manifest, we had some incorrect logic. This simplfies and fixes the various paths we had to handle this. The fix is dependent on a fix on video-dev/hls.js#1582 and kaltura/playkit-js-hls#65.
use shaka setTextTrackVisibility to set text track display mode according to useNativeTextTrack 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.
use shaka setTextTrackVisibility to set text track display mode according to useNativeTextTrack 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.
Description of the Changes
this is basically the same as before, but hls.js run different code paths when we use it's API for selecting text track.
Before this change we used to set the
showing
/hidden
mode attribute of the text track in playkit-js html5 engine. we now set this in HLS.JS which internally does the same but also it manages internal state for this and so it's better to use its API and not access the textTrack.mode directly.This fix depends on a fix in kaltura/playkit-js#263
CheckLists