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/v6.2.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathen committed Jan 14, 2018
2 parents d8c1d6d + 571936b commit 7431112
Show file tree
Hide file tree
Showing 14 changed files with 78 additions and 64 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-6.2.3-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-6.2.4-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 @@

## 效果

**[jiaozivideoplayer-6.2.3.apk](https://github.com/lipangit/JiaoZiVideoPlayer/releases/download/v6.2.3/jiaozivideoplayer-6.2.3.apk)**
**[jiaozivideoplayer-6.2.4.apk](https://github.com/lipangit/JiaoZiVideoPlayer/releases/download/v6.2.4/jiaozivideoplayer-6.2.4.apk)**

![Demo Screenshot][1]

Expand All @@ -35,10 +35,10 @@

1.添加类库
```gradle
compile 'cn.jzvd:jiaozivideoplayer:6.2.3'
compile 'cn.jzvd:jiaozivideoplayer:6.2.4'
```

或直接下载 [jar包](https://github.com/lipangit/JiaoZiVideoPlayer/releases/tag/v6.2.3) (不建议)
或直接下载 [jar包](https://github.com/lipangit/JiaoZiVideoPlayer/releases/tag/v6.2.4) (不建议)

2.添加布局
```xml
Expand Down
22 changes: 11 additions & 11 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-6.2.3-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-6.2.4-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 @@ -16,40 +16,40 @@

Q群:490442439 验证信息:jzvd

[中文文档](https://github.com/lipangit/JiaoZiVideoPlayer/blob/develop/README-ZH.md) [工作计划](https://github.com/lipangit/JiaoZiVideoPlayer/projects/2) [微博](http://weibo.com/2342820395/profile?topnav=1&wvr=6&is_all=1) [视频教程](https://github.com/lipangit/JiaoZiVideoPlayer/wiki/%E8%A7%86%E9%A2%91%E6%95%99%E7%A8%8B)
[中文文档](https://github.com/lipangit/JiaoZiVideoPlayer/blob/develop/README-ZH.md) [WorkPlan](https://github.com/lipangit/JiaoZiVideoPlayer/projects/2) [微博](http://weibo.com/2342820395/profile?topnav=1&wvr=6&is_all=1) [视频教程](https://github.com/lipangit/JiaoZiVideoPlayer/wiki/%E8%A7%86%E9%A2%91%E6%95%99%E7%A8%8B)

## Features

1. You can completely customize the UI and any function
2. One line of code to switch the playback engine, supported video formats and protocols depends on the playback engine,[android.media.MediaPlayer](https://developer.android.com/guide/topics/media/media-formats.html) [ijkplayer](https://github.com/Bilibili/ijkplayer)
3. Perfect detection list sliding
4. Can achieve full-screen playback, small window playback
5. Full-screen work in multiple nested modes like ListView, ViewPager and ListView, ViewPager and Fragment
4. Full screen and small window option available
5. Full-screen works in multiple nested modes like ListView, ViewPager and ListView, ViewPager and Fragment
6. Can load, pause, play and other normal state into the full screen and exit full screen
7. A variety of video adaptation screen mode, can be covered full screen, you can cut full screen
8. Gravity sensing automatically enter full screen
9. Full screen gestures to modify the progress and volume
8. Ability to enter full-screen automatically using gravity sensing
9. Change progress and volume right from full screen mode
10. Home key to exit the interface to suspend the playback, return to the interface to continue playing
11. WebView Nested Local Video Controls

## Effect
## A demo showing available effects

**[jiaozivideoplayer-6.2.3.apk](https://github.com/lipangit/JiaoZiVideoPlayer/releases/download/v6.2.3/jiaozivideoplayer-6.2.3.apk)**
**[jiaozivideoplayer-6.2.4.apk](https://github.com/lipangit/JiaoZiVideoPlayer/releases/download/v6.2.4/jiaozivideoplayer-6.2.4.apk)**

![Demo Screenshot][1]

[List sliding automatically into the small window effect](http://weibo.com/tv/v/FtxpWgqmg?fid=1034:5cda6fc7f394b403d592bd9b1d5a9701)

## Usage

Even the custom UI, or has changed to the Library, is also the five steps to use the player.
Only five steps to use the player.

1.Import library
```gradle
compile 'cn.jzvd:jiaozivideoplayer:6.2.3'
compile 'cn.jzvd:jiaozivideoplayer:6.2.4'
```

Or download [lib](https://github.com/lipangit/JiaoZiVideoPlayer/releases/tag/v6.2.3) (not recommended)
Or download [lib](https://github.com/lipangit/JiaoZiVideoPlayer/releases/tag/v6.2.4) (not recommended)

2.Add JZVideoPlayer in your layout
```xml
Expand Down
6 changes: 3 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ apply plugin: 'com.android.application'

android {
compileSdkVersion 27
buildToolsVersion '27.0.1'
buildToolsVersion '27.0.3'

defaultConfig {
applicationId "cn.jzvd.demo"
minSdkVersion 16
targetSdkVersion 27
versionCode 74
versionName "6.2.3"
versionCode 75
versionName "6.2.4"
}
signingConfigs {
releaseConfig {
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
<activity
android:name=".ActivityApiOrientation"
android:configChanges="orientation|screenSize|keyboardHidden"
android:screenOrientation="landscape" />
android:screenOrientation="portrait" />
<activity
android:name=".ActivityApiExtendsNormal"
android:configChanges="orientation|screenSize|keyboardHidden"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/cn/jzvd/demo/ActivityApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
map.put("普清", VideoConstant.videoUrlList[0]);
Object[] objects = new Object[3];
objects[0] = map;
objects[1] = false;
objects[1] = false;//looping
objects[2] = new HashMap<>();
((HashMap) objects[2]).put("key", "value");
mJzVideoPlayerStandard.setUp(objects, 2
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/cn/jzvd/demo/ActivityApiOrientation.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
.into(mJzVideoPlayerStandard.thumbImageView);

JZVideoPlayer.FULLSCREEN_ORIENTATION = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;
JZVideoPlayer.NORMAL_ORIENTATION = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;
JZVideoPlayer.NORMAL_ORIENTATION = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT;

}

Expand Down
3 changes: 3 additions & 0 deletions app/src/main/java/cn/jzvd/demo/ActivityMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ public void onClick(View v) {
}
}

/**
* 这只是给埋点统计用户数据用的,不能写和播放相关的逻辑,监听事件请参考MyJZVideoPlayerStandard,复写函数取得相应事件
*/
class MyUserActionStandard implements JZUserActionStandard {

@Override
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout/activity_orientation.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@

<cn.jzvd.JZVideoPlayerStandard
android:id="@+id/jz_video"
android:layout_width="300dp"
android:layout_height="300dp" />
android:layout_width="match_parent"
android:layout_height="200dp" />
</LinearLayout>
2 changes: 1 addition & 1 deletion gradle/maven_push.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ signing {

group = "cn.jzvd"
archivesBaseName = "jiaozivideoplayer"
version = "6.2.3"
version = "6.2.4"

uploadArchives {
repositories {
Expand Down
8 changes: 4 additions & 4 deletions jiaozivideoplayer/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ apply plugin: 'com.android.library'

android {
compileSdkVersion 27
buildToolsVersion '27.0.1'
buildToolsVersion '27.0.3'

defaultConfig {
minSdkVersion 16
targetSdkVersion 27
versionCode 74
versionName "6.2.3"
versionCode 75
versionName "6.2.4"
}
buildTypes {
release {
Expand All @@ -24,7 +24,7 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
provided 'com.android.support:appcompat-v7:27.0.1'
provided 'com.android.support:appcompat-v7:27.0.2'
}

apply from: '../gradle/maven_push.gradle'
11 changes: 7 additions & 4 deletions jiaozivideoplayer/src/main/java/cn/jzvd/JZMediaManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,14 @@ public void handleMessage(Message msg) {
currentVideoWidth = 0;
currentVideoHeight = 0;
jzMediaInterface.prepare();
if (surface != null) {
surface.release();

if (savedSurfaceTexture != null) {
if (surface != null) {
surface.release();
}
surface = new Surface(savedSurfaceTexture);
jzMediaInterface.setSurface(surface);
}
surface = new Surface(savedSurfaceTexture);
jzMediaInterface.setSurface(surface);
break;
case HANDLER_RELEASE:
jzMediaInterface.release();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ public interface JZUserActionStandard extends JZUserAction {

int ON_CLICK_START_THUMB = 101;
int ON_CLICK_BLANK = 102;
int ON_CLICK_START_WIFIDIALOG = 103;

}
29 changes: 19 additions & 10 deletions jiaozivideoplayer/src/main/java/cn/jzvd/JZVideoPlayer.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ public void onAudioFocusChange(int focusChange) {
break;
case AudioManager.AUDIOFOCUS_LOSS_TRANSIENT:
try {
if (JZMediaManager.isPlaying()) {
JZMediaManager.pause();
if (JZVideoPlayerManager.getCurrentJzvd().currentState == JZVideoPlayer.CURRENT_STATE_PLAYING) {
JZVideoPlayerManager.getCurrentJzvd().startButton.performClick();
}
} catch (IllegalStateException e) {
e.printStackTrace();
Expand Down Expand Up @@ -115,7 +115,6 @@ public void onAudioFocusChange(int focusChange) {
protected int mScreenWidth;
protected int mScreenHeight;
protected AudioManager mAudioManager;
protected Handler mHandler;
protected ProgressTimerTask mProgressTimerTask;
protected boolean mTouchingProgressBar;
protected float mDownX;
Expand Down Expand Up @@ -380,7 +379,6 @@ public void init(Context context) {
mScreenWidth = getContext().getResources().getDisplayMetrics().widthPixels;
mScreenHeight = getContext().getResources().getDisplayMetrics().heightPixels;
mAudioManager = (AudioManager) getContext().getSystemService(Context.AUDIO_SERVICE);
mHandler = new Handler();

try {
if (isCurrentPlay()) {
Expand Down Expand Up @@ -446,7 +444,7 @@ public void onClick(View v) {
if (!JZUtils.getCurrentFromDataSource(dataSourceObjects, currentUrlMapIndex).toString().startsWith("file") && !
JZUtils.getCurrentFromDataSource(dataSourceObjects, currentUrlMapIndex).toString().startsWith("/") &&
!JZUtils.isWifiConnected(getContext()) && !WIFI_TIP_DIALOG_SHOWED) {
showWifiDialog(JZUserAction.ON_CLICK_START_ICON);
showWifiDialog();
return;
}
startVideo();
Expand Down Expand Up @@ -838,11 +836,21 @@ public void clearFullscreenLayout() {
public void clearFloatScreen() {
JZUtils.setRequestedOrientation(getContext(), NORMAL_ORIENTATION);
showSupportActionBar(getContext());
JZVideoPlayer currJzvd = JZVideoPlayerManager.getCurrentJzvd();
currJzvd.textureViewContainer.removeView(JZMediaManager.textureView);
ViewGroup vp = (JZUtils.scanForActivity(getContext()))//.getWindow().getDecorView();
.findViewById(Window.ID_ANDROID_CONTENT);
vp.removeView(currJzvd);
JZVideoPlayer fullJzvd = vp.findViewById(R.id.jz_fullscreen_id);
JZVideoPlayer tinyJzvd = vp.findViewById(R.id.jz_tiny_id);

if (fullJzvd != null) {
vp.removeView(fullJzvd);
if (fullJzvd.textureViewContainer != null)
fullJzvd.textureViewContainer.removeView(JZMediaManager.textureView);
}
if (tinyJzvd != null) {
vp.removeView(tinyJzvd);
if (tinyJzvd.textureViewContainer != null)
tinyJzvd.textureViewContainer.removeView(JZMediaManager.textureView);
}
JZVideoPlayerManager.setSecondFloor(null);
}

Expand Down Expand Up @@ -1042,6 +1050,7 @@ public void playOnThisJzvd() {
clearFloatScreen();
//2.在本jzvd上播放
setState(currentState);
// removeTextureView();
addTextureView();
}

Expand Down Expand Up @@ -1086,7 +1095,7 @@ public void onSeekComplete() {

}

public void showWifiDialog(int event) {
public void showWifiDialog() {
}

public void showProgressDialog(float deltaX,
Expand Down Expand Up @@ -1141,7 +1150,7 @@ public class ProgressTimerTask extends TimerTask {
public void run() {
if (currentState == CURRENT_STATE_PLAYING || currentState == CURRENT_STATE_PAUSE) {
// Log.v(TAG, "onProgressUpdate " + "[" + this.hashCode() + "] ");
mHandler.post(new Runnable() {
post(new Runnable() {
@Override
public void run() {
long position = getCurrentPositionWhenPlaying();
Expand Down
Loading

0 comments on commit 7431112

Please sign in to comment.