public abstract class AbstractMusicPlayer extends java.lang.Object implements MusicPlayer
VolumeEaseHelper
进行了封装,用于减少模板代码。构造器和说明 |
---|
AbstractMusicPlayer() |
限定符和类型 | 方法和说明 |
---|---|
void |
dismissQuiet()
从临时降低的音量中恢复原来的音量。
|
void |
pause()
暂停播放。
|
abstract void |
pauseEx()
暂停播放。
|
void |
quiet()
临时降低音量。
|
void |
release()
释放音乐播放器。
|
abstract void |
releaseEx()
释放音乐播放器。
|
void |
start()
开始播放。
|
abstract void |
startEx()
开始播放。
|
void |
stop()
停止播放。
|
abstract void |
stopEx()
停止播放。
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAudioSessionId, getDuration, getProgress, isInvalid, isLooping, isPlaying, isStalled, prepare, seekTo, setLooping, setOnBufferingUpdateListener, setOnCompletionListener, setOnErrorListener, setOnPreparedListener, setOnRepeatListener, setOnSeekCompleteListener, setOnStalledListener, setSpeed, setVolume
public final void start()
MusicPlayer
start
在接口中 MusicPlayer
public abstract void startEx()
public final void pause()
MusicPlayer
pause
在接口中 MusicPlayer
public abstract void pauseEx()
public final void stop()
MusicPlayer
stop
在接口中 MusicPlayer
public abstract void stopEx()
public final void release()
MusicPlayer
注意!一旦调用该方法,就不能再调用 MusicPlayer
对象的任何方法,否则会发生不可预见的错误。
调用该方法后应该立即释放你的音乐播放器(释放占用的内存,断开网络连接)。此时 MusicPlayer.isInvalid()
方法应该返回 true,MusicPlayer.isPlaying()
方法与 MusicPlayer.isStalled()
方法应该返回 false。
release
在接口中 MusicPlayer
public abstract void releaseEx()
public void quiet()
MusicPlayer
音量应该降低到不足以影响到其他应用的音频清晰度,通常为当前音量的 0.2。
quiet
在接口中 MusicPlayer
MusicPlayer.dismissQuiet()
public void dismissQuiet()
MusicPlayer
dismissQuiet
在接口中 MusicPlayer
MusicPlayer.quiet()