Skip to content
This repository has been archived by the owner on Feb 11, 2022. It is now read-only.

Select Audio Track #13

Merged
merged 6 commits into from
Apr 7, 2017
Merged

Select Audio Track #13

merged 6 commits into from
Apr 7, 2017

Conversation

Mecharyry
Copy link
Contributor

@Mecharyry Mecharyry commented Apr 6, 2017

Problem

Clients of no-player are unable to select the audio track they desire at any point during video playback.

Solution

Expose methods in the Player to allow clients to get a list of PlayerAudioTrack. PlayAudioTrack consists of basic info around a MediaFormat such as language, channels, mimeType etc. To set an AudioTrack the client needs to specify an index from the PlayerAudioTrack that matches the audio track they desire.

mediaPlayer.selectTrack() is only available above api level 15 so we upped this as well in this PR. It seems impossible to set an audio track before this.

Paired with

@jackSzm

@@ -27,6 +29,10 @@

void attach(PlayerView playerView);

void setAudioTrack(int audioTrackIndex);
Copy link
Contributor

Choose a reason for hiding this comment

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

this is more of a selectAudioTrack(index) than a set

@ouchadam
Copy link
Contributor

ouchadam commented Apr 7, 2017

nice work! just the comment about a method name, otherwise LGMT 👍

return audioTracks;
}

public void setAudioTrack(int audioTrackIndex) {
Copy link
Contributor

Choose a reason for hiding this comment

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

same as the other? select

@juankysoriano
Copy link
Contributor

Same as @ouchadam ; select seems a better name than set

@jszmltr
Copy link
Contributor

jszmltr commented Apr 7, 2017

Amended in : 3fef8ed

Also found one more thing 🙈 . 3fef8ed#diff-379a1e7be0f368e89f56122346e736a4R443

it should be if (audioTrackIndex < 0 || audioTrackIndex > trackCount - 1) since trackCount is already out of bounds.

@juankysoriano juankysoriano merged commit 21e8208 into master Apr 7, 2017
@juankysoriano juankysoriano deleted the audio_described_track branch April 7, 2017 09:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants