-
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-7590): filter Shaka audio tracks by language and not bitrate #58
Conversation
no need to ID and setting the active, it is set by the player. using getAudioLanguagesAndRoles() to get the list of languages from shaka.
src/dash-adapter.js
Outdated
@@ -409,8 +414,6 @@ export default class DashAdapter extends BaseMediaSourceAdapter { | |||
if (audioTracks) { | |||
for (let i = 0; i < audioTracks.length; i++) { | |||
let settings = { | |||
id: audioTracks[i].id, | |||
active: audioTracks[i].active, | |||
label: audioTracks[i].label, |
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??
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.
@dan-ziv, because it's not relevant here. We now create the number of audio tracks based on the number of languages. (shaka selects an audio track based on the language)
I can leave the id and active flag of the variant, but this data will become stale when/if we change the bitrate of the video.
currently, we have no use of this data, so it can be removed
active - variant value id - concatonation of all the variants id's
return variantTrack.videoId === activeVariantTrack.videoId; | ||
const variantTracks = this._shaka.getVariantTracks(); | ||
let audioTracks = this._shaka.getAudioLanguagesAndRoles(); | ||
audioTracks.forEach(track => { |
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.
A more functional way to do it is:
audioTracks.forEach(track => {
const sameLangAudioVariants = variantTracks.filter(vt=>vt.language === t.language);
const id = sameLangAudioVariants.map(t=>t.id).join('_');
const active = sameLangAudioVariants.some(t=>t.active);
track.id = id;
track.label = sameLangAudioVariants[0].label ;
track.active = active;
});
Use our own stream for VoD testing. Fix async tests that don't have catch clauses: ```javascript Promise.then().catch(e => {done(e)) try { ... } catch (e) { done(e); } ``` Fix failing audio tests following #58
Description of the Changes
creating an audio track array of unique languages
no need to ID and setting the active, it is set by the player.
using getAudioLanguagesAndRoles() to get the list of languages from shaka.
CheckLists