public class LiveMusicManager
extends java.lang.Object
implements com.ksy.recordlib.service.model.processor.CommonIMLive.LiveBackMusicCallBack
限定符和类型 | 类和说明 |
---|---|
static interface |
LiveMusicManager.MusicProgressChangeCallBack
对外的回调接口
|
限定符和类型 | 字段和说明 |
---|---|
static int |
REPEAT_MODE_LOOP |
static int |
REPEAT_MODE_RANDOM |
static int |
REPEAT_MODE_SINGLE
循环的模式
|
static int |
START_PLAY_ERROR_BEAN |
static int |
START_PLAY_ERROR_NOFILE |
static int |
START_PLAY_ERROR_OTHER |
static int |
START_PLAY_SUCCESS
开始音乐的错误码
|
构造器和说明 |
---|
LiveMusicManager()
初始化,获取本地存储的播放模式,获取本地的收藏音乐的列表
|
限定符和类型 | 方法和说明 |
---|---|
void |
addMusicProgressChangeCallBack(LiveMusicManager.MusicProgressChangeCallBack musicProgressChangeCallBack)
增加对外的回调,一定记得删除,防止泄漏
|
void |
deleteFavoriteMusic(MusicBean musicBean)
删除当前的音乐,并且跳到下一首
|
MusicBean |
getCurPlayBean()
获取当前播放的对象
|
java.util.ArrayList<MusicBean> |
getFavoriteMusicLists()
获取收藏列表,不能使用copy,因为外面adapter用的是同一个对象
|
int |
getMusicVolume()
获取当前的混音音量
|
int |
getRepeatMode()
获取当前的循环模式
|
boolean |
isPlaying()
获取当前正在播放
|
static void |
log(java.lang.String msg) |
void |
onFinishLiveMusic()
SDK的回调,对应的是结束
|
void |
onMusicProgress(long timeMS)
音乐的进度回调
|
void |
onProgressChange(long mts)
修改进度
|
void |
pauseMusic()
暂停音乐,与resumePushLiveMusic配对
|
void |
removeMusicProgressChageCallBack(LiveMusicManager.MusicProgressChangeCallBack musicProgressChangeCallBack)
删除回调
|
void |
resumePushLiveMusic()
开始音乐,与pauseMusic配对
|
void |
setCommonIMLive(com.ksy.recordlib.service.model.processor.CommonIMLive commonIMLive)
设置推拉流SDK,现在仅支持自研SDK
|
void |
setFavoriteMusicLists(java.util.ArrayList<MusicBean> mFavoriteMusicLists)
设置收藏列表
|
void |
setLiveMusicCallBack(LiveMusicUtil.LiveMusicCallBack liveMusicCallBack)
设置播放的callback
|
void |
setMusicVolume(int volume)
设置混音音量
|
void |
setRepeatMode(int repeatMode)
修改音乐循环模式
|
int |
startPlay(MusicBean curPlayBean)
播放音乐
|
void |
stopPushLiveMusic()
停止音乐,与startplay配对
|
public static final int REPEAT_MODE_SINGLE
public static final int REPEAT_MODE_LOOP
public static final int REPEAT_MODE_RANDOM
public static final int START_PLAY_SUCCESS
public static final int START_PLAY_ERROR_NOFILE
public static final int START_PLAY_ERROR_BEAN
public static final int START_PLAY_ERROR_OTHER
public void setCommonIMLive(com.ksy.recordlib.service.model.processor.CommonIMLive commonIMLive)
commonIMLive
- public java.util.ArrayList<MusicBean> getFavoriteMusicLists()
public void setFavoriteMusicLists(java.util.ArrayList<MusicBean> mFavoriteMusicLists)
mFavoriteMusicLists
- 收藏列表public void setLiveMusicCallBack(LiveMusicUtil.LiveMusicCallBack liveMusicCallBack)
liveMusicCallBack
- 播放回调public MusicBean getCurPlayBean()
public void setRepeatMode(int repeatMode)
repeatMode
- 循环模式public int getRepeatMode()
public int startPlay(MusicBean curPlayBean)
curPlayBean
- 播放音乐的对象public boolean isPlaying()
public void deleteFavoriteMusic(MusicBean musicBean)
musicBean
- 要删除的beanpublic void pauseMusic()
public void resumePushLiveMusic()
public void stopPushLiveMusic()
public void setMusicVolume(int volume)
volume
- 0~100public int getMusicVolume()
public void onFinishLiveMusic()
onFinishLiveMusic
在接口中 com.ksy.recordlib.service.model.processor.CommonIMLive.LiveBackMusicCallBack
public void onMusicProgress(long timeMS)
onMusicProgress
在接口中 com.ksy.recordlib.service.model.processor.CommonIMLive.LiveBackMusicCallBack
timeMS
- 毫秒public void onProgressChange(long mts)
mts
- 毫秒public void addMusicProgressChangeCallBack(LiveMusicManager.MusicProgressChangeCallBack musicProgressChangeCallBack)
musicProgressChangeCallBack
- 回调public void removeMusicProgressChageCallBack(LiveMusicManager.MusicProgressChangeCallBack musicProgressChangeCallBack)
musicProgressChangeCallBack
- 回调对象public static void log(java.lang.String msg)