SysVideoPlayerActivity.java 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. //package com.hc.webapp.video;
  2. //
  3. //import android.app.Activity;
  4. //import android.os.Build;
  5. //import android.os.Bundle;
  6. //import android.support.annotation.Nullable;
  7. //import android.view.KeyEvent;
  8. //import android.widget.Toast;
  9. //
  10. //import com.hc.sysvideo.BDVideoView;
  11. //import com.hc.webapp.R;
  12. //
  13. //public class SysVideoPlayerActivity extends Activity implements
  14. // BDVideoView.BdPlayerListener {
  15. //
  16. // private BDVideoView videoView;
  17. //
  18. // @Override
  19. // protected void onStart() {
  20. // super.onStart();
  21. // if(videoView != null) {
  22. // videoView.onStart();
  23. // }
  24. // }
  25. //
  26. // @Override
  27. // protected void onCreate(@Nullable Bundle savedInstanceState) {
  28. // super.onCreate(savedInstanceState);
  29. // setContentView(R.layout.activity_video_player);
  30. // init();
  31. // }
  32. //
  33. // private void init() {
  34. // videoView = findViewById(R.id.video_player);
  35. // videoView.setActivity(this);
  36. //
  37. // VideoInfo info = new VideoInfo("测试", "http://10.43.111.4/88888888/16/20171218/268485555/index.m3u8?servicetype=0");
  38. //
  39. // videoView.startPlayVideo(info);
  40. // videoView.setBdPlayerListener(this);
  41. // }
  42. //
  43. // //遥控事件
  44. // @Override
  45. // public boolean onKeyDown(int keyCode, KeyEvent event) {
  46. // switch (keyCode) {
  47. // case KeyEvent.KEYCODE_DPAD_CENTER: //播放/暂停
  48. // playOrPause();
  49. // return true;
  50. //// case KeyEvent.KEYCODE_DPAD_LEFT:
  51. //// if (videoView.canSeek()) {
  52. //// seekBack();
  53. //// } else {
  54. //// Toast.makeText(SysVideoPlayerActivity.this, "视频准备中,暂时不能拖动快进", Toast.LENGTH_SHORT).show();
  55. //// }
  56. //// return true;
  57. //// case KeyEvent.KEYCODE_DPAD_RIGHT:
  58. //// //seekForward();
  59. //// if (videoView.canSeek()) {
  60. //// seekForward();
  61. //// } else {
  62. //// Toast.makeText(SysVideoPlayerActivity.this, "视频准备中,暂时不能拖动快进", Toast.LENGTH_SHORT).show();
  63. //// }
  64. //// return true;
  65. //// case KeyEvent.KEYCODE_BACK: //到顶跳到相应tab
  66. //// /* duduPlayer.pause();*/
  67. //// videoView.pause();
  68. //// if (!showVideoEndDialog) {
  69. //// if (Build.VERSION.SDK_INT > 15) {
  70. //// showVideoEndDialog();
  71. //// } else {
  72. //// SysVideoPlayerActivity.this.finish();
  73. //// }
  74. //// //Toast.makeText(this,"显示VideoEndDialog",Toast.LENGTH_SHORT).show();
  75. //// return true;
  76. //// } else {
  77. //// return false;
  78. //// }
  79. // }
  80. // return false;
  81. // }
  82. //
  83. // private void playOrPause(){
  84. // videoView.playOrPause();
  85. // }
  86. //
  87. // @Override
  88. // public void onComplete() {
  89. //
  90. // }
  91. //
  92. // @Override
  93. // protected void onStop() {
  94. // super.onStop();
  95. // if(videoView != null) {
  96. // videoView.onStop();
  97. // }
  98. // this.finish();
  99. // }
  100. //
  101. // @Override
  102. // protected void onDestroy() {
  103. // if(videoView != null) {
  104. // videoView.onDestroy();
  105. // }
  106. // super.onDestroy();
  107. // }
  108. //
  109. //}