From 2f7a9184c1503bd0b536ed2c7570e652a771c027 Mon Sep 17 00:00:00 2001
From: I
Date: Tue, 19 Mar 2019 01:54:11 +0800
Subject: [PATCH 01/33] qa
---
README-ZH.md | 1 +
README.md | 1 +
2 files changed, 2 insertions(+)
diff --git a/README-ZH.md b/README-ZH.md
index 348b9a20..8879b483 100644
--- a/README-ZH.md
+++ b/README-ZH.md
@@ -129,6 +129,7 @@ protected void onPause() {
1. [熊晓清](http://blog.csdn.net/yaya_xiong) QQ:137048616
2. [の伤也快乐](https://github.com/jmhjmh) QQ:466278628
+3. [吴亚男]() QQ:623562486
* [wiki整理](https://github.com/lipangit/JiaoZiVideoPlayer/wiki#wiki%E6%95%B4%E7%90%86)
diff --git a/README.md b/README.md
index 06c54efc..fb7c6e25 100644
--- a/README.md
+++ b/README.md
@@ -117,6 +117,7 @@ protected void onPause() {
1. [熊晓清](http://blog.csdn.net/yaya_xiong) QQ:137048616
2. [の伤也快乐](https://github.com/jmhjmh) QQ:466278628
+3. [吴亚男]() QQ:623562486
## Reward
From a368fea6ffb388c28ef41130d8a7967c55ec6fc5 Mon Sep 17 00:00:00 2001
From: I
Date: Mon, 25 Mar 2019 05:48:44 +0800
Subject: [PATCH 02/33] fix ui
---
app/src/main/res/layout/activity_api_rotation_videosize.xml | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/app/src/main/res/layout/activity_api_rotation_videosize.xml b/app/src/main/res/layout/activity_api_rotation_videosize.xml
index 4e7b43ca..cc21d47d 100644
--- a/app/src/main/res/layout/activity_api_rotation_videosize.xml
+++ b/app/src/main/res/layout/activity_api_rotation_videosize.xml
@@ -10,7 +10,8 @@
+ android:layout_height="wrap_content"
+ android:orientation="vertical">
Date: Mon, 25 Mar 2019 06:00:41 +0800
Subject: [PATCH 03/33] minify enable
---
app/build.gradle | 2 +-
jiaozivideoplayer/build.gradle | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/build.gradle b/app/build.gradle
index 44bd5a17..2dd262bb 100755
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -20,7 +20,7 @@ android {
}
buildTypes {
release {
- minifyEnabled false
+ minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.releaseConfig
}
diff --git a/jiaozivideoplayer/build.gradle b/jiaozivideoplayer/build.gradle
index d6415e24..e56330b6 100644
--- a/jiaozivideoplayer/build.gradle
+++ b/jiaozivideoplayer/build.gradle
@@ -11,7 +11,7 @@ android {
}
buildTypes {
release {
- minifyEnabled false
+ minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
From 18c38552752e865320615e1566629936e61db88d Mon Sep 17 00:00:00 2001
From: I
Date: Tue, 26 Mar 2019 07:15:29 +0800
Subject: [PATCH 04/33] attach importent
---
.../src/main/java/cn/jzvd/JZDataSource.java | 4 +++
.../src/main/java/cn/jzvd/Jzvd.java | 25 +++++++++++++++++++
2 files changed, 29 insertions(+)
diff --git a/jiaozivideoplayer/src/main/java/cn/jzvd/JZDataSource.java b/jiaozivideoplayer/src/main/java/cn/jzvd/JZDataSource.java
index 7d392901..da270815 100644
--- a/jiaozivideoplayer/src/main/java/cn/jzvd/JZDataSource.java
+++ b/jiaozivideoplayer/src/main/java/cn/jzvd/JZDataSource.java
@@ -79,4 +79,8 @@ public boolean containsTheUrl(Object object) {
}
return false;
}
+
+ public JZDataSource cloneMe() {
+ return new JZDataSource(urlsMap, title);
+ }
}
diff --git a/jiaozivideoplayer/src/main/java/cn/jzvd/Jzvd.java b/jiaozivideoplayer/src/main/java/cn/jzvd/Jzvd.java
index 3751fe40..3155272b 100644
--- a/jiaozivideoplayer/src/main/java/cn/jzvd/Jzvd.java
+++ b/jiaozivideoplayer/src/main/java/cn/jzvd/Jzvd.java
@@ -24,6 +24,7 @@
import android.widget.Toast;
import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
import java.util.LinkedList;
import java.util.Timer;
import java.util.TimerTask;
@@ -828,6 +829,27 @@ public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
}
}
+ public Jzvd cloneMe() {
+ Jzvd jzvd = null;
+ try {
+ Constructor constructor = (Constructor) Jzvd.this.getClass().getConstructor(Context.class);
+ jzvd = constructor.newInstance(getContext());
+ jzvd.jzDataSource = jzDataSource.cloneMe();//jzvd应该是idle状态
+ } catch (IllegalAccessException e) {
+ e.printStackTrace();
+ } catch (InstantiationException e) {
+ e.printStackTrace();
+ } catch (InvocationTargetException e) {
+ e.printStackTrace();
+ } catch (NoSuchMethodException e) {
+ e.printStackTrace();
+ }
+// FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(
+// ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
+// vp.addView(jzvd, lp);
+ return jzvd;
+ }
+
/**
* 这个仅仅是一个如何进入小窗的例子
*/
@@ -837,6 +859,7 @@ public void gotoScreenTiny() {
return;
ViewGroup vg = (ViewGroup) getParent();
vg.removeView(this);
+ vg.addView(cloneMe());
CONTAINER_LIST.add(vg);
vg = (ViewGroup) (JZUtils.scanForActivity(getContext())).getWindow().getDecorView();//和他也没有关系
FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(400, 400);
@@ -848,6 +871,7 @@ public void gotoScreenTiny() {
public void gotoScreenFullscreen() {
ViewGroup vg = (ViewGroup) getParent();
vg.removeView(this);
+ vg.addView(cloneMe());
CONTAINER_LIST.add(vg);
vg = (ViewGroup) (JZUtils.scanForActivity(getContext())).getWindow().getDecorView();//和他也没有关系
vg.addView(this, new FrameLayout.LayoutParams(
@@ -864,6 +888,7 @@ public void gotoScreenFullscreen() {
public void gotoScreenNormal() {//goback本质上是goto
ViewGroup vg = (ViewGroup) (JZUtils.scanForActivity(getContext())).getWindow().getDecorView();
vg.removeView(this);
+ CONTAINER_LIST.getLast().removeAllViews();
CONTAINER_LIST.getLast().addView(this, new FrameLayout.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
CONTAINER_LIST.pop();
From 8df7eaa101c659e2facb626e8dfd55cea09da893 Mon Sep 17 00:00:00 2001
From: I
Date: Tue, 26 Mar 2019 17:39:29 +0800
Subject: [PATCH 05/33] attach
---
jiaozivideoplayer/src/main/java/cn/jzvd/Jzvd.java | 1 +
1 file changed, 1 insertion(+)
diff --git a/jiaozivideoplayer/src/main/java/cn/jzvd/Jzvd.java b/jiaozivideoplayer/src/main/java/cn/jzvd/Jzvd.java
index 3155272b..cf557027 100644
--- a/jiaozivideoplayer/src/main/java/cn/jzvd/Jzvd.java
+++ b/jiaozivideoplayer/src/main/java/cn/jzvd/Jzvd.java
@@ -835,6 +835,7 @@ public Jzvd cloneMe() {
Constructor constructor = (Constructor) Jzvd.this.getClass().getConstructor(Context.class);
jzvd = constructor.newInstance(getContext());
jzvd.jzDataSource = jzDataSource.cloneMe();//jzvd应该是idle状态
+// jzvd.setId(getId());
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InstantiationException e) {
From c4d2686137066b66b46fa686473ff67bf7efcf48 Mon Sep 17 00:00:00 2001
From: I
Date: Wed, 27 Mar 2019 05:35:35 +0800
Subject: [PATCH 06/33] goback fullscreen in listview
---
jiaozivideoplayer/src/main/java/cn/jzvd/Jzvd.java | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/jiaozivideoplayer/src/main/java/cn/jzvd/Jzvd.java b/jiaozivideoplayer/src/main/java/cn/jzvd/Jzvd.java
index cf557027..953b84ca 100644
--- a/jiaozivideoplayer/src/main/java/cn/jzvd/Jzvd.java
+++ b/jiaozivideoplayer/src/main/java/cn/jzvd/Jzvd.java
@@ -123,6 +123,10 @@ public void onAudioFocusChange(int focusChange) {
protected int mGestureDownVolume;
protected float mGestureDownBrightness;
protected long mSeekTimePosition;
+ /**
+ * liestview中,退出全屏也会导致列表getview->setUp,这个变量要屏蔽这个过程
+ **/
+ protected long gobakFullscreenTime = 0;
public Jzvd(Context context) {
super(context);
@@ -314,14 +318,11 @@ public void setUp(JZDataSource jzDataSource, int screen) {
}
public void setUp(JZDataSource jzDataSource, int screen, JZMediaInterface jzMediaInterface) {
-// if (this.jzDataSource != null && jzDataSource.getCurrentUrl() != null &&
-// this.jzDataSource.containsTheUrl(jzDataSource.getCurrentUrl())) {
-// return;
-// }
+ if ((System.currentTimeMillis() - gobakFullscreenTime) < 200) return;
+
this.jzDataSource = jzDataSource;
this.currentScreen = screen;
onStateNormal();
-
mediaInterface = jzMediaInterface;//这个位置可能需要调整
}
@@ -835,7 +836,7 @@ public Jzvd cloneMe() {
Constructor constructor = (Constructor) Jzvd.this.getClass().getConstructor(Context.class);
jzvd = constructor.newInstance(getContext());
jzvd.jzDataSource = jzDataSource.cloneMe();//jzvd应该是idle状态
-// jzvd.setId(getId());
+ jzvd.setId(getId());
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InstantiationException e) {
@@ -887,6 +888,7 @@ public void gotoScreenFullscreen() {
}
public void gotoScreenNormal() {//goback本质上是goto
+ gobakFullscreenTime = System.currentTimeMillis();
ViewGroup vg = (ViewGroup) (JZUtils.scanForActivity(getContext())).getWindow().getDecorView();
vg.removeView(this);
CONTAINER_LIST.getLast().removeAllViews();
From 9802f17c7ab3901628872ae7baf858956bffc3da Mon Sep 17 00:00:00 2001
From: I
Date: Wed, 27 Mar 2019 09:41:26 +0800
Subject: [PATCH 07/33] goto and quit tiny in listview
---
.../java/cn/jzvd/demo/ActivityTinyWindow.java | 4 +--
.../ActivityTinyWindowListViewNormal.java | 23 ++++++++++++-
.../main/res/layout/activity_tiny_window.xml | 18 +++++-----
app/src/main/res/layout/item_videoview.xml | 2 +-
.../src/main/java/cn/jzvd/Jzvd.java | 33 ++-----------------
5 files changed, 37 insertions(+), 43 deletions(-)
diff --git a/app/src/main/java/cn/jzvd/demo/ActivityTinyWindow.java b/app/src/main/java/cn/jzvd/demo/ActivityTinyWindow.java
index aef810a1..1c398076 100644
--- a/app/src/main/java/cn/jzvd/demo/ActivityTinyWindow.java
+++ b/app/src/main/java/cn/jzvd/demo/ActivityTinyWindow.java
@@ -1,5 +1,6 @@
package cn.jzvd.demo;
+import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
@@ -70,8 +71,7 @@ public void clickTinyWindow(View view) {
}
public void clickAutoTinyListView(View view) {
- Toast.makeText(this, "comming soon", Toast.LENGTH_SHORT).show();
-// startActivity(new Intent(this, ActivityTinyWindowListViewNormal.class));
+ startActivity(new Intent(this, ActivityTinyWindowListViewNormal.class));
}
public void clickAutoTinyListViewMultiHolder(View view) {
diff --git a/app/src/main/java/cn/jzvd/demo/ActivityTinyWindowListViewNormal.java b/app/src/main/java/cn/jzvd/demo/ActivityTinyWindowListViewNormal.java
index 5ec7c776..fee9759d 100644
--- a/app/src/main/java/cn/jzvd/demo/ActivityTinyWindowListViewNormal.java
+++ b/app/src/main/java/cn/jzvd/demo/ActivityTinyWindowListViewNormal.java
@@ -3,6 +3,7 @@
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
+import android.util.Log;
import android.view.MenuItem;
import android.widget.AbsListView;
import android.widget.ListView;
@@ -41,7 +42,27 @@ public void onScrollStateChanged(AbsListView view, int scrollState) {
@Override
public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
-// Jzvd.onScrollAutoTiny(view, firstVisibleItem, visibleItemCount, totalItemCount);
+ int lastVisibleItem = firstVisibleItem + visibleItemCount;
+ Jzvd jzvd = Jzvd.CURRENT_JZVD;
+ if (jzvd == null) return;
+ int currentPlayPosition = jzvd.positionInList;
+ if (currentPlayPosition >= 0) {
+ if ((currentPlayPosition < firstVisibleItem || currentPlayPosition > (lastVisibleItem - 1))) {
+ if (jzvd.currentState == Jzvd.CURRENT_STATE_PAUSE) {
+ Jzvd.resetAllVideos();
+ } else {
+ Log.e("jzvd", "onScroll: out screen");
+ if (jzvd.currentScreen != Jzvd.SCREEN_WINDOW_TINY) {
+ jzvd.gotoScreenTiny();
+ }
+ }
+ } else {
+ if (jzvd.currentScreen == Jzvd.SCREEN_WINDOW_TINY) {
+ Log.e("jzvd", "onScroll: into screen");
+ Jzvd.backPress();
+ }
+ }
+ }
}
});
}
diff --git a/app/src/main/res/layout/activity_tiny_window.xml b/app/src/main/res/layout/activity_tiny_window.xml
index 620e33fb..144a8859 100644
--- a/app/src/main/res/layout/activity_tiny_window.xml
+++ b/app/src/main/res/layout/activity_tiny_window.xml
@@ -14,15 +14,6 @@
android:layout_height="wrap_content"
android:orientation="vertical">
-
-
-
-
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/item_videoview.xml b/app/src/main/res/layout/item_videoview.xml
index b4a22a0c..c3a0f235 100755
--- a/app/src/main/res/layout/item_videoview.xml
+++ b/app/src/main/res/layout/item_videoview.xml
@@ -11,7 +11,7 @@
+ android:layout_height="match_parent" />
diff --git a/jiaozivideoplayer/src/main/java/cn/jzvd/Jzvd.java b/jiaozivideoplayer/src/main/java/cn/jzvd/Jzvd.java
index 953b84ca..aa5ad692 100644
--- a/jiaozivideoplayer/src/main/java/cn/jzvd/Jzvd.java
+++ b/jiaozivideoplayer/src/main/java/cn/jzvd/Jzvd.java
@@ -165,31 +165,7 @@ public static void goOnPlayOnResume() {
}
}
- // public static void onScrollAutoTiny(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
-// int lastVisibleItem = firstVisibleItem + visibleItemCount;
-// int currentPlayPosition = JZMediaPlayer.instance().positionInList;
-// if (currentPlayPosition >= 0) {
-// if ((currentPlayPosition < firstVisibleItem || currentPlayPosition > (lastVisibleItem - 1))) {
-// if (JzvdMgr.getCurrentJzvd() != null &&
-// JzvdMgr.getCurrentJzvd().currentScreen != Jzvd.SCREEN_WINDOW_TINY &&
-// JzvdMgr.getCurrentJzvd().currentScreen != Jzvd.SCREEN_WINDOW_FULLSCREEN) {
-// if (JzvdMgr.getCurrentJzvd().currentState == Jzvd.CURRENT_STATE_PAUSE) {
-// Jzvd.resetAllVideos();
-// } else {
-// Log.e(TAG, "onScroll: out screen");
-// JzvdMgr.getCurrentJzvd().startWindowTiny();
-// }
-// }
-// } else {
-// if (JzvdMgr.getCurrentJzvd() != null &&
-// JzvdMgr.getCurrentJzvd().currentScreen == Jzvd.SCREEN_WINDOW_TINY) {
-// Log.e(TAG, "onScroll: into screen");
-// Jzvd.backPress();
-// }
-// }
-// }
-// }
-//
+
public static void onScrollReleaseAllVideos(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
//以后这种功能不要写在jzvd里了,让用户看看详细的也能更了解
@@ -846,9 +822,6 @@ public Jzvd cloneMe() {
} catch (NoSuchMethodException e) {
e.printStackTrace();
}
-// FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(
-// ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
-// vp.addView(jzvd, lp);
return jzvd;
}
@@ -863,10 +836,10 @@ public void gotoScreenTiny() {
vg.removeView(this);
vg.addView(cloneMe());
CONTAINER_LIST.add(vg);
- vg = (ViewGroup) (JZUtils.scanForActivity(getContext())).getWindow().getDecorView();//和他也没有关系
+ ViewGroup vgg = (ViewGroup) (JZUtils.scanForActivity(getContext())).getWindow().getDecorView();//和他也没有关系
FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(400, 400);
lp.gravity = Gravity.RIGHT | Gravity.BOTTOM;
- vg.addView(this, lp);
+ vgg.addView(this, lp);
setScreenTiny();
}
From c190cc37e337529135ce08ac0be37b2882a48243 Mon Sep 17 00:00:00 2001
From: I
Date: Wed, 27 Mar 2019 11:07:28 +0800
Subject: [PATCH 08/33] tinywindow xml
---
.../main/res/layout/activity_tiny_window.xml | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/app/src/main/res/layout/activity_tiny_window.xml b/app/src/main/res/layout/activity_tiny_window.xml
index 144a8859..44d02aaa 100644
--- a/app/src/main/res/layout/activity_tiny_window.xml
+++ b/app/src/main/res/layout/activity_tiny_window.xml
@@ -14,6 +14,15 @@
android:layout_height="wrap_content"
android:orientation="vertical">
+
+
+
+
-
-
-
\ No newline at end of file
From 3c959c1f57e63a2da87584634df72ba1143d7211 Mon Sep 17 00:00:00 2001
From: I
Date: Wed, 27 Mar 2019 12:40:18 +0800
Subject: [PATCH 09/33] make tiny a class
---
.../main/java/cn/jzvd/demo/ActivityApi.java | 4 +-
.../java/cn/jzvd/demo/ActivityTinyWindow.java | 11 +--
.../ActivityTinyWindowListViewNormal.java | 2 +-
.../cn/jzvd/demo/AdapterVideoListTiny.java | 77 +++++++++++++++++++
.../demo/CustomJzvd/JzvdStdTinyWindow.java | 59 ++++++++++++++
.../main/res/layout/activity_tiny_window.xml | 2 +-
.../main/res/layout/item_videoview_tiny.xml | 18 +++++
.../src/main/java/cn/jzvd/Jzvd.java | 18 +----
.../src/main/java/cn/jzvd/JzvdStd.java | 2 +-
9 files changed, 167 insertions(+), 26 deletions(-)
create mode 100644 app/src/main/java/cn/jzvd/demo/AdapterVideoListTiny.java
create mode 100644 app/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdTinyWindow.java
create mode 100644 app/src/main/res/layout/item_videoview_tiny.xml
diff --git a/app/src/main/java/cn/jzvd/demo/ActivityApi.java b/app/src/main/java/cn/jzvd/demo/ActivityApi.java
index 8e8a94a5..5764bb55 100644
--- a/app/src/main/java/cn/jzvd/demo/ActivityApi.java
+++ b/app/src/main/java/cn/jzvd/demo/ActivityApi.java
@@ -55,12 +55,12 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
mJzvdStd.setUp(jzDataSource
, JzvdStd.SCREEN_NORMAL);
Glide.with(this).load(VideoConstant.videoThumbList[0]).into(mJzvdStd.thumbImageView);
-// mJzvdStd.seekToInAdvance = 20000;
+// jzvdStdTinyWindow.seekToInAdvance = 20000;
//JZVideoPlayer.SAVE_PROGRESS = false;
/** Play video in local path, eg:record by system camera **/
// cpAssertVideoToLocalPath();
-// mJzvdStd.setUp(Environment.getExternalStorageDirectory().getAbsolutePath() + "/DCIM/Camera/local_video.mp4"
+// jzvdStdTinyWindow.setUp(Environment.getExternalStorageDirectory().getAbsolutePath() + "/DCIM/Camera/local_video.mp4"
// , "饺子不信", Jzvd.SCREEN_NORMAL);
mSensorManager = (SensorManager) getSystemService(SENSOR_SERVICE);
mSensorEventListener = new Jzvd.JZAutoFullscreenListener();
diff --git a/app/src/main/java/cn/jzvd/demo/ActivityTinyWindow.java b/app/src/main/java/cn/jzvd/demo/ActivityTinyWindow.java
index 1c398076..84f334c9 100644
--- a/app/src/main/java/cn/jzvd/demo/ActivityTinyWindow.java
+++ b/app/src/main/java/cn/jzvd/demo/ActivityTinyWindow.java
@@ -12,6 +12,7 @@
import cn.jzvd.Jzvd;
import cn.jzvd.JzvdStd;
+import cn.jzvd.demo.CustomJzvd.JzvdStdTinyWindow;
/**
* Created by Nathen on 2017/10/31.
@@ -19,7 +20,7 @@
public class ActivityTinyWindow extends AppCompatActivity {
- JzvdStd mJzvdStd;
+ JzvdStdTinyWindow jzvdStdTinyWindow;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
@@ -31,12 +32,12 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
getSupportActionBar().setTitle("TinyWindow");
setContentView(R.layout.activity_tiny_window);
- mJzvdStd = findViewById(R.id.jz_video);
- mJzvdStd.setUp("http://jzvd.nathen.cn/342a5f7ef6124a4a8faf00e738b8bee4/cf6d9db0bd4d41f59d09ea0a81e918fd-5287d2089db37e62345123a1be272f8b.mp4", "饺子快长大"
+ jzvdStdTinyWindow = findViewById(R.id.jz_video);
+ jzvdStdTinyWindow.setUp("http://jzvd.nathen.cn/342a5f7ef6124a4a8faf00e738b8bee4/cf6d9db0bd4d41f59d09ea0a81e918fd-5287d2089db37e62345123a1be272f8b.mp4", "饺子快长大"
, JzvdStd.SCREEN_NORMAL);
Glide.with(this)
.load("http://jzvd-pic.nathen.cn/jzvd-pic/1bb2ebbe-140d-4e2e-abd2-9e7e564f71ac.png")
- .into(mJzvdStd.thumbImageView);
+ .into(jzvdStdTinyWindow.thumbImageView);
}
@@ -67,7 +68,7 @@ public boolean onOptionsItemSelected(MenuItem item) {
public void clickTinyWindow(View view) {
- mJzvdStd.gotoScreenTiny();
+ jzvdStdTinyWindow.gotoScreenTiny();
}
public void clickAutoTinyListView(View view) {
diff --git a/app/src/main/java/cn/jzvd/demo/ActivityTinyWindowListViewNormal.java b/app/src/main/java/cn/jzvd/demo/ActivityTinyWindowListViewNormal.java
index fee9759d..74b6c6d7 100644
--- a/app/src/main/java/cn/jzvd/demo/ActivityTinyWindowListViewNormal.java
+++ b/app/src/main/java/cn/jzvd/demo/ActivityTinyWindowListViewNormal.java
@@ -29,7 +29,7 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
setContentView(R.layout.activity_listview_normal_auto_tiny);
listView = findViewById(R.id.listview);
- listView.setAdapter(new AdapterVideoList(this,
+ listView.setAdapter(new AdapterVideoListTiny(this,
VideoConstant.videoUrls[0],
VideoConstant.videoTitles[0],
VideoConstant.videoThumbs[0]));
diff --git a/app/src/main/java/cn/jzvd/demo/AdapterVideoListTiny.java b/app/src/main/java/cn/jzvd/demo/AdapterVideoListTiny.java
new file mode 100644
index 00000000..3e25d2ed
--- /dev/null
+++ b/app/src/main/java/cn/jzvd/demo/AdapterVideoListTiny.java
@@ -0,0 +1,77 @@
+package cn.jzvd.demo;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseAdapter;
+
+import com.bumptech.glide.Glide;
+
+import cn.jzvd.Jzvd;
+import cn.jzvd.JzvdStd;
+import cn.jzvd.demo.CustomJzvd.JzvdStdTinyWindow;
+
+/**
+ * Created by Nathen
+ * On 2019/03/27 11:38
+ */
+public class AdapterVideoListTiny extends BaseAdapter {
+
+ public static final String TAG = "JZVD";
+
+ Context context;
+
+ String[] videoUrls;
+ String[] videoTitles;
+ String[] videoThumbs;
+
+ public AdapterVideoListTiny(Context context, String[] videoUrls, String[] videoTitles, String[] videoThumbs) {
+ this.context = context;
+ this.videoUrls = videoUrls;
+ this.videoTitles = videoTitles;
+ this.videoThumbs = videoThumbs;
+ }
+
+ @Override
+ public int getCount() {
+ return videoUrls.length;
+ }
+
+ @Override
+ public Object getItem(int position) {
+ return null;
+ }
+
+ @Override
+ public long getItemId(int position) {
+ return position;
+ }
+
+ @Override
+ public View getView(int position, View convertView, ViewGroup parent) {
+
+ ViewHolder viewHolder;
+ if (null == convertView) {
+ viewHolder = new ViewHolder();
+ LayoutInflater mInflater = LayoutInflater.from(context);
+ convertView = mInflater.inflate(R.layout.item_videoview_tiny, null);
+ convertView.setTag(viewHolder);
+ } else {
+ viewHolder = (ViewHolder) convertView.getTag();
+ }
+ viewHolder.jzvdStd = convertView.findViewById(R.id.videoplayer);
+ viewHolder.jzvdStd.setUp(
+ videoUrls[position],
+ videoTitles[position], Jzvd.SCREEN_NORMAL);
+ Glide.with(convertView.getContext())
+ .load(videoThumbs[position])
+ .into(viewHolder.jzvdStd.thumbImageView);
+ viewHolder.jzvdStd.positionInList = position;
+ return convertView;
+ }
+
+ class ViewHolder {
+ JzvdStdTinyWindow jzvdStd;
+ }
+}
diff --git a/app/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdTinyWindow.java b/app/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdTinyWindow.java
new file mode 100644
index 00000000..44859481
--- /dev/null
+++ b/app/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdTinyWindow.java
@@ -0,0 +1,59 @@
+package cn.jzvd.demo.CustomJzvd;
+
+import android.content.Context;
+import android.util.AttributeSet;
+import android.util.Log;
+import android.view.Gravity;
+import android.view.ViewGroup;
+import android.widget.FrameLayout;
+
+import cn.jzvd.JZDataSource;
+import cn.jzvd.JZMediaInterface;
+import cn.jzvd.JZUtils;
+import cn.jzvd.JzvdStd;
+
+/**
+ * 这个类里详细定义了进入小窗的方式,进入小窗之后小窗的操作等
+ */
+public class JzvdStdTinyWindow extends JzvdStd {
+ public JzvdStdTinyWindow(Context context) {
+ super(context);
+ }
+
+ public JzvdStdTinyWindow(Context context, AttributeSet attrs) {
+ super(context, attrs);
+ }
+
+ @Override
+ public void setUp(JZDataSource jzDataSource, int screen, JZMediaInterface jzMediaInterface) {
+ //滑动列表的时候
+ //如果滑动过快,setUp在scroll之前生效
+ //setUp是原来的url 不是原来的url
+
+ //滑出去 快速 慢速
+ if (jzDataSource.getCurrentUrl().equals(CURRENT_JZVD.jzDataSource.getCurrentUrl())) {
+ //正在播放滑动过快,如果这个正式当前正在播放的url
+
+
+ }
+
+ super.setUp(jzDataSource, screen, jzMediaInterface);
+ }
+
+ @Override
+ public void gotoScreenTiny() {
+ super.gotoScreenTiny();
+ Log.i(TAG, "startWindowTiny " + " [" + this.hashCode() + "] ");
+ if (currentState == CURRENT_STATE_NORMAL || currentState == CURRENT_STATE_ERROR || currentState == CURRENT_STATE_AUTO_COMPLETE)
+ return;
+ ViewGroup vg = (ViewGroup) getParent();
+ vg.removeView(this);
+ vg.addView(cloneMe());
+ CONTAINER_LIST.add(vg);
+ ViewGroup vgg = (ViewGroup) (JZUtils.scanForActivity(getContext())).getWindow().getDecorView();//和他也没有关系
+ FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(400, 400);
+ lp.gravity = Gravity.RIGHT | Gravity.BOTTOM;
+ vgg.addView(this, lp);
+ setScreenTiny();
+ }
+}
diff --git a/app/src/main/res/layout/activity_tiny_window.xml b/app/src/main/res/layout/activity_tiny_window.xml
index 44d02aaa..098c4931 100644
--- a/app/src/main/res/layout/activity_tiny_window.xml
+++ b/app/src/main/res/layout/activity_tiny_window.xml
@@ -18,7 +18,7 @@
android:layout_width="match_parent"
android:layout_height="200dp">
-
diff --git a/app/src/main/res/layout/item_videoview_tiny.xml b/app/src/main/res/layout/item_videoview_tiny.xml
new file mode 100644
index 00000000..781fa6a3
--- /dev/null
+++ b/app/src/main/res/layout/item_videoview_tiny.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/jiaozivideoplayer/src/main/java/cn/jzvd/Jzvd.java b/jiaozivideoplayer/src/main/java/cn/jzvd/Jzvd.java
index aa5ad692..a3f75d43 100644
--- a/jiaozivideoplayer/src/main/java/cn/jzvd/Jzvd.java
+++ b/jiaozivideoplayer/src/main/java/cn/jzvd/Jzvd.java
@@ -825,22 +825,8 @@ public Jzvd cloneMe() {
return jzvd;
}
- /**
- * 这个仅仅是一个如何进入小窗的例子
- */
public void gotoScreenTiny() {
- Log.i(TAG, "startWindowTiny " + " [" + this.hashCode() + "] ");
- if (currentState == CURRENT_STATE_NORMAL || currentState == CURRENT_STATE_ERROR || currentState == CURRENT_STATE_AUTO_COMPLETE)
- return;
- ViewGroup vg = (ViewGroup) getParent();
- vg.removeView(this);
- vg.addView(cloneMe());
- CONTAINER_LIST.add(vg);
- ViewGroup vgg = (ViewGroup) (JZUtils.scanForActivity(getContext())).getWindow().getDecorView();//和他也没有关系
- FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(400, 400);
- lp.gravity = Gravity.RIGHT | Gravity.BOTTOM;
- vgg.addView(this, lp);
- setScreenTiny();
+
}
public void gotoScreenFullscreen() {
@@ -861,7 +847,7 @@ public void gotoScreenFullscreen() {
}
public void gotoScreenNormal() {//goback本质上是goto
- gobakFullscreenTime = System.currentTimeMillis();
+ gobakFullscreenTime = System.currentTimeMillis();//退出全屏
ViewGroup vg = (ViewGroup) (JZUtils.scanForActivity(getContext())).getWindow().getDecorView();
vg.removeView(this);
CONTAINER_LIST.getLast().removeAllViews();
diff --git a/jiaozivideoplayer/src/main/java/cn/jzvd/JzvdStd.java b/jiaozivideoplayer/src/main/java/cn/jzvd/JzvdStd.java
index 4838ef6d..03b03b2e 100644
--- a/jiaozivideoplayer/src/main/java/cn/jzvd/JzvdStd.java
+++ b/jiaozivideoplayer/src/main/java/cn/jzvd/JzvdStd.java
@@ -118,7 +118,7 @@ public void setUp(JZDataSource jzDataSource, int screen, JZMediaInterface jzMedi
super.setUp(jzDataSource, screen, jzMediaInterface);
titleTextView.setText(jzDataSource.title);
setScreen(screen);
-// if (Jzvd.CURRENT_JZVD == null) return;
+ // if (Jzvd.CURRENT_JZVD == null) return; 这是保存进度
// if (jzDataSource.containsTheUrl(Jzvd.CURRENT_JZVD.jzDataSource.getCurrentUrl())) {
// long position = 0;
// try {
From a947cffc2f730a6a663bd29730a5dbca6cc13b84 Mon Sep 17 00:00:00 2001
From: I
Date: Wed, 27 Mar 2019 14:36:30 +0800
Subject: [PATCH 10/33] give up tiny window in listview
---
app/src/main/AndroidManifest.xml | 8 -
.../java/cn/jzvd/demo/ActivityTinyWindow.java | 10 --
...ActivityTinyWindowListViewMultiHolder.java | 158 ------------------
.../ActivityTinyWindowListViewNormal.java | 93 -----------
.../cn/jzvd/demo/AdapterVideoListTiny.java | 77 ---------
.../demo/CustomJzvd/JzvdStdTinyWindow.java | 28 +++-
.../activity_listview_normal_auto_tiny.xml | 13 --
.../main/res/layout/activity_tiny_window.xml | 90 ++++------
.../main/res/layout/item_videoview_tiny.xml | 18 --
.../src/main/java/cn/jzvd/Jzvd.java | 4 +-
10 files changed, 56 insertions(+), 443 deletions(-)
delete mode 100644 app/src/main/java/cn/jzvd/demo/ActivityTinyWindowListViewMultiHolder.java
delete mode 100644 app/src/main/java/cn/jzvd/demo/ActivityTinyWindowListViewNormal.java
delete mode 100644 app/src/main/java/cn/jzvd/demo/AdapterVideoListTiny.java
delete mode 100644 app/src/main/res/layout/activity_listview_normal_auto_tiny.xml
delete mode 100644 app/src/main/res/layout/item_videoview_tiny.xml
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index de59e3b9..836df031 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -37,10 +37,6 @@
android:name=".ActivityListViewNormal"
android:configChanges="orientation|screenSize|keyboardHidden"
android:screenOrientation="portrait" />
-
-
= 0) {
- if ((currentPlayPosition < firstVisibleItem || currentPlayPosition > (lastVisibleItem - 1))) {
- if (jzvd.currentState == Jzvd.CURRENT_STATE_PAUSE) {
- Jzvd.resetAllVideos();
- } else {
- Log.e("jzvd", "onScroll: out screen");
- if (jzvd.currentScreen != Jzvd.SCREEN_WINDOW_TINY) {
- jzvd.gotoScreenTiny();
- }
- }
- } else {
- if (jzvd.currentScreen == Jzvd.SCREEN_WINDOW_TINY) {
- Log.e("jzvd", "onScroll: into screen");
- Jzvd.backPress();
- }
- }
- }
- }
- });
- }
-
- @Override
- public void onBackPressed() {
- if (Jzvd.backPress()) {
- return;
- }
- super.onBackPressed();
- }
-
- @Override
- protected void onPause() {
- super.onPause();
- Jzvd.resetAllVideos();
- }
-
- @Override
- public boolean onOptionsItemSelected(MenuItem item) {
- switch (item.getItemId()) {
- case android.R.id.home:
- finish();
- break;
- }
- return super.onOptionsItemSelected(item);
- }
-}
diff --git a/app/src/main/java/cn/jzvd/demo/AdapterVideoListTiny.java b/app/src/main/java/cn/jzvd/demo/AdapterVideoListTiny.java
deleted file mode 100644
index 3e25d2ed..00000000
--- a/app/src/main/java/cn/jzvd/demo/AdapterVideoListTiny.java
+++ /dev/null
@@ -1,77 +0,0 @@
-package cn.jzvd.demo;
-
-import android.content.Context;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.BaseAdapter;
-
-import com.bumptech.glide.Glide;
-
-import cn.jzvd.Jzvd;
-import cn.jzvd.JzvdStd;
-import cn.jzvd.demo.CustomJzvd.JzvdStdTinyWindow;
-
-/**
- * Created by Nathen
- * On 2019/03/27 11:38
- */
-public class AdapterVideoListTiny extends BaseAdapter {
-
- public static final String TAG = "JZVD";
-
- Context context;
-
- String[] videoUrls;
- String[] videoTitles;
- String[] videoThumbs;
-
- public AdapterVideoListTiny(Context context, String[] videoUrls, String[] videoTitles, String[] videoThumbs) {
- this.context = context;
- this.videoUrls = videoUrls;
- this.videoTitles = videoTitles;
- this.videoThumbs = videoThumbs;
- }
-
- @Override
- public int getCount() {
- return videoUrls.length;
- }
-
- @Override
- public Object getItem(int position) {
- return null;
- }
-
- @Override
- public long getItemId(int position) {
- return position;
- }
-
- @Override
- public View getView(int position, View convertView, ViewGroup parent) {
-
- ViewHolder viewHolder;
- if (null == convertView) {
- viewHolder = new ViewHolder();
- LayoutInflater mInflater = LayoutInflater.from(context);
- convertView = mInflater.inflate(R.layout.item_videoview_tiny, null);
- convertView.setTag(viewHolder);
- } else {
- viewHolder = (ViewHolder) convertView.getTag();
- }
- viewHolder.jzvdStd = convertView.findViewById(R.id.videoplayer);
- viewHolder.jzvdStd.setUp(
- videoUrls[position],
- videoTitles[position], Jzvd.SCREEN_NORMAL);
- Glide.with(convertView.getContext())
- .load(videoThumbs[position])
- .into(viewHolder.jzvdStd.thumbImageView);
- viewHolder.jzvdStd.positionInList = position;
- return convertView;
- }
-
- class ViewHolder {
- JzvdStdTinyWindow jzvdStd;
- }
-}
diff --git a/app/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdTinyWindow.java b/app/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdTinyWindow.java
index 44859481..fd930439 100644
--- a/app/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdTinyWindow.java
+++ b/app/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdTinyWindow.java
@@ -29,12 +29,34 @@ public void setUp(JZDataSource jzDataSource, int screen, JZMediaInterface jzMedi
//滑动列表的时候
//如果滑动过快,setUp在scroll之前生效
//setUp是原来的url 不是原来的url
+ //这个是clone出来的
- //滑出去 快速 慢速
- if (jzDataSource.getCurrentUrl().equals(CURRENT_JZVD.jzDataSource.getCurrentUrl())) {
- //正在播放滑动过快,如果这个正式当前正在播放的url
+ //滑出去进入小窗, 当前的url和正在播放的url不一样,
+// if (!jzDataSource.containsTheUrl(CURRENT_JZVD.jzDataSource.getCurrentUrl())) {
+// //进入小窗
+// gotoScreenTiny();
+// }
+ //滑进来,退出小窗
+ ////
+ if (CURRENT_JZVD != null) {
+ if (this == CURRENT_JZVD && jzDataSource.containsTheUrl(CURRENT_JZVD.jzDataSource.getCurrentUrl())) {
+ //不理解
+ } else if (this == CURRENT_JZVD && !jzDataSource.containsTheUrl(CURRENT_JZVD.jzDataSource.getCurrentUrl())) {
+ gotoScreenTiny();
+ } else if (this != CURRENT_JZVD && jzDataSource.containsTheUrl(CURRENT_JZVD.jzDataSource.getCurrentUrl())) {
+ if (CURRENT_JZVD.currentScreen == SCREEN_WINDOW_TINY) {
+ //需要退出小窗退到我这里,我这里是第一层级
+ //clear container, goback
+ ViewGroup vp = (ViewGroup) getParent();
+ vp.removeAllViews();
+ ((ViewGroup) CURRENT_JZVD.getParent()).removeAllViews();
+ vp.addView(CURRENT_JZVD);
+ CONTAINER_LIST.pop();
+ }
+ } else if (this != CURRENT_JZVD && !jzDataSource.containsTheUrl(CURRENT_JZVD.jzDataSource.getCurrentUrl())) {
+ }
}
super.setUp(jzDataSource, screen, jzMediaInterface);
diff --git a/app/src/main/res/layout/activity_listview_normal_auto_tiny.xml b/app/src/main/res/layout/activity_listview_normal_auto_tiny.xml
deleted file mode 100644
index 421e983c..00000000
--- a/app/src/main/res/layout/activity_listview_normal_auto_tiny.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
diff --git a/app/src/main/res/layout/activity_tiny_window.xml b/app/src/main/res/layout/activity_tiny_window.xml
index 098c4931..3922919a 100644
--- a/app/src/main/res/layout/activity_tiny_window.xml
+++ b/app/src/main/res/layout/activity_tiny_window.xml
@@ -4,72 +4,42 @@
android:layout_height="match_parent"
android:orientation="vertical">
-
+ android:layout_height="200dp">
-
-
-
-
-
-
+ android:layout_height="200dp" />
+
-
-
-
-
-
+
-
+
-
+
-
-
\ No newline at end of file
diff --git a/app/src/main/res/layout/item_videoview_tiny.xml b/app/src/main/res/layout/item_videoview_tiny.xml
deleted file mode 100644
index 781fa6a3..00000000
--- a/app/src/main/res/layout/item_videoview_tiny.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/jiaozivideoplayer/src/main/java/cn/jzvd/Jzvd.java b/jiaozivideoplayer/src/main/java/cn/jzvd/Jzvd.java
index a3f75d43..d98d8174 100644
--- a/jiaozivideoplayer/src/main/java/cn/jzvd/Jzvd.java
+++ b/jiaozivideoplayer/src/main/java/cn/jzvd/Jzvd.java
@@ -123,9 +123,7 @@ public void onAudioFocusChange(int focusChange) {
protected int mGestureDownVolume;
protected float mGestureDownBrightness;
protected long mSeekTimePosition;
- /**
- * liestview中,退出全屏也会导致列表getview->setUp,这个变量要屏蔽这个过程
- **/
+ //liestview中,退出全屏也会导致列表getview->setUp,这个变量要屏蔽这个过程
protected long gobakFullscreenTime = 0;
public Jzvd(Context context) {
From eebfa585b31d0fa55b158bcfd5af4fc39b166994 Mon Sep 17 00:00:00 2001
From: I
Date: Wed, 27 Mar 2019 17:08:59 +0800
Subject: [PATCH 11/33] =?UTF-8?q?=E5=A4=8D=E6=9D=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../cn/jzvd/demo/ActivityListViewNormal.java | 2 +-
.../demo/ActivityListViewRecyclerView.java | 4 +-
.../java/cn/jzvd/demo/ActivityTinyWindow.java | 7 +-
.../demo/ActivityTinyWindowRecycleView.java | 45 +++++++----
...terVideoList.java => AdapterListView.java} | 4 +-
...iewVideo.java => AdapterRecyclerView.java} | 6 +-
.../cn/jzvd/demo/AdapterRecyclerViewTiny.java | 70 +++++++++++++++++
.../demo/CustomJzvd/JzvdStdTinyWindow.java | 77 +++++++++++--------
.../cn/jzvd/demo/CustomJzvd/MyJzvdStd.java | 6 --
.../main/java/cn/jzvd/demo/FragmentDemo.java | 2 +-
.../main/res/layout/item_videoview_tiny.xml | 18 +++++
.../src/main/java/cn/jzvd/Jzvd.java | 4 -
.../src/main/java/cn/jzvd/JzvdStd.java | 14 ----
13 files changed, 176 insertions(+), 83 deletions(-)
rename app/src/main/java/cn/jzvd/demo/{AdapterVideoList.java => AdapterListView.java} (91%)
rename app/src/main/java/cn/jzvd/demo/{AdapterRecyclerViewVideo.java => AdapterRecyclerView.java} (87%)
create mode 100644 app/src/main/java/cn/jzvd/demo/AdapterRecyclerViewTiny.java
create mode 100755 app/src/main/res/layout/item_videoview_tiny.xml
diff --git a/app/src/main/java/cn/jzvd/demo/ActivityListViewNormal.java b/app/src/main/java/cn/jzvd/demo/ActivityListViewNormal.java
index ba79d253..d1ce4829 100644
--- a/app/src/main/java/cn/jzvd/demo/ActivityListViewNormal.java
+++ b/app/src/main/java/cn/jzvd/demo/ActivityListViewNormal.java
@@ -31,7 +31,7 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
setContentView(R.layout.activity_listview_normal);
listView = findViewById(R.id.listview);
- listView.setAdapter(new AdapterVideoList(this,
+ listView.setAdapter(new AdapterListView(this,
VideoConstant.videoUrls[0],
VideoConstant.videoTitles[0],
VideoConstant.videoThumbs[0]));
diff --git a/app/src/main/java/cn/jzvd/demo/ActivityListViewRecyclerView.java b/app/src/main/java/cn/jzvd/demo/ActivityListViewRecyclerView.java
index fbaa3684..9d1abd0d 100644
--- a/app/src/main/java/cn/jzvd/demo/ActivityListViewRecyclerView.java
+++ b/app/src/main/java/cn/jzvd/demo/ActivityListViewRecyclerView.java
@@ -15,7 +15,7 @@
*/
public class ActivityListViewRecyclerView extends AppCompatActivity {
RecyclerView recyclerView;
- AdapterRecyclerViewVideo adapterVideoList;
+ AdapterRecyclerView adapterVideoList;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
@@ -30,7 +30,7 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
recyclerView = findViewById(R.id.recyclerview);
recyclerView.setLayoutManager(new LinearLayoutManager(this));
- adapterVideoList = new AdapterRecyclerViewVideo(this);
+ adapterVideoList = new AdapterRecyclerView(this);
recyclerView.setAdapter(adapterVideoList);
recyclerView.addOnChildAttachStateChangeListener(new RecyclerView.OnChildAttachStateChangeListener() {
@Override
diff --git a/app/src/main/java/cn/jzvd/demo/ActivityTinyWindow.java b/app/src/main/java/cn/jzvd/demo/ActivityTinyWindow.java
index cd7f869f..d31c327d 100644
--- a/app/src/main/java/cn/jzvd/demo/ActivityTinyWindow.java
+++ b/app/src/main/java/cn/jzvd/demo/ActivityTinyWindow.java
@@ -1,5 +1,6 @@
package cn.jzvd.demo;
+import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
@@ -71,12 +72,10 @@ public void clickTinyWindow(View view) {
}
public void clickAutoTinyListViewRecyclerView(View view) {
- Toast.makeText(this, "comming soon", Toast.LENGTH_SHORT).show();
-// startActivity(new Intent(this, ActivityTinyWindowRecycleView.class));
+ startActivity(new Intent(this, ActivityTinyWindowRecycleView.class));
}
public void clickAutoTinyListViewRecyclerViewMultiHolder(View view) {
- Toast.makeText(this, "comming soon", Toast.LENGTH_SHORT).show();
-// startActivity(new Intent(this, ActivityTinyWindowRecycleViewMultiHolder.class));
+ startActivity(new Intent(this, ActivityTinyWindowRecycleViewMultiHolder.class));
}
}
diff --git a/app/src/main/java/cn/jzvd/demo/ActivityTinyWindowRecycleView.java b/app/src/main/java/cn/jzvd/demo/ActivityTinyWindowRecycleView.java
index 3c03d52a..ee79c935 100644
--- a/app/src/main/java/cn/jzvd/demo/ActivityTinyWindowRecycleView.java
+++ b/app/src/main/java/cn/jzvd/demo/ActivityTinyWindowRecycleView.java
@@ -8,8 +8,10 @@
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
+import android.widget.FrameLayout;
import cn.jzvd.Jzvd;
+import cn.jzvd.demo.CustomJzvd.JzvdStdTinyWindow;
/**
* Created by Nathen on 2017/11/1.
@@ -17,7 +19,7 @@
public class ActivityTinyWindowRecycleView extends AppCompatActivity {
RecyclerView recyclerView;
- AdapterRecyclerViewVideo adapterVideoList;
+ AdapterRecyclerViewTiny adapterVideoList;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
@@ -32,33 +34,50 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
recyclerView = findViewById(R.id.recyclerview);
recyclerView.setLayoutManager(new LinearLayoutManager(this));
- adapterVideoList = new AdapterRecyclerViewVideo(this);
+ adapterVideoList = new AdapterRecyclerViewTiny(this);
recyclerView.setAdapter(adapterVideoList);
recyclerView.addOnChildAttachStateChangeListener(new RecyclerView.OnChildAttachStateChangeListener() {
@Override
- public void onChildViewAttachedToWindow(View view) {
- if (Jzvd.CONTAINER_LIST.size() == 0) return;
- int vp = ((ViewGroup) view).indexOfChild(Jzvd.CONTAINER_LIST.getLast());
- System.out.println("fdsfdsafds 1");
- if (vp != -1 && Jzvd.CURRENT_JZVD != null) {
- if (Jzvd.CURRENT_JZVD.currentScreen == Jzvd.SCREEN_WINDOW_TINY) {
- System.out.println("fdsfdsafds 3");
- Jzvd.backPress();
- }
+ public void onChildViewAttachedToWindow(View view) {//这个的本质是gotoThisJzvd,不管他是不是原来的容器
+ //如果这个容器中jzvd的url是currentJzvd的url,那么直接回到这里,不用管其他的
+ JzvdStdTinyWindow jzvd = view.findViewById(R.id.videoplayer);
+ System.out.println("fsdfsa onChildViewAttachedToWindow " + jzvd.jzDataSource.title);
+
+ JzvdStdTinyWindow currentJzvd = (JzvdStdTinyWindow) Jzvd.CURRENT_JZVD;
+ if (jzvd != null && currentJzvd != null &&
+ jzvd.jzDataSource.containsTheUrl(Jzvd.CURRENT_JZVD.jzDataSource.getCurrentUrl())
+ && Jzvd.CURRENT_JZVD.currentState == Jzvd.CURRENT_STATE_PLAYING) {
+ ViewGroup vp = (ViewGroup) jzvd.getParent();
+ vp.removeAllViews();
+ ((ViewGroup) currentJzvd.getParent()).removeView(currentJzvd);
+ FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
+ vp.addView(currentJzvd, lp);
+ currentJzvd.setScreenNormal();
+ Jzvd.CONTAINER_LIST.pop();
}
+
+// if (Jzvd.CONTAINER_LIST.size() == 0) return;
+// int vp = ((ViewGroup) view).indexOfChild(Jzvd.CONTAINER_LIST.getLast());
+// System.out.println("fdsfdsafds 1");
+// if (vp != -1 && Jzvd.CURRENT_JZVD != null) {
+// if (Jzvd.CURRENT_JZVD.currentScreen == Jzvd.SCREEN_WINDOW_TINY) {
+// System.out.println("fdsfdsafds 3");
+// Jzvd.backPress();
+// }
+// }
// Jzvd.onChildViewAttachedToWindow(view, R.id.videoplayer);
}
@Override
public void onChildViewDetachedFromWindow(View view) {
- Jzvd jzvd = view.findViewById(R.id.videoplayer);
+ JzvdStdTinyWindow jzvd = view.findViewById(R.id.videoplayer);
if (jzvd != null && Jzvd.CURRENT_JZVD != null &&
jzvd.jzDataSource.containsTheUrl(Jzvd.CURRENT_JZVD.jzDataSource.getCurrentUrl())
&& Jzvd.CURRENT_JZVD.currentScreen != Jzvd.SCREEN_WINDOW_TINY) {
if (Jzvd.CURRENT_JZVD.currentState == Jzvd.CURRENT_STATE_PAUSE) {
Jzvd.resetAllVideos();
} else {
- Jzvd.CURRENT_JZVD.gotoScreenTiny();
+ ((JzvdStdTinyWindow) Jzvd.CURRENT_JZVD).gotoScreenTiny();
}
}
}
diff --git a/app/src/main/java/cn/jzvd/demo/AdapterVideoList.java b/app/src/main/java/cn/jzvd/demo/AdapterListView.java
similarity index 91%
rename from app/src/main/java/cn/jzvd/demo/AdapterVideoList.java
rename to app/src/main/java/cn/jzvd/demo/AdapterListView.java
index e00b5e1e..ff9ebc36 100644
--- a/app/src/main/java/cn/jzvd/demo/AdapterVideoList.java
+++ b/app/src/main/java/cn/jzvd/demo/AdapterListView.java
@@ -15,7 +15,7 @@
* Created by Nathen
* On 2016/02/07 01:20
*/
-public class AdapterVideoList extends BaseAdapter {
+public class AdapterListView extends BaseAdapter {
public static final String TAG = "JZVD";
@@ -25,7 +25,7 @@ public class AdapterVideoList extends BaseAdapter {
String[] videoTitles;
String[] videoThumbs;
- public AdapterVideoList(Context context, String[] videoUrls, String[] videoTitles, String[] videoThumbs) {
+ public AdapterListView(Context context, String[] videoUrls, String[] videoTitles, String[] videoThumbs) {
this.context = context;
this.videoUrls = videoUrls;
this.videoTitles = videoTitles;
diff --git a/app/src/main/java/cn/jzvd/demo/AdapterRecyclerViewVideo.java b/app/src/main/java/cn/jzvd/demo/AdapterRecyclerView.java
similarity index 87%
rename from app/src/main/java/cn/jzvd/demo/AdapterRecyclerViewVideo.java
rename to app/src/main/java/cn/jzvd/demo/AdapterRecyclerView.java
index 7687dca3..df6296f5 100644
--- a/app/src/main/java/cn/jzvd/demo/AdapterRecyclerViewVideo.java
+++ b/app/src/main/java/cn/jzvd/demo/AdapterRecyclerView.java
@@ -13,13 +13,13 @@
import cn.jzvd.Jzvd;
import cn.jzvd.JzvdStd;
-public class AdapterRecyclerViewVideo extends RecyclerView.Adapter {
+public class AdapterRecyclerView extends RecyclerView.Adapter {
- public static final String TAG = "AdapterRecyclerViewVideo";
+ public static final String TAG = "AdapterRecyclerView";
int[] videoIndexs = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
private Context context;
- public AdapterRecyclerViewVideo(Context context) {
+ public AdapterRecyclerView(Context context) {
this.context = context;
}
diff --git a/app/src/main/java/cn/jzvd/demo/AdapterRecyclerViewTiny.java b/app/src/main/java/cn/jzvd/demo/AdapterRecyclerViewTiny.java
new file mode 100644
index 00000000..6ff9f990
--- /dev/null
+++ b/app/src/main/java/cn/jzvd/demo/AdapterRecyclerViewTiny.java
@@ -0,0 +1,70 @@
+package cn.jzvd.demo;
+
+import android.annotation.SuppressLint;
+import android.content.Context;
+import android.support.v7.widget.RecyclerView;
+import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+import com.bumptech.glide.Glide;
+
+import cn.jzvd.Jzvd;
+import cn.jzvd.demo.CustomJzvd.JzvdStdTinyWindow;
+
+public class AdapterRecyclerViewTiny extends RecyclerView.Adapter {
+
+ public static final String TAG = "AdapterRecyclerView";
+ int[] videoIndexs = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
+ private Context context;
+
+ public AdapterRecyclerViewTiny(Context context) {
+ this.context = context;
+ }
+
+ @Override
+ public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
+ MyViewHolder holder = new MyViewHolder(LayoutInflater.from(
+ context).inflate(R.layout.item_videoview_tiny, parent,
+ false));
+ return holder;
+ }
+
+ @SuppressLint("LongLogTag")
+ @Override
+ public void onBindViewHolder(MyViewHolder holder, int position) {
+ Log.i(TAG, "onBindViewHolder [" + holder.jzvdStd.hashCode() + "] position=" + position);
+ //进入小窗之后,这个jzvd已经被移动走了,判断,如果jzvdstd==currentJzvd==小窗,那么就给jzvdStd重新赋值,赋值成clone出来的jzvd
+
+// if (Jzvd.CURRENT_JZVD != null && holder.jzvdStd.jzDataSource != null &&
+// ==Jzvd.CURRENT_JZVD &&
+// Jzvd.CURRENT_JZVD.currentScreen == Jzvd.SCREEN_WINDOW_TINY){
+ if (holder.jzvdStd.getTag() != null)
+ holder.jzvdStd = ((View) holder.jzvdStd.getTag()).findViewById(R.id.videoplayer);
+// System.out.println("fsdfsa onBindViewHolder " + holder.jzvdStd.jzDataSource.title);
+// }//第二次来的时候需不需要替换
+
+ holder.jzvdStd.setUp(
+ VideoConstant.videoUrls[0][position],
+ VideoConstant.videoTitles[0][position], Jzvd.SCREEN_NORMAL);
+ Glide.with(holder.jzvdStd.getContext()).load(VideoConstant.videoThumbs[0][position]).into(holder.jzvdStd.thumbImageView);
+ System.out.println("fsdfsa onBindViewHolder " + holder.jzvdStd.jzDataSource.title);
+ }
+
+ @Override
+ public int getItemCount() {
+ return videoIndexs.length;
+ }
+
+ class MyViewHolder extends RecyclerView.ViewHolder {
+ JzvdStdTinyWindow jzvdStd;
+
+ public MyViewHolder(View itemView) {
+ super(itemView);
+ jzvdStd = itemView.findViewById(R.id.videoplayer);
+ jzvdStd.setTag(itemView);
+ }
+ }
+
+}
diff --git a/app/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdTinyWindow.java b/app/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdTinyWindow.java
index fd930439..b43fa4f0 100644
--- a/app/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdTinyWindow.java
+++ b/app/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdTinyWindow.java
@@ -10,6 +10,7 @@
import cn.jzvd.JZDataSource;
import cn.jzvd.JZMediaInterface;
import cn.jzvd.JZUtils;
+import cn.jzvd.Jzvd;
import cn.jzvd.JzvdStd;
/**
@@ -26,56 +27,66 @@ public JzvdStdTinyWindow(Context context, AttributeSet attrs) {
@Override
public void setUp(JZDataSource jzDataSource, int screen, JZMediaInterface jzMediaInterface) {
- //滑动列表的时候
- //如果滑动过快,setUp在scroll之前生效
- //setUp是原来的url 不是原来的url
- //这个是clone出来的
-
- //滑出去进入小窗, 当前的url和正在播放的url不一样,
-// if (!jzDataSource.containsTheUrl(CURRENT_JZVD.jzDataSource.getCurrentUrl())) {
-// //进入小窗
-// gotoScreenTiny();
+// //滑动列表的时候
+// //如果滑动过快,setUp在scroll之前生效
+// //setUp是原来的url 不是原来的url
+// //这个是clone出来的
+//
+// //滑出去进入小窗, 当前的url和正在播放的url不一样,
+//// if (!jzDataSource.containsTheUrl(CURRENT_JZVD.jzDataSource.getCurrentUrl())) {
+//// //进入小窗
+//// gotoScreenTiny();
+//// }
+// //滑进来,退出小窗
+//
+//
+// ////
+// if (CURRENT_JZVD != null) {
+// if (this == CURRENT_JZVD && jzDataSource.containsTheUrl(CURRENT_JZVD.jzDataSource.getCurrentUrl())) {
+// //不理解
+// } else if (this == CURRENT_JZVD && !jzDataSource.containsTheUrl(CURRENT_JZVD.jzDataSource.getCurrentUrl())) {
+// gotoScreenTiny();
+// } else if (this != CURRENT_JZVD && jzDataSource.containsTheUrl(CURRENT_JZVD.jzDataSource.getCurrentUrl())) {
+// if (CURRENT_JZVD.currentScreen == SCREEN_WINDOW_TINY) {
+// //需要退出小窗退到我这里,我这里是第一层级
+// //clear container, goback
+// ViewGroup vp = (ViewGroup) getParent();
+// vp.removeAllViews();
+// ((ViewGroup) CURRENT_JZVD.getParent()).removeAllViews();
+// vp.addView(CURRENT_JZVD);
+// CONTAINER_LIST.pop();
+// }
+// } else if (this != CURRENT_JZVD && !jzDataSource.containsTheUrl(CURRENT_JZVD.jzDataSource.getCurrentUrl())) {
+// }
+// }
+ //如果被复用了,tiny已经出现,然后继续下拉出现,新的item复用正在播放的jzvd
+// if (jzDataSource.containsTheUrl(CURRENT_JZVD.jzDataSource.getCurrentUrl())) {
+//
// }
- //滑进来,退出小窗
-
- ////
- if (CURRENT_JZVD != null) {
- if (this == CURRENT_JZVD && jzDataSource.containsTheUrl(CURRENT_JZVD.jzDataSource.getCurrentUrl())) {
- //不理解
- } else if (this == CURRENT_JZVD && !jzDataSource.containsTheUrl(CURRENT_JZVD.jzDataSource.getCurrentUrl())) {
- gotoScreenTiny();
- } else if (this != CURRENT_JZVD && jzDataSource.containsTheUrl(CURRENT_JZVD.jzDataSource.getCurrentUrl())) {
- if (CURRENT_JZVD.currentScreen == SCREEN_WINDOW_TINY) {
- //需要退出小窗退到我这里,我这里是第一层级
- //clear container, goback
- ViewGroup vp = (ViewGroup) getParent();
- vp.removeAllViews();
- ((ViewGroup) CURRENT_JZVD.getParent()).removeAllViews();
- vp.addView(CURRENT_JZVD);
- CONTAINER_LIST.pop();
- }
- } else if (this != CURRENT_JZVD && !jzDataSource.containsTheUrl(CURRENT_JZVD.jzDataSource.getCurrentUrl())) {
- }
- }
+// if (this.jzDataSource != null)
+// System.out.println("fdsfdsaf new " + this.jzDataSource.title + " " + CURRENT_JZVD + " " + this);
super.setUp(jzDataSource, screen, jzMediaInterface);
+
+// System.out.println("fdsfdsaf " + jzDataSource.title);
}
- @Override
public void gotoScreenTiny() {
- super.gotoScreenTiny();
Log.i(TAG, "startWindowTiny " + " [" + this.hashCode() + "] ");
if (currentState == CURRENT_STATE_NORMAL || currentState == CURRENT_STATE_ERROR || currentState == CURRENT_STATE_AUTO_COMPLETE)
return;
ViewGroup vg = (ViewGroup) getParent();
vg.removeView(this);
- vg.addView(cloneMe());
+ Jzvd jj = cloneMe();
+ vg.addView(jj);
CONTAINER_LIST.add(vg);
ViewGroup vgg = (ViewGroup) (JZUtils.scanForActivity(getContext())).getWindow().getDecorView();//和他也没有关系
FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(400, 400);
lp.gravity = Gravity.RIGHT | Gravity.BOTTOM;
+ //添加滑动事件等
vgg.addView(this, lp);
+ System.out.println(jj + " " + this);
setScreenTiny();
}
}
diff --git a/app/src/main/java/cn/jzvd/demo/CustomJzvd/MyJzvdStd.java b/app/src/main/java/cn/jzvd/demo/CustomJzvd/MyJzvdStd.java
index 695f8334..a79a6bb3 100644
--- a/app/src/main/java/cn/jzvd/demo/CustomJzvd/MyJzvdStd.java
+++ b/app/src/main/java/cn/jzvd/demo/CustomJzvd/MyJzvdStd.java
@@ -77,12 +77,6 @@ public void onStopTrackingTouch(SeekBar seekBar) {
Log.i(TAG, "Seek position ");
}
- @Override
- public void gotoScreenTiny() {
- super.gotoScreenTiny();
- Log.i(TAG, "goto Tiny");
- }
-
@Override
public void gotoScreenFullscreen() {
super.gotoScreenFullscreen();
diff --git a/app/src/main/java/cn/jzvd/demo/FragmentDemo.java b/app/src/main/java/cn/jzvd/demo/FragmentDemo.java
index da6ac49e..90c73745 100644
--- a/app/src/main/java/cn/jzvd/demo/FragmentDemo.java
+++ b/app/src/main/java/cn/jzvd/demo/FragmentDemo.java
@@ -33,7 +33,7 @@ public void onCreate(Bundle savedInstanceState) {
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInastanceState) {
listView = (ListView) inflater.inflate(R.layout.layout_list, container, false);
- listView.setAdapter(new AdapterVideoList(getActivity(),
+ listView.setAdapter(new AdapterListView(getActivity(),
VideoConstant.videoUrls[index],
VideoConstant.videoTitles[index],
VideoConstant.videoThumbs[index]));
diff --git a/app/src/main/res/layout/item_videoview_tiny.xml b/app/src/main/res/layout/item_videoview_tiny.xml
new file mode 100755
index 00000000..781fa6a3
--- /dev/null
+++ b/app/src/main/res/layout/item_videoview_tiny.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/jiaozivideoplayer/src/main/java/cn/jzvd/Jzvd.java b/jiaozivideoplayer/src/main/java/cn/jzvd/Jzvd.java
index d98d8174..9ac44308 100644
--- a/jiaozivideoplayer/src/main/java/cn/jzvd/Jzvd.java
+++ b/jiaozivideoplayer/src/main/java/cn/jzvd/Jzvd.java
@@ -823,10 +823,6 @@ public Jzvd cloneMe() {
return jzvd;
}
- public void gotoScreenTiny() {
-
- }
-
public void gotoScreenFullscreen() {
ViewGroup vg = (ViewGroup) getParent();
vg.removeView(this);
diff --git a/jiaozivideoplayer/src/main/java/cn/jzvd/JzvdStd.java b/jiaozivideoplayer/src/main/java/cn/jzvd/JzvdStd.java
index 03b03b2e..1d6bbaff 100644
--- a/jiaozivideoplayer/src/main/java/cn/jzvd/JzvdStd.java
+++ b/jiaozivideoplayer/src/main/java/cn/jzvd/JzvdStd.java
@@ -118,20 +118,6 @@ public void setUp(JZDataSource jzDataSource, int screen, JZMediaInterface jzMedi
super.setUp(jzDataSource, screen, jzMediaInterface);
titleTextView.setText(jzDataSource.title);
setScreen(screen);
- // if (Jzvd.CURRENT_JZVD == null) return; 这是保存进度
-// if (jzDataSource.containsTheUrl(Jzvd.CURRENT_JZVD.jzDataSource.getCurrentUrl())) {
-// long position = 0;
-// try {
-// position = Jzvd.CURRENT_JZVD.mediaInterface.getCurrentPosition();
-// } catch (IllegalStateException e) {
-// e.printStackTrace();
-// }
-// if (position != 0) {
-// JZUtils.saveProgress(getContext(), Jzvd.CURRENT_JZVD.jzDataSource.getCurrentUrl(), position);
-// }
-// System.out.println("fdsafdsaf setup");
-// Jzvd.CURRENT_JZVD.reset();
-// }
}
public void changeStartButtonSize(int size) {
From 585ccd53314342515f5434006a992b5f02b0f535 Mon Sep 17 00:00:00 2001
From: I
Date: Wed, 27 Mar 2019 17:13:00 +0800
Subject: [PATCH 12/33] move code
---
.../demo/CustomJzvd/JzvdStdTinyWindow.java | 22 +++++++++++++++++++
.../src/main/java/cn/jzvd/Jzvd.java | 21 ------------------
2 files changed, 22 insertions(+), 21 deletions(-)
diff --git a/app/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdTinyWindow.java b/app/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdTinyWindow.java
index b43fa4f0..b24fe450 100644
--- a/app/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdTinyWindow.java
+++ b/app/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdTinyWindow.java
@@ -7,6 +7,9 @@
import android.view.ViewGroup;
import android.widget.FrameLayout;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+
import cn.jzvd.JZDataSource;
import cn.jzvd.JZMediaInterface;
import cn.jzvd.JZUtils;
@@ -89,4 +92,23 @@ public void gotoScreenTiny() {
System.out.println(jj + " " + this);
setScreenTiny();
}
+
+ public Jzvd cloneMe() {
+ Jzvd jzvd = null;
+ try {
+ Constructor constructor = (Constructor) JzvdStdTinyWindow.this.getClass().getConstructor(Context.class);
+ jzvd = constructor.newInstance(getContext());
+ jzvd.jzDataSource = jzDataSource.cloneMe();//jzvd应该是idle状态
+ jzvd.setId(getId());
+ } catch (IllegalAccessException e) {
+ e.printStackTrace();
+ } catch (InstantiationException e) {
+ e.printStackTrace();
+ } catch (InvocationTargetException e) {
+ e.printStackTrace();
+ } catch (NoSuchMethodException e) {
+ e.printStackTrace();
+ }
+ return jzvd;
+ }
}
diff --git a/jiaozivideoplayer/src/main/java/cn/jzvd/Jzvd.java b/jiaozivideoplayer/src/main/java/cn/jzvd/Jzvd.java
index 9ac44308..cba012e4 100644
--- a/jiaozivideoplayer/src/main/java/cn/jzvd/Jzvd.java
+++ b/jiaozivideoplayer/src/main/java/cn/jzvd/Jzvd.java
@@ -24,7 +24,6 @@
import android.widget.Toast;
import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
import java.util.LinkedList;
import java.util.Timer;
import java.util.TimerTask;
@@ -804,29 +803,9 @@ public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
}
}
- public Jzvd cloneMe() {
- Jzvd jzvd = null;
- try {
- Constructor constructor = (Constructor) Jzvd.this.getClass().getConstructor(Context.class);
- jzvd = constructor.newInstance(getContext());
- jzvd.jzDataSource = jzDataSource.cloneMe();//jzvd应该是idle状态
- jzvd.setId(getId());
- } catch (IllegalAccessException e) {
- e.printStackTrace();
- } catch (InstantiationException e) {
- e.printStackTrace();
- } catch (InvocationTargetException e) {
- e.printStackTrace();
- } catch (NoSuchMethodException e) {
- e.printStackTrace();
- }
- return jzvd;
- }
-
public void gotoScreenFullscreen() {
ViewGroup vg = (ViewGroup) getParent();
vg.removeView(this);
- vg.addView(cloneMe());
CONTAINER_LIST.add(vg);
vg = (ViewGroup) (JZUtils.scanForActivity(getContext())).getWindow().getDecorView();//和他也没有关系
vg.addView(this, new FrameLayout.LayoutParams(
From 1f82d67c8d86b8958769a8f509e4d892ddb56f1e Mon Sep 17 00:00:00 2001
From: I
Date: Thu, 28 Mar 2019 17:16:29 +0800
Subject: [PATCH 13/33] fix
---
.../main/java/cn/jzvd/demo/CustomJzvd/JzvdStdTinyWindow.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdTinyWindow.java b/app/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdTinyWindow.java
index b24fe450..17162fb0 100644
--- a/app/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdTinyWindow.java
+++ b/app/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdTinyWindow.java
@@ -94,9 +94,9 @@ public void gotoScreenTiny() {
}
public Jzvd cloneMe() {
- Jzvd jzvd = null;
+ JzvdStdTinyWindow jzvd = null;
try {
- Constructor constructor = (Constructor) JzvdStdTinyWindow.this.getClass().getConstructor(Context.class);
+ Constructor constructor = (Constructor) JzvdStdTinyWindow.this.getClass().getConstructor(Context.class);
jzvd = constructor.newInstance(getContext());
jzvd.jzDataSource = jzDataSource.cloneMe();//jzvd应该是idle状态
jzvd.setId(getId());
From ce9587f70bfdf946529bd115e825dfe2fecbb0b3 Mon Sep 17 00:00:00 2001
From: I
Date: Sat, 30 Mar 2019 17:03:21 +0800
Subject: [PATCH 14/33] add jzt to readme
---
README.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index fb7c6e25..9ce4c43e 100644
--- a/README.md
+++ b/README.md
@@ -7,10 +7,10 @@
-Highly customizable Android video player
-
Q群: 490442439 2群: 761899104 验证信息:jzvd
+为了增加项目质量,促进项目进度,调用社群力量,方便社群管理,近日将推出基于以太坊erc-20的数字通证[JiaoZiToken(JZT)(饺子Token)](https://github.com/lipangit/JZT),通俗点理解,谁给饺子视频播放器写代码、出主意、解决用户问题、活跃社群关系、关注项目进展,就给谁饺子Token. 将来会让项目更加丰富,更加精致,必定大有可为.
+
[Wiki](https://github.com/lipangit/JiaoZiVideoPlayer/wiki) [EnglishWiki](https://github.com/felipetorres/VideoPlayer-Wiki)
[中文ReadMe](https://github.com/lipangit/JiaoZiVideoPlayer/blob/develop/README-ZH.md)
[WorkPlan](https://github.com/lipangit/JiaoZiVideoPlayer/projects/2)
From ed69524dccdab8658859009cc03bb3055071ef47 Mon Sep 17 00:00:00 2001
From: I
Date: Sat, 30 Mar 2019 17:23:57 +0800
Subject: [PATCH 15/33] .
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 9ce4c43e..a1b6f2f3 100644
--- a/README.md
+++ b/README.md
@@ -9,7 +9,7 @@
Q群: 490442439 2群: 761899104 验证信息:jzvd
-为了增加项目质量,促进项目进度,调用社群力量,方便社群管理,近日将推出基于以太坊erc-20的数字通证[JiaoZiToken(JZT)(饺子Token)](https://github.com/lipangit/JZT),通俗点理解,谁给饺子视频播放器写代码、出主意、解决用户问题、活跃社群关系、关注项目进展,就给谁饺子Token. 将来会让项目更加丰富,更加精致,必定大有可为.
+为了增加项目质量,促进项目进度,调用社群力量,方便社群管理,近日将推出基于以太坊erc-20的数字通证[JiaoZiToken(JZT)(饺子Token)](https://github.com/lipangit/JZT),通俗点理解,谁给饺子视频播放器写代码、出主意、解决用户问题、活跃社群关系、关注项目进展,就给谁饺子Token。将来会让项目更加丰富,更加精致,必定大有可为。
[Wiki](https://github.com/lipangit/JiaoZiVideoPlayer/wiki) [EnglishWiki](https://github.com/felipetorres/VideoPlayer-Wiki)
[中文ReadMe](https://github.com/lipangit/JiaoZiVideoPlayer/blob/develop/README-ZH.md)
From 848ddb0e4253a28c5b6abfa939fcb61e896786ee Mon Sep 17 00:00:00 2001
From: I
Date: Sat, 30 Mar 2019 17:34:52 +0800
Subject: [PATCH 16/33] =?UTF-8?q?=E5=88=92=E9=87=8D=E7=82=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
README.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/README.md b/README.md
index a1b6f2f3..6543d128 100644
--- a/README.md
+++ b/README.md
@@ -9,6 +9,7 @@
Q群: 490442439 2群: 761899104 验证信息:jzvd
+## 划重点
为了增加项目质量,促进项目进度,调用社群力量,方便社群管理,近日将推出基于以太坊erc-20的数字通证[JiaoZiToken(JZT)(饺子Token)](https://github.com/lipangit/JZT),通俗点理解,谁给饺子视频播放器写代码、出主意、解决用户问题、活跃社群关系、关注项目进展,就给谁饺子Token。将来会让项目更加丰富,更加精致,必定大有可为。
[Wiki](https://github.com/lipangit/JiaoZiVideoPlayer/wiki) [EnglishWiki](https://github.com/felipetorres/VideoPlayer-Wiki)
From 060c131ded57034a8e7fcfe0b429f799d52d9432 Mon Sep 17 00:00:00 2001
From: I
Date: Sun, 31 Mar 2019 12:06:33 +0800
Subject: [PATCH 17/33] adapter immersive
---
.../src/main/java/cn/jzvd/JZUtils.java | 32 +++++++++++++------
.../src/main/java/cn/jzvd/Jzvd.java | 5 ++-
2 files changed, 24 insertions(+), 13 deletions(-)
diff --git a/jiaozivideoplayer/src/main/java/cn/jzvd/JZUtils.java b/jiaozivideoplayer/src/main/java/cn/jzvd/JZUtils.java
index eea284ae..8412c926 100755
--- a/jiaozivideoplayer/src/main/java/cn/jzvd/JZUtils.java
+++ b/jiaozivideoplayer/src/main/java/cn/jzvd/JZUtils.java
@@ -15,6 +15,7 @@
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
+import android.widget.Toast;
import java.util.Formatter;
import java.util.Locale;
@@ -165,21 +166,32 @@ public static void hideStatusBar(Context context) {
}
@SuppressLint("NewApi")
- public static void hideSystemUI(View view) {
- view.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE
- | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
+ public static void hideSystemUI(Context context) {
+ int uiOptions = View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
- | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_FULLSCREEN
- | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
+ | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
+ ;
+ if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.KITKAT) {
+ uiOptions |= View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
+ }
+ SYSTEM_UI = JZUtils.getWindow(context).getDecorView().getSystemUiVisibility();
+ JZUtils.getWindow(context).getDecorView().setSystemUiVisibility(uiOptions);
+
}
+ public static int SYSTEM_UI = 0;
+
@SuppressLint("NewApi")
- public static void showSystemUI(View view) {
- view.setSystemUiVisibility(
- View.SYSTEM_UI_FLAG_LAYOUT_STABLE
- | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
- | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);
+ public static void showSystemUI(Context context) {
+// view.setSystemUiVisibility(
+// View.SYSTEM_UI_FLAG_LAYOUT_STABLE
+// | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
+// | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);
+
+ int uiOptions = View.SYSTEM_UI_FLAG_VISIBLE;
+ Toast.makeText(context, "fjdkslfdska " + SYSTEM_UI, Toast.LENGTH_SHORT).show();
+ JZUtils.getWindow(context).getDecorView().setSystemUiVisibility(SYSTEM_UI);
}
public static void verifyStoragePermissions(Activity activity) {
diff --git a/jiaozivideoplayer/src/main/java/cn/jzvd/Jzvd.java b/jiaozivideoplayer/src/main/java/cn/jzvd/Jzvd.java
index cba012e4..7a260936 100644
--- a/jiaozivideoplayer/src/main/java/cn/jzvd/Jzvd.java
+++ b/jiaozivideoplayer/src/main/java/cn/jzvd/Jzvd.java
@@ -814,8 +814,7 @@ public void gotoScreenFullscreen() {
setScreenFullscreen();
JZUtils.hideStatusBar(getContext());
JZUtils.setRequestedOrientation(getContext(), FULLSCREEN_ORIENTATION);
-// hideSystemUI((JZUtils.scanForActivity(getContext())).getWindow().getDecorView());
-// jzvd.setUp(jzDataSource, JzvdStd.SCREEN_WINDOW_FULLSCREEN);//华为手机和有虚拟键的手机全屏时可隐藏虚拟键 issue:1326
+ JZUtils.hideSystemUI(getContext());//华为手机和有虚拟键的手机全屏时可隐藏虚拟键 issue:1326
}
@@ -835,7 +834,7 @@ public void gotoScreenNormal() {//goback本质上是goto
// View.SYSTEM_UI_FLAG_LAYOUT_STABLE
// | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
// | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);//华为手机和有虚拟键的手机全屏时可隐藏虚拟键 issue:1326
-// showSystemUI((JZUtils.scanForActivity(CURRENT_JZVD.getContext())).getWindow().getDecorView());
+ JZUtils.showSystemUI(getContext());
}
public void setScreenNormal() {
From d4948a104dabea6de6904e1286f1c6a7b8ceb472 Mon Sep 17 00:00:00 2001
From: I
Date: Thu, 4 Apr 2019 16:51:30 +0800
Subject: [PATCH 18/33] readme
---
README-ZH.md | 2 ++
README.md | 2 ++
2 files changed, 4 insertions(+)
diff --git a/README-ZH.md b/README-ZH.md
index 8879b483..a423c28e 100644
--- a/README-ZH.md
+++ b/README-ZH.md
@@ -47,6 +47,8 @@ Q群: 490442439 2群: 761899104 验证信息:jzvd
即便是自定义UI,或者对Library有过修改,也是这五步骤来使用播放器。
+7.0版本是预览版本,还没开发完,还有问题,请先用6.4.1
+
1.添加类库
```gradle
compile 'cn.jzvd:jiaozivideoplayer:7.0_preview'
diff --git a/README.md b/README.md
index 6543d128..fb30cade 100644
--- a/README.md
+++ b/README.md
@@ -53,6 +53,8 @@ Q群: 490442439 2群: 761899104 验证信息:jzvd
Only five steps to use the player:
+The 7.0 version is a preview version. It has not been developed yet. There are still problems. Please use 6.4.1 first.
+
1.Import library:
```gradle
implementation 'cn.jzvd:jiaozivideoplayer:7.0_preview'
From 21fef32c5c33a08e177edafc4549b8f823d74c79 Mon Sep 17 00:00:00 2001
From: I
Date: Sat, 6 Apr 2019 16:27:34 +0800
Subject: [PATCH 19/33] readme
---
README-ZH.md | 2 +-
README.md | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/README-ZH.md b/README-ZH.md
index a423c28e..631f1b73 100644
--- a/README-ZH.md
+++ b/README-ZH.md
@@ -47,7 +47,7 @@ Q群: 490442439 2群: 761899104 验证信息:jzvd
即便是自定义UI,或者对Library有过修改,也是这五步骤来使用播放器。
-7.0版本是预览版本,还没开发完,还有问题,请先用6.4.1
+7.0版本是预览版本,还没开发完,还有问题,请先用6.4.3
1.添加类库
```gradle
diff --git a/README.md b/README.md
index fb30cade..97c6081c 100644
--- a/README.md
+++ b/README.md
@@ -53,7 +53,7 @@ Q群: 490442439 2群: 761899104 验证信息:jzvd
Only five steps to use the player:
-The 7.0 version is a preview version. It has not been developed yet. There are still problems. Please use 6.4.1 first.
+The 7.0 version is a preview version. It has not been developed yet. There are still problems. Please use 6.4.3 first.
1.Import library:
```gradle
From e904f217412ec39f5be72ecce57350ce7afa5f55 Mon Sep 17 00:00:00 2001
From: I
Date: Fri, 19 Apr 2019 01:03:38 +0800
Subject: [PATCH 20/33] upgrade as
---
build.gradle | 2 +-
gradle/wrapper/gradle-wrapper.properties | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/build.gradle b/build.gradle
index 2d45a15b..74874672 100644
--- a/build.gradle
+++ b/build.gradle
@@ -6,7 +6,7 @@ buildscript {
google()
}
dependencies {
- classpath 'com.android.tools.build:gradle:3.3.2'
+ classpath 'com.android.tools.build:gradle:3.4.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 81214194..2b4308c2 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
-#Sat Sep 29 15:04:20 CST 2018
+#Fri Apr 19 00:29:43 CST 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
From 61e581df86ca7ef0c5181239fb65a8714c5d89bb Mon Sep 17 00:00:00 2001
From: I
Date: Wed, 24 Apr 2019 23:49:09 +0800
Subject: [PATCH 21/33] readme
---
README-ZH.md | 1 +
README.md | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/README-ZH.md b/README-ZH.md
index 631f1b73..83262b1e 100644
--- a/README-ZH.md
+++ b/README-ZH.md
@@ -10,6 +10,7 @@
高度自定义的安卓视频播放器
Q群: 490442439 2群: 761899104 验证信息:jzvd
+微信公众号搜索: jzvdjzt
## 主要特点
diff --git a/README.md b/README.md
index 97c6081c..adbd8f86 100644
--- a/README.md
+++ b/README.md
@@ -8,7 +8,7 @@
Q群: 490442439 2群: 761899104 验证信息:jzvd
-
+微信公众号搜索: jzvdjzt
## 划重点
为了增加项目质量,促进项目进度,调用社群力量,方便社群管理,近日将推出基于以太坊erc-20的数字通证[JiaoZiToken(JZT)(饺子Token)](https://github.com/lipangit/JZT),通俗点理解,谁给饺子视频播放器写代码、出主意、解决用户问题、活跃社群关系、关注项目进展,就给谁饺子Token。将来会让项目更加丰富,更加精致,必定大有可为。
From e9d597a41e4cc6c5ccee19bb97b7ada787bbd38c Mon Sep 17 00:00:00 2001
From: I
Date: Fri, 26 Apr 2019 11:43:36 +0800
Subject: [PATCH 22/33] readme
---
README-ZH.md | 3 ++-
README.md | 4 +++-
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/README-ZH.md b/README-ZH.md
index 83262b1e..c78fb02a 100644
--- a/README-ZH.md
+++ b/README-ZH.md
@@ -10,7 +10,8 @@
高度自定义的安卓视频播放器
Q群: 490442439 2群: 761899104 验证信息:jzvd
-微信公众号搜索: jzvdjzt
+
+微信公众号搜索: jzvdjzt [公众号文章](https://github.com/lipangit/JiaoZiVideoPlayer/wiki/%E5%85%AC%E4%BC%97%E5%8F%B7%E6%96%87%E7%AB%A0)
## 主要特点
diff --git a/README.md b/README.md
index adbd8f86..e4237b7c 100644
--- a/README.md
+++ b/README.md
@@ -8,7 +8,9 @@
Q群: 490442439 2群: 761899104 验证信息:jzvd
-微信公众号搜索: jzvdjzt
+
+微信公众号搜索: jzvdjzt [公众号文章](https://github.com/lipangit/JiaoZiVideoPlayer/wiki/%E5%85%AC%E4%BC%97%E5%8F%B7%E6%96%87%E7%AB%A0)
+
## 划重点
为了增加项目质量,促进项目进度,调用社群力量,方便社群管理,近日将推出基于以太坊erc-20的数字通证[JiaoZiToken(JZT)(饺子Token)](https://github.com/lipangit/JZT),通俗点理解,谁给饺子视频播放器写代码、出主意、解决用户问题、活跃社群关系、关注项目进展,就给谁饺子Token。将来会让项目更加丰富,更加精致,必定大有可为。
From 1bb85f2794bf13867014a78b5e7e413d5f661edd Mon Sep 17 00:00:00 2001
From: I
Date: Sat, 27 Apr 2019 02:11:24 +0800
Subject: [PATCH 23/33] rm log code
---
jiaozivideoplayer/src/main/java/cn/jzvd/JZUtils.java | 6 ------
1 file changed, 6 deletions(-)
diff --git a/jiaozivideoplayer/src/main/java/cn/jzvd/JZUtils.java b/jiaozivideoplayer/src/main/java/cn/jzvd/JZUtils.java
index 8412c926..477eeadb 100755
--- a/jiaozivideoplayer/src/main/java/cn/jzvd/JZUtils.java
+++ b/jiaozivideoplayer/src/main/java/cn/jzvd/JZUtils.java
@@ -184,13 +184,7 @@ public static void hideSystemUI(Context context) {
@SuppressLint("NewApi")
public static void showSystemUI(Context context) {
-// view.setSystemUiVisibility(
-// View.SYSTEM_UI_FLAG_LAYOUT_STABLE
-// | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
-// | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);
-
int uiOptions = View.SYSTEM_UI_FLAG_VISIBLE;
- Toast.makeText(context, "fjdkslfdska " + SYSTEM_UI, Toast.LENGTH_SHORT).show();
JZUtils.getWindow(context).getDecorView().setSystemUiVisibility(SYSTEM_UI);
}
From cdd38124b349b2671eb9b86aaddeca2512121012 Mon Sep 17 00:00:00 2001
From: I
Date: Sat, 27 Apr 2019 03:31:40 +0800
Subject: [PATCH 24/33] fix demo
---
.../main/java/cn/jzvd/demo/ActivityApi.java | 6 ++--
.../demo/ActivityListViewMultiHolder.java | 2 --
.../cn/jzvd/demo/ActivityListViewNormal.java | 1 -
.../demo/ActivityTinyWindowRecycleView.java | 15 ----------
...ivityTinyWindowRecycleViewMultiHolder.java | 29 +++++++++++++++++--
.../src/main/java/cn/jzvd/Jzvd.java | 1 +
6 files changed, 30 insertions(+), 24 deletions(-)
diff --git a/app/src/main/java/cn/jzvd/demo/ActivityApi.java b/app/src/main/java/cn/jzvd/demo/ActivityApi.java
index 5764bb55..7d880340 100644
--- a/app/src/main/java/cn/jzvd/demo/ActivityApi.java
+++ b/app/src/main/java/cn/jzvd/demo/ActivityApi.java
@@ -55,12 +55,12 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
mJzvdStd.setUp(jzDataSource
, JzvdStd.SCREEN_NORMAL);
Glide.with(this).load(VideoConstant.videoThumbList[0]).into(mJzvdStd.thumbImageView);
-// jzvdStdTinyWindow.seekToInAdvance = 20000;
- //JZVideoPlayer.SAVE_PROGRESS = false;
+// mJzvdStd.seekToInAdvance = 20000;
+// Jzvd.SAVE_PROGRESS = false;
/** Play video in local path, eg:record by system camera **/
// cpAssertVideoToLocalPath();
-// jzvdStdTinyWindow.setUp(Environment.getExternalStorageDirectory().getAbsolutePath() + "/DCIM/Camera/local_video.mp4"
+// mJzvdStd.setUp(Environment.getExternalStorageDirectory().getAbsolutePath() + "/DCIM/Camera/local_video.mp4"
// , "饺子不信", Jzvd.SCREEN_NORMAL);
mSensorManager = (SensorManager) getSystemService(SENSOR_SERVICE);
mSensorEventListener = new Jzvd.JZAutoFullscreenListener();
diff --git a/app/src/main/java/cn/jzvd/demo/ActivityListViewMultiHolder.java b/app/src/main/java/cn/jzvd/demo/ActivityListViewMultiHolder.java
index 34c81834..70075910 100644
--- a/app/src/main/java/cn/jzvd/demo/ActivityListViewMultiHolder.java
+++ b/app/src/main/java/cn/jzvd/demo/ActivityListViewMultiHolder.java
@@ -48,8 +48,6 @@ public void onScrollStateChanged(AbsListView view, int scrollState) {
@Override
public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
-// Jzvd.onScrollReleaseAllVideos(view, firstVisibleItem, visibleItemCount, totalItemCount);
-
if (Jzvd.CURRENT_JZVD == null) return;
int lastVisibleItem = firstVisibleItem + visibleItemCount;
int currentPlayPosition = Jzvd.CURRENT_JZVD.positionInList;
diff --git a/app/src/main/java/cn/jzvd/demo/ActivityListViewNormal.java b/app/src/main/java/cn/jzvd/demo/ActivityListViewNormal.java
index d1ce4829..ecbaf60b 100644
--- a/app/src/main/java/cn/jzvd/demo/ActivityListViewNormal.java
+++ b/app/src/main/java/cn/jzvd/demo/ActivityListViewNormal.java
@@ -56,7 +56,6 @@ public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCoun
}
}
}
-// Jzvd.onScrollReleaseAllVideos(view, firstVisibleItem, visibleItemCount, totalItemCount);
}
});
diff --git a/app/src/main/java/cn/jzvd/demo/ActivityTinyWindowRecycleView.java b/app/src/main/java/cn/jzvd/demo/ActivityTinyWindowRecycleView.java
index ee79c935..09a4f52a 100644
--- a/app/src/main/java/cn/jzvd/demo/ActivityTinyWindowRecycleView.java
+++ b/app/src/main/java/cn/jzvd/demo/ActivityTinyWindowRecycleView.java
@@ -41,8 +41,6 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
public void onChildViewAttachedToWindow(View view) {//这个的本质是gotoThisJzvd,不管他是不是原来的容器
//如果这个容器中jzvd的url是currentJzvd的url,那么直接回到这里,不用管其他的
JzvdStdTinyWindow jzvd = view.findViewById(R.id.videoplayer);
- System.out.println("fsdfsa onChildViewAttachedToWindow " + jzvd.jzDataSource.title);
-
JzvdStdTinyWindow currentJzvd = (JzvdStdTinyWindow) Jzvd.CURRENT_JZVD;
if (jzvd != null && currentJzvd != null &&
jzvd.jzDataSource.containsTheUrl(Jzvd.CURRENT_JZVD.jzDataSource.getCurrentUrl())
@@ -55,17 +53,6 @@ public void onChildViewAttachedToWindow(View view) {//这个的本质是gotoThis
currentJzvd.setScreenNormal();
Jzvd.CONTAINER_LIST.pop();
}
-
-// if (Jzvd.CONTAINER_LIST.size() == 0) return;
-// int vp = ((ViewGroup) view).indexOfChild(Jzvd.CONTAINER_LIST.getLast());
-// System.out.println("fdsfdsafds 1");
-// if (vp != -1 && Jzvd.CURRENT_JZVD != null) {
-// if (Jzvd.CURRENT_JZVD.currentScreen == Jzvd.SCREEN_WINDOW_TINY) {
-// System.out.println("fdsfdsafds 3");
-// Jzvd.backPress();
-// }
-// }
-// Jzvd.onChildViewAttachedToWindow(view, R.id.videoplayer);
}
@Override
@@ -81,8 +68,6 @@ public void onChildViewDetachedFromWindow(View view) {
}
}
}
-
-// Jzvd.onChildViewDetachedFromWindow(view, R.id.videoplayer);
});
}
diff --git a/app/src/main/java/cn/jzvd/demo/ActivityTinyWindowRecycleViewMultiHolder.java b/app/src/main/java/cn/jzvd/demo/ActivityTinyWindowRecycleViewMultiHolder.java
index 263d3ac0..54e7d573 100644
--- a/app/src/main/java/cn/jzvd/demo/ActivityTinyWindowRecycleViewMultiHolder.java
+++ b/app/src/main/java/cn/jzvd/demo/ActivityTinyWindowRecycleViewMultiHolder.java
@@ -9,12 +9,14 @@
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
+import android.widget.FrameLayout;
import android.widget.TextView;
import com.bumptech.glide.Glide;
import cn.jzvd.Jzvd;
import cn.jzvd.JzvdStd;
+import cn.jzvd.demo.CustomJzvd.JzvdStdTinyWindow;
/**
* Created by Nathen on 2017/11/1.
@@ -43,12 +45,33 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
recyclerView.addOnChildAttachStateChangeListener(new RecyclerView.OnChildAttachStateChangeListener() {
@Override
public void onChildViewAttachedToWindow(View view) {
-// Jzvd.onChildViewAttachedToWindow(view, R.id.videoplayer);
+ JzvdStdTinyWindow jzvd = view.findViewById(R.id.videoplayer);
+ JzvdStdTinyWindow currentJzvd = (JzvdStdTinyWindow) Jzvd.CURRENT_JZVD;
+ if (jzvd != null && currentJzvd != null &&
+ jzvd.jzDataSource.containsTheUrl(Jzvd.CURRENT_JZVD.jzDataSource.getCurrentUrl())
+ && Jzvd.CURRENT_JZVD.currentState == Jzvd.CURRENT_STATE_PLAYING) {
+ ViewGroup vp = (ViewGroup) jzvd.getParent();
+ vp.removeAllViews();
+ ((ViewGroup) currentJzvd.getParent()).removeView(currentJzvd);
+ FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
+ vp.addView(currentJzvd, lp);
+ currentJzvd.setScreenNormal();
+ Jzvd.CONTAINER_LIST.pop();
+ }
}
@Override
public void onChildViewDetachedFromWindow(View view) {
-// Jzvd.onChildViewDetachedFromWindow(view);
+ JzvdStdTinyWindow jzvd = view.findViewById(R.id.videoplayer);
+ if (jzvd != null && Jzvd.CURRENT_JZVD != null &&
+ jzvd.jzDataSource.containsTheUrl(Jzvd.CURRENT_JZVD.jzDataSource.getCurrentUrl())
+ && Jzvd.CURRENT_JZVD.currentScreen != Jzvd.SCREEN_WINDOW_TINY) {
+ if (Jzvd.CURRENT_JZVD.currentState == Jzvd.CURRENT_STATE_PAUSE) {
+ Jzvd.resetAllVideos();
+ } else {
+ ((JzvdStdTinyWindow) Jzvd.CURRENT_JZVD).gotoScreenTiny();
+ }
+ }
}
});
@@ -108,7 +131,7 @@ public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
VideoHolder videoHolder = (VideoHolder) holder;
videoHolder.jzvdStd.setUp(
VideoConstant.videoUrls[0][position],
- VideoConstant.videoTitles[0][position], Jzvd.SCREEN_WINDOW_LIST);
+ VideoConstant.videoTitles[0][position], Jzvd.SCREEN_NORMAL);
videoHolder.jzvdStd.positionInList = position;
Glide.with(ActivityTinyWindowRecycleViewMultiHolder.this).load(VideoConstant.videoThumbs[0][position]).into(videoHolder.jzvdStd.thumbImageView);
}
diff --git a/jiaozivideoplayer/src/main/java/cn/jzvd/Jzvd.java b/jiaozivideoplayer/src/main/java/cn/jzvd/Jzvd.java
index 7a260936..eb4bcb03 100644
--- a/jiaozivideoplayer/src/main/java/cn/jzvd/Jzvd.java
+++ b/jiaozivideoplayer/src/main/java/cn/jzvd/Jzvd.java
@@ -37,6 +37,7 @@ public abstract class Jzvd extends FrameLayout implements View.OnClickListener,
public static final int THRESHOLD = 80;
public static final int SCREEN_NORMAL = 0;
+ //TODO 干掉这个变量
public static final int SCREEN_WINDOW_LIST = 1;
public static final int SCREEN_WINDOW_FULLSCREEN = 2;
public static final int SCREEN_WINDOW_TINY = 3;
From a098b9a5f57c8fe5108058c55d88b08a2b811ada Mon Sep 17 00:00:00 2001
From: I
Date: Sat, 27 Apr 2019 03:43:14 +0800
Subject: [PATCH 25/33] fix demo
---
jiaozivideoplayer/src/main/java/cn/jzvd/Jzvd.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/jiaozivideoplayer/src/main/java/cn/jzvd/Jzvd.java b/jiaozivideoplayer/src/main/java/cn/jzvd/Jzvd.java
index eb4bcb03..49c2ad43 100644
--- a/jiaozivideoplayer/src/main/java/cn/jzvd/Jzvd.java
+++ b/jiaozivideoplayer/src/main/java/cn/jzvd/Jzvd.java
@@ -227,6 +227,8 @@ public static void startFullscreenDirectly(Context context, Class _class, String
public static void startFullscreenDirectly(Context context, Class _class, JZDataSource jzDataSource) {
JZUtils.hideStatusBar(context);
JZUtils.setRequestedOrientation(context, FULLSCREEN_ORIENTATION);
+ JZUtils.hideSystemUI(context);
+
ViewGroup vp = (ViewGroup) JZUtils.scanForActivity(context).getWindow().getDecorView();
try {
Constructor constructor = _class.getConstructor(Context.class);
@@ -241,7 +243,6 @@ public static void startFullscreenDirectly(Context context, Class _class, JZData
} catch (Exception e) {
e.printStackTrace();
}
-
}
/**
From 2f3c6e3d746bd9026a4b278d0bdf002c7d06d058 Mon Sep 17 00:00:00 2001
From: I
Date: Sat, 27 Apr 2019 17:18:04 +0800
Subject: [PATCH 26/33] exo demo
---
.../java/cn/jzvd/demo/ActivityApiCustomMedia.java | 1 -
.../java/cn/jzvd/demo/CustomMedia/JZMediaExo.java | 13 +++++++++----
2 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/app/src/main/java/cn/jzvd/demo/ActivityApiCustomMedia.java b/app/src/main/java/cn/jzvd/demo/ActivityApiCustomMedia.java
index 894d12b1..d8ee3707 100755
--- a/app/src/main/java/cn/jzvd/demo/ActivityApiCustomMedia.java
+++ b/app/src/main/java/cn/jzvd/demo/ActivityApiCustomMedia.java
@@ -62,7 +62,6 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
public void clickChangeToIjkplayer(View view) {
Jzvd.resetAllVideos();
-
jzvdStd.setUp("http://jzvd.nathen.cn/342a5f7ef6124a4a8faf00e738b8bee4/cf6d9db0bd4d41f59d09ea0a81e918fd-5287d2089db37e62345123a1be272f8b.mp4"
, "饺子快长大", JzvdStd.SCREEN_NORMAL, new JZMediaIjk(jzvdStd));
jzvdStd.startVideo();
diff --git a/app/src/main/java/cn/jzvd/demo/CustomMedia/JZMediaExo.java b/app/src/main/java/cn/jzvd/demo/CustomMedia/JZMediaExo.java
index 2869744c..e43a4a52 100755
--- a/app/src/main/java/cn/jzvd/demo/CustomMedia/JZMediaExo.java
+++ b/app/src/main/java/cn/jzvd/demo/CustomMedia/JZMediaExo.java
@@ -2,6 +2,7 @@
import android.content.Context;
import android.graphics.SurfaceTexture;
+import android.media.MediaPlayer;
import android.net.Uri;
import android.os.Handler;
import android.os.HandlerThread;
@@ -148,11 +149,15 @@ public void seekTo(long time) {
@Override
public void release() {
- if (simpleExoPlayer != null) {
- simpleExoPlayer.release();
+ if (mMediaHandler != null && mMediaHandlerThread != null && simpleExoPlayer != null) {//不知道有没有妖孽
+ HandlerThread tmpHandlerThread = mMediaHandlerThread;
+ SimpleExoPlayer tmpMediaPlayer = simpleExoPlayer;
+ mMediaHandler.post(() -> {
+ tmpMediaPlayer.release();//release就不能放到主线程里,界面会卡顿
+ tmpHandlerThread.quit();
+ });
+ simpleExoPlayer = null;
}
- if (handler != null)
- handler.removeCallbacks(callback);
}
@Override
From 5e4c9bc138886a27f8191a17b3155d97e14c5bf5 Mon Sep 17 00:00:00 2001
From: I
Date: Sun, 28 Apr 2019 00:37:38 +0800
Subject: [PATCH 27/33] fxi fullscreen directly backpress bug
---
.../src/main/java/cn/jzvd/Jzvd.java | 31 +++++++------------
1 file changed, 12 insertions(+), 19 deletions(-)
diff --git a/jiaozivideoplayer/src/main/java/cn/jzvd/Jzvd.java b/jiaozivideoplayer/src/main/java/cn/jzvd/Jzvd.java
index 49c2ad43..f1fd389e 100644
--- a/jiaozivideoplayer/src/main/java/cn/jzvd/Jzvd.java
+++ b/jiaozivideoplayer/src/main/java/cn/jzvd/Jzvd.java
@@ -216,6 +216,9 @@ public static boolean backPress() {
if (CONTAINER_LIST.size() != 0 && CURRENT_JZVD != null) {//判断条件,因为当前所有goBack都是回到普通窗口
CURRENT_JZVD.gotoScreenNormal();
return true;
+ } else if (CONTAINER_LIST.size() == 0 && CURRENT_JZVD != null) {//退出直接进入的全屏
+ CURRENT_JZVD.clearFloatScreen();
+ return true;
}
return false;
}
@@ -237,7 +240,7 @@ public static void startFullscreenDirectly(Context context, Class _class, JZData
ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
vp.addView(jzvd, lp);
jzvd.setUp(jzDataSource, JzvdStd.SCREEN_WINDOW_FULLSCREEN);
- jzvd.startButton.performClick();
+ jzvd.startVideo();
} catch (InstantiationException e) {
e.printStackTrace();
} catch (Exception e) {
@@ -669,20 +672,14 @@ public void addTextureView() {
}
public void clearFloatScreen() {
-// JZUtils.setRequestedOrientation(getContext(), NORMAL_ORIENTATION);
-//// showStatusBar(getContext());
-// ViewGroup vp = (JZUtils.scanForActivity(getContext()))//.getWindow().getDecorView();
-// .findViewById(Window.ID_ANDROID_CONTENT);
-// Jzvd fullJzvd = vp.findViewById(R.id.jz_fullscreen_id);
-// Jzvd tinyJzvd = vp.findViewById(R.id.jz_tiny_id);
-//
-// if (fullJzvd != null) {
-// vp.removeView(fullJzvd);
-// }
-// if (tinyJzvd != null) {
-// vp.removeView(tinyJzvd);
-// }
-// JzvdMgr.setSecondFloor(null);
+ JZUtils.showStatusBar(getContext());
+ JZUtils.setRequestedOrientation(getContext(), NORMAL_ORIENTATION);
+ JZUtils.showSystemUI(getContext());
+
+ ViewGroup vg = (ViewGroup) (JZUtils.scanForActivity(getContext())).getWindow().getDecorView();
+ vg.removeView(this);
+
+ mediaInterface.release();
}
public void onVideoSizeChanged(int width, int height) {
@@ -832,10 +829,6 @@ public void gotoScreenNormal() {//goback本质上是goto
setScreenNormal();//这块可以放到jzvd中
JZUtils.showStatusBar(getContext());
JZUtils.setRequestedOrientation(getContext(), NORMAL_ORIENTATION);
-// CURRENT_JZVD.setSystemUiVisibility(
-// View.SYSTEM_UI_FLAG_LAYOUT_STABLE
-// | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
-// | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);//华为手机和有虚拟键的手机全屏时可隐藏虚拟键 issue:1326
JZUtils.showSystemUI(getContext());
}
From e8126c0c1e094f89349edd8dd5bb5c68b137802c Mon Sep 17 00:00:00 2001
From: Nathen <1066666651@qq.com>
Date: Tue, 30 Apr 2019 01:33:21 +0800
Subject: [PATCH 28/33] fix change url bug
---
app/src/main/java/cn/jzvd/demo/ActivityMain.java | 1 +
app/src/main/java/cn/jzvd/demo/AdapterRecyclerViewTiny.java | 1 -
.../main/java/cn/jzvd/demo/CustomJzvd/JzvdStdTinyWindow.java | 1 -
jiaozivideoplayer/src/main/java/cn/jzvd/JZMediaSystem.java | 5 +++--
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/app/src/main/java/cn/jzvd/demo/ActivityMain.java b/app/src/main/java/cn/jzvd/demo/ActivityMain.java
index dc5e96ce..3a903eed 100644
--- a/app/src/main/java/cn/jzvd/demo/ActivityMain.java
+++ b/app/src/main/java/cn/jzvd/demo/ActivityMain.java
@@ -28,6 +28,7 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
myJzvdStd.setUp("http://jzvd.nathen.cn/342a5f7ef6124a4a8faf00e738b8bee4/cf6d9db0bd4d41f59d09ea0a81e918fd-5287d2089db37e62345123a1be272f8b.mp4"
, "饺子快长大", JzvdStd.SCREEN_NORMAL);
Glide.with(this).load("http://jzvd-pic.nathen.cn/jzvd-pic/1bb2ebbe-140d-4e2e-abd2-9e7e564f71ac.png").into(myJzvdStd.thumbImageView);
+
}
@Override
diff --git a/app/src/main/java/cn/jzvd/demo/AdapterRecyclerViewTiny.java b/app/src/main/java/cn/jzvd/demo/AdapterRecyclerViewTiny.java
index 6ff9f990..6d0d9331 100644
--- a/app/src/main/java/cn/jzvd/demo/AdapterRecyclerViewTiny.java
+++ b/app/src/main/java/cn/jzvd/demo/AdapterRecyclerViewTiny.java
@@ -49,7 +49,6 @@ public void onBindViewHolder(MyViewHolder holder, int position) {
VideoConstant.videoUrls[0][position],
VideoConstant.videoTitles[0][position], Jzvd.SCREEN_NORMAL);
Glide.with(holder.jzvdStd.getContext()).load(VideoConstant.videoThumbs[0][position]).into(holder.jzvdStd.thumbImageView);
- System.out.println("fsdfsa onBindViewHolder " + holder.jzvdStd.jzDataSource.title);
}
@Override
diff --git a/app/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdTinyWindow.java b/app/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdTinyWindow.java
index 17162fb0..c1cf82cd 100644
--- a/app/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdTinyWindow.java
+++ b/app/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdTinyWindow.java
@@ -89,7 +89,6 @@ public void gotoScreenTiny() {
lp.gravity = Gravity.RIGHT | Gravity.BOTTOM;
//添加滑动事件等
vgg.addView(this, lp);
- System.out.println(jj + " " + this);
setScreenTiny();
}
diff --git a/jiaozivideoplayer/src/main/java/cn/jzvd/JZMediaSystem.java b/jiaozivideoplayer/src/main/java/cn/jzvd/JZMediaSystem.java
index 6d832f83..c7f5d05a 100644
--- a/jiaozivideoplayer/src/main/java/cn/jzvd/JZMediaSystem.java
+++ b/jiaozivideoplayer/src/main/java/cn/jzvd/JZMediaSystem.java
@@ -84,12 +84,13 @@ public void seekTo(long time) {
}
@Override
- public void release() {
+ public void release() {//not perfect change you later
if (mMediaHandler != null && mMediaHandlerThread != null && mediaPlayer != null) {//不知道有没有妖孽
HandlerThread tmpHandlerThread = mMediaHandlerThread;
MediaPlayer tmpMediaPlayer = mediaPlayer;
+ tmpMediaPlayer.setSurface(null);
mMediaHandler.post(() -> {
- tmpMediaPlayer.release();//release就不能放到主线程里,界面会卡顿
+ tmpMediaPlayer.release();
tmpHandlerThread.quit();
});
mediaPlayer = null;
From 99773ba2940f6f18a91acba7ced20de43d49b8b0 Mon Sep 17 00:00:00 2001
From: Nathen <1066666651@qq.com>
Date: Tue, 30 Apr 2019 16:35:59 +0800
Subject: [PATCH 29/33] fix bug of goto logic
---
.../demo/CustomJzvd/JzvdStdTinyWindow.java | 61 +------------------
.../src/main/java/cn/jzvd/Jzvd.java | 25 +++++++-
2 files changed, 25 insertions(+), 61 deletions(-)
diff --git a/app/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdTinyWindow.java b/app/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdTinyWindow.java
index c1cf82cd..56164b9d 100644
--- a/app/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdTinyWindow.java
+++ b/app/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdTinyWindow.java
@@ -30,49 +30,7 @@ public JzvdStdTinyWindow(Context context, AttributeSet attrs) {
@Override
public void setUp(JZDataSource jzDataSource, int screen, JZMediaInterface jzMediaInterface) {
-// //滑动列表的时候
-// //如果滑动过快,setUp在scroll之前生效
-// //setUp是原来的url 不是原来的url
-// //这个是clone出来的
-//
-// //滑出去进入小窗, 当前的url和正在播放的url不一样,
-//// if (!jzDataSource.containsTheUrl(CURRENT_JZVD.jzDataSource.getCurrentUrl())) {
-//// //进入小窗
-//// gotoScreenTiny();
-//// }
-// //滑进来,退出小窗
-//
-//
-// ////
-// if (CURRENT_JZVD != null) {
-// if (this == CURRENT_JZVD && jzDataSource.containsTheUrl(CURRENT_JZVD.jzDataSource.getCurrentUrl())) {
-// //不理解
-// } else if (this == CURRENT_JZVD && !jzDataSource.containsTheUrl(CURRENT_JZVD.jzDataSource.getCurrentUrl())) {
-// gotoScreenTiny();
-// } else if (this != CURRENT_JZVD && jzDataSource.containsTheUrl(CURRENT_JZVD.jzDataSource.getCurrentUrl())) {
-// if (CURRENT_JZVD.currentScreen == SCREEN_WINDOW_TINY) {
-// //需要退出小窗退到我这里,我这里是第一层级
-// //clear container, goback
-// ViewGroup vp = (ViewGroup) getParent();
-// vp.removeAllViews();
-// ((ViewGroup) CURRENT_JZVD.getParent()).removeAllViews();
-// vp.addView(CURRENT_JZVD);
-// CONTAINER_LIST.pop();
-// }
-// } else if (this != CURRENT_JZVD && !jzDataSource.containsTheUrl(CURRENT_JZVD.jzDataSource.getCurrentUrl())) {
-// }
-// }
- //如果被复用了,tiny已经出现,然后继续下拉出现,新的item复用正在播放的jzvd
-// if (jzDataSource.containsTheUrl(CURRENT_JZVD.jzDataSource.getCurrentUrl())) {
-//
-// }
-
-// if (this.jzDataSource != null)
-// System.out.println("fdsfdsaf new " + this.jzDataSource.title + " " + CURRENT_JZVD + " " + this);
-
super.setUp(jzDataSource, screen, jzMediaInterface);
-
-// System.out.println("fdsfdsaf " + jzDataSource.title);
}
public void gotoScreenTiny() {
@@ -92,22 +50,5 @@ public void gotoScreenTiny() {
setScreenTiny();
}
- public Jzvd cloneMe() {
- JzvdStdTinyWindow jzvd = null;
- try {
- Constructor constructor = (Constructor) JzvdStdTinyWindow.this.getClass().getConstructor(Context.class);
- jzvd = constructor.newInstance(getContext());
- jzvd.jzDataSource = jzDataSource.cloneMe();//jzvd应该是idle状态
- jzvd.setId(getId());
- } catch (IllegalAccessException e) {
- e.printStackTrace();
- } catch (InstantiationException e) {
- e.printStackTrace();
- } catch (InvocationTargetException e) {
- e.printStackTrace();
- } catch (NoSuchMethodException e) {
- e.printStackTrace();
- }
- return jzvd;
- }
+
}
diff --git a/jiaozivideoplayer/src/main/java/cn/jzvd/Jzvd.java b/jiaozivideoplayer/src/main/java/cn/jzvd/Jzvd.java
index f1fd389e..8f911255 100644
--- a/jiaozivideoplayer/src/main/java/cn/jzvd/Jzvd.java
+++ b/jiaozivideoplayer/src/main/java/cn/jzvd/Jzvd.java
@@ -24,6 +24,7 @@
import android.widget.Toast;
import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
import java.util.LinkedList;
import java.util.Timer;
import java.util.TimerTask;
@@ -216,7 +217,7 @@ public static boolean backPress() {
if (CONTAINER_LIST.size() != 0 && CURRENT_JZVD != null) {//判断条件,因为当前所有goBack都是回到普通窗口
CURRENT_JZVD.gotoScreenNormal();
return true;
- } else if (CONTAINER_LIST.size() == 0 && CURRENT_JZVD != null) {//退出直接进入的全屏
+ } else if (CONTAINER_LIST.size() == 0 && CURRENT_JZVD != null && CURRENT_JZVD.currentScreen != SCREEN_NORMAL) {//退出直接进入的全屏
CURRENT_JZVD.clearFloatScreen();
return true;
}
@@ -802,9 +803,31 @@ public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
}
}
+ public Jzvd cloneMe() {
+ Jzvd jzvd = null;
+ try {
+ Constructor constructor = (Constructor) Jzvd.this.getClass().getConstructor(Context.class);
+ jzvd = constructor.newInstance(getContext());
+ jzvd.setId(getId());
+ } catch (IllegalAccessException e) {
+ e.printStackTrace();
+ } catch (InstantiationException e) {
+ e.printStackTrace();
+ } catch (InvocationTargetException e) {
+ e.printStackTrace();
+ } catch (NoSuchMethodException e) {
+ e.printStackTrace();
+ }
+ return jzvd;
+ }
+
public void gotoScreenFullscreen() {
ViewGroup vg = (ViewGroup) getParent();
vg.removeView(this);
+ Jzvd tmp = cloneMe();
+ vg.addView(tmp);
+ tmp.setUp(jzDataSource.cloneMe(), SCREEN_NORMAL, new JZMediaSystem(this));//这里应该用class参数
+
CONTAINER_LIST.add(vg);
vg = (ViewGroup) (JZUtils.scanForActivity(getContext())).getWindow().getDecorView();//和他也没有关系
vg.addView(this, new FrameLayout.LayoutParams(
From 82ea8e17b7a0d68b00139f529131c950ecf87a69 Mon Sep 17 00:00:00 2001
From: Nathen <1066666651@qq.com>
Date: Tue, 30 Apr 2019 18:36:15 +0800
Subject: [PATCH 30/33] make interface class
---
.../cn/jzvd/demo/ActivityApiCustomMedia.java | 8 +++---
.../cn/jzvd/demo/CustomJzvd/JzvdStdList.java | 4 +--
.../demo/CustomJzvd/JzvdStdTinyWindow.java | 4 +--
.../src/main/java/cn/jzvd/JZMediaSystem.java | 2 +-
.../src/main/java/cn/jzvd/Jzvd.java | 26 ++++++++++++++-----
.../src/main/java/cn/jzvd/JzvdStd.java | 4 +--
6 files changed, 31 insertions(+), 17 deletions(-)
diff --git a/app/src/main/java/cn/jzvd/demo/ActivityApiCustomMedia.java b/app/src/main/java/cn/jzvd/demo/ActivityApiCustomMedia.java
index d8ee3707..aef07b3c 100755
--- a/app/src/main/java/cn/jzvd/demo/ActivityApiCustomMedia.java
+++ b/app/src/main/java/cn/jzvd/demo/ActivityApiCustomMedia.java
@@ -47,7 +47,7 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
} catch (IOException e) {
e.printStackTrace();
}
- jzvdStd.setUp(jzDataSource, JzvdStd.SCREEN_NORMAL, new JZMediaSystemAssertFolder(jzvdStd));
+ jzvdStd.setUp(jzDataSource, JzvdStd.SCREEN_NORMAL, JZMediaSystemAssertFolder.class);
// jzvdStd.setUp("http://jzvd.nathen.cn/342a5f7ef6124a4a8faf00e738b8bee4/cf6d9db0bd4d41f59d09ea0a81e918fd-5287d2089db37e62345123a1be272f8b.mp4"
@@ -63,7 +63,7 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
public void clickChangeToIjkplayer(View view) {
Jzvd.resetAllVideos();
jzvdStd.setUp("http://jzvd.nathen.cn/342a5f7ef6124a4a8faf00e738b8bee4/cf6d9db0bd4d41f59d09ea0a81e918fd-5287d2089db37e62345123a1be272f8b.mp4"
- , "饺子快长大", JzvdStd.SCREEN_NORMAL, new JZMediaIjk(jzvdStd));
+ , "饺子快长大", JzvdStd.SCREEN_NORMAL, JZMediaIjk.class);
jzvdStd.startVideo();
Toast.makeText(this, "Change to Ijkplayer", Toast.LENGTH_SHORT).show();
}
@@ -71,7 +71,7 @@ public void clickChangeToIjkplayer(View view) {
public void clickChangeToSystem(View view) {
Jzvd.resetAllVideos();
jzvdStd.setUp("http://jzvd.nathen.cn/342a5f7ef6124a4a8faf00e738b8bee4/cf6d9db0bd4d41f59d09ea0a81e918fd-5287d2089db37e62345123a1be272f8b.mp4"
- , "饺子快长大", JzvdStd.SCREEN_NORMAL, new JZMediaSystem(jzvdStd));
+ , "饺子快长大", JzvdStd.SCREEN_NORMAL, JZMediaSystem.class);
jzvdStd.startVideo();
Toast.makeText(this, "Change to MediaPlayer", Toast.LENGTH_SHORT).show();
}
@@ -79,7 +79,7 @@ public void clickChangeToSystem(View view) {
public void clickChangeToExo(View view) {
Jzvd.resetAllVideos();
jzvdStd.setUp("http://jzvd.nathen.cn/342a5f7ef6124a4a8faf00e738b8bee4/cf6d9db0bd4d41f59d09ea0a81e918fd-5287d2089db37e62345123a1be272f8b.mp4"
- , "饺子快长大", JzvdStd.SCREEN_NORMAL, new JZMediaExo(jzvdStd));
+ , "饺子快长大", JzvdStd.SCREEN_NORMAL, JZMediaExo.class);
jzvdStd.startVideo();
Toast.makeText(this, "Change to ExoPlayer", Toast.LENGTH_SHORT).show();
}
diff --git a/app/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdList.java b/app/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdList.java
index a01b6720..d5b0bd75 100644
--- a/app/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdList.java
+++ b/app/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdList.java
@@ -19,8 +19,8 @@ public JzvdStdList(Context context, AttributeSet attrs) {
}
@Override
- public void setUp(JZDataSource jzDataSource, int screen, JZMediaInterface jzMediaInterface) {
- super.setUp(jzDataSource, screen, jzMediaInterface);
+ public void setUp(JZDataSource jzDataSource, int screen, Class mediaInterface) {
+ super.setUp(jzDataSource, screen, mediaInterface);
if (jzDataSource.containsTheUrl(Jzvd.CURRENT_JZVD.jzDataSource.getCurrentUrl())) {
long position = 0;
diff --git a/app/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdTinyWindow.java b/app/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdTinyWindow.java
index 56164b9d..845f9211 100644
--- a/app/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdTinyWindow.java
+++ b/app/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdTinyWindow.java
@@ -29,8 +29,8 @@ public JzvdStdTinyWindow(Context context, AttributeSet attrs) {
}
@Override
- public void setUp(JZDataSource jzDataSource, int screen, JZMediaInterface jzMediaInterface) {
- super.setUp(jzDataSource, screen, jzMediaInterface);
+ public void setUp(JZDataSource jzDataSource, int screen, Class mediaInterface) {
+ super.setUp(jzDataSource, screen, mediaInterface);
}
public void gotoScreenTiny() {
diff --git a/jiaozivideoplayer/src/main/java/cn/jzvd/JZMediaSystem.java b/jiaozivideoplayer/src/main/java/cn/jzvd/JZMediaSystem.java
index c7f5d05a..84b44b0d 100644
--- a/jiaozivideoplayer/src/main/java/cn/jzvd/JZMediaSystem.java
+++ b/jiaozivideoplayer/src/main/java/cn/jzvd/JZMediaSystem.java
@@ -50,7 +50,7 @@ public void prepare() {
Method method = clazz.getDeclaredMethod("setDataSource", String.class, Map.class);
method.invoke(mediaPlayer, jzvd.jzDataSource.getCurrentUrl().toString(), jzvd.jzDataSource.headerMap);
mediaPlayer.prepareAsync();
- mediaPlayer.setSurface(new Surface(jzvd.textureView.getSurfaceTexture()));
+ mediaPlayer.setSurface(new Surface(SAVED_SURFACE));
} catch (Exception e) {
e.printStackTrace();
}
diff --git a/jiaozivideoplayer/src/main/java/cn/jzvd/Jzvd.java b/jiaozivideoplayer/src/main/java/cn/jzvd/Jzvd.java
index 8f911255..145057d0 100644
--- a/jiaozivideoplayer/src/main/java/cn/jzvd/Jzvd.java
+++ b/jiaozivideoplayer/src/main/java/cn/jzvd/Jzvd.java
@@ -107,6 +107,7 @@ public void onAudioFocusChange(int focusChange) {
public int positionInList = -1;//很想干掉它
public int videoRotation = 0;
public JZMediaInterface mediaInterface;
+ public Class mediaInterfaceClass;
public JZTextureView textureView;
public int seekToManulPosition = -1;
protected Timer UPDATE_PROGRESS_TIMER;
@@ -288,21 +289,21 @@ public void setUp(String url, String title, int screen) {
setUp(new JZDataSource(url, title), screen);
}
- public void setUp(String url, String title, int screen, JZMediaInterface jzMediaInterface) {
- setUp(new JZDataSource(url, title), screen, jzMediaInterface);
+ public void setUp(String url, String title, int screen, Class mediaInterfaceClass) {
+ setUp(new JZDataSource(url, title), screen, mediaInterfaceClass);
}
public void setUp(JZDataSource jzDataSource, int screen) {
- setUp(jzDataSource, screen, new JZMediaSystem(this));
+ setUp(jzDataSource, screen, JZMediaSystem.class);
}
- public void setUp(JZDataSource jzDataSource, int screen, JZMediaInterface jzMediaInterface) {
+ public void setUp(JZDataSource jzDataSource, int screen, Class mediaInterfaceClass) {
if ((System.currentTimeMillis() - gobakFullscreenTime) < 200) return;
this.jzDataSource = jzDataSource;
this.currentScreen = screen;
onStateNormal();
- mediaInterface = jzMediaInterface;//这个位置可能需要调整
+ this.mediaInterfaceClass = mediaInterfaceClass;
}
@Override
@@ -466,6 +467,19 @@ public boolean onTouch(View v, MotionEvent event) {
public void startVideo() {
Log.d(TAG, "startVideo [" + this.hashCode() + "] ");
setCurrentJzvd(this);
+ Constructor constructor = null;
+ try {
+ constructor = mediaInterfaceClass.getConstructor(Jzvd.class);
+ this.mediaInterface = constructor.newInstance(this);
+ } catch (NoSuchMethodException e) {
+ e.printStackTrace();
+ } catch (IllegalAccessException e) {
+ e.printStackTrace();
+ } catch (InstantiationException e) {
+ e.printStackTrace();
+ } catch (InvocationTargetException e) {
+ e.printStackTrace();
+ }
addTextureView();
AudioManager mAudioManager = (AudioManager) getApplicationContext().getSystemService(Context.AUDIO_SERVICE);
mAudioManager.requestAudioFocus(onAudioFocusChangeListener, AudioManager.STREAM_MUSIC, AudioManager.AUDIOFOCUS_GAIN_TRANSIENT);
@@ -826,7 +840,7 @@ public void gotoScreenFullscreen() {
vg.removeView(this);
Jzvd tmp = cloneMe();
vg.addView(tmp);
- tmp.setUp(jzDataSource.cloneMe(), SCREEN_NORMAL, new JZMediaSystem(this));//这里应该用class参数
+ tmp.setUp(jzDataSource.cloneMe(), SCREEN_NORMAL, mediaInterfaceClass);//这里应该用class参数
CONTAINER_LIST.add(vg);
vg = (ViewGroup) (JZUtils.scanForActivity(getContext())).getWindow().getDecorView();//和他也没有关系
diff --git a/jiaozivideoplayer/src/main/java/cn/jzvd/JzvdStd.java b/jiaozivideoplayer/src/main/java/cn/jzvd/JzvdStd.java
index 1d6bbaff..95ba1ae2 100644
--- a/jiaozivideoplayer/src/main/java/cn/jzvd/JzvdStd.java
+++ b/jiaozivideoplayer/src/main/java/cn/jzvd/JzvdStd.java
@@ -114,8 +114,8 @@ public void init(Context context) {
mRetryBtn.setOnClickListener(this);
}
- public void setUp(JZDataSource jzDataSource, int screen, JZMediaInterface jzMediaInterface) {
- super.setUp(jzDataSource, screen, jzMediaInterface);
+ public void setUp(JZDataSource jzDataSource, int screen, Class mediaInterfaceClass) {
+ super.setUp(jzDataSource, screen, mediaInterfaceClass);
titleTextView.setText(jzDataSource.title);
setScreen(screen);
}
From 4b5fda4e2a82cd94805ce6429bad4c068a68ecc7 Mon Sep 17 00:00:00 2001
From: Nathen <1066666651@qq.com>
Date: Tue, 30 Apr 2019 18:48:34 +0800
Subject: [PATCH 31/33] fix ui slow
---
jiaozivideoplayer/src/main/java/cn/jzvd/JZMediaSystem.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/jiaozivideoplayer/src/main/java/cn/jzvd/JZMediaSystem.java b/jiaozivideoplayer/src/main/java/cn/jzvd/JZMediaSystem.java
index 84b44b0d..cb3bc5c1 100644
--- a/jiaozivideoplayer/src/main/java/cn/jzvd/JZMediaSystem.java
+++ b/jiaozivideoplayer/src/main/java/cn/jzvd/JZMediaSystem.java
@@ -88,8 +88,8 @@ public void release() {//not perfect change you later
if (mMediaHandler != null && mMediaHandlerThread != null && mediaPlayer != null) {//不知道有没有妖孽
HandlerThread tmpHandlerThread = mMediaHandlerThread;
MediaPlayer tmpMediaPlayer = mediaPlayer;
- tmpMediaPlayer.setSurface(null);
mMediaHandler.post(() -> {
+ tmpMediaPlayer.setSurface(null);
tmpMediaPlayer.release();
tmpHandlerThread.quit();
});
From 7c4944034e720b9002225f33684abdbc5fa20597 Mon Sep 17 00:00:00 2001
From: Nathen <1066666651@qq.com>
Date: Tue, 30 Apr 2019 21:50:00 +0800
Subject: [PATCH 32/33] fix bug
---
.../java/cn/jzvd/demo/ActivityTinyWindow.java | 6 ++++--
.../cn/jzvd/demo/AdapterRecyclerViewTiny.java | 8 -------
.../demo/CustomJzvd/JzvdStdTinyWindow.java | 7 +------
.../src/main/java/cn/jzvd/Jzvd.java | 21 ++++++-------------
.../src/main/java/cn/jzvd/JzvdStd.java | 2 +-
5 files changed, 12 insertions(+), 32 deletions(-)
diff --git a/app/src/main/java/cn/jzvd/demo/ActivityTinyWindow.java b/app/src/main/java/cn/jzvd/demo/ActivityTinyWindow.java
index d31c327d..0e18f7a6 100644
--- a/app/src/main/java/cn/jzvd/demo/ActivityTinyWindow.java
+++ b/app/src/main/java/cn/jzvd/demo/ActivityTinyWindow.java
@@ -72,10 +72,12 @@ public void clickTinyWindow(View view) {
}
public void clickAutoTinyListViewRecyclerView(View view) {
- startActivity(new Intent(this, ActivityTinyWindowRecycleView.class));
+ Toast.makeText(this, "comming soon", Toast.LENGTH_SHORT).show();
+// startActivity(new Intent(this, ActivityTinyWindowRecycleView.class));
}
public void clickAutoTinyListViewRecyclerViewMultiHolder(View view) {
- startActivity(new Intent(this, ActivityTinyWindowRecycleViewMultiHolder.class));
+ Toast.makeText(this, "comming soon", Toast.LENGTH_SHORT).show();
+// startActivity(new Intent(this, ActivityTinyWindowRecycleViewMultiHolder.class));
}
}
diff --git a/app/src/main/java/cn/jzvd/demo/AdapterRecyclerViewTiny.java b/app/src/main/java/cn/jzvd/demo/AdapterRecyclerViewTiny.java
index 6d0d9331..035d5de2 100644
--- a/app/src/main/java/cn/jzvd/demo/AdapterRecyclerViewTiny.java
+++ b/app/src/main/java/cn/jzvd/demo/AdapterRecyclerViewTiny.java
@@ -35,16 +35,8 @@ public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
@Override
public void onBindViewHolder(MyViewHolder holder, int position) {
Log.i(TAG, "onBindViewHolder [" + holder.jzvdStd.hashCode() + "] position=" + position);
- //进入小窗之后,这个jzvd已经被移动走了,判断,如果jzvdstd==currentJzvd==小窗,那么就给jzvdStd重新赋值,赋值成clone出来的jzvd
-
-// if (Jzvd.CURRENT_JZVD != null && holder.jzvdStd.jzDataSource != null &&
-// ==Jzvd.CURRENT_JZVD &&
-// Jzvd.CURRENT_JZVD.currentScreen == Jzvd.SCREEN_WINDOW_TINY){
if (holder.jzvdStd.getTag() != null)
holder.jzvdStd = ((View) holder.jzvdStd.getTag()).findViewById(R.id.videoplayer);
-// System.out.println("fsdfsa onBindViewHolder " + holder.jzvdStd.jzDataSource.title);
-// }//第二次来的时候需不需要替换
-
holder.jzvdStd.setUp(
VideoConstant.videoUrls[0][position],
VideoConstant.videoTitles[0][position], Jzvd.SCREEN_NORMAL);
diff --git a/app/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdTinyWindow.java b/app/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdTinyWindow.java
index 845f9211..6bfa0564 100644
--- a/app/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdTinyWindow.java
+++ b/app/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdTinyWindow.java
@@ -7,11 +7,7 @@
import android.view.ViewGroup;
import android.widget.FrameLayout;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-
import cn.jzvd.JZDataSource;
-import cn.jzvd.JZMediaInterface;
import cn.jzvd.JZUtils;
import cn.jzvd.Jzvd;
import cn.jzvd.JzvdStd;
@@ -39,8 +35,7 @@ public void gotoScreenTiny() {
return;
ViewGroup vg = (ViewGroup) getParent();
vg.removeView(this);
- Jzvd jj = cloneMe();
- vg.addView(jj);
+ cloneAJzvd(vg);
CONTAINER_LIST.add(vg);
ViewGroup vgg = (ViewGroup) (JZUtils.scanForActivity(getContext())).getWindow().getDecorView();//和他也没有关系
FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(400, 400);
diff --git a/jiaozivideoplayer/src/main/java/cn/jzvd/Jzvd.java b/jiaozivideoplayer/src/main/java/cn/jzvd/Jzvd.java
index 145057d0..d45cece8 100644
--- a/jiaozivideoplayer/src/main/java/cn/jzvd/Jzvd.java
+++ b/jiaozivideoplayer/src/main/java/cn/jzvd/Jzvd.java
@@ -165,12 +165,6 @@ public static void goOnPlayOnResume() {
}
}
-
- public static void onScrollReleaseAllVideos(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
- //以后这种功能不要写在jzvd里了,让用户看看详细的也能更了解
-
- }
-
public static void goOnPlayOnPause() {
if (CURRENT_JZVD != null) {
if (CURRENT_JZVD.currentState == Jzvd.CURRENT_STATE_AUTO_COMPLETE ||
@@ -693,7 +687,7 @@ public void clearFloatScreen() {
ViewGroup vg = (ViewGroup) (JZUtils.scanForActivity(getContext())).getWindow().getDecorView();
vg.removeView(this);
-
+ CURRENT_JZVD = null;
mediaInterface.release();
}
@@ -817,12 +811,13 @@ public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
}
}
- public Jzvd cloneMe() {
- Jzvd jzvd = null;
+ public void cloneAJzvd(ViewGroup vg) {
try {
Constructor constructor = (Constructor) Jzvd.this.getClass().getConstructor(Context.class);
- jzvd = constructor.newInstance(getContext());
+ Jzvd jzvd = constructor.newInstance(getContext());
jzvd.setId(getId());
+ vg.addView(jzvd);
+ jzvd.setUp(jzDataSource.cloneMe(), SCREEN_NORMAL, mediaInterfaceClass);
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InstantiationException e) {
@@ -832,16 +827,12 @@ public Jzvd cloneMe() {
} catch (NoSuchMethodException e) {
e.printStackTrace();
}
- return jzvd;
}
public void gotoScreenFullscreen() {
ViewGroup vg = (ViewGroup) getParent();
vg.removeView(this);
- Jzvd tmp = cloneMe();
- vg.addView(tmp);
- tmp.setUp(jzDataSource.cloneMe(), SCREEN_NORMAL, mediaInterfaceClass);//这里应该用class参数
-
+ cloneAJzvd(vg);
CONTAINER_LIST.add(vg);
vg = (ViewGroup) (JZUtils.scanForActivity(getContext())).getWindow().getDecorView();//和他也没有关系
vg.addView(this, new FrameLayout.LayoutParams(
diff --git a/jiaozivideoplayer/src/main/java/cn/jzvd/JzvdStd.java b/jiaozivideoplayer/src/main/java/cn/jzvd/JzvdStd.java
index 95ba1ae2..ee9cc056 100644
--- a/jiaozivideoplayer/src/main/java/cn/jzvd/JzvdStd.java
+++ b/jiaozivideoplayer/src/main/java/cn/jzvd/JzvdStd.java
@@ -290,7 +290,7 @@ public void onClick(View v) {
} else if (i == R.id.back) {
backPress();
} else if (i == R.id.back_tiny) {
- backPress();
+ clearFloatScreen();
} else if (i == R.id.clarity) {
LayoutInflater inflater = (LayoutInflater) getContext()
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
From 54f037265d5e8c5053cfc426e5d97c1e332a943e Mon Sep 17 00:00:00 2001
From: Nathen <1066666651@qq.com>
Date: Wed, 1 May 2019 17:44:47 +0800
Subject: [PATCH 33/33] v7.0.1
---
app/build.gradle | 4 ++--
gradle/maven_push.gradle | 2 +-
jiaozivideoplayer/build.gradle | 4 ++--
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/app/build.gradle b/app/build.gradle
index 2dd262bb..b13b5440 100755
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -7,8 +7,8 @@ android {
applicationId "cn.jzvd.demo"
minSdkVersion 16
targetSdkVersion 28
- versionCode 88
- versionName "7.0_preview"
+ versionCode 89
+ versionName "7.0.1"
}
signingConfigs {
releaseConfig {
diff --git a/gradle/maven_push.gradle b/gradle/maven_push.gradle
index 027d7781..829b7569 100644
--- a/gradle/maven_push.gradle
+++ b/gradle/maven_push.gradle
@@ -22,7 +22,7 @@ signing {
group = "cn.jzvd"
archivesBaseName = "jiaozivideoplayer"
-version = "7.0_preview"
+version = "7.0.1"
uploadArchives {
repositories {
diff --git a/jiaozivideoplayer/build.gradle b/jiaozivideoplayer/build.gradle
index e56330b6..5b474fbb 100644
--- a/jiaozivideoplayer/build.gradle
+++ b/jiaozivideoplayer/build.gradle
@@ -6,8 +6,8 @@ android {
defaultConfig {
minSdkVersion 16
targetSdkVersion 28
- versionCode 88
- versionName "7.0_preview"
+ versionCode 89
+ versionName "7.0.1"
}
buildTypes {
release {