Skip to content

Commit

Permalink
Merge branch 'release/v7.4.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
lipangit committed May 27, 2020
2 parents 15f1616 + b68d0aa commit 9144411
Show file tree
Hide file tree
Showing 13 changed files with 45 additions and 45 deletions.
16 changes: 6 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
--
<p align="center">
<a href="http://developer.android.com/index.html"><img src="https://img.shields.io/badge/platform-android-green.svg"></a>
<a href="http://search.maven.org/#artifactdetails%7Ccn.jzvd%7Cjiaozivideoplayer%7C7.4.0%7Caar"><img src="https://img.shields.io/badge/Maven%20Central-7.4.0-green.svg"></a>
<a href="http://search.maven.org/#artifactdetails%7Ccn.jzvd%7Cjiaozivideoplayer%7C7.4.1%7Caar"><img src="https://img.shields.io/badge/Maven%20Central-7.4.1-green.svg"></a>
<a href="http://choosealicense.com/licenses/mit/"><img src="https://img.shields.io/badge/license-MIT-green.svg"></a>
<a href="https://android-arsenal.com/details/1/3269"><img src="https://img.shields.io/badge/Android%20Arsenal-jiaozivideoplayer-green.svg?style=true"></a>
</p>
Expand All @@ -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),测试哪个播放内核适合自己的项目

Expand All @@ -37,19 +37,15 @@

1.添加类库
```gradle
implementation 'cn.jzvd:jiaozivideoplayer:7.4.0'
implementation 'cn.jzvd:jiaozivideoplayer:7.4.1'
```

2.添加布局
```xml
<LinearLayout
<cn.jzvd.demo.CustomJzvd.MyJzvdStd
android:id="@+id/jz_video"
android:layout_width="match_parent"
android:layout_height="200dp">
<cn.jzvd.demo.CustomJzvd.MyJzvdStd
android:id="@+id/jz_video"
android:layout_width="match_parent"
android:layout_height="200dp" />
</LinearLayout>
android:layout_height="200dp" />
```

3.设置视频地址、缩略图地址、标题
Expand Down
4 changes: 2 additions & 2 deletions demo/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -44,5 +51,4 @@ public void gotoScreenTiny() {
setScreenTiny();
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ public void onPrepared() {
* 进入全屏模式的时候关闭静音模式
*/
@Override
public void gotoScreenFullscreen() {
super.gotoScreenFullscreen();
public void gotoFullscreen() {
super.gotoFullscreen();
}

@Override
Expand Down
8 changes: 4 additions & 4 deletions demo/src/main/java/cn/jzvd/demo/CustomJzvd/MyJzvdStd.java
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public boolean onOptionsItemSelected(MenuItem item) {


public void clickTinyWindow(View view) {
jzvdStdTinyWindow.gotoScreenTiny();
jzvdStdTinyWindow.gotoTinyScreen();
}

public void clickAutoTinyListViewRecyclerView(View view) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ public void onClick(View v) {
//quit fullscreen
backPress();
} else {
gotoScreenFullscreen();
gotoFullscreen();
}
break;
case R.id.screen:
Expand Down
2 changes: 1 addition & 1 deletion gradle/build_upload.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ signing {

group = "cn.jzvd"
archivesBaseName = "jiaozivideoplayer"
version = "7.4.0"
version = "7.4.1"

uploadArchives {
repositories {
Expand Down
4 changes: 2 additions & 2 deletions library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
defaultConfig {
minSdkVersion 16
targetSdkVersion 29
versionCode 102
versionName "7.4.0"
versionCode 103
versionName "7.4.1"
}

compileOptions {
Expand Down
26 changes: 12 additions & 14 deletions library/src/main/java/cn/jzvd/Jzvd.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -347,7 +347,7 @@ protected void clickFullscreen() {
backPress();
} else {
Log.d(TAG, "toFullscreenActivity [" + this.hashCode() + "] ");
gotoScreenFullscreen();
gotoFullscreen();
}
}

Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -961,15 +959,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();
Expand All @@ -994,7 +992,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);
Expand Down Expand Up @@ -1032,7 +1030,7 @@ public void autoFullscreen(float x) {//TODO写道demo中
} else {
JZUtils.setRequestedOrientation(getContext(), ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE);
}
gotoScreenFullscreen();
gotoFullscreen();
}
}

Expand Down

0 comments on commit 9144411

Please sign in to comment.