From 5290fa2bba661849eb6b97bfbce3c514a0488000 Mon Sep 17 00:00:00 2001 From: monsterLin Date: Tue, 26 May 2020 15:50:30 +0800 Subject: [PATCH 1/5] =?UTF-8?q?fix(touch):=20=E4=BF=AE=E5=A4=8D=E5=85=A8?= =?UTF-8?q?=E5=B1=8F=E7=8A=B6=E6=80=81=E5=B7=A6=E4=BE=A7=E6=94=B9=E5=8F=98?= =?UTF-8?q?=E4=BA=AE=E5=BA=A6=E5=9D=90=E6=A0=87=E4=B8=8D=E5=87=86=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/src/main/java/cn/jzvd/Jzvd.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/src/main/java/cn/jzvd/Jzvd.java b/library/src/main/java/cn/jzvd/Jzvd.java index b75a1e9a..735a0df4 100644 --- a/library/src/main/java/cn/jzvd/Jzvd.java +++ b/library/src/main/java/cn/jzvd/Jzvd.java @@ -439,7 +439,7 @@ protected void touchActionMove(float x, float y) { } } else { //如果y轴滑动距离超过设置的处理范围,那么进行滑动事件处理 - if (mDownX < mScreenWidth * 0.5f) {//左侧改变亮度 + if (mDownX < mScreenHeight * 0.5f) {//左侧改变亮度 mChangeBrightness = true; WindowManager.LayoutParams lp = JZUtils.getWindow(getContext()).getAttributes(); if (lp.screenBrightness < 0) { From 834b627be4295d23c55f2c72b5237b1d2e4dab16 Mon Sep 17 00:00:00 2001 From: Nathen <1066666651@qq.com> Date: Wed, 27 May 2020 10:14:47 +0800 Subject: [PATCH 2/5] Update README.md --- README.md | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index b2ae9e63..d7556b29 100644 --- a/README.md +++ b/README.md @@ -42,14 +42,10 @@ implementation 'cn.jzvd:jiaozivideoplayer:7.4.0' 2.添加布局 ```xml - - - + android:layout_height="200dp" /> ``` 3.设置视频地址、缩略图地址、标题 From b2d4ea6d16ad6a4f6079a7fda3dc7bd6e50385b2 Mon Sep 17 00:00:00 2001 From: Liberations <1487098940@qq.com> Date: Wed, 27 May 2020 10:50:43 +0800 Subject: [PATCH 3/5] Reset Jzvd LayoutParams --- library/src/main/java/cn/jzvd/Jzvd.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/library/src/main/java/cn/jzvd/Jzvd.java b/library/src/main/java/cn/jzvd/Jzvd.java index b75a1e9a..f1067b7b 100644 --- a/library/src/main/java/cn/jzvd/Jzvd.java +++ b/library/src/main/java/cn/jzvd/Jzvd.java @@ -671,11 +671,9 @@ public void gotoNormalCompletion() { ViewGroup vg = (ViewGroup) (JZUtils.scanForActivity(jzvdContext)).getWindow().getDecorView(); vg.removeView(this); textureViewContainer.removeView(textureView); - CONTAINER_LIST.getLast().removeAllViews(); - CONTAINER_LIST.getLast().addView(this, new FrameLayout.LayoutParams( - ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)); + CONTAINER_LIST.getLast().removeViewAt(blockIndex);//remove block + CONTAINER_LIST.getLast().addView(this, blockIndex, blockLayoutParams); CONTAINER_LIST.pop(); - setScreenNormal(); JZUtils.showStatusBar(jzvdContext); JZUtils.setRequestedOrientation(jzvdContext, NORMAL_ORIENTATION); From 345823a77a39310bb0c838fabc7941bc36c4dd8f Mon Sep 17 00:00:00 2001 From: Nathen <1066666651@qq.com> Date: Thu, 28 May 2020 04:40:39 +0800 Subject: [PATCH 4/5] fix tiny window bug --- .../JzvdStdShowTitleAfterFullscreen.java | 8 ++++---- .../demo/CustomJzvd/JzvdStdTinyWindow.java | 10 ++++++++-- .../JzvdStdVolumeAfterFullscreen.java | 4 ++-- .../cn/jzvd/demo/CustomJzvd/MyJzvdStd.java | 8 ++++---- .../demo/TinyWindow/TinyWindowActivity.java | 2 +- .../TinyWindowRecycleViewActivity.java | 2 +- ...nyWindowRecycleViewMultiHolderActivity.java | 2 +- .../jzvd/demo/api/BigUIChangeAG/AGVideo.java | 2 +- library/src/main/java/cn/jzvd/Jzvd.java | 18 +++++++++--------- 9 files changed, 31 insertions(+), 25 deletions(-) diff --git a/demo/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdShowTitleAfterFullscreen.java b/demo/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdShowTitleAfterFullscreen.java index ae1d019d..4b2a03c2 100644 --- a/demo/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdShowTitleAfterFullscreen.java +++ b/demo/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdShowTitleAfterFullscreen.java @@ -27,15 +27,15 @@ public void setUp(JZDataSource jzDataSource, int screen) { } @Override - public void gotoScreenFullscreen() { - super.gotoScreenFullscreen(); + public void gotoFullscreen() { + super.gotoFullscreen(); titleTextView.setVisibility(View.VISIBLE); } @Override - public void gotoScreenNormal() { - super.gotoScreenNormal(); + public void gotoNormalScreen() { + super.gotoNormalScreen(); titleTextView.setVisibility(View.INVISIBLE); } } diff --git a/demo/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdTinyWindow.java b/demo/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdTinyWindow.java index 5b8d7228..536ac9e1 100644 --- a/demo/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdTinyWindow.java +++ b/demo/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdTinyWindow.java @@ -28,14 +28,21 @@ public void setUp(JZDataSource jzDataSource, int screen, Class mediaInterface) { super.setUp(jzDataSource, screen, mediaInterface); } - public void gotoScreenTiny() { + public void gotoTinyScreen() { Log.i(TAG, "startWindowTiny " + " [" + this.hashCode() + "] "); if (state == STATE_NORMAL || state == STATE_ERROR || state == STATE_AUTO_COMPLETE) return; ViewGroup vg = (ViewGroup) getParent(); + jzvdContext = vg.getContext(); + blockLayoutParams = getLayoutParams(); + blockIndex = vg.indexOfChild(this); + blockWidth = getWidth(); + blockHeight = getHeight(); + vg.removeView(this); cloneAJzvd(vg); 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; @@ -44,5 +51,4 @@ public void gotoScreenTiny() { setScreenTiny(); } - } diff --git a/demo/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdVolumeAfterFullscreen.java b/demo/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdVolumeAfterFullscreen.java index 82de59af..5ed7ff38 100644 --- a/demo/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdVolumeAfterFullscreen.java +++ b/demo/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdVolumeAfterFullscreen.java @@ -32,8 +32,8 @@ public void onPrepared() { * 进入全屏模式的时候关闭静音模式 */ @Override - public void gotoScreenFullscreen() { - super.gotoScreenFullscreen(); + public void gotoFullscreen() { + super.gotoFullscreen(); } @Override diff --git a/demo/src/main/java/cn/jzvd/demo/CustomJzvd/MyJzvdStd.java b/demo/src/main/java/cn/jzvd/demo/CustomJzvd/MyJzvdStd.java index a79a6bb3..bda5dcc2 100644 --- a/demo/src/main/java/cn/jzvd/demo/CustomJzvd/MyJzvdStd.java +++ b/demo/src/main/java/cn/jzvd/demo/CustomJzvd/MyJzvdStd.java @@ -78,14 +78,14 @@ public void onStopTrackingTouch(SeekBar seekBar) { } @Override - public void gotoScreenFullscreen() { - super.gotoScreenFullscreen(); + public void gotoFullscreen() { + super.gotoFullscreen(); Log.i(TAG, "goto Fullscreen"); } @Override - public void gotoScreenNormal() { - super.gotoScreenNormal(); + public void gotoNormalScreen() { + super.gotoNormalScreen(); Log.i(TAG, "quit Fullscreen"); } diff --git a/demo/src/main/java/cn/jzvd/demo/TinyWindow/TinyWindowActivity.java b/demo/src/main/java/cn/jzvd/demo/TinyWindow/TinyWindowActivity.java index 81710dfa..187ae96c 100644 --- a/demo/src/main/java/cn/jzvd/demo/TinyWindow/TinyWindowActivity.java +++ b/demo/src/main/java/cn/jzvd/demo/TinyWindow/TinyWindowActivity.java @@ -69,7 +69,7 @@ public boolean onOptionsItemSelected(MenuItem item) { public void clickTinyWindow(View view) { - jzvdStdTinyWindow.gotoScreenTiny(); + jzvdStdTinyWindow.gotoTinyScreen(); } public void clickAutoTinyListViewRecyclerView(View view) { diff --git a/demo/src/main/java/cn/jzvd/demo/TinyWindow/TinyWindowRecycleViewActivity.java b/demo/src/main/java/cn/jzvd/demo/TinyWindow/TinyWindowRecycleViewActivity.java index 2ce8ab0a..08ca2f4c 100644 --- a/demo/src/main/java/cn/jzvd/demo/TinyWindow/TinyWindowRecycleViewActivity.java +++ b/demo/src/main/java/cn/jzvd/demo/TinyWindow/TinyWindowRecycleViewActivity.java @@ -67,7 +67,7 @@ public void onChildViewDetachedFromWindow(View view) { if (Jzvd.CURRENT_JZVD.state == Jzvd.STATE_PAUSE) { Jzvd.releaseAllVideos(); } else { - ((JzvdStdTinyWindow) Jzvd.CURRENT_JZVD).gotoScreenTiny(); + ((JzvdStdTinyWindow) Jzvd.CURRENT_JZVD).gotoTinyScreen(); } } } diff --git a/demo/src/main/java/cn/jzvd/demo/TinyWindow/TinyWindowRecycleViewMultiHolderActivity.java b/demo/src/main/java/cn/jzvd/demo/TinyWindow/TinyWindowRecycleViewMultiHolderActivity.java index 08bcdf1c..f6b83c81 100644 --- a/demo/src/main/java/cn/jzvd/demo/TinyWindow/TinyWindowRecycleViewMultiHolderActivity.java +++ b/demo/src/main/java/cn/jzvd/demo/TinyWindow/TinyWindowRecycleViewMultiHolderActivity.java @@ -72,7 +72,7 @@ public void onChildViewDetachedFromWindow(View view) { if (Jzvd.CURRENT_JZVD.state == Jzvd.STATE_PAUSE) { Jzvd.releaseAllVideos(); } else { - ((JzvdStdTinyWindow) Jzvd.CURRENT_JZVD).gotoScreenTiny(); + ((JzvdStdTinyWindow) Jzvd.CURRENT_JZVD).gotoTinyScreen(); } } } diff --git a/demo/src/main/java/cn/jzvd/demo/api/BigUIChangeAG/AGVideo.java b/demo/src/main/java/cn/jzvd/demo/api/BigUIChangeAG/AGVideo.java index 1a74b944..c8a6d2d1 100644 --- a/demo/src/main/java/cn/jzvd/demo/api/BigUIChangeAG/AGVideo.java +++ b/demo/src/main/java/cn/jzvd/demo/api/BigUIChangeAG/AGVideo.java @@ -322,7 +322,7 @@ public void onClick(View v) { //quit fullscreen backPress(); } else { - gotoScreenFullscreen(); + gotoFullscreen(); } break; case R.id.screen: diff --git a/library/src/main/java/cn/jzvd/Jzvd.java b/library/src/main/java/cn/jzvd/Jzvd.java index b75a1e9a..ea21b5d2 100644 --- a/library/src/main/java/cn/jzvd/Jzvd.java +++ b/library/src/main/java/cn/jzvd/Jzvd.java @@ -220,7 +220,7 @@ public static void releaseAllVideos() { public static boolean backPress() { Log.i(TAG, "backPress"); if (CONTAINER_LIST.size() != 0 && CURRENT_JZVD != null) {//判断条件,因为当前所有goBack都是回到普通窗口 - CURRENT_JZVD.gotoScreenNormal(); + CURRENT_JZVD.gotoNormalScreen(); return true; } else if (CONTAINER_LIST.size() == 0 && CURRENT_JZVD != null && CURRENT_JZVD.screen != SCREEN_NORMAL) {//退出直接进入的全屏 CURRENT_JZVD.clearFloatScreen(); @@ -347,7 +347,7 @@ protected void clickFullscreen() { backPress(); } else { Log.d(TAG, "toFullscreenActivity [" + this.hashCode() + "] "); - gotoScreenFullscreen(); + gotoFullscreen(); } } @@ -961,15 +961,15 @@ public void cloneAJzvd(ViewGroup vg) { /** * 如果不在列表中可以不加block */ - ViewGroup.LayoutParams blockLayoutParams; - int blockIndex; - int blockWidth; - int blockHeight; + protected ViewGroup.LayoutParams blockLayoutParams; + protected int blockIndex; + protected int blockWidth; + protected int blockHeight; /** * 如果全屏或者返回全屏的视图有问题,复写这两个函数gotoScreenNormal(),根据自己布局的情况重新布局。 */ - public void gotoScreenFullscreen() { + public void gotoFullscreen() { gotoFullscreenTime = System.currentTimeMillis(); ViewGroup vg = (ViewGroup) getParent(); jzvdContext = vg.getContext(); @@ -994,7 +994,7 @@ public void gotoScreenFullscreen() { } - public void gotoScreenNormal() {//goback本质上是goto + public void gotoNormalScreen() {//goback本质上是goto gobakFullscreenTime = System.currentTimeMillis();//退出全屏 ViewGroup vg = (ViewGroup) (JZUtils.scanForActivity(jzvdContext)).getWindow().getDecorView(); vg.removeView(this); @@ -1032,7 +1032,7 @@ public void autoFullscreen(float x) {//TODO写道demo中 } else { JZUtils.setRequestedOrientation(getContext(), ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE); } - gotoScreenFullscreen(); + gotoFullscreen(); } } From b68d0aa037894fb1eebf603e84959aaaaf091c3d Mon Sep 17 00:00:00 2001 From: Nathen <1066666651@qq.com> Date: Thu, 28 May 2020 05:05:13 +0800 Subject: [PATCH 5/5] v7.4.1 --- README.md | 6 +++--- demo/build.gradle | 4 ++-- gradle/build_upload.gradle | 2 +- library/build.gradle | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index d7556b29..994de1fb 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ --

- +

@@ -23,7 +23,7 @@ ## 文档 -- [文档 - API](https://github.com/Jzvd/JiaoZiVideoPlayer/wiki/%E6%96%87%E6%A1%A3-%E2%80%94-API),下载安装[Demo jiaozivideoplayer-7.4.0.apk](https://github.com/Jzvd/JiaoZiVideoPlayer/releases/download/v7.4.0/jiaozivideoplayer-7.4.0.apk),仔细过一遍Demo +- [文档 - API](https://github.com/Jzvd/JiaoZiVideoPlayer/wiki/%E6%96%87%E6%A1%A3-%E2%80%94-API),下载安装[Demo jiaozivideoplayer-7.4.1.apk](https://github.com/Jzvd/JiaoZiVideoPlayer/releases/download/v7.4.1/jiaozivideoplayer-7.4.1.apk),仔细过一遍Demo - [文档 - 自定义Jzvd](https://github.com/Jzvd/JiaoZiVideoPlayer/wiki/%E6%96%87%E6%A1%A3-%E2%80%94-%E8%87%AA%E5%AE%9A%E4%B9%89Jzvd),继承JzvdStd实现自己的播放器 - [文档 - 自定义播放内核](https://github.com/Jzvd/JiaoZiVideoPlayer/wiki/%E6%96%87%E6%A1%A3-%E2%80%94-%E8%87%AA%E5%AE%9A%E4%B9%89%E6%92%AD%E6%94%BE%E5%86%85%E6%A0%B8),测试哪个播放内核适合自己的项目 @@ -37,7 +37,7 @@ 1.添加类库 ```gradle -implementation 'cn.jzvd:jiaozivideoplayer:7.4.0' +implementation 'cn.jzvd:jiaozivideoplayer:7.4.1' ``` 2.添加布局 diff --git a/demo/build.gradle b/demo/build.gradle index b888b879..a0100a43 100644 --- a/demo/build.gradle +++ b/demo/build.gradle @@ -8,8 +8,8 @@ android { applicationId "cn.jzvd.demo" minSdkVersion 16 targetSdkVersion 29 - versionCode 102 - versionName "7.4.0" + versionCode 103 + versionName "7.4.1" ndk { // add support lib abiFilters 'armeabi-v7a' //, 'arm64-v8a'//, "mips" //,'armeabi''x86',, 'x86_64', diff --git a/gradle/build_upload.gradle b/gradle/build_upload.gradle index 445d2a54..a82ddf0c 100644 --- a/gradle/build_upload.gradle +++ b/gradle/build_upload.gradle @@ -8,7 +8,7 @@ signing { group = "cn.jzvd" archivesBaseName = "jiaozivideoplayer" -version = "7.4.0" +version = "7.4.1" uploadArchives { repositories { diff --git a/library/build.gradle b/library/build.gradle index 39047ab3..b8ac84b5 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -7,8 +7,8 @@ android { defaultConfig { minSdkVersion 16 targetSdkVersion 29 - versionCode 102 - versionName "7.4.0" + versionCode 103 + versionName "7.4.1" } compileOptions {