Skip to content

Commit

Permalink
Merge branch 'release/v7.0_preview'
Browse files Browse the repository at this point in the history
  • Loading branch information
I authored and I committed Mar 15, 2019
2 parents 7c551fe + 289de7a commit 7bbbfa9
Show file tree
Hide file tree
Showing 71 changed files with 1,689 additions and 1,816 deletions.
6 changes: 3 additions & 3 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.1-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_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 @@ -30,7 +30,7 @@ Q群: 490442439 2群: 761899104 验证信息:jzvd
## 使用步骤

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

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

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

或直接下载 [aar](https://github.com/lipangit/JiaoZiVideoPlayer/releases/tag/v6.4.2) (不建议)
Expand Down
6 changes: 3 additions & 3 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.1-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_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 @@ -35,7 +35,7 @@ Q群: 490442439 2群: 761899104 验证信息:jzvd
## Steps for usage

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

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

Or download [aar](https://github.com/lipangit/JiaoZiVideoPlayer/releases/tag/v6.4.2) (not recommended).
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 87
versionName "6.4.2"
versionCode 88
versionName "7.0_preview"
}
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 @@ -82,7 +82,7 @@
android:configChanges="orientation|screenSize|keyboardHidden"
android:screenOrientation="portrait" />
<activity
android:name=".ActivityApiCustomMediaPlayer"
android:name=".ActivityApiCustomMedia"
android:configChanges="orientation|screenSize|keyboardHidden"
android:screenOrientation="portrait" />
<activity
Expand Down
20 changes: 8 additions & 12 deletions app/src/main/java/cn/jzvd/demo/ActivityApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import android.support.v7.app.AppCompatActivity;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;

import com.bumptech.glide.Glide;
Expand All @@ -21,6 +20,7 @@
import java.util.LinkedHashMap;

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

Expand All @@ -44,9 +44,7 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {

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]);
Expand All @@ -55,23 +53,19 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
jzDataSource.currentUrlIndex = 2;
jzDataSource.headerMap.put("key", "value");//header
mJzvdStd.setUp(jzDataSource
, JzvdStd.SCREEN_WINDOW_NORMAL);
, JzvdStd.SCREEN_NORMAL);
Glide.with(this).load(VideoConstant.videoThumbList[0]).into(mJzvdStd.thumbImageView);
mJzvdStd.seekToInAdvance = 20000;
// mJzvdStd.seekToInAdvance = 20000;
//JZVideoPlayer.SAVE_PROGRESS = false;

/** Play video in local path, eg:record by system camera **/
// cpAssertVideoToLocalPath();
// mJzVideoPlayerStandard.setUp(Environment.getExternalStorageDirectory().getAbsolutePath() + "/DCIM/Camera/local_video.mp4"
// , JZVideoPlayerStandard.SCREEN_WINDOW_NORMAL, "饺子不信");
/** ImageLoader **/
// ImageLoader.getInstance().displayImage(VideoConstant.videoThumbs[0][1],
// videoController1.thumbImageView);
// mJzvdStd.setUp(Environment.getExternalStorageDirectory().getAbsolutePath() + "/DCIM/Camera/local_video.mp4"
// , "饺子不信", Jzvd.SCREEN_NORMAL);
mSensorManager = (SensorManager) getSystemService(SENSOR_SERVICE);
mSensorEventListener = new Jzvd.JZAutoFullscreenListener();
}


@Override
protected void onResume() {
super.onResume();
Expand Down Expand Up @@ -109,6 +103,7 @@ public boolean onOptionsItemSelected(MenuItem item) {
}

public void cpAssertVideoToLocalPath() {
JZUtils.verifyStoragePermissions(this);
try {
InputStream myInput;
OutputStream myOutput = new FileOutputStream(Environment.getExternalStorageDirectory().getAbsolutePath() + "/DCIM/Camera/local_video.mp4");
Expand Down Expand Up @@ -151,6 +146,7 @@ public void clickRotationAndVideoSize(View view) {
}

public void clickCustomMediaPlayer(View view) {
startActivity(new Intent(ActivityApi.this, ActivityApiCustomMediaPlayer.class));
startActivity(new Intent(ActivityApi.this, ActivityApiCustomMedia.class));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import android.support.v7.app.AppCompatActivity;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;

import com.bumptech.glide.Glide;
Expand All @@ -17,15 +16,15 @@
import cn.jzvd.JZMediaSystem;
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;
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.
*/

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

Expand All @@ -48,12 +47,42 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
} catch (IOException e) {
e.printStackTrace();
}
jzvdStd.setUp(jzDataSource, JzvdStd.SCREEN_WINDOW_NORMAL);
jzvdStd.setUp(jzDataSource, JzvdStd.SCREEN_NORMAL, new JZMediaSystemAssertFolder(jzvdStd));


// jzvdStd.setUp("http://jzvd.nathen.cn/342a5f7ef6124a4a8faf00e738b8bee4/cf6d9db0bd4d41f59d09ea0a81e918fd-5287d2089db37e62345123a1be272f8b.mp4"
// , "饺子快长大", JzvdStd.SCREEN_NORMAL, new JZMediaIjk(jzvdStd));

Glide.with(this)
.load("http://jzvd-pic.nathen.cn/jzvd-pic/1bb2ebbe-140d-4e2e-abd2-9e7e564f71ac.png")
.into(jzvdStd.thumbImageView);

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


public void clickChangeToIjkplayer(View view) {
Jzvd.resetAllVideos();

jzvdStd.setUp("http://jzvd.nathen.cn/342a5f7ef6124a4a8faf00e738b8bee4/cf6d9db0bd4d41f59d09ea0a81e918fd-5287d2089db37e62345123a1be272f8b.mp4"
, "饺子快长大", JzvdStd.SCREEN_NORMAL, new JZMediaIjk(jzvdStd));
jzvdStd.startVideo();
Toast.makeText(this, "Change to Ijkplayer", Toast.LENGTH_SHORT).show();
}

public void clickChangeToSystem(View view) {
Jzvd.resetAllVideos();
jzvdStd.setUp("http://jzvd.nathen.cn/342a5f7ef6124a4a8faf00e738b8bee4/cf6d9db0bd4d41f59d09ea0a81e918fd-5287d2089db37e62345123a1be272f8b.mp4"
, "饺子快长大", JzvdStd.SCREEN_NORMAL, new JZMediaSystem(jzvdStd));
jzvdStd.startVideo();
Toast.makeText(this, "Change to MediaPlayer", Toast.LENGTH_SHORT).show();
}

public void clickChangeToExo(View view) {
Jzvd.resetAllVideos();
jzvdStd.setUp("http://jzvd.nathen.cn/342a5f7ef6124a4a8faf00e738b8bee4/cf6d9db0bd4d41f59d09ea0a81e918fd-5287d2089db37e62345123a1be272f8b.mp4"
, "饺子快长大", JzvdStd.SCREEN_NORMAL, new JZMediaExo(jzvdStd));
jzvdStd.startVideo();
Toast.makeText(this, "Change to ExoPlayer", Toast.LENGTH_SHORT).show();
}


Expand All @@ -62,48 +91,23 @@ public void onBackPressed() {
if (Jzvd.backPress()) {
return;
}
Jzvd.releaseAllVideos();
handler.postDelayed(() -> Jzvd.setMediaInterface(new JZMediaSystem()), 1000);
super.onBackPressed();
}

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

@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
Jzvd.releaseAllVideos();
handler.postDelayed(() -> Jzvd.setMediaInterface(new JZMediaSystem()), 1000);
finish();
break;
}
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();
}
}
6 changes: 3 additions & 3 deletions app/src/main/java/cn/jzvd/demo/ActivityApiExtendsNormal.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
import cn.jzvd.JzvdStd;

/**
* 适配了普通的Activity,如果不适配并且不继承AppCompatActivity的话会出现Context空指针的情况
* Created by Nathen on 2017/9/19.
*/

public class ActivityApiExtendsNormal extends Activity {

@Override
Expand All @@ -20,7 +20,7 @@ protected void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.activity_extends_normal);
JzvdStd jzvdStd = findViewById(R.id.videoplayer);
jzvdStd.setUp(VideoConstant.videoUrlList[0], "饺子不信"
, JzvdStd.SCREEN_WINDOW_NORMAL);
, JzvdStd.SCREEN_NORMAL);
Glide.with(this)
.load(VideoConstant.videoThumbList[0])
.into(jzvdStd.thumbImageView);
Expand All @@ -37,6 +37,6 @@ public void onBackPressed() {
@Override
protected void onPause() {
super.onPause();
Jzvd.releaseAllVideos();
Jzvd.resetAllVideos();
}
}
4 changes: 2 additions & 2 deletions app/src/main/java/cn/jzvd/demo/ActivityApiOrientation.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
setContentView(R.layout.activity_orientation);
mJzvdStd = findViewById(R.id.jz_video);
mJzvdStd.setUp(VideoConstant.videoUrlList[0], "饺子不信"
, JzvdStd.SCREEN_WINDOW_NORMAL);
, JzvdStd.SCREEN_NORMAL);
Glide.with(this)
.load(VideoConstant.videoThumbList[0])
.into(mJzvdStd.thumbImageView);
Expand All @@ -52,7 +52,7 @@ public void onBackPressed() {
@Override
protected void onPause() {
super.onPause();
Jzvd.releaseAllVideos();
Jzvd.resetAllVideos();

//Change these two variables back
Jzvd.FULLSCREEN_ORIENTATION = ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE;
Expand Down
27 changes: 21 additions & 6 deletions app/src/main/java/cn/jzvd/demo/ActivityApiRotationVideoSize.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import android.support.v7.app.AppCompatActivity;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;

import com.bumptech.glide.Glide;

Expand All @@ -32,19 +31,19 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {

myJzvdStd = findViewById(R.id.jz_video);
myJzvdStd.setUp(VideoConstant.videoUrls[0][7], VideoConstant.videoTitles[0][7]
, JzvdStd.SCREEN_WINDOW_NORMAL);
, JzvdStd.SCREEN_NORMAL);
Glide.with(this)
.load(VideoConstant.videoThumbs[0][7])
.into(myJzvdStd.thumbImageView);
// The Point IS
myJzvdStd.videoRotation = 180;
// The Point IS 或者这样写也可以
// myJzvdStd.videoRotation = 180;
}


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

Expand All @@ -66,10 +65,26 @@ public boolean onOptionsItemSelected(MenuItem item) {
return super.onOptionsItemSelected(item);
}

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

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

public void clickRotationTo180(View view) {
Jzvd.setTextureViewRotation(180);
}

public void clickRotationTo270(View view) {
Jzvd.setTextureViewRotation(270);
}

public void clickVideoImageDiaplayAdapter(View view) {
Jzvd.setVideoImageDisplayType(Jzvd.VIDEO_IMAGE_DISPLAY_TYPE_ADAPTER);
}

public void clickVideoImageDisplayFillParent(View view) {
Jzvd.setVideoImageDisplayType(Jzvd.VIDEO_IMAGE_DISPLAY_TYPE_FILL_PARENT);
}
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/cn/jzvd/demo/ActivityApiUIBigChange.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public void onBackPressed() {
@Override
protected void onPause() {
super.onPause();
Jzvd.releaseAllVideos();
Jzvd.resetAllVideos();
}

@Override
Expand Down
Loading

0 comments on commit 7bbbfa9

Please sign in to comment.