本文整理汇总了Java中tv.danmaku.ijk.media.player.AndroidMediaPlayer类的典型用法代码示例。如果您正苦于以下问题:Java AndroidMediaPlayer类的具体用法?Java AndroidMediaPlayer怎么用?Java AndroidMediaPlayer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AndroidMediaPlayer类属于tv.danmaku.ijk.media.player包,在下文中一共展示了AndroidMediaPlayer类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getSelectedTrack
import tv.danmaku.ijk.media.player.AndroidMediaPlayer; //导入依赖的package包/类
public int getSelectedTrack(int trackType) {
if (mediaPlayer == null || released) {
return -1;
}
if (mediaPlayer instanceof IjkMediaPlayer) {
return ((IjkMediaPlayer) mediaPlayer).getSelectedTrack(trackType);
} else if (mediaPlayer instanceof AndroidMediaPlayer) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
return ((AndroidMediaPlayer) mediaPlayer).getInternalMediaPlayer().getSelectedTrack(trackType);
}
}
return -1;
}
示例2: setPlayer
import tv.danmaku.ijk.media.player.AndroidMediaPlayer; //导入依赖的package包/类
/**
* Sets the {@link } to control.
*
* @param mPlayer the {@code ExoPlayer} to control.
*/
public void setPlayer(AndroidMediaPlayer mPlayer) {
if (this.mPlayer == mPlayer) {
return;
}
if (this.mPlayer != null) {
// this.mPlayer.removeListener(componentListener);
}
this.mPlayer = mPlayer;
if (mPlayer != null) {
// mPlayer.addListener(componentListener);
}
}
示例3: initVideoPlayer
import tv.danmaku.ijk.media.player.AndroidMediaPlayer; //导入依赖的package包/类
@Override
public void initVideoPlayer(Context context, Message msg, List<VideoOptionModel> optionModelList) {
mediaPlayer = new AndroidMediaPlayer();
mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
release = false;
try {
mediaPlayer.setDataSource(context, Uri.parse(((GSYModel) msg.obj).getUrl()), ((GSYModel) msg.obj).getMapHeadData());
mediaPlayer.setLooping(((GSYModel) msg.obj).isLooping());
if (((GSYModel) msg.obj).getSpeed() != 1 && ((GSYModel) msg.obj).getSpeed() > 0) {
}
} catch (Exception e) {
e.printStackTrace();
}
}
示例4: createMediaPlayer
import tv.danmaku.ijk.media.player.AndroidMediaPlayer; //导入依赖的package包/类
private IMediaPlayer createMediaPlayer() {
if (VideoInfo.PLAYER_IMPL_SYSTEM.equals(videoInfo.getPlayerImpl())) {
return new AndroidMediaPlayer();
}
return new IjkMediaPlayer(Looper.getMainLooper());
}