Share via


MediaPlayer.SetNextMediaPlayer(MediaPlayer) Method

Definition

Set the MediaPlayer to start when this MediaPlayer finishes playback (i.

[Android.Runtime.Register("setNextMediaPlayer", "(Landroid/media/MediaPlayer;)V", "GetSetNextMediaPlayer_Landroid_media_MediaPlayer_Handler")]
public virtual void SetNextMediaPlayer (Android.Media.MediaPlayer? next);
[<Android.Runtime.Register("setNextMediaPlayer", "(Landroid/media/MediaPlayer;)V", "GetSetNextMediaPlayer_Landroid_media_MediaPlayer_Handler")>]
abstract member SetNextMediaPlayer : Android.Media.MediaPlayer -> unit
override this.SetNextMediaPlayer : Android.Media.MediaPlayer -> unit

Parameters

next
MediaPlayer

the player to start after this one completes playback.

Attributes

Remarks

Set the MediaPlayer to start when this MediaPlayer finishes playback (i.e. reaches the end of the stream). The media framework will attempt to transition from this player to the next as seamlessly as possible. The next player can be set at any time before completion, but shall be after setDataSource has been called successfully. The next player must be prepared by the app, and the application should not call start() on it. The next MediaPlayer must be different from 'this'. An exception will be thrown if next == this. The application may call setNextMediaPlayer(null) to indicate no next player should be started at the end of playback. If the current player is looping, it will keep looping and the next player will not be started.

Java documentation for android.media.MediaPlayer.setNextMediaPlayer(android.media.MediaPlayer).

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