C# Class Plugin.MediaManager.MediaPlayerService

Inheritance: MediaServiceBase, MediaPlayer.IOnBufferingUpdateListener, MediaPlayer.IOnCompletionListener, MediaPlayer.IOnErrorListener, MediaPlayer.IOnPreparedListener, MediaPlayer.IOnSeekCompleteListener
显示文件 Open project: martijn00/XamarinMediaManager Class Usage Examples

Public Methods

Method Description
InitializePlayer ( ) : void
InitializePlayerWithUrl ( string audioUrl ) : void
OnBufferingUpdate ( Android.Media.MediaPlayer mp, int percent ) : void
OnCompletion ( Android.Media.MediaPlayer mp ) : void
OnDestroy ( ) : void
OnError ( Android.Media.MediaPlayer mp, MediaError what, int extra ) : bool
OnPrepared ( Android.Media.MediaPlayer mp ) : void
OnSeekComplete ( Android.Media.MediaPlayer mp ) : void
Pause ( ) : System.Threading.Tasks.Task
Play ( IEnumerable mediaFiles ) : System.Threading.Tasks.Task
Play ( IMediaFile mediaFile = null ) : System.Threading.Tasks.Task
Seek ( System.TimeSpan position ) : System.Threading.Tasks.Task
SetMediaPlayerDataSource ( ) : Task
SetMediaPlayerOptions ( ) : void
SetVolume ( float leftVolume, float rightVolume ) : void
Stop ( ) : System.Threading.Tasks.Task
TogglePlayPause ( bool forceToPlay ) : System.Threading.Tasks.Task

Private Methods

Method Description
DisposeMediaPlayer ( ) : void
OnStartCommand ( Android.Content.Intent intent, StartCommandFlags flags, int startId ) : StartCommandResult
SetMediaPlayerDataSourcePostHoneyComb ( ) : System.Threading.Tasks.Task
SetMediaPlayerDataSourcePreHoneyComb ( ) : System.Threading.Tasks.Task
SetMediaPlayerDataSourceUsingFileDescriptor ( ) : System.Threading.Tasks.Task

Method Details

InitializePlayer() public method

public InitializePlayer ( ) : void
return void

InitializePlayerWithUrl() public method

public InitializePlayerWithUrl ( string audioUrl ) : void
audioUrl string
return void

OnBufferingUpdate() public method

public OnBufferingUpdate ( Android.Media.MediaPlayer mp, int percent ) : void
mp Android.Media.MediaPlayer
percent int
return void

OnCompletion() public method

public OnCompletion ( Android.Media.MediaPlayer mp ) : void
mp Android.Media.MediaPlayer
return void

OnDestroy() public method

public OnDestroy ( ) : void
return void

OnError() public method

public OnError ( Android.Media.MediaPlayer mp, MediaError what, int extra ) : bool
mp Android.Media.MediaPlayer
what MediaError
extra int
return bool

OnPrepared() public method

public OnPrepared ( Android.Media.MediaPlayer mp ) : void
mp Android.Media.MediaPlayer
return void

OnSeekComplete() public method

public OnSeekComplete ( Android.Media.MediaPlayer mp ) : void
mp Android.Media.MediaPlayer
return void

Pause() public method

public Pause ( ) : System.Threading.Tasks.Task
return System.Threading.Tasks.Task

Play() public method

public Play ( IEnumerable mediaFiles ) : System.Threading.Tasks.Task
mediaFiles IEnumerable
return System.Threading.Tasks.Task

Play() public method

public Play ( IMediaFile mediaFile = null ) : System.Threading.Tasks.Task
mediaFile IMediaFile
return System.Threading.Tasks.Task

Seek() public method

public Seek ( System.TimeSpan position ) : System.Threading.Tasks.Task
position System.TimeSpan
return System.Threading.Tasks.Task

SetMediaPlayerDataSource() public method

public SetMediaPlayerDataSource ( ) : Task
return Task

SetMediaPlayerOptions() public method

public SetMediaPlayerOptions ( ) : void
return void

SetVolume() public method

public SetVolume ( float leftVolume, float rightVolume ) : void
leftVolume float
rightVolume float
return void

Stop() public method

public Stop ( ) : System.Threading.Tasks.Task
return System.Threading.Tasks.Task

TogglePlayPause() public method

public TogglePlayPause ( bool forceToPlay ) : System.Threading.Tasks.Task
forceToPlay bool
return System.Threading.Tasks.Task