use of master.flame.danmaku.controller.DrawHandler.Callback in project ABPlayer by winkstu.
the class MainActivity method findViews.
private void findViews() {
mMediaController = findViewById(R.id.media_controller);
mBtnRotate = (Button) findViewById(R.id.rotate);
mBtnHideDanmaku = (Button) findViewById(R.id.btn_hide);
mBtnShowDanmaku = (Button) findViewById(R.id.btn_show);
mBtnPauseDanmaku = (Button) findViewById(R.id.btn_pause);
mBtnResumeDanmaku = (Button) findViewById(R.id.btn_resume);
mBtnSendDanmaku = (Button) findViewById(R.id.btn_send);
mBtnSendDanmakus = (Button) findViewById(R.id.btn_send_danmakus);
mBtnRotate.setOnClickListener(this);
mBtnHideDanmaku.setOnClickListener(this);
mMediaController.setOnClickListener(this);
mBtnShowDanmaku.setOnClickListener(this);
mBtnPauseDanmaku.setOnClickListener(this);
mBtnResumeDanmaku.setOnClickListener(this);
mBtnSendDanmaku.setOnClickListener(this);
mBtnSendDanmakus.setOnClickListener(this);
// VideoView
VideoView mVideoView = (VideoView) findViewById(R.id.videoview);
// DanmakuView
mDanmakuView = (IDanmakuView) findViewById(R.id.sv_danmaku);
DanmakuGlobalConfig.DEFAULT.setDanmakuStyle(DanmakuGlobalConfig.DANMAKU_STYLE_STROKEN, 3).setDuplicateMergingEnabled(false);
if (mDanmakuView != null) {
mParser = createParser(this.getResources().openRawResource(R.raw.comments));
mDanmakuView.setCallback(new Callback() {
@Override
public void updateTimer(DanmakuTimer timer) {
}
@Override
public void prepared() {
mDanmakuView.start();
}
});
mDanmakuView.prepare(mParser);
mDanmakuView.showFPS(true);
mDanmakuView.enableDanmakuDrawingCache(true);
((View) mDanmakuView).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
mMediaController.setVisibility(View.VISIBLE);
}
});
}
if (mVideoView != null) {
mVideoView.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
@Override
public void onPrepared(MediaPlayer mediaPlayer) {
mediaPlayer.start();
}
});
// mVideoView.setVideoPath(Environment.getExternalStorageDirectory() + "/1.flv");
mVideoView.setVideoURI(Uri.parse("http://us-chicago.acgvideo.com/e/e9/3444659.mp4?expires=1429119900&ssig=o8fAECKGmZkIsdZE31EYOQ&o=401361084&rate=0"));
}
}
Aggregations