rockplayer2如何使用_斗战神 使用使用多开外挂_电子检测基础使用常见电子设备的使用

电脑杂谈  发布时间:2020-02-11 07:01:23  来源:网络整理

rockplayer2如何使用_斗战神 使用使用多开外挂_电子测量基础使用常用电子仪器的使用

Introduction

Customized Player-This article interpret how to implement a customized video player instead of the UI of android’s MediaController and how to handle error of android’s MediaPlayer to enable it continue replaying from the last position after reset the engine of media player

Background

I have googled lots of open source player for android, unfortunately almost all of the players are just for music but not for video, audio isn’t easy to play failed compared with video, I implement the customized player to enable developer easy to modify controller UI of media player and pay attention to the drawback of VideoView control provided by Android

Using the code

Android provide MediaPlayer and VideoView/MediaController to create player, but if dislike the UI and hope to redesign a player to enable it increasing more features such as adjusting volume or full screen , you can refer to my customized player code , it include 3 files, MediaControllerEx.java, VideoViewEx.java, PlayerActivity.java, MediaControllerEx.java implement the controller UI layout for player,if you want to adjust the SeekBar height, you should replace the default style with your customized style.

// layout your own UI for controller

protected View makeControllerView() {

LayoutInflater inflate = (LayoutInflater) mContext

.getSystemService(Context.LAYOUT_INFLATER_SERVICE);

mRoot = inflate.inflate(R.layout.media_controller_view, null);

initControllerView(mRoot);

斗战神 使用使用多开外挂_电子测量基础使用常用电子仪器的使用_rockplayer2如何使用

return mRoot;

}

//SeekBar style for controller

<style>

<item>false</item>

<item>@drawable/seekbar_style_drawable</item>

<item>@drawable/seekbar_style_drawable</item>

<item>10dip</item>

<item>10dip</item>

<item>@drawable/controller_playhead_drawable</item>

<item>8px</item>

<item>true</item>

</style>

rockplayer2如何使用_电子测量基础使用常用电子仪器的使用_斗战神 使用使用多开外挂

//assign the seek position when setting video path in VideoViewEx.java

public void setVideoPath(String path,int position) {

setVideoURI(Uri.parse(path),position);

}

/**

* The MediaPlayer often change to error state when playing video,and then prompt "can't play this video" dialog, so you have to handle these error via remembering the played time and replaying video after reset MediaPlayer engine

*/

private MediaPlayer.OnErrorListener mOnErrorListener = new MediaPlayer.OnErrorListener() {

public boolean onError(MediaPlayer mp, int what, int extra) {

switch (what) {

case MediaPlayer.MEDIA_ERROR_SERVER_DIED:

Toast.makeText(PlayerActivity.this, "MEDIA_ERROR_SERVER_DIED",

Toast.LENGTH_SHORT).show();

rockplayer2如何使用_斗战神 使用使用多开外挂_电子测量基础使用常用电子仪器的使用

showErrorDlg(what);

return true;

case MediaPlayer.MEDIA_ERROR_NOT_VALID_FOR_PROGRESSIVE_PLAYBACK:

Toast.makeText(PlayerActivity.this,

"MEDIA_ERROR_NOT_VALID_FOR_PROGRESSIVE_PLAYBACK",

Toast.LENGTH_SHORT).show();

break;

case MediaPlayer.MEDIA_ERROR_UNKNOWN:

Toast.makeText(PlayerActivity.this, "MEDIA_ERROR_UNKNOWN",

Toast.LENGTH_SHORT).show();

break;

}

setProgressContainer(true, getString(R.string.msg_handle_error));

斗战神 使用使用多开外挂_rockplayer2如何使用_电子测量基础使用常用电子仪器的使用

int position=mVideoView.getCurrentPosition();

if(position>0){

mCurPosition=position;

}

mVideoView.setVideoPath(mCurrentMediaUrl,position);

return true;

}

};

Points of Interest

My interest includes streaming player, decoder/encoder/demuxer of android's openCore media framework

History

CustomizedPlayer 0.1 version.

备注:懒得用英文再描述一遍rockplayer2如何使用rockplayer2如何使用,需要再次建立的地方是怎样在播放过程中有相应的提醒信息(如正在缓冲,网络断线,出错处理等)


本文来自电脑杂谈,转载请注明本文网址:
http://xinshanjie.com/a/bofangqi/article-140386-1.html

    相关阅读
    发表评论  请自觉遵守互联网相关的政策法规,严禁发布、暴力、反动的言论

    • 夏鹏圆
      夏鹏圆

      就是将剩余的小包或者再买同批次的打开

    热点图片
    拼命载入中...