Skip to content

Commit

Permalink
Merge branch 'release/v7.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
lipangit committed Dec 22, 2019
2 parents a07843f + bcd8ebc commit 02f86c7
Show file tree
Hide file tree
Showing 18 changed files with 104 additions and 211 deletions.
11 changes: 0 additions & 11 deletions .github/ISSUE_TEMPLATE/-------.md

This file was deleted.

8 changes: 4 additions & 4 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ about: Create a report to help us improve

**什么jzvd版本

**是否和安卓版本有关系,什么版本
**相关log是什么

**是否和特定品牌的手机机型有关系,什么机型
**demo是否有这个问题

**相关log是什么
**如何操作复现

**复现流程
**什么安卓版本,什么机型

**最好有截图或者视频说明情况
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: 我的需求
name: 提需求
about: 需求描述

---
Expand Down
135 changes: 0 additions & 135 deletions README-EN.md

This file was deleted.

66 changes: 23 additions & 43 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,24 @@
--
<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.5-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://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>

高度自定义的安卓视频播框架
高度自定义的安卓视频框架

## 置顶消息:

Q群:490442439, 2群:761899104, 验证信息:jzvd, 微信公众号:jzvdjzt,微信:lipanhelloworld,QQ:1066666651,[Telegram](https://t.me/jiaozitoken)
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)

为了增加项目质量,促进项目进度,调用社群力量,方便社群管理,推出基于以太坊erc-20的数字通证[JiaoZiToken(JZT)(饺子Token)](https://github.com/lipangit/JZT),通俗点理解,谁给饺子视频播放器写代码、出主意、解决用户问题、活跃社群关系、关注项目进展,就给谁饺子Token。将来会让项目更加丰富,更加精致,必定大有可为。
为了增加项目质量,促进项目进度,调用社群力量,方便社群管理,推出基于以太坊ERC-20的数字通证[JiaoZiToken(JZT)(饺子Token)](https://github.com/JZVD/JZT),必定大有可为。

## 主要特点
#### [找点事做挣饺子币](https://github.com/Jzvd/JiaoZiVideoPlayer/wiki/%E6%89%BE%E7%82%B9%E4%BA%8B%E5%81%9A%EF%BC%8C%E6%8C%A3%E7%82%B9%E9%A5%BA%E5%AD%90%E5%B8%81)

#### [购买咨询服务送饺子币](https://github.com/Jzvd/JiaoZiVideoPlayer/wiki/%E8%B4%AD%E4%B9%B0%E5%92%A8%E8%AF%A2%E6%9C%8D%E5%8A%A1%E9%80%81%E9%A5%BA%E5%AD%90%E5%B8%81)

## 项目功能

1. 可以完全自定义UI和任何功能
2. 一行代码切换播放引擎,支持的视频格式和协议取决于播放引擎,[android.media.MediaPlayer](https://developer.android.com/guide/topics/media/media-formats.html) [ijkplayer](https://github.com/Bilibili/ijkplayer)
Expand All @@ -31,51 +35,21 @@ Q群:490442439, 2群:761899104, 验证信息:jzvd, 微信公众号:jzvdjzt,微
12. demo中添加视频缓存的例子
13. 倍速播放

## 必读

#### 首先

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

#### 必读文章

- [入门文档 1](https://juejin.im/entry/5cb838b5518825186d65430a)
- [入门文档 2](https://shimo.im/docs/xj5F85W1gqEEBXRJ)
- [Wiki](https://github.com/lipangit/JiaoZiVideoPlayer/wiki),很久没更新了
- [English Wiki](https://github.com/felipetorres/VideoPlayer-Wiki)
- [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)

#### 提问必读

- [常见问题](https://github.com/lipangit/JiaoZiVideoPlayer/wiki/常见问题),查找已经解决的问题
- 有问题请到Issue提问,我会第一时间回复,然后加我QQ微信(请备注)。
- 到群里提问,请按照Issue模板,说清楚问题的情况,有管理员接应,解决不了的再找群主。
## 文档

#### 参与项目必读

- [加入我们](https://github.com/lipangit/JiaoZiVideoPlayer/wiki/加入我们)
- [未解决问题](https://github.com/lipangit/JiaoZiVideoPlayer/wiki/未解决问题),群主解决不了的,需要大家帮助的问题
- [文档 - 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
- [文档 - 自定义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),测试哪个播放内核适合自己的项目

## 效果

![Demo Screenshot][1]

## 使用

即便是自定义UI,或者对Library有过修改,把自定义的逻辑写到继承JzvdStd的类中,然后依然通过如下骤调用播放器。

#### 注意:
1.7.0版本之后要在JzvdStd外面包一层Layout
2.如果引入配置失败,根据失败的log检查是否添加了Java8的配置,或者升级环境到最新的稳定版
## QuickStart

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

2.添加布局
Expand Down Expand Up @@ -134,15 +108,21 @@ protected void onPause() {
-keep interface tv.danmaku.ijk.media.player.** { *; }
```

即便是自定义UI,或者对Library有过修改,依然要通过上述步骤使用播放器。

## 注意:
1.7.0版本之后要在JzvdStd外面包一层Layout
2.如果引入配置失败,根据失败的log检查是否添加了Java8的配置,或者升级环境到最新的稳定版


## License MIT

Copyright (c) 2015-2019 李盼
Copyright (c) 2015-2020 李盼

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

[1]: https://user-images.githubusercontent.com/2038071/31045150-a077cc8a-a5a2-11e7-8dc2-7a0e3a9f3e62.jpg
[1]: https://user-images.githubusercontent.com/2038071/31045150-a077cc8a-a5a2-11e7-8dc2-7a0e3a9f3e62.jpg
9 changes: 7 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@ android {
applicationId "cn.jzvd.demo"
minSdkVersion 16
targetSdkVersion 28
versionCode 93
versionName "7.0.5"
versionCode 94
versionName "7.1.0"
ndk {
// add support lib
abiFilters 'armeabi-v7a' //, 'arm64-v8a'//, "mips" //,'armeabi''x86',, 'x86_64',
}
}
signingConfigs {
releaseConfig {
Expand Down Expand Up @@ -50,4 +54,5 @@ dependencies {
implementation 'com.danikula:videocache:2.7.0'
implementation 'com.github.bumptech.glide:glide:4.7.1'
implementation 'com.google.android.exoplayer:exoplayer:2.9.1'
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.0'
}
8 changes: 4 additions & 4 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@
android:configChanges="orientation|screenSize|keyboardHidden"
android:screenOrientation="portrait" />

<!--<activity-->
<!--android:name=".ActivityPreloading"-->
<!--android:configChanges="orientation|screenSize|keyboardHidden"-->
<!--android:screenOrientation="portrait" />-->
<activity
android:name=".ActivityPreloading"
android:configChanges="orientation|screenSize|keyboardHidden"
android:screenOrientation="portrait" />


</application>
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/java/cn/jzvd/demo/ActivityPreloading.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ public class ActivityPreloading extends AppCompatActivity {
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setDisplayShowHomeEnabled(true);
getSupportActionBar().setDisplayShowTitleEnabled(true);
getSupportActionBar().setDisplayUseLogoEnabled(false);
getSupportActionBar().setTitle("Preloading");
setContentView(R.layout.activity_preloading);
jzvdStd = findViewById(R.id.jz_video);

Expand Down
2 changes: 2 additions & 0 deletions app/src/main/java/cn/jzvd/demo/CustomMedia/JZMediaExo.java
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ public void release() {
if (mMediaHandler != null && mMediaHandlerThread != null && simpleExoPlayer != null) {//不知道有没有妖孽
HandlerThread tmpHandlerThread = mMediaHandlerThread;
SimpleExoPlayer tmpMediaPlayer = simpleExoPlayer;
JZMediaInterface.SAVED_SURFACE = null;

mMediaHandler.post(() -> {
tmpMediaPlayer.release();//release就不能放到主线程里,界面会卡顿
tmpHandlerThread.quit();
Expand Down
15 changes: 13 additions & 2 deletions app/src/main/java/cn/jzvd/demo/CustomMedia/JZMediaIjk.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import android.graphics.SurfaceTexture;
import android.media.AudioManager;
import android.media.MediaPlayer;
import android.os.Handler;
import android.os.HandlerThread;
import android.view.Surface;
Expand Down Expand Up @@ -93,8 +94,18 @@ public void seekTo(long time) {

@Override
public void release() {
if (ijkMediaPlayer != null)
ijkMediaPlayer.release();
if (mMediaHandler != null && mMediaHandlerThread != null && ijkMediaPlayer != null) {//不知道有没有妖孽
HandlerThread tmpHandlerThread = mMediaHandlerThread;
IjkMediaPlayer tmpMediaPlayer = ijkMediaPlayer;
JZMediaInterface.SAVED_SURFACE = null;

mMediaHandler.post(() -> {
tmpMediaPlayer.setSurface(null);
tmpMediaPlayer.release();
tmpHandlerThread.quit();
});
ijkMediaPlayer = null;
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ public void release() {
if (mMediaHandler != null && mMediaHandlerThread != null && mediaPlayer != null) {//不知道有没有妖孽
HandlerThread tmpHandlerThread = mMediaHandlerThread;
MediaPlayer tmpMediaPlayer = mediaPlayer;
JZMediaInterface.SAVED_SURFACE = null;

mMediaHandler.post(() -> {
tmpMediaPlayer.release();//release就不能放到主线程里,界面会卡顿
tmpHandlerThread.quit();
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout/activity_preloading.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
android:layout_height="wrap_content"
android:layout_marginTop="18dp"
android:onClick="clickStartPreloading"
android:text="startPreloading" />
android:text="start Preloading" />

<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="clickStartVideoAfterPreloading"
android:text="startVideoAfterPreloading" />
android:text="start Video After Preloading" />

</LinearLayout>
Loading

0 comments on commit 02f86c7

Please sign in to comment.