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.3_preview'
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathen committed Sep 2, 2018
2 parents 6ac1a60 + 9badb52 commit 1a127a3
Show file tree
Hide file tree
Showing 63 changed files with 1,109 additions and 624 deletions.
11 changes: 11 additions & 0 deletions .github/ISSUE_TEMPLATE/-------.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
name: 此需求如何实现
about: 需求描述

---

**需求描述

**其他app是否实现

**截图或者小视频说明
11 changes: 11 additions & 0 deletions .github/ISSUE_TEMPLATE/----.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
name: 我的需求
about: 需求描述

---

**需求描述

**其他app是否实现

**截图或者小视频说明
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: Bug report
about: Create a report to help us improve

---

**什么jzvd版本

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

**是否和特定品牌的手机机型有关系,什么机型

**相关log是什么

**复现流程

**最好有截图或者视频说明情况
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.12-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.3_preview-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 @@ -24,7 +24,7 @@

## 效果

**[jiaozivideoplayer-6.2.12.apk](https://github.com/lipangit/JiaoZiVideoPlayer/releases/download/v6.2.12/jiaozivideoplayer-6.2.12.apk)**
**[jiaozivideoplayer-6.3_preview.apk](https://github.com/lipangit/JiaoZiVideoPlayer/releases/download/v6.3_preview/jiaozivideoplayer-6.3_preview.apk)**

![Demo Screenshot][1]

Expand All @@ -36,10 +36,10 @@

1.添加类库
```gradle
compile 'cn.jzvd:jiaozivideoplayer:6.2.12'
compile 'cn.jzvd:jiaozivideoplayer:6.3_preview'
```

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

2.添加布局
```xml
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-6.2.12-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.3_preview-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 @@ -34,7 +34,7 @@ Group Q: 490442439 (group 1 full) 761899104 (group 2) authentication information

## Demo apk

A demo apk [jiaozivideoplayer-6.2.12.apk](https://github.com/lipangit/JiaoZiVideoPlayer/releases/download/v6.2.12/jiaozivideoplayer-6.2.12.apk) is available on Google Play showing all available features like this [small window effect on list sliding](http://weibo.com/tv/v/FtxpWgqmg?fid=1034:5cda6fc7f394b403d592bd9b1d5a9701).
A demo apk [jiaozivideoplayer-6.3_preview.apk](https://github.com/lipangit/JiaoZiVideoPlayer/releases/download/v6.3_preview/jiaozivideoplayer-6.3_preview.apk) is available on Google Play showing all available features like this [small window effect on list sliding](http://weibo.com/tv/v/FtxpWgqmg?fid=1034:5cda6fc7f394b403d592bd9b1d5a9701).

![Demo screenshot][1]

Expand All @@ -44,10 +44,10 @@ Only five steps to use the player:

1.Import library:
```gradle
compile 'cn.jzvd:jiaozivideoplayer:6.2.12'
compile 'cn.jzvd:jiaozivideoplayer:6.3_preview'
```

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

2.Add `JZVideoPlayer` in your layout:
```xml
Expand Down
4 changes: 2 additions & 2 deletions app/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 27
versionCode 82
versionName "6.2.12"
versionCode 83
versionName "6.3_preview"
}
signingConfigs {
releaseConfig {
Expand Down
39 changes: 19 additions & 20 deletions app/src/main/java/cn/jzvd/demo/ActivityApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.HashMap;
import java.util.LinkedHashMap;

import cn.jzvd.JZVideoPlayer;
import cn.jzvd.JZVideoPlayerStandard;
import cn.jzvd.JZDataSource;
import cn.jzvd.Jzvd;
import cn.jzvd.JzvdStd;

/**
* Created by Nathen on 16/7/31.
*/
public class ActivityApi extends AppCompatActivity implements View.OnClickListener {
Button mSmallChange, mBigChange, mOrientation, mExtendsNormalActivity, mRationAndVideoSize, mCustomMediaPlayer;
JZVideoPlayerStandard mJzVideoPlayerStandard;
JZVideoPlayer.JZAutoFullscreenListener mSensorEventListener;
JzvdStd mJzvdStd;
Jzvd.JZAutoFullscreenListener mSensorEventListener;
SensorManager mSensorManager;

@Override
Expand Down Expand Up @@ -58,23 +58,22 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
mCustomMediaPlayer.setOnClickListener(this);


mJzVideoPlayerStandard = findViewById(R.id.jz_video);
mJzvdStd = findViewById(R.id.jz_video);
LinkedHashMap map = new LinkedHashMap();

String proxyUrl = ApplicationDemo.getProxy(this).getProxyUrl(VideoConstant.videoUrls[0][9]);

map.put("高清", proxyUrl);
map.put("标清", VideoConstant.videoUrls[0][6]);
map.put("普清", VideoConstant.videoUrlList[0]);
Object[] objects = new Object[3];
objects[0] = map;
objects[1] = false;//looping
objects[2] = new HashMap<>();
((HashMap) objects[2]).put("key", "value");//header
mJzVideoPlayerStandard.setUp(objects, 2
, JZVideoPlayerStandard.SCREEN_WINDOW_NORMAL, "饺子不信");
Glide.with(this).load(VideoConstant.videoThumbList[0]).into(mJzVideoPlayerStandard.thumbImageView);
mJzVideoPlayerStandard.seekToInAdvance = 20000;
JZDataSource jzDataSource = new JZDataSource(map, "饺子不信");
jzDataSource.looping = true;
jzDataSource.currentUrlIndex = 2;
jzDataSource.headerMap.put("key", "value");//header
mJzvdStd.setUp(jzDataSource
, JzvdStd.SCREEN_WINDOW_NORMAL);
Glide.with(this).load(VideoConstant.videoThumbList[0]).into(mJzvdStd.thumbImageView);
mJzvdStd.seekToInAdvance = 20000;
//JZVideoPlayer.SAVE_PROGRESS = false;

/** Play video in local path, eg:record by system camera **/
Expand All @@ -86,7 +85,7 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
// videoController1.thumbImageView);
/** volley Fresco omit **/
mSensorManager = (SensorManager) getSystemService(SENSOR_SERVICE);
mSensorEventListener = new JZVideoPlayer.JZAutoFullscreenListener();
mSensorEventListener = new Jzvd.JZAutoFullscreenListener();
}

@Override
Expand Down Expand Up @@ -120,21 +119,21 @@ protected void onResume() {
Sensor accelerometerSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);
mSensorManager.registerListener(mSensorEventListener, accelerometerSensor, SensorManager.SENSOR_DELAY_NORMAL);
//home back
JZVideoPlayer.goOnPlayOnResume();
Jzvd.goOnPlayOnResume();
}

@Override
protected void onPause() {
super.onPause();
mSensorManager.unregisterListener(mSensorEventListener);
JZVideoPlayer.clearSavedProgress(this, null);
Jzvd.clearSavedProgress(this, null);
//home back
JZVideoPlayer.goOnPlayOnPause();
Jzvd.goOnPlayOnPause();
}

@Override
public void onBackPressed() {
if (JZVideoPlayer.backPress()) {
if (Jzvd.backPress()) {
return;
}
super.onBackPressed();
Expand Down
48 changes: 23 additions & 25 deletions app/src/main/java/cn/jzvd/demo/ActivityApiCustomMediaPlayer.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
import com.bumptech.glide.Glide;

import java.io.IOException;
import java.util.LinkedHashMap;

import cn.jzvd.JZDataSource;
import cn.jzvd.JZMediaSystem;
import cn.jzvd.JZVideoPlayer;
import cn.jzvd.JZVideoPlayerStandard;
import cn.jzvd.Jzvd;
import cn.jzvd.JzvdStd;
import cn.jzvd.demo.CustomMediaPlayer.CustomMediaPlayerAssertFolder;
import cn.jzvd.demo.CustomMediaPlayer.JZExoPlayer;
import cn.jzvd.demo.CustomMediaPlayer.JZMediaIjkplayer;
Expand All @@ -27,7 +27,7 @@

public class ActivityApiCustomMediaPlayer extends AppCompatActivity implements View.OnClickListener {
Button mChangeToIjk, mChangeToSystemMediaPlayer, mChangeToExo;
JZVideoPlayerStandard jzVideoPlayerStandard;
JzvdStd jzvdStd;
Handler handler = new Handler();//这里其实并不需要handler,为了防止播放中切换播放器引擎导致的崩溃,实际使用时一般不会遇到,可以随时调用JZVideoPlayer.setMediaInterface();

@Override
Expand All @@ -40,7 +40,7 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
getSupportActionBar().setTitle("CustomMediaPlayer");
setContentView(R.layout.activity_api_custom_mediaplayer);

jzVideoPlayerStandard = findViewById(R.id.videoplayer);
jzvdStd = findViewById(R.id.videoplayer);
mChangeToIjk = findViewById(R.id.change_to_ijkplayer);
mChangeToSystemMediaPlayer = findViewById(R.id.change_to_system_mediaplayer);
mChangeToExo = findViewById(R.id.change_to_exo);
Expand All @@ -49,54 +49,52 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
mChangeToSystemMediaPlayer.setOnClickListener(this);
mChangeToExo.setOnClickListener(this);

LinkedHashMap map = new LinkedHashMap();
JZDataSource jzDataSource = null;
try {
map.put(JZVideoPlayer.URL_KEY_DEFAULT, getAssets().openFd("local_video.mp4"));
jzDataSource = new JZDataSource(getAssets().openFd("local_video.mp4"));
jzDataSource.title = "饺子快长大";
} catch (IOException e) {
e.printStackTrace();
}
Object[] dataSourceObjects = new Object[2];
dataSourceObjects[0] = map;
dataSourceObjects[1] = this;
jzVideoPlayerStandard.setUp(dataSourceObjects, 0, JZVideoPlayerStandard.SCREEN_WINDOW_NORMAL, "饺子快长大");
jzvdStd.setUp(jzDataSource, JzvdStd.SCREEN_WINDOW_NORMAL);
Glide.with(this)
.load("http://jzvd-pic.nathen.cn/jzvd-pic/1bb2ebbe-140d-4e2e-abd2-9e7e564f71ac.png")
.into(jzVideoPlayerStandard.thumbImageView);
.into(jzvdStd.thumbImageView);

JZVideoPlayer.setMediaInterface(new CustomMediaPlayerAssertFolder());//进入此页面修改MediaInterface,让此页面的jzvd正常工作
Jzvd.setMediaInterface(new CustomMediaPlayerAssertFolder());//进入此页面修改MediaInterface,让此页面的jzvd正常工作
}

@Override
public void onClick(View view) {
switch (view.getId()) {
case R.id.change_to_ijkplayer:
JZVideoPlayer.releaseAllVideos();
Jzvd.releaseAllVideos();
handler.postDelayed(new Runnable() {
@Override
public void run() {
JZVideoPlayer.setMediaInterface(new JZMediaIjkplayer());
Jzvd.setMediaInterface(new JZMediaIjkplayer());
}
}, 1000);
Toast.makeText(ActivityApiCustomMediaPlayer.this, "Change to Ijkplayer", Toast.LENGTH_SHORT).show();
finish();
break;
case R.id.change_to_system_mediaplayer:
JZVideoPlayer.releaseAllVideos();
Jzvd.releaseAllVideos();
handler.postDelayed(new Runnable() {
@Override
public void run() {
JZVideoPlayer.setMediaInterface(new JZMediaSystem());
Jzvd.setMediaInterface(new JZMediaSystem());
}
}, 1000);
Toast.makeText(this, "Change to MediaPlayer", Toast.LENGTH_SHORT).show();
finish();
break;
case R.id.change_to_exo:
JZVideoPlayer.releaseAllVideos();
Jzvd.releaseAllVideos();
handler.postDelayed(new Runnable() {
@Override
public void run() {
JZVideoPlayer.setMediaInterface(new JZExoPlayer());
Jzvd.setMediaInterface(new JZExoPlayer());
}
}, 1000);
Toast.makeText(this, "Change to ExoPlayer", Toast.LENGTH_SHORT).show();
Expand All @@ -107,14 +105,14 @@ public void run() {

@Override
public void onBackPressed() {
if (JZVideoPlayer.backPress()) {
if (Jzvd.backPress()) {
return;
}
JZVideoPlayer.releaseAllVideos();
Jzvd.releaseAllVideos();
handler.postDelayed(new Runnable() {
@Override
public void run() {
JZVideoPlayer.setMediaInterface(new JZMediaSystem());
Jzvd.setMediaInterface(new JZMediaSystem());
}
}, 1000);
super.onBackPressed();
Expand All @@ -123,18 +121,18 @@ public void run() {
@Override
protected void onPause() {
super.onPause();
JZVideoPlayer.releaseAllVideos();
Jzvd.releaseAllVideos();
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
JZVideoPlayer.releaseAllVideos();
Jzvd.releaseAllVideos();
handler.postDelayed(new Runnable() {
@Override
public void run() {
JZVideoPlayer.setMediaInterface(new JZMediaSystem());
Jzvd.setMediaInterface(new JZMediaSystem());
}
}, 1000);
finish();
Expand Down
16 changes: 8 additions & 8 deletions app/src/main/java/cn/jzvd/demo/ActivityApiExtendsNormal.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

import com.bumptech.glide.Glide;

import cn.jzvd.JZVideoPlayer;
import cn.jzvd.JZVideoPlayerStandard;
import cn.jzvd.Jzvd;
import cn.jzvd.JzvdStd;

/**
* Created by Nathen on 2017/9/19.
Expand All @@ -18,17 +18,17 @@ public class ActivityApiExtendsNormal extends Activity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_extends_normal);
JZVideoPlayerStandard jzVideoPlayerStandard = findViewById(R.id.videoplayer);
jzVideoPlayerStandard.setUp(VideoConstant.videoUrlList[0]
, JZVideoPlayerStandard.SCREEN_WINDOW_NORMAL, "饺子不信");
JzvdStd jzvdStd = findViewById(R.id.videoplayer);
jzvdStd.setUp(VideoConstant.videoUrlList[0], "饺子不信"
, JzvdStd.SCREEN_WINDOW_NORMAL);
Glide.with(this)
.load(VideoConstant.videoThumbList[0])
.into(jzVideoPlayerStandard.thumbImageView);
.into(jzvdStd.thumbImageView);
}

@Override
public void onBackPressed() {
if (JZVideoPlayer.backPress()) {
if (Jzvd.backPress()) {
return;
}
super.onBackPressed();
Expand All @@ -37,6 +37,6 @@ public void onBackPressed() {
@Override
protected void onPause() {
super.onPause();
JZVideoPlayer.releaseAllVideos();
Jzvd.releaseAllVideos();
}
}
Loading

0 comments on commit 1a127a3

Please sign in to comment.