|
@@ -1,15 +1,7 @@
|
|
|
package com.miekir.eden.ui.home.goods.play;
|
|
package com.miekir.eden.ui.home.goods.play;
|
|
|
|
|
|
|
|
import android.app.Activity;
|
|
import android.app.Activity;
|
|
|
-import android.os.Bundle;
|
|
|
|
|
|
|
|
|
|
-import androidx.annotation.Nullable;
|
|
|
|
|
-
|
|
|
|
|
-import com.miekir.eden.R;
|
|
|
|
|
-import com.miekir.eden.widget.VideoPlayer;
|
|
|
|
|
-
|
|
|
|
|
-import cn.jzvd.Jzvd;
|
|
|
|
|
-import cn.jzvd.JzvdStd;
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* Copyright (C), 2019-2020, Miekir
|
|
* Copyright (C), 2019-2020, Miekir
|
|
@@ -19,44 +11,44 @@ import cn.jzvd.JzvdStd;
|
|
|
* Description: 视频播放类,这是一个全屏的界面
|
|
* Description: 视频播放类,这是一个全屏的界面
|
|
|
*/
|
|
*/
|
|
|
public class VideoPlayActivity extends Activity {
|
|
public class VideoPlayActivity extends Activity {
|
|
|
- public static final String KEY_URL = "url";
|
|
|
|
|
- public static final String KEY_TITLE = "title";
|
|
|
|
|
-
|
|
|
|
|
- @Override
|
|
|
|
|
- protected void onCreate(@Nullable Bundle savedInstanceState) {
|
|
|
|
|
- super.onCreate(savedInstanceState);
|
|
|
|
|
- setContentView(R.layout.activity_video_play);
|
|
|
|
|
-
|
|
|
|
|
- String url = getIntent().getStringExtra(KEY_URL);
|
|
|
|
|
- String title = getIntent().getStringExtra(KEY_TITLE);
|
|
|
|
|
-
|
|
|
|
|
- Jzvd.WIFI_TIP_DIALOG_SHOWED = true;
|
|
|
|
|
- // 直接播放视频
|
|
|
|
|
- VideoPlayer.setVideoPlayListener(new VideoPlayer.VideoPlayListener() {
|
|
|
|
|
- @Override
|
|
|
|
|
- public void onPlayComplete() {
|
|
|
|
|
- finish();
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- JzvdStd.setCurrentJzvd(VideoPlayer.CURRENT_JZVD);
|
|
|
|
|
- JzvdStd.startFullscreenDirectly(this, VideoPlayer.class, url, title);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- @Override
|
|
|
|
|
- protected void onPause() {
|
|
|
|
|
- super.onPause();
|
|
|
|
|
- Jzvd.releaseAllVideos();
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- @Override
|
|
|
|
|
- public void onBackPressed() {
|
|
|
|
|
- Jzvd.backPress();
|
|
|
|
|
- super.onBackPressed();
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- @Override
|
|
|
|
|
- protected void onDestroy() {
|
|
|
|
|
- super.onDestroy();
|
|
|
|
|
- VideoPlayer.setVideoPlayListener(null);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+// public static final String KEY_URL = "url";
|
|
|
|
|
+// public static final String KEY_TITLE = "title";
|
|
|
|
|
+//
|
|
|
|
|
+// @Override
|
|
|
|
|
+// protected void onCreate(@Nullable Bundle savedInstanceState) {
|
|
|
|
|
+// super.onCreate(savedInstanceState);
|
|
|
|
|
+// setContentView(R.layout.activity_video_play);
|
|
|
|
|
+//
|
|
|
|
|
+// String url = getIntent().getStringExtra(KEY_URL);
|
|
|
|
|
+// String title = getIntent().getStringExtra(KEY_TITLE);
|
|
|
|
|
+//
|
|
|
|
|
+// Jzvd.WIFI_TIP_DIALOG_SHOWED = true;
|
|
|
|
|
+// // 直接播放视频
|
|
|
|
|
+// VideoPlayer.setVideoPlayListener(new VideoPlayer.VideoPlayListener() {
|
|
|
|
|
+// @Override
|
|
|
|
|
+// public void onPlayComplete() {
|
|
|
|
|
+// finish();
|
|
|
|
|
+// }
|
|
|
|
|
+// });
|
|
|
|
|
+// JzvdStd.setCurrentJzvd(VideoPlayer.CURRENT_JZVD);
|
|
|
|
|
+// JzvdStd.startFullscreenDirectly(this, VideoPlayer.class, url, title);
|
|
|
|
|
+// }
|
|
|
|
|
+//
|
|
|
|
|
+// @Override
|
|
|
|
|
+// protected void onPause() {
|
|
|
|
|
+// super.onPause();
|
|
|
|
|
+// Jzvd.releaseAllVideos();
|
|
|
|
|
+// }
|
|
|
|
|
+//
|
|
|
|
|
+// @Override
|
|
|
|
|
+// public void onBackPressed() {
|
|
|
|
|
+// Jzvd.backPress();
|
|
|
|
|
+// super.onBackPressed();
|
|
|
|
|
+// }
|
|
|
|
|
+//
|
|
|
|
|
+// @Override
|
|
|
|
|
+// protected void onDestroy() {
|
|
|
|
|
+// super.onDestroy();
|
|
|
|
|
+// VideoPlayer.setVideoPlayListener(null);
|
|
|
|
|
+// }
|
|
|
}
|
|
}
|