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

how to select audio track #11

Closed
prikshitgupta opened this issue May 22, 2020 · 3 comments
Closed

how to select audio track #11

prikshitgupta opened this issue May 22, 2020 · 3 comments

Comments

@prikshitgupta
Copy link

prikshitgupta commented May 22, 2020

How do i select audio track if video has several audio tracks?

@kingslay
Copy link
Owner

Selecting Tracks

  let player: MediaPlayerProtocol
  let tracks = player.tracks(mediaType: .audio)
  let track = tracks[1]
  /// the name of the track
  let name = track.name
  /// the language of the track
  let language = track.language
  /// selecting the one
	player.select(track: track)

@byMohamedali
Copy link
Sponsor

player.select(track: track) work only if we seek the player after changing the track, it doesn't change by calling calling this function. It is a wanted behavior ?

@kingslay
Copy link
Owner

i fixed. after select(track) I seek the player

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

No branches or pull requests

3 participants