Skip to content
This repository has been archived by the owner on Aug 9, 2022. It is now read-only.

Commit

Permalink
Merge branch 'release/v7.0.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
lipangit committed May 11, 2019
2 parents 998d67f + 732b9e2 commit ac437db
Show file tree
Hide file tree
Showing 34 changed files with 516 additions and 597 deletions.
8 changes: 4 additions & 4 deletions README-ZH.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%7C5.8.2%7Caar"><img src="https://img.shields.io/badge/Maven%20Central-7.0.2-green.svg"></a>
<a href="http://search.maven.org/#artifactdetails%7Ccn.jzvd%7Cjiaozivideoplayer%7C5.8.2%7Caar"><img src="https://img.shields.io/badge/Maven%20Central-7.0.3-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 Down Expand Up @@ -32,7 +32,7 @@ Q群: 490442439 2群: 761899104 验证信息:jzvd
## 使用步骤

1. 通读ReadMe
2. 下载安装demo apk [jiaozivideoplayer-7.0.2.apk](https://github.com/lipangit/JiaoZiVideoPlayer/releases/download/v7.0.2/jiaozivideoplayer-7.0.2.apk),各个页面都进入一次,各个按钮点一次
2. 下载安装demo apk [jiaozivideoplayer-7.0.3.apk](https://github.com/lipangit/JiaoZiVideoPlayer/releases/download/v7.0.3/jiaozivideoplayer-7.0.3.apk),各个页面都进入一次,各个按钮点一次
3. 下载调试develop分支,有针对性的通过效果找到实现的源码
4.[自定义相关的WIKI](https://github.com/lipangit/JiaoZiVideoPlayer/wiki),实现自己的需求

Expand All @@ -49,11 +49,11 @@ Q群: 490442439 2群: 761899104 验证信息:jzvd

即便是自定义UI,或者对Library有过修改,也是这五步骤来使用播放器。

7.0.2不是非常稳定,感兴趣的可以尝试
7.0.3不是非常稳定,感兴趣的可以尝试

1.添加类库
```gradle
compile 'cn.jzvd:jiaozivideoplayer:7.0.2'
compile 'cn.jzvd:jiaozivideoplayer:7.0.3'
```

或直接下载 [aar](https://github.com/lipangit/JiaoZiVideoPlayer/releases/tag/v6.4.2) (不建议)
Expand Down
8 changes: 4 additions & 4 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%7C5.8.2%7Caar"><img src="https://img.shields.io/badge/Maven%20Central-7.0.2-green.svg"></a>
<a href="http://search.maven.org/#artifactdetails%7Ccn.jzvd%7Cjiaozivideoplayer%7C5.8.2%7Caar"><img src="https://img.shields.io/badge/Maven%20Central-7.0.3-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 Down Expand Up @@ -38,7 +38,7 @@ Q群: 490442439 2群: 761899104 验证信息:jzvd
## Steps for usage

1. Read through ReadMe
2. Download and install the demo apk[jiaozivideoplayer-7.0.2.apk](https://github.com/lipangit/JiaoZiVideoPlayer/releases/download/v7.0.2/jiaozivideoplayer-7.0.2.apk), each page enters once, each button clicks once
2. Download and install the demo apk[jiaozivideoplayer-7.0.3.apk](https://github.com/lipangit/JiaoZiVideoPlayer/releases/download/v7.0.3/jiaozivideoplayer-7.0.3.apk), each page enters once, each button clicks once
3. Download and debug the develop branch, and find the source code through the effect
4. See [custom-related WIKI](https://github.com/lipangit/JiaoZiVideoPlayer/wiki),Realize your own needs

Expand All @@ -55,11 +55,11 @@ Q群: 490442439 2群: 761899104 验证信息:jzvd

Only five steps to use the player:

The 7.0.2 version is not very stable.
The 7.0.3 version is not very stable.

1.Import library:
```gradle
implementation 'cn.jzvd:jiaozivideoplayer:7.0.2'
implementation 'cn.jzvd:jiaozivideoplayer:7.0.3'
```

Or download [aar](https://github.com/lipangit/JiaoZiVideoPlayer/releases/tag/v6.4.2) (not recommended).
Expand Down
14 changes: 7 additions & 7 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
applicationId "cn.jzvd.demo"
minSdkVersion 16
targetSdkVersion 28
versionCode 90
versionName "7.0.2"
versionCode 91
versionName "7.0.3"
}
signingConfigs {
releaseConfig {
Expand All @@ -19,11 +19,11 @@ android {
}
}
buildTypes {
debug {//测试时会用到
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.releaseConfig
}
// debug {//测试时会用到
// minifyEnabled true
// proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
// signingConfig signingConfigs.releaseConfig
// }
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
Expand Down
13 changes: 0 additions & 13 deletions app/src/androidTest/java/cn/jzvd/demo/ApplicationTest.java

This file was deleted.

1 change: 0 additions & 1 deletion app/src/main/assets/jzvd.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ <h3 style="width:100%;text-align:center">This is webview</h3>

var cont1=document.getElementById("cont1");
jzvd.adViewJiaoZiVideoPlayer(210,120,cont1.offsetTop,cont1.offsetLeft,1)

</script>
</body>
</html>
20 changes: 18 additions & 2 deletions app/src/main/java/cn/jzvd/demo/ActivityApi.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package cn.jzvd.demo;

import android.content.Intent;
import android.content.pm.PackageManager;
import android.hardware.Sensor;
import android.hardware.SensorManager;
import android.os.Bundle;
import android.os.Environment;
import android.support.annotation.Nullable;
import android.support.v4.app.ActivityCompat;
import android.support.v7.app.AppCompatActivity;
import android.view.MenuItem;
import android.view.View;
Expand All @@ -20,7 +22,6 @@
import java.util.LinkedHashMap;

import cn.jzvd.JZDataSource;
import cn.jzvd.JZUtils;
import cn.jzvd.Jzvd;
import cn.jzvd.JzvdStd;

Expand Down Expand Up @@ -103,7 +104,7 @@ public boolean onOptionsItemSelected(MenuItem item) {
}

public void cpAssertVideoToLocalPath() {
JZUtils.verifyStoragePermissions(this);
verifyStoragePermissions();
try {
InputStream myInput;
OutputStream myOutput = new FileOutputStream(Environment.getExternalStorageDirectory().getAbsolutePath() + "/DCIM/Camera/local_video.mp4");
Expand All @@ -123,6 +124,21 @@ public void cpAssertVideoToLocalPath() {
}
}


public void verifyStoragePermissions() {
try {
int permission = ActivityCompat.checkSelfPermission(this,
"android.permission.WRITE_EXTERNAL_STORAGE");
if (permission != PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(this, new String[]{
"android.permission.READ_EXTERNAL_STORAGE",
"android.permission.WRITE_EXTERNAL_STORAGE"}, 1);
}
} catch (Exception e) {
e.printStackTrace();
}
}

public void clickSmallChange(View view) {
startActivity(new Intent(ActivityApi.this, ActivityApiUISmallChange.class));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCoun
// currentPlayPosition + " " + firstVisibleItem + " " + currentPlayPosition + " " + lastVisibleItem);
if (currentPlayPosition >= 0) {
if ((currentPlayPosition < firstVisibleItem || currentPlayPosition > (lastVisibleItem - 1))) {
if (Jzvd.CURRENT_JZVD.currentScreen != Jzvd.SCREEN_WINDOW_FULLSCREEN) {
if (Jzvd.CURRENT_JZVD.screen != Jzvd.SCREEN_FULLSCREEN) {
Jzvd.resetAllVideos();//为什么最后一个视频横屏会调用这个,其他地方不会
}
}
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/cn/jzvd/demo/ActivityListViewNormal.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCoun
// currentPlayPosition + " " + firstVisibleItem + " " + currentPlayPosition + " " + lastVisibleItem);
if (currentPlayPosition >= 0) {
if ((currentPlayPosition < firstVisibleItem || currentPlayPosition > (lastVisibleItem - 1))) {
if (Jzvd.CURRENT_JZVD.currentScreen != Jzvd.SCREEN_WINDOW_FULLSCREEN) {
if (Jzvd.CURRENT_JZVD.screen != Jzvd.SCREEN_FULLSCREEN) {
Jzvd.resetAllVideos();//为什么最后一个视频横屏会调用这个,其他地方不会
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public void onChildViewDetachedFromWindow(View view) {
Jzvd jzvd = view.findViewById(R.id.videoplayer);
if (jzvd != null && Jzvd.CURRENT_JZVD != null &&
jzvd.jzDataSource.containsTheUrl(Jzvd.CURRENT_JZVD.jzDataSource.getCurrentUrl())) {
if (Jzvd.CURRENT_JZVD != null && Jzvd.CURRENT_JZVD.currentScreen != Jzvd.SCREEN_WINDOW_FULLSCREEN) {
if (Jzvd.CURRENT_JZVD != null && Jzvd.CURRENT_JZVD.screen != Jzvd.SCREEN_FULLSCREEN) {
Jzvd.resetAllVideos();
}
}
Expand Down
3 changes: 1 addition & 2 deletions app/src/main/java/cn/jzvd/demo/ActivityMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import com.bumptech.glide.Glide;

import cn.jzvd.Jzvd;
import cn.jzvd.JzvdStd;
import cn.jzvd.demo.CustomJzvd.MyJzvdStd;

/**
Expand All @@ -26,7 +25,7 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {

myJzvdStd = findViewById(R.id.jz_video);
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);

}
Expand Down
1 change: 0 additions & 1 deletion app/src/main/java/cn/jzvd/demo/ActivityTinyWindow.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package cn.jzvd.demo;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public void onChildViewAttachedToWindow(View view) {//这个的本质是gotoThis
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) {
&& Jzvd.CURRENT_JZVD.state == Jzvd.STATE_PLAYING) {
ViewGroup vp = (ViewGroup) jzvd.getParent();
vp.removeAllViews();
((ViewGroup) currentJzvd.getParent()).removeView(currentJzvd);
Expand All @@ -60,8 +60,8 @@ public void onChildViewDetachedFromWindow(View 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.CURRENT_JZVD.screen != Jzvd.SCREEN_TINY) {
if (Jzvd.CURRENT_JZVD.state == Jzvd.STATE_PAUSE) {
Jzvd.resetAllVideos();
} else {
((JzvdStdTinyWindow) Jzvd.CURRENT_JZVD).gotoScreenTiny();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public void onChildViewAttachedToWindow(View view) {
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) {
&& Jzvd.CURRENT_JZVD.state == Jzvd.STATE_PLAYING) {
ViewGroup vp = (ViewGroup) jzvd.getParent();
vp.removeAllViews();
((ViewGroup) currentJzvd.getParent()).removeView(currentJzvd);
Expand All @@ -65,8 +65,8 @@ public void onChildViewDetachedFromWindow(View 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.CURRENT_JZVD.screen != Jzvd.SCREEN_TINY) {
if (Jzvd.CURRENT_JZVD.state == Jzvd.STATE_PAUSE) {
Jzvd.resetAllVideos();
} else {
((JzvdStdTinyWindow) Jzvd.CURRENT_JZVD).gotoScreenTiny();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public JzvdStdAutoCompleteAfterFullscreen(Context context, AttributeSet attrs) {

@Override
public void startVideo() {
if (currentScreen == SCREEN_WINDOW_FULLSCREEN) {
if (screen == SCREEN_FULLSCREEN) {
Log.d(TAG, "startVideo [" + this.hashCode() + "] ");
JZMediaInterface.SAVED_SURFACE = null;
addTextureView();
Expand All @@ -41,7 +41,7 @@ public void startVideo() {

@Override
public void onAutoCompletion() {
if (currentScreen == SCREEN_WINDOW_FULLSCREEN) {
if (screen == SCREEN_FULLSCREEN) {
onStateAutoComplete();
} else {
super.onAutoCompletion();
Expand Down
1 change: 0 additions & 1 deletion app/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdList.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import android.util.AttributeSet;

import cn.jzvd.JZDataSource;
import cn.jzvd.JZMediaInterface;
import cn.jzvd.JZUtils;
import cn.jzvd.Jzvd;
import cn.jzvd.JzvdStd;
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdMp3.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ public int getLayoutId() {
@Override
public void onClick(View v) {
if (v.getId() == cn.jzvd.R.id.thumb &&
(currentState == CURRENT_STATE_PLAYING ||
currentState == CURRENT_STATE_PAUSE)) {
(state == STATE_PLAYING ||
state == STATE_PAUSE)) {
onClickUiToggle();
} else if (v.getId() == R.id.fullscreen) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public JzvdStdShowTitleAfterFullscreen(Context context, AttributeSet attrs) {
@Override
public void setUp(JZDataSource jzDataSource, int screen) {
super.setUp(jzDataSource, screen);
if (currentScreen == SCREEN_WINDOW_FULLSCREEN) {
if (this.screen == SCREEN_FULLSCREEN) {
titleTextView.setVisibility(View.VISIBLE);
} else {
titleTextView.setVisibility(View.INVISIBLE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

import cn.jzvd.JZDataSource;
import cn.jzvd.JZUtils;
import cn.jzvd.Jzvd;
import cn.jzvd.JzvdStd;

/**
Expand All @@ -31,7 +30,7 @@ public void setUp(JZDataSource jzDataSource, int screen, Class mediaInterface) {

public void gotoScreenTiny() {
Log.i(TAG, "startWindowTiny " + " [" + this.hashCode() + "] ");
if (currentState == CURRENT_STATE_NORMAL || currentState == CURRENT_STATE_ERROR || currentState == CURRENT_STATE_AUTO_COMPLETE)
if (state == STATE_NORMAL || state == STATE_ERROR || state == STATE_AUTO_COMPLETE)
return;
ViewGroup vg = (ViewGroup) getParent();
vg.removeView(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public JzvdStdVolumeAfterFullscreen(Context context, AttributeSet attrs) {
@Override
public void onPrepared() {
super.onPrepared();
if (currentScreen == SCREEN_WINDOW_FULLSCREEN) {
if (screen == SCREEN_FULLSCREEN) {
mediaInterface.setVolume(1f, 1f);
} else {
mediaInterface.setVolume(0f, 0f);
Expand All @@ -39,12 +39,14 @@ public void gotoScreenFullscreen() {
@Override
public void setScreenFullscreen() {
super.setScreenFullscreen();
mediaInterface.setVolume(1f, 1f);
if (mediaInterface != null)
mediaInterface.setVolume(1f, 1f);
}

@Override
public void setScreenNormal() {
super.setScreenNormal();
mediaInterface.setVolume(0f, 0f);
if (mediaInterface != null)
mediaInterface.setVolume(0f, 0f);
}
}
1 change: 0 additions & 1 deletion app/src/main/java/cn/jzvd/demo/CustomMedia/JZMediaExo.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import android.content.Context;
import android.graphics.SurfaceTexture;
import android.media.MediaPlayer;
import android.net.Uri;
import android.os.Handler;
import android.os.HandlerThread;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,8 @@ public boolean onError(MediaPlayer mediaPlayer, final int what, final int extra)
public boolean onInfo(MediaPlayer mediaPlayer, final int what, final int extra) {
handler.post(() -> {
if (what == MediaPlayer.MEDIA_INFO_VIDEO_RENDERING_START) {
if (jzvd.currentState == Jzvd.CURRENT_STATE_PREPARING
|| jzvd.currentState == Jzvd.CURRENT_STATE_PREPARING_CHANGING_URL) {
if (jzvd.state == Jzvd.STATE_PREPARING
|| jzvd.state == Jzvd.STATE_PREPARING_CHANGING_URL) {
jzvd.onPrepared();
}
} else {
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/cn/jzvd/demo/FragmentDemo.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCoun
// currentPlayPosition + " " + firstVisibleItem + " " + currentPlayPosition + " " + lastVisibleItem);
if (currentPlayPosition >= 0) {
if ((currentPlayPosition < firstVisibleItem || currentPlayPosition > (lastVisibleItem - 1))) {
if (Jzvd.CURRENT_JZVD.currentScreen != Jzvd.SCREEN_WINDOW_FULLSCREEN) {
if (Jzvd.CURRENT_JZVD.screen != Jzvd.SCREEN_FULLSCREEN) {
Jzvd.resetAllVideos();//为什么最后一个视频横屏会调用这个,其他地方不会
}
}
Expand Down
Loading

0 comments on commit ac437db

Please sign in to comment.