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.4.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
I authored and I committed Dec 2, 2018
2 parents eb8f3b7 + da2d60a commit 32fe872
Show file tree
Hide file tree
Showing 37 changed files with 239 additions and 309 deletions.
11 changes: 5 additions & 6 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.4.0-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.4.1-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 @@ -25,11 +25,12 @@ Q群: 490442439 2群: 761899104 验证信息:jzvd
10. Home键退出界面暂停播放,返回界面继续播放
11. WebView嵌套本地视频控件
12. demo中添加视频缓存的例子
13. 倍速播放

## 使用步骤

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

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

1.添加类库
```gradle
compile 'cn.jzvd:jiaozivideoplayer:6.4.0'
compile 'cn.jzvd:jiaozivideoplayer:6.4.1'
```

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

2.添加布局
```xml
Expand Down Expand Up @@ -137,8 +138,6 @@ protected void onPause() {

## [打赏](https://github.com/lipangit/JiaoZiVideoPlayer/wiki#%E6%89%93%E8%B5%8F%E5%92%8C%E5%92%A8%E8%AF%A2)

这项目是专门给中小app集成视频播放的,极大降低开发成本,如果给您节省了成吨的时间,建议零售价:打赏500元

![打赏][2]

## License MIT
Expand Down
11 changes: 5 additions & 6 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.4.0-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.4.1-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 @@ -30,11 +30,12 @@ Q群: 490442439 2群: 761899104 验证信息:jzvd
10. Home key to exit the interface to suspend the playback, return to the interface to continue playing
11. WebView Nested Local Video Controls
12. VideoCache in demo
13. PlayBack speed

## Steps for usage

1. Read through ReadMe
2. Download and install the demo apk[jiaozivideoplayer-6.4.0.apk](https://github.com/lipangit/JiaoZiVideoPlayer/releases/download/v6.4.0/jiaozivideoplayer-6.4.0.apk), each page enters once, each button clicks once
2. Download and install the demo apk[jiaozivideoplayer-6.4.1.apk](https://github.com/lipangit/JiaoZiVideoPlayer/releases/download/v6.4.1/jiaozivideoplayer-6.4.1.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 @@ -53,10 +54,10 @@ Only five steps to use the player:

1.Import library:
```gradle
implementation 'cn.jzvd:jiaozivideoplayer:6.4.0'
implementation 'cn.jzvd:jiaozivideoplayer:6.4.1'
```

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

2.Add `JZVideoPlayer` in your layout:
```xml
Expand Down Expand Up @@ -119,8 +120,6 @@ protected void onPause() {

## Reward

This project is dedicated to the integration of small and medium video playback app, greatly reducing the cost of development. If you save tons of time, we suggest a retail price of 76 USD. (It's not expensive, get a two-year project worth more than that)

![Reward][2]

## License MIT
Expand Down
8 changes: 4 additions & 4 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 85
versionName "6.4.0"
versionCode 86
versionName "6.4.1"
}
signingConfigs {
releaseConfig {
Expand Down Expand Up @@ -43,6 +43,6 @@ dependencies {
implementation 'tv.danmaku.ijk.media:ijkplayer-armv7a:0.8.4'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.danikula:videocache:2.7.0'
implementation 'com.github.bumptech.glide:glide:4.6.1'
implementation 'com.google.android.exoplayer:exoplayer:2.9.0'
implementation 'com.github.bumptech.glide:glide:4.7.1'
implementation 'com.google.android.exoplayer:exoplayer:2.9.1'
}
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
android:allowBackup="false"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:networkSecurityConfig="@xml/jz_network_security_config_allow_cleartext"
android:networkSecurityConfig="@xml/jz_network_security_config"
android:theme="@style/AppTheme">
<activity
android:name=".ActivityMain"
Expand Down
68 changes: 27 additions & 41 deletions app/src/main/java/cn/jzvd/demo/ActivityApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@
/**
* Created by Nathen on 16/7/31.
*/
public class ActivityApi extends AppCompatActivity implements View.OnClickListener {
Button mSmallChange, mBigChange, mOrientation, mExtendsNormalActivity, mRationAndVideoSize, mCustomMediaPlayer;
public class ActivityApi extends AppCompatActivity {
JzvdStd mJzvdStd;
Jzvd.JZAutoFullscreenListener mSensorEventListener;
SensorManager mSensorManager;
Expand All @@ -43,21 +42,6 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
getSupportActionBar().setTitle("Api");
setContentView(R.layout.activity_api);

mSmallChange = findViewById(R.id.small_change);
mBigChange = findViewById(R.id.big_change);
mOrientation = findViewById(R.id.orientation);
mExtendsNormalActivity = findViewById(R.id.extends_normal_activity);
mRationAndVideoSize = findViewById(R.id.rotation_and_videosize);
mCustomMediaPlayer = findViewById(R.id.custom_mediaplayer);

mSmallChange.setOnClickListener(this);
mBigChange.setOnClickListener(this);
mOrientation.setOnClickListener(this);
mExtendsNormalActivity.setOnClickListener(this);
mRationAndVideoSize.setOnClickListener(this);
mCustomMediaPlayer.setOnClickListener(this);


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

Expand Down Expand Up @@ -87,30 +71,6 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
mSensorEventListener = new Jzvd.JZAutoFullscreenListener();
}

@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.small_change:
startActivity(new Intent(ActivityApi.this, ActivityApiUISmallChange.class));
break;
case R.id.big_change:
Toast.makeText(ActivityApi.this, "Comming Soon", Toast.LENGTH_SHORT).show();
// startActivity(new Intent(ActivityApi.this, ActivityApiUIBigChange.class));
break;
case R.id.orientation:
startActivity(new Intent(ActivityApi.this, ActivityApiOrientation.class));
break;
case R.id.extends_normal_activity:
startActivity(new Intent(ActivityApi.this, ActivityApiExtendsNormal.class));
break;
case R.id.rotation_and_videosize:
startActivity(new Intent(ActivityApi.this, ActivityApiRotationVideoSize.class));
break;
case R.id.custom_mediaplayer:
startActivity(new Intent(ActivityApi.this, ActivityApiCustomMediaPlayer.class));
break;
}
}

@Override
protected void onResume() {
Expand Down Expand Up @@ -167,4 +127,30 @@ public void cpAssertVideoToLocalPath() {
e.printStackTrace();
}
}

public void clickSmallChange(View view) {
startActivity(new Intent(ActivityApi.this, ActivityApiUISmallChange.class));
}

public void clickBigChange(View view) {
Toast.makeText(ActivityApi.this, "Comming Soon", Toast.LENGTH_SHORT).show();
// startActivity(new Intent(ActivityApi.this, ActivityApiUIBigChange.class));
}

public void clickOrientation(View view) {
startActivity(new Intent(ActivityApi.this, ActivityApiOrientation.class));

}

public void clickExtendsNormalActivity(View view) {
startActivity(new Intent(ActivityApi.this, ActivityApiExtendsNormal.class));
}

public void clickRotationAndVideoSize(View view) {
startActivity(new Intent(ActivityApi.this, ActivityApiRotationVideoSize.class));
}

public void clickCustomMediaPlayer(View view) {
startActivity(new Intent(ActivityApi.this, ActivityApiCustomMediaPlayer.class));
}
}
54 changes: 22 additions & 32 deletions app/src/main/java/cn/jzvd/demo/ActivityApiCustomMediaPlayer.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
* Created by Nathen on 2017/11/23.
*/

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

Expand All @@ -41,13 +40,6 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
setContentView(R.layout.activity_api_custom_mediaplayer);

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);

mChangeToIjk.setOnClickListener(this);
mChangeToSystemMediaPlayer.setOnClickListener(this);
mChangeToExo.setOnClickListener(this);

JZDataSource jzDataSource = null;
try {
Expand All @@ -64,29 +56,6 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
Jzvd.setMediaInterface(new CustomMediaPlayerAssertFolder());//进入此页面修改MediaInterface,让此页面的jzvd正常工作
}

@Override
public void onClick(View view) {
switch (view.getId()) {
case R.id.change_to_ijkplayer:
Jzvd.releaseAllVideos();
handler.postDelayed(() -> 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:
Jzvd.releaseAllVideos();
handler.postDelayed(() -> Jzvd.setMediaInterface(new JZMediaSystem()), 1000);
Toast.makeText(this, "Change to MediaPlayer", Toast.LENGTH_SHORT).show();
finish();
break;
case R.id.change_to_exo:
Jzvd.releaseAllVideos();
handler.postDelayed(() -> Jzvd.setMediaInterface(new JZExoPlayer()), 1000);
Toast.makeText(this, "Change to ExoPlayer", Toast.LENGTH_SHORT).show();
finish();
break;
}
}

@Override
public void onBackPressed() {
Expand Down Expand Up @@ -116,4 +85,25 @@ public boolean onOptionsItemSelected(MenuItem item) {
return super.onOptionsItemSelected(item);
}


public void clickChangeToIjkplayer(View view) {
Jzvd.releaseAllVideos();
handler.postDelayed(() -> Jzvd.setMediaInterface(new JZMediaIjkplayer()), 1000);
Toast.makeText(ActivityApiCustomMediaPlayer.this, "Change to Ijkplayer", Toast.LENGTH_SHORT).show();
finish();
}

public void clickChangeToSystemMediaPlayer(View view) {
Jzvd.releaseAllVideos();
handler.postDelayed(() -> Jzvd.setMediaInterface(new JZMediaSystem()), 1000);
Toast.makeText(this, "Change to MediaPlayer", Toast.LENGTH_SHORT).show();
finish();
}

public void clickChangeToExo(View view) {
Jzvd.releaseAllVideos();
handler.postDelayed(() -> Jzvd.setMediaInterface(new JZExoPlayer()), 1000);
Toast.makeText(this, "Change to ExoPlayer", Toast.LENGTH_SHORT).show();
finish();
}
}
9 changes: 6 additions & 3 deletions app/src/main/java/cn/jzvd/demo/ActivityApiOrientation.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,13 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
Glide.with(this)
.load(VideoConstant.videoThumbList[0])
.into(mJzvdStd.thumbImageView);
}

Jzvd.FULLSCREEN_ORIENTATION = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;
@Override
protected void onResume() {
super.onResume();
Jzvd.FULLSCREEN_ORIENTATION = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT;
Jzvd.NORMAL_ORIENTATION = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT;

}

@Override
Expand All @@ -52,7 +55,7 @@ protected void onPause() {
Jzvd.releaseAllVideos();

//Change these two variables back
Jzvd.FULLSCREEN_ORIENTATION = ActivityInfo.SCREEN_ORIENTATION_SENSOR;
Jzvd.FULLSCREEN_ORIENTATION = ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE;
Jzvd.NORMAL_ORIENTATION = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT;
}

Expand Down
48 changes: 16 additions & 32 deletions app/src/main/java/cn/jzvd/demo/ActivityApiRotationVideoSize.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@
* Created by Nathen on 2017/11/2.
*/

public class ActivityApiRotationVideoSize extends AppCompatActivity implements View.OnClickListener {
public class ActivityApiRotationVideoSize extends AppCompatActivity {

JzvdStd myJzvdStd;
Button mBtnRotation, mBtnFillParent, mBtnFillCrop, mBtnOriginal;

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
Expand All @@ -39,38 +38,8 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
.into(myJzvdStd.thumbImageView);
// The Point IS
myJzvdStd.videoRotation = 180;

mBtnRotation = findViewById(R.id.rotation_to_90);
mBtnFillParent = findViewById(R.id.video_image_display_fill_parent);
mBtnFillCrop = findViewById(R.id.video_image_display_fill_crop);
mBtnOriginal = findViewById(R.id.video_image_diaplay_original);
mBtnRotation.setOnClickListener(this);
mBtnFillParent.setOnClickListener(this);
mBtnFillCrop.setOnClickListener(this);
mBtnOriginal.setOnClickListener(this);
}

@Override
public void onClick(View view) {
switch (view.getId()) {
case R.id.rotation_to_90:
Jzvd.setTextureViewRotation(90);

break;
case R.id.video_image_display_fill_parent:
Jzvd.setVideoImageDisplayType(Jzvd.VIDEO_IMAGE_DISPLAY_TYPE_FILL_PARENT);

break;
case R.id.video_image_display_fill_crop:
Jzvd.setVideoImageDisplayType(Jzvd.VIDEO_IMAGE_DISPLAY_TYPE_FILL_SCROP);

break;
case R.id.video_image_diaplay_original:
Jzvd.setVideoImageDisplayType(Jzvd.VIDEO_IMAGE_DISPLAY_TYPE_ORIGINAL);

break;
}
}

@Override
protected void onPause() {
Expand All @@ -97,4 +66,19 @@ public boolean onOptionsItemSelected(MenuItem item) {
return super.onOptionsItemSelected(item);
}

public void clickRotationToNinety(View view) {
Jzvd.setTextureViewRotation(90);
}

public void clickVideoImageDisplayFillParent(View view) {
Jzvd.setVideoImageDisplayType(Jzvd.VIDEO_IMAGE_DISPLAY_TYPE_FILL_PARENT);
}

public void clickVideoImageDisplayFillCrop(View view) {
Jzvd.setVideoImageDisplayType(Jzvd.VIDEO_IMAGE_DISPLAY_TYPE_FILL_SCROP);
}

public void clickVideoImageDiaplayOriginal(View view) {
Jzvd.setVideoImageDisplayType(Jzvd.VIDEO_IMAGE_DISPLAY_TYPE_ORIGINAL);
}
}
Loading

0 comments on commit 32fe872

Please sign in to comment.