C# 클래스 Plugin.MediaManager.MediaServiceBase

상속: Android.App.Service, AudioManager.IOnAudioFocusChangeListener, IPlaybackManager
파일 보기 프로젝트 열기: martijn00/XamarinMediaManager 1 사용 예제들

공개 메소드들

메소드 설명
AquireWifiLock ( ) : void

Lock the wifi so we can still stream under lock screen

GetUriFromPath ( Android.Content.Context context, string path ) : string
HandleIntent ( Android.Content.Intent intent ) : void
InitializePlayer ( ) : void

Intializes the player.

InitializePlayerWithUrl ( string audioUrl ) : void
OnAudioFocusChange ( AudioFocus focusChange ) : void

For a good user experience we should account for when audio focus has changed. There is only 1 audio output there may be several media services trying to use it so we should act correctly based on this. "duck" to be quiet and when we gain go full. All applications are encouraged to follow this, but are not enforced.

OnBind ( Android.Content.Intent intent ) : IBinder
OnCreate ( ) : void

On create simply detect some of our managers

OnDestroy ( ) : void

Properly cleanup of your player by releasing resources

OnUnbind ( Android.Content.Intent intent ) : bool
Pause ( ) : System.Threading.Tasks.Task
Play ( IEnumerable mediaFiles ) : System.Threading.Tasks.Task
Play ( IMediaFile mediaFile = null ) : System.Threading.Tasks.Task
ReleaseWifiLock ( ) : void

This will release the wifi lock if it is no longer needed

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

보호된 메소드들

메소드 설명
OnBufferingChanged ( BufferingChangedEventArgs e ) : void
OnMediaFailed ( MediaFailedEventArgs e ) : void
OnMediaFileChanged ( MediaFileChangedEventArgs e ) : void
OnMediaFileFailed ( MediaFileFailedEventArgs e ) : void
OnMediaFinished ( MediaFinishedEventArgs e ) : void
OnPlayingChanged ( PlayingChangedEventArgs e ) : void
OnStatusChanged ( StatusChangedEventArgs e ) : void

비공개 메소드들

메소드 설명
CheckIfFileAlreadyIsPlaying ( IMediaFile mediaFile ) : Task

Checks if player just paused.

SetMediaSession ( MediaSessionManager sessionManager ) : void
ValidateMediaFile ( IMediaFile mediaFile ) : bool

메소드 상세

AquireWifiLock() 공개 메소드

Lock the wifi so we can still stream under lock screen
public AquireWifiLock ( ) : void
리턴 void

GetUriFromPath() 공개 정적인 메소드

public static GetUriFromPath ( Android.Content.Context context, string path ) : string
context Android.Content.Context
path string
리턴 string

HandleIntent() 공개 메소드

public HandleIntent ( Android.Content.Intent intent ) : void
intent Android.Content.Intent
리턴 void

InitializePlayer() 공개 추상적인 메소드

Intializes the player.
public abstract InitializePlayer ( ) : void
리턴 void

InitializePlayerWithUrl() 공개 추상적인 메소드

public abstract InitializePlayerWithUrl ( string audioUrl ) : void
audioUrl string
리턴 void

OnAudioFocusChange() 공개 메소드

For a good user experience we should account for when audio focus has changed. There is only 1 audio output there may be several media services trying to use it so we should act correctly based on this. "duck" to be quiet and when we gain go full. All applications are encouraged to follow this, but are not enforced.
public OnAudioFocusChange ( AudioFocus focusChange ) : void
focusChange AudioFocus
리턴 void

OnBind() 공개 메소드

public OnBind ( Android.Content.Intent intent ) : IBinder
intent Android.Content.Intent
리턴 IBinder

OnBufferingChanged() 보호된 메소드

protected OnBufferingChanged ( BufferingChangedEventArgs e ) : void
e Plugin.MediaManager.Abstractions.EventArguments.BufferingChangedEventArgs
리턴 void

OnCreate() 공개 메소드

On create simply detect some of our managers
public OnCreate ( ) : void
리턴 void

OnDestroy() 공개 메소드

Properly cleanup of your player by releasing resources
public OnDestroy ( ) : void
리턴 void

OnMediaFailed() 보호된 메소드

protected OnMediaFailed ( MediaFailedEventArgs e ) : void
e MediaFailedEventArgs
리턴 void

OnMediaFileChanged() 보호된 메소드

protected OnMediaFileChanged ( MediaFileChangedEventArgs e ) : void
e Plugin.MediaManager.Abstractions.EventArguments.MediaFileChangedEventArgs
리턴 void

OnMediaFileFailed() 보호된 메소드

protected OnMediaFileFailed ( MediaFileFailedEventArgs e ) : void
e Plugin.MediaManager.Abstractions.EventArguments.MediaFileFailedEventArgs
리턴 void

OnMediaFinished() 보호된 메소드

protected OnMediaFinished ( MediaFinishedEventArgs e ) : void
e Plugin.MediaManager.Abstractions.EventArguments.MediaFinishedEventArgs
리턴 void

OnPlayingChanged() 보호된 메소드

protected OnPlayingChanged ( PlayingChangedEventArgs e ) : void
e Plugin.MediaManager.Abstractions.EventArguments.PlayingChangedEventArgs
리턴 void

OnStatusChanged() 보호된 메소드

protected OnStatusChanged ( StatusChangedEventArgs e ) : void
e Plugin.MediaManager.Abstractions.EventArguments.StatusChangedEventArgs
리턴 void

OnUnbind() 공개 메소드

public OnUnbind ( Android.Content.Intent intent ) : bool
intent Android.Content.Intent
리턴 bool

Pause() 공개 메소드

public Pause ( ) : System.Threading.Tasks.Task
리턴 System.Threading.Tasks.Task

Play() 공개 추상적인 메소드

public abstract Play ( IEnumerable mediaFiles ) : System.Threading.Tasks.Task
mediaFiles IEnumerable
리턴 System.Threading.Tasks.Task

Play() 공개 메소드

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

ReleaseWifiLock() 공개 메소드

This will release the wifi lock if it is no longer needed
public ReleaseWifiLock ( ) : void
리턴 void

Seek() 공개 추상적인 메소드

public abstract Seek ( System.TimeSpan position ) : System.Threading.Tasks.Task
position System.TimeSpan
리턴 System.Threading.Tasks.Task

SetMediaPlayerDataSource() 공개 추상적인 메소드

public abstract SetMediaPlayerDataSource ( ) : Task
리턴 Task

SetMediaPlayerOptions() 공개 추상적인 메소드

public abstract SetMediaPlayerOptions ( ) : void
리턴 void

SetVolume() 공개 추상적인 메소드

public abstract SetVolume ( float leftVolume, float rightVolume ) : void
leftVolume float
rightVolume float
리턴 void

Stop() 공개 메소드

public Stop ( ) : System.Threading.Tasks.Task
리턴 System.Threading.Tasks.Task

TogglePlayPause() 공개 추상적인 메소드

public abstract TogglePlayPause ( bool forceToPlay ) : System.Threading.Tasks.Task
forceToPlay bool
리턴 System.Threading.Tasks.Task