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

Audio tracks #16

Closed
halibegic opened this issue Aug 25, 2016 · 6 comments
Closed

Audio tracks #16

halibegic opened this issue Aug 25, 2016 · 6 comments
Assignees
Labels

Comments

@halibegic
Copy link

How to call audio API in order to list / set audio tracks. Example: https://jsfiddle.net/halibegic/ohovkrbv/

P.S stream "angel-one" contains the following tracks:

  • language: de, 131357 bits/s
  • language: en, 130201 bits/s
  • language: es, 132963 bits/s
  • language: fr, 134350 bits/s
  • language: it, 134045 bits/s
@leandromoreira
Copy link
Member

@halibegic this should work https://jsfiddle.net/ohovkrbv/2/ but it's not I'm looking into to understand (but at least you can see how it can be done)

@leandromoreira
Copy link
Member

@halibegic it works :P you just need to:

First gather the tracks:

player.on(Clappr.Events.PLAYER_PLAY, function(){
  var clapprShaka = player.core.getCurrentContainer().playback
  var options = clapprShaka.audioTracks;
  console.log(options);
})

And then create an UI (binding onClick) to change it:

clapprShaka.selectTrack(options[0]);

@halibegic
Copy link
Author

I will try :) Thank You

@halibegic
Copy link
Author

halibegic commented Aug 25, 2016

I don't know why but when stream is played for the first time I need to click two times in order to change audio https://jsfiddle.net/halibegic/ohovkrbv/12/

@leandromoreira
Copy link
Member

I'll check it, I also would point you to this project https://github.com/clappr/clappr-level-selector-plugin it might inspire you.

@leandromoreira
Copy link
Member

@halibegic can you test with the newer version?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants