123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110 |
- //package com.hc.webapp.video;
- //
- //import android.app.Activity;
- //import android.os.Build;
- //import android.os.Bundle;
- //import android.support.annotation.Nullable;
- //import android.view.KeyEvent;
- //import android.widget.Toast;
- //
- //import com.hc.sysvideo.BDVideoView;
- //import com.hc.webapp.R;
- //
- //public class SysVideoPlayerActivity extends Activity implements
- // BDVideoView.BdPlayerListener {
- //
- // private BDVideoView videoView;
- //
- // @Override
- // protected void onStart() {
- // super.onStart();
- // if(videoView != null) {
- // videoView.onStart();
- // }
- // }
- //
- // @Override
- // protected void onCreate(@Nullable Bundle savedInstanceState) {
- // super.onCreate(savedInstanceState);
- // setContentView(R.layout.activity_video_player);
- // init();
- // }
- //
- // private void init() {
- // videoView = findViewById(R.id.video_player);
- // videoView.setActivity(this);
- //
- // VideoInfo info = new VideoInfo("测试", "http://10.43.111.4/88888888/16/20171218/268485555/index.m3u8?servicetype=0");
- //
- // videoView.startPlayVideo(info);
- // videoView.setBdPlayerListener(this);
- // }
- //
- // //遥控事件
- // @Override
- // public boolean onKeyDown(int keyCode, KeyEvent event) {
- // switch (keyCode) {
- // case KeyEvent.KEYCODE_DPAD_CENTER: //播放/暂停
- // playOrPause();
- // return true;
- //// case KeyEvent.KEYCODE_DPAD_LEFT:
- //// if (videoView.canSeek()) {
- //// seekBack();
- //// } else {
- //// Toast.makeText(SysVideoPlayerActivity.this, "视频准备中,暂时不能拖动快进", Toast.LENGTH_SHORT).show();
- //// }
- //// return true;
- //// case KeyEvent.KEYCODE_DPAD_RIGHT:
- //// //seekForward();
- //// if (videoView.canSeek()) {
- //// seekForward();
- //// } else {
- //// Toast.makeText(SysVideoPlayerActivity.this, "视频准备中,暂时不能拖动快进", Toast.LENGTH_SHORT).show();
- //// }
- //// return true;
- //// case KeyEvent.KEYCODE_BACK: //到顶跳到相应tab
- //// /* duduPlayer.pause();*/
- //// videoView.pause();
- //// if (!showVideoEndDialog) {
- //// if (Build.VERSION.SDK_INT > 15) {
- //// showVideoEndDialog();
- //// } else {
- //// SysVideoPlayerActivity.this.finish();
- //// }
- //// //Toast.makeText(this,"显示VideoEndDialog",Toast.LENGTH_SHORT).show();
- //// return true;
- //// } else {
- //// return false;
- //// }
- // }
- // return false;
- // }
- //
- // private void playOrPause(){
- // videoView.playOrPause();
- // }
- //
- // @Override
- // public void onComplete() {
- //
- // }
- //
- // @Override
- // protected void onStop() {
- // super.onStop();
- // if(videoView != null) {
- // videoView.onStop();
- // }
- // this.finish();
- // }
- //
- // @Override
- // protected void onDestroy() {
- // if(videoView != null) {
- // videoView.onDestroy();
- // }
- // super.onDestroy();
- // }
- //
- //}
|