Sdílet prostřednictvím


MediaPlayer.GetSelectedTrack(MediaTrackType) Method

Definition

Returns the index of the audio, video, or subtitle track currently selected for playback, The return value is an index into the array returned by #getTrackInfo(), and can be used in calls to #selectTrack(int) or #deselectTrack(int).

[Android.Runtime.Register("getSelectedTrack", "(I)I", "GetGetSelectedTrack_IHandler")]
public virtual int GetSelectedTrack (Android.Media.MediaTrackType trackType);
[<Android.Runtime.Register("getSelectedTrack", "(I)I", "GetGetSelectedTrack_IHandler")>]
abstract member GetSelectedTrack : Android.Media.MediaTrackType -> int
override this.GetSelectedTrack : Android.Media.MediaTrackType -> int

Parameters

trackType
MediaTrackType

should be one of TrackInfo#MEDIA_TRACK_TYPE_VIDEO, TrackInfo#MEDIA_TRACK_TYPE_AUDIO, or TrackInfo#MEDIA_TRACK_TYPE_SUBTITLE

Returns

index of the audio, video, or subtitle track currently selected for playback; a negative integer is returned when there is no selected track for trackType or when trackType is not one of audio, video, or subtitle.

Attributes

Exceptions

Remarks

Returns the index of the audio, video, or subtitle track currently selected for playback, The return value is an index into the array returned by #getTrackInfo(), and can be used in calls to #selectTrack(int) or #deselectTrack(int).

Java documentation for android.media.MediaPlayer.getSelectedTrack(int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

See also