Skip to content

Commit

Permalink
Merge branch 'release/v7.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
lipangit committed Jan 22, 2020
2 parents 02f86c7 + 8961ff8 commit 63c6dab
Show file tree
Hide file tree
Showing 41 changed files with 1,673 additions and 59 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<a href="https://github.com/lipangit/JiaoZiVideoPlayer" target="_blank"><p align="center"><img src="https://user-images.githubusercontent.com/2038071/42033014-0bf1c0b0-7b0e-11e8-811d-7639bcd294eb.png" alt="JiaoZiVideoPlayer" height="150px"></p></a>
<a href="https://github.com/Jzvd/JiaoZiVideoPlayer" target="_blank"><p align="center"><img src="https://user-images.githubusercontent.com/2038071/42033014-0bf1c0b0-7b0e-11e8-811d-7639bcd294eb.png" alt="JiaoZiVideoPlayer" height="150px"></p></a>
--
<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.1.0-green.svg"></a>
<a href="http://search.maven.org/#artifactdetails%7Ccn.jzvd%7Cjiaozivideoplayer%7C7.2.0%7Caar"><img src="https://img.shields.io/badge/Maven%20Central-7.2.0-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 @@ -11,7 +11,7 @@

## 置顶消息:

Q群:490442439, 2群:761899104, 验证信息:jzvd, 微信公众号:jzvdjzt,微信:lipanhelloworld,QQ:1066666651,[Telegram](https://t.me/jiaozitoken)[Weibo](http://weibo.com/2342820395/profile?topnav=1&wvr=6&is_all=1)[公众号文章](https://github.com/lipangit/JiaoZiVideoPlayer/wiki/%E5%85%AC%E4%BC%97%E5%8F%B7%E6%96%87%E7%AB%A0)
Q群:490442439, 2群:761899104, 验证信息:jzvd, 微信公众号:jzvdjzt,微信:lipanhelloworld,QQ:1066666651,[Telegram](https://t.me/jiaozitoken)[Weibo](http://weibo.com/2342820395/profile?topnav=1&wvr=6&is_all=1)[公众号文章](https://github.com/Jzvd/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/JZVD/JZT),必定大有可为。

Expand All @@ -37,7 +37,7 @@ Q群:490442439, 2群:761899104, 验证信息:jzvd, 微信公众号:jzvdjzt,微

## 文档

- [文档 - API](https://github.com/Jzvd/JiaoZiVideoPlayer/wiki/%E6%96%87%E6%A1%A3-%E2%80%94-API),下载安装demo[jiaozivideoplayer-7.1.0.apk](https://github.com/lipangit/JiaoZiVideoPlayer/releases/download/v7.1.0/jiaozivideoplayer-7.1.0.apk),仔细过一遍demo
- [文档 - API](https://github.com/Jzvd/JiaoZiVideoPlayer/wiki/%E6%96%87%E6%A1%A3-%E2%80%94-API),下载安装demo[jiaozivideoplayer-7.2.0.apk](https://github.com/Jzvd/JiaoZiVideoPlayer/releases/download/v7.2.0/jiaozivideoplayer-7.2.0.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 @@ -49,7 +49,7 @@ Q群:490442439, 2群:761899104, 验证信息:jzvd, 微信公众号:jzvdjzt,微

1.添加类库
```gradle
compile 'cn.jzvd:jiaozivideoplayer:7.1.0'
compile 'cn.jzvd:jiaozivideoplayer:7.2.0'
```

2.添加布局
Expand Down
4 changes: 2 additions & 2 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 94
versionName "7.1.0"
versionCode 95
versionName "7.2.0"
ndk {
// add support lib
abiFilters 'armeabi-v7a' //, 'arm64-v8a'//, "mips" //,'armeabi''x86',, 'x86_64',
Expand Down
26 changes: 23 additions & 3 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<activity
android:name=".ActivityDirectPlay"
android:configChanges="orientation|screenSize|keyboardHidden"
Expand Down Expand Up @@ -93,13 +92,34 @@
android:name=".ActivityApiExtendsNormal"
android:configChanges="orientation|screenSize|keyboardHidden"
android:screenOrientation="portrait" />

<activity
android:name=".ActivityPreloading"
android:configChanges="orientation|screenSize|keyboardHidden"
android:screenOrientation="portrait" />
<activity
android:name=".tiktok.ActivityTikTok"
android:configChanges="orientation|screenSize|keyboardHidden"
android:screenOrientation="portrait"
android:theme="@style/jz_activity_fullscreen"/>

<activity
android:name=".ActivityListViewToDetail"
android:configChanges="orientation|screenSize|keyboardHidden"
android:screenOrientation="portrait" />
<activity
android:name=".ActivityListViewDetail"
android:configChanges="orientation|screenSize|keyboardHidden"
android:screenOrientation="portrait"
android:theme="@style/TransparentWindow" />
<activity
android:name=".ActivityListViewAutoPlay"
android:configChanges="orientation|screenSize|keyboardHidden"
android:screenOrientation="portrait" />

<activity
android:name=".ActivityLocalVideo"
android:configChanges="orientation|screenSize|keyboardHidden"
android:screenOrientation="portrait" />
</application>

</manifest>
</manifest>
5 changes: 3 additions & 2 deletions app/src/main/java/cn/jzvd/demo/ActivityApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import java.util.LinkedHashMap;

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

Expand Down Expand Up @@ -59,7 +60,7 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
// mJzvdStd.seekToInAdvance = 20000;
// Jzvd.SAVE_PROGRESS = false;//把这些注释的代码放到按钮上,让它可操作可见。

/** Play video in local path, eg:record by system camera **/
/** Play video in local localVideoPath, eg:record by system camera **/
// cpAssertVideoToLocalPath();
// mJzvdStd.setUp(Environment.getExternalStorageDirectory().getAbsolutePath() + "/DCIM/Camera/local_video.mp4"
// , "饺子不信", Jzvd.SCREEN_NORMAL);
Expand All @@ -80,7 +81,7 @@ protected void onResume() {
protected void onPause() {
super.onPause();
mSensorManager.unregisterListener(mSensorEventListener);
Jzvd.clearSavedProgress(this, null);
JZUtils.clearSavedProgress(this, null);
//home back
Jzvd.goOnPlayOnPause();
}
Expand Down
18 changes: 2 additions & 16 deletions app/src/main/java/cn/jzvd/demo/ActivityApiCustomMedia.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,11 @@

import com.bumptech.glide.Glide;

import java.io.IOException;

import cn.jzvd.JZDataSource;
import cn.jzvd.JZMediaSystem;
import cn.jzvd.Jzvd;
import cn.jzvd.JzvdStd;
import cn.jzvd.demo.CustomMedia.JZMediaExo;
import cn.jzvd.demo.CustomMedia.JZMediaIjk;
import cn.jzvd.demo.CustomMedia.JZMediaSystemAssertFolder;

/**
* Created by Nathen on 2017/11/23.
Expand All @@ -40,18 +36,8 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {

jzvdStd = findViewById(R.id.videoplayer);

JZDataSource jzDataSource = null;
try {
jzDataSource = new JZDataSource(getAssets().openFd("local_video.mp4"));
jzDataSource.title = "饺子快长大";
} catch (IOException e) {
e.printStackTrace();
}
jzvdStd.setUp(jzDataSource, JzvdStd.SCREEN_NORMAL, JZMediaSystemAssertFolder.class);


// jzvdStd.setUp("http://jzvd.nathen.cn/342a5f7ef6124a4a8faf00e738b8bee4/cf6d9db0bd4d41f59d09ea0a81e918fd-5287d2089db37e62345123a1be272f8b.mp4"
// , "饺子快长大", JzvdStd.SCREEN_NORMAL, new JZMediaIjk(jzvdStd));
jzvdStd.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")
Expand Down
15 changes: 15 additions & 0 deletions app/src/main/java/cn/jzvd/demo/ActivityListView.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
import android.view.MenuItem;
import android.view.View;

import cn.jzvd.demo.tiktok.ActivityTikTok;

/**
* Created by Nathen on 16/7/31.
*/
Expand Down Expand Up @@ -51,4 +53,17 @@ public void clickMultiHolder(View view) {
public void clickRecyclerView(View view) {
startActivity(new Intent(ActivityListView.this, ActivityListViewRecyclerView.class));
}

public void clickListSmoothToDetail(View view) {
startActivity(new Intent(ActivityListView.this, ActivityListViewToDetail.class));
}

public void clickListAutoPlay(View view) {
startActivity(new Intent(ActivityListView.this, ActivityListViewAutoPlay.class));
}

public void clickTikTok(View view) {
startActivity(new Intent(ActivityListView.this, ActivityTikTok.class));
}

}
98 changes: 98 additions & 0 deletions app/src/main/java/cn/jzvd/demo/ActivityListViewAutoPlay.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
package cn.jzvd.demo;

import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.MenuItem;
import android.view.View;

import cn.jzvd.Jzvd;
import cn.jzvd.demo.CustomJzvd.AutoPlayUtils;


public class ActivityListViewAutoPlay extends AppCompatActivity {
RecyclerView recyclerView;
AdapterRecyclerView adapterVideoList;
private LinearLayoutManager mLayoutManager;

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setDisplayShowHomeEnabled(true);
getSupportActionBar().setDisplayShowTitleEnabled(true);
getSupportActionBar().setDisplayUseLogoEnabled(false);
getSupportActionBar().setTitle("RecyclerView");
setContentView(R.layout.activity_recyclerview_content);

recyclerView = findViewById(R.id.recyclerview);
mLayoutManager = new LinearLayoutManager(this);
recyclerView.setLayoutManager(mLayoutManager);

adapterVideoList = new AdapterRecyclerView(this);
recyclerView.setAdapter(adapterVideoList);
recyclerView.addOnChildAttachStateChangeListener(new RecyclerView.OnChildAttachStateChangeListener() {
@Override
public void onChildViewAttachedToWindow(View view) {

}

@Override
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.screen != Jzvd.SCREEN_FULLSCREEN) {
Jzvd.releaseAllVideos();
}
}
}
});

recyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {
@Override
public void onScrollStateChanged(@NonNull RecyclerView recyclerView, int newState) {
super.onScrollStateChanged(recyclerView, newState);
if (newState == RecyclerView.SCROLL_STATE_IDLE) {
AutoPlayUtils.onScrollPlayVideo(recyclerView, R.id.videoplayer, mLayoutManager.findFirstVisibleItemPosition(), mLayoutManager.findLastVisibleItemPosition());
}
}

@Override
public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
super.onScrolled(recyclerView, dx, dy);
if (dy != 0) {
AutoPlayUtils.onScrollReleaseAllVideos(mLayoutManager.findFirstVisibleItemPosition(), mLayoutManager.findLastVisibleItemPosition(), 0.2f);
}
}
});
}

@Override
public void onBackPressed() {
if (Jzvd.backPress()) {
return;
}
super.onBackPressed();
}

@Override
protected void onPause() {
super.onPause();
Jzvd.releaseAllVideos();
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
finish();
break;
}
return super.onOptionsItemSelected(item);
}

}
Loading

0 comments on commit 63c6dab

Please sign in to comment.