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-7590): filter Shaka audio tracks by language and not bitrate #58

Merged
merged 4 commits into from
Jul 31, 2018

Conversation

odedhutzler
Copy link
Contributor

@odedhutzler odedhutzler commented Jul 29, 2018

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

  • changes have been done against master branch, and PR does not conflict
  • new unit / functional tests have been added (whenever applicable)
  • test are passing in local environment
  • Travis tests are passing (or test results are not worse than on master branch :))
  • Docs have been updated

no need to ID and setting the active, it is set by the player.
using getAudioLanguagesAndRoles() to get the list of languages from shaka.
@odedhutzler odedhutzler self-assigned this Jul 29, 2018
@@ -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,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why to remove??

Copy link
Contributor Author

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 => {
Copy link
Contributor

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;
});

@odedhutzler odedhutzler changed the title fix(FEC-7590): Filter Shaka audio tracks by language and not bitrate fix(FEC-7590): filter Shaka audio tracks by language and not bitrate Jul 31, 2018
@odedhutzler odedhutzler merged commit e88747c into master Jul 31, 2018
@odedhutzler odedhutzler deleted the FEC-7590 branch July 31, 2018 14:18
OrenMe added a commit that referenced this pull request Aug 11, 2018
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants