diff --git a/README.md b/README.md
index 21b92fe5..bb708c7c 100644
--- a/README.md
+++ b/README.md
@@ -2,7 +2,7 @@
--
-
+
@@ -39,7 +39,7 @@
## 文档
-- [文档 - API](https://github.com/Jzvd/JiaoZiVideoPlayer/wiki/%E6%96%87%E6%A1%A3-%E2%80%94-API),下载安装demo[jiaozivideoplayer-7.2.2.apk](https://github.com/Jzvd/JiaoZiVideoPlayer/releases/download/v7.2.2/jiaozivideoplayer-7.2.2.apk),仔细过一遍demo
+- [文档 - API](https://github.com/Jzvd/JiaoZiVideoPlayer/wiki/%E6%96%87%E6%A1%A3-%E2%80%94-API),下载安装demo[jiaozivideoplayer-7.2.3.apk](https://github.com/Jzvd/JiaoZiVideoPlayer/releases/download/v7.2.3/jiaozivideoplayer-7.2.3.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),测试哪个播放内核适合自己的项目
@@ -53,7 +53,7 @@
1.添加类库
```gradle
-compile 'cn.jzvd:jiaozivideoplayer:7.2.2'
+compile 'cn.jzvd:jiaozivideoplayer:7.2.3'
```
2.添加布局
diff --git a/app/src/main/res/drawable-xxhdpi/ic_comment_normal.png b/app/src/main/res/drawable-xxhdpi/ic_comment_normal.png
deleted file mode 100644
index 4901df0f..00000000
Binary files a/app/src/main/res/drawable-xxhdpi/ic_comment_normal.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_douyin_icon.png b/app/src/main/res/drawable-xxhdpi/ic_douyin_icon.png
deleted file mode 100644
index 53842e22..00000000
Binary files a/app/src/main/res/drawable-xxhdpi/ic_douyin_icon.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_star_normal.png b/app/src/main/res/drawable-xxhdpi/ic_star_normal.png
deleted file mode 100644
index d6c1185b..00000000
Binary files a/app/src/main/res/drawable-xxhdpi/ic_star_normal.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_star_selected.png b/app/src/main/res/drawable-xxhdpi/ic_star_selected.png
deleted file mode 100644
index 19c8823b..00000000
Binary files a/app/src/main/res/drawable-xxhdpi/ic_star_selected.png and /dev/null differ
diff --git a/app/src/main/res/drawable/ic_star_selector.xml b/app/src/main/res/drawable/ic_star_selector.xml
deleted file mode 100644
index 7e1a685d..00000000
--- a/app/src/main/res/drawable/ic_star_selector.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/drawable/skin_enlarge_video.png b/app/src/main/res/drawable/skin_enlarge_video.png
deleted file mode 100644
index a7f47e20..00000000
Binary files a/app/src/main/res/drawable/skin_enlarge_video.png and /dev/null differ
diff --git a/app/src/main/res/drawable/skin_shrink_video.png b/app/src/main/res/drawable/skin_shrink_video.png
deleted file mode 100644
index 5daa02b2..00000000
Binary files a/app/src/main/res/drawable/skin_shrink_video.png and /dev/null differ
diff --git a/app/src/main/res/layout/activity_ui_big_change.xml b/app/src/main/res/layout/activity_ui_big_change.xml
deleted file mode 100644
index c9edfbd8..00000000
--- a/app/src/main/res/layout/activity_ui_big_change.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/mipmap-xhdpi/add_bg.png b/app/src/main/res/mipmap-xhdpi/add_bg.png
deleted file mode 100644
index a5308d6c..00000000
Binary files a/app/src/main/res/mipmap-xhdpi/add_bg.png and /dev/null differ
diff --git a/app/src/main/res/mipmap-xhdpi/btn_share_to.png b/app/src/main/res/mipmap-xhdpi/btn_share_to.png
deleted file mode 100644
index 7a35d10e..00000000
Binary files a/app/src/main/res/mipmap-xhdpi/btn_share_to.png and /dev/null differ
diff --git a/app/src/main/res/mipmap-xxhdpi/lock.png b/app/src/main/res/mipmap-xxhdpi/lock.png
deleted file mode 100644
index ff2bf0ee..00000000
Binary files a/app/src/main/res/mipmap-xxhdpi/lock.png and /dev/null differ
diff --git a/app/src/main/res/mipmap-xxhdpi/share_normal.png b/app/src/main/res/mipmap-xxhdpi/share_normal.png
deleted file mode 100644
index d72a0c40..00000000
Binary files a/app/src/main/res/mipmap-xxhdpi/share_normal.png and /dev/null differ
diff --git a/app/src/main/res/mipmap-xxhdpi/share_pressed.png b/app/src/main/res/mipmap-xxhdpi/share_pressed.png
deleted file mode 100644
index 9fc94b79..00000000
Binary files a/app/src/main/res/mipmap-xxhdpi/share_pressed.png and /dev/null differ
diff --git a/app/src/main/res/mipmap-xxhdpi/unlock.png b/app/src/main/res/mipmap-xxhdpi/unlock.png
deleted file mode 100644
index f6893313..00000000
Binary files a/app/src/main/res/mipmap-xxhdpi/unlock.png and /dev/null differ
diff --git a/build.gradle b/build.gradle
index 0cc143e0..2d1d9aae 100644
--- a/build.gradle
+++ b/build.gradle
@@ -6,7 +6,7 @@ buildscript {
google()
}
dependencies {
- classpath 'com.android.tools.build:gradle:3.5.3'
+ classpath 'com.android.tools.build:gradle:3.6.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
diff --git a/app/build.gradle b/demo/build.gradle
similarity index 84%
rename from app/build.gradle
rename to demo/build.gradle
index 4d64f720..005717ea 100755
--- a/app/build.gradle
+++ b/demo/build.gradle
@@ -2,13 +2,14 @@ apply plugin: 'com.android.application'
android {
compileSdkVersion 29
+ buildToolsVersion = '29.0.3'
defaultConfig {
applicationId "cn.jzvd.demo"
minSdkVersion 16
targetSdkVersion 29
- versionCode 97
- versionName "7.2.2"
+ versionCode 98
+ versionName "7.2.3"
ndk {
// add support lib
abiFilters 'armeabi-v7a' //, 'arm64-v8a'//, "mips" //,'armeabi''x86',, 'x86_64',
@@ -47,12 +48,14 @@ dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
testImplementation 'junit:junit:4.12'
implementation 'androidx.appcompat:appcompat:1.1.0'
- implementation project(':jiaozivideoplayer')
+ implementation 'com.android.support:design:28.0.0'
+ implementation project(':library')
implementation 'tv.danmaku.ijk.media:ijkplayer-java:0.8.8'
implementation 'tv.danmaku.ijk.media:ijkplayer-armv7a:0.8.4'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'com.danikula:videocache:2.7.0'
- implementation 'com.github.bumptech.glide:glide:4.9.0'
+ implementation 'com.github.bumptech.glide:glide:4.11.0'
implementation 'com.google.android.exoplayer:exoplayer:2.10.4'
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.0'
+ implementation 'com.android.support.constraint:constraint-layout:1.1.3'
}
diff --git a/app/jzvd-keystore b/demo/jzvd-keystore
similarity index 100%
rename from app/jzvd-keystore
rename to demo/jzvd-keystore
diff --git a/app/proguard-rules.pro b/demo/proguard-rules.pro
similarity index 100%
rename from app/proguard-rules.pro
rename to demo/proguard-rules.pro
diff --git a/app/src/main/AndroidManifest.xml b/demo/src/main/AndroidManifest.xml
similarity index 96%
rename from app/src/main/AndroidManifest.xml
rename to demo/src/main/AndroidManifest.xml
index b728ed8f..fb32a504 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/demo/src/main/AndroidManifest.xml
@@ -124,6 +124,9 @@
+
\ No newline at end of file
diff --git a/app/src/main/assets/jzvd.html b/demo/src/main/assets/jzvd.html
similarity index 100%
rename from app/src/main/assets/jzvd.html
rename to demo/src/main/assets/jzvd.html
diff --git a/app/src/main/assets/local_video.mp4 b/demo/src/main/assets/local_video.mp4
similarity index 100%
rename from app/src/main/assets/local_video.mp4
rename to demo/src/main/assets/local_video.mp4
diff --git a/app/src/main/ic_launcher-web.png b/demo/src/main/ic_launcher-web.png
similarity index 100%
rename from app/src/main/ic_launcher-web.png
rename to demo/src/main/ic_launcher-web.png
diff --git a/app/src/main/java/cn/jzvd/demo/ActivityApi.java b/demo/src/main/java/cn/jzvd/demo/ActivityApi.java
similarity index 95%
rename from app/src/main/java/cn/jzvd/demo/ActivityApi.java
rename to demo/src/main/java/cn/jzvd/demo/ActivityApi.java
index 3f1ebf20..4f489f6f 100644
--- a/app/src/main/java/cn/jzvd/demo/ActivityApi.java
+++ b/demo/src/main/java/cn/jzvd/demo/ActivityApi.java
@@ -63,7 +63,7 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
/** Play video in local localVideoPath, eg:record by system camera **/
// cpAssertVideoToLocalPath();
-// mJzvdStd.setUp(Environment.getExternalStorageDirectory().getAbsolutePath() + "/DCIM/Camera/local_video.mp4"
+// mJzvdStd.setUp(Environment.getExternalStorageDirectory().getAbsolutePath() + "/DCIM/Camera/activity_local_video.mp4"
// , "饺子不信", Jzvd.SCREEN_NORMAL);
mSensorManager = (SensorManager) getSystemService(SENSOR_SERVICE);
mSensorEventListener = new Jzvd.JZAutoFullscreenListener();
@@ -109,7 +109,7 @@ public void cpAssertVideoToLocalPath() {
verifyStoragePermissions();
try {
InputStream myInput;
- OutputStream myOutput = new FileOutputStream(Environment.getExternalStorageDirectory().getAbsolutePath() + "/DCIM/Camera/local_video.mp4");
+ OutputStream myOutput = new FileOutputStream(Environment.getExternalStorageDirectory().getAbsolutePath() + "/DCIM/Camera/activity_local_video.mp4");
myInput = this.getAssets().open("local_video.mp4");
byte[] buffer = new byte[1024];
int length = myInput.read(buffer);
@@ -146,8 +146,8 @@ public void clickSmallChange(View view) {
}
public void clickBigChange(View view) {
- Toast.makeText(ActivityApi.this, "Comming Soon", Toast.LENGTH_SHORT).show();
-// startActivity(new Intent(ActivityApi.this, ActivityApiUIBigChange.class));
+// Toast.makeText(ActivityApi.this, "Comming Soon", Toast.LENGTH_SHORT).show();
+ startActivity(new Intent(ActivityApi.this, ActivityApiUIBigChange.class));
}
public void clickOrientation(View view) {
diff --git a/app/src/main/java/cn/jzvd/demo/ActivityApiCustomMedia.java b/demo/src/main/java/cn/jzvd/demo/ActivityApiCustomMedia.java
similarity index 100%
rename from app/src/main/java/cn/jzvd/demo/ActivityApiCustomMedia.java
rename to demo/src/main/java/cn/jzvd/demo/ActivityApiCustomMedia.java
diff --git a/app/src/main/java/cn/jzvd/demo/ActivityApiExtendsNormal.java b/demo/src/main/java/cn/jzvd/demo/ActivityApiExtendsNormal.java
similarity index 100%
rename from app/src/main/java/cn/jzvd/demo/ActivityApiExtendsNormal.java
rename to demo/src/main/java/cn/jzvd/demo/ActivityApiExtendsNormal.java
diff --git a/app/src/main/java/cn/jzvd/demo/ActivityApiOrientation.java b/demo/src/main/java/cn/jzvd/demo/ActivityApiOrientation.java
similarity index 100%
rename from app/src/main/java/cn/jzvd/demo/ActivityApiOrientation.java
rename to demo/src/main/java/cn/jzvd/demo/ActivityApiOrientation.java
diff --git a/app/src/main/java/cn/jzvd/demo/ActivityApiRotationVideoSize.java b/demo/src/main/java/cn/jzvd/demo/ActivityApiRotationVideoSize.java
similarity index 100%
rename from app/src/main/java/cn/jzvd/demo/ActivityApiRotationVideoSize.java
rename to demo/src/main/java/cn/jzvd/demo/ActivityApiRotationVideoSize.java
diff --git a/app/src/main/java/cn/jzvd/demo/ActivityApiUIBigChange.java b/demo/src/main/java/cn/jzvd/demo/ActivityApiUIBigChange.java
similarity index 83%
rename from app/src/main/java/cn/jzvd/demo/ActivityApiUIBigChange.java
rename to demo/src/main/java/cn/jzvd/demo/ActivityApiUIBigChange.java
index d78e7ac2..78b72cd8 100644
--- a/app/src/main/java/cn/jzvd/demo/ActivityApiUIBigChange.java
+++ b/demo/src/main/java/cn/jzvd/demo/ActivityApiUIBigChange.java
@@ -1,12 +1,15 @@
package cn.jzvd.demo;
+import android.content.Intent;
import android.os.Bundle;
import android.view.MenuItem;
+import android.view.View;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import cn.jzvd.Jzvd;
+import cn.jzvd.demo.BigUIChangeAG.ActivityApiUIBigChangeAG;
/**
* Created by Nathen on 16/7/31.
@@ -38,6 +41,10 @@ protected void onPause() {
Jzvd.releaseAllVideos();
}
+ public void clickUiAGBigChange(View view) {
+ startActivity(new Intent(ActivityApiUIBigChange.this, ActivityApiUIBigChangeAG.class));
+ }
+
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
diff --git a/app/src/main/java/cn/jzvd/demo/ActivityApiUISmallChange.java b/demo/src/main/java/cn/jzvd/demo/ActivityApiUISmallChange.java
similarity index 100%
rename from app/src/main/java/cn/jzvd/demo/ActivityApiUISmallChange.java
rename to demo/src/main/java/cn/jzvd/demo/ActivityApiUISmallChange.java
diff --git a/app/src/main/java/cn/jzvd/demo/ActivityDirectPlay.java b/demo/src/main/java/cn/jzvd/demo/ActivityDirectPlay.java
similarity index 100%
rename from app/src/main/java/cn/jzvd/demo/ActivityDirectPlay.java
rename to demo/src/main/java/cn/jzvd/demo/ActivityDirectPlay.java
diff --git a/app/src/main/java/cn/jzvd/demo/ActivityListView.java b/demo/src/main/java/cn/jzvd/demo/ActivityListView.java
similarity index 100%
rename from app/src/main/java/cn/jzvd/demo/ActivityListView.java
rename to demo/src/main/java/cn/jzvd/demo/ActivityListView.java
diff --git a/app/src/main/java/cn/jzvd/demo/ActivityListViewAutoPlay.java b/demo/src/main/java/cn/jzvd/demo/ActivityListViewAutoPlay.java
similarity index 100%
rename from app/src/main/java/cn/jzvd/demo/ActivityListViewAutoPlay.java
rename to demo/src/main/java/cn/jzvd/demo/ActivityListViewAutoPlay.java
diff --git a/app/src/main/java/cn/jzvd/demo/ActivityListViewDetail.java b/demo/src/main/java/cn/jzvd/demo/ActivityListViewDetail.java
similarity index 100%
rename from app/src/main/java/cn/jzvd/demo/ActivityListViewDetail.java
rename to demo/src/main/java/cn/jzvd/demo/ActivityListViewDetail.java
diff --git a/app/src/main/java/cn/jzvd/demo/ActivityListViewFragmentViewPager.java b/demo/src/main/java/cn/jzvd/demo/ActivityListViewFragmentViewPager.java
similarity index 100%
rename from app/src/main/java/cn/jzvd/demo/ActivityListViewFragmentViewPager.java
rename to demo/src/main/java/cn/jzvd/demo/ActivityListViewFragmentViewPager.java
diff --git a/app/src/main/java/cn/jzvd/demo/ActivityListViewMultiHolder.java b/demo/src/main/java/cn/jzvd/demo/ActivityListViewMultiHolder.java
similarity index 100%
rename from app/src/main/java/cn/jzvd/demo/ActivityListViewMultiHolder.java
rename to demo/src/main/java/cn/jzvd/demo/ActivityListViewMultiHolder.java
diff --git a/app/src/main/java/cn/jzvd/demo/ActivityListViewNormal.java b/demo/src/main/java/cn/jzvd/demo/ActivityListViewNormal.java
similarity index 100%
rename from app/src/main/java/cn/jzvd/demo/ActivityListViewNormal.java
rename to demo/src/main/java/cn/jzvd/demo/ActivityListViewNormal.java
diff --git a/app/src/main/java/cn/jzvd/demo/ActivityListViewRecyclerView.java b/demo/src/main/java/cn/jzvd/demo/ActivityListViewRecyclerView.java
similarity index 100%
rename from app/src/main/java/cn/jzvd/demo/ActivityListViewRecyclerView.java
rename to demo/src/main/java/cn/jzvd/demo/ActivityListViewRecyclerView.java
diff --git a/app/src/main/java/cn/jzvd/demo/ActivityListViewToDetail.java b/demo/src/main/java/cn/jzvd/demo/ActivityListViewToDetail.java
similarity index 100%
rename from app/src/main/java/cn/jzvd/demo/ActivityListViewToDetail.java
rename to demo/src/main/java/cn/jzvd/demo/ActivityListViewToDetail.java
diff --git a/app/src/main/java/cn/jzvd/demo/ActivityLocalVideo.java b/demo/src/main/java/cn/jzvd/demo/ActivityLocalVideo.java
similarity index 97%
rename from app/src/main/java/cn/jzvd/demo/ActivityLocalVideo.java
rename to demo/src/main/java/cn/jzvd/demo/ActivityLocalVideo.java
index 077cfbf0..adb15f8f 100644
--- a/app/src/main/java/cn/jzvd/demo/ActivityLocalVideo.java
+++ b/demo/src/main/java/cn/jzvd/demo/ActivityLocalVideo.java
@@ -44,10 +44,10 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
getSupportActionBar().setDisplayShowTitleEnabled(true);
getSupportActionBar().setDisplayUseLogoEnabled(false);
getSupportActionBar().setTitle("PlayLocalVideo");
- setContentView(R.layout.local_video);
+ setContentView(R.layout.activity_local_video);
jzvdLocalPath = findViewById(cn.jzvd.demo.R.id.lcoal_path);
jzvdAssertPath = findViewById(cn.jzvd.demo.R.id.assert_path);
- localVideoPath = Environment.getExternalStorageDirectory().getAbsolutePath() + "/DCIM/Camera/local_video.mp4";
+ localVideoPath = Environment.getExternalStorageDirectory().getAbsolutePath() + "/DCIM/Camera/activity_local_video.mp4";
//checkPermission
int permission = ActivityCompat.checkSelfPermission(this, "android.permission.WRITE_EXTERNAL_STORAGE");
diff --git a/app/src/main/java/cn/jzvd/demo/ActivityMain.java b/demo/src/main/java/cn/jzvd/demo/ActivityMain.java
similarity index 100%
rename from app/src/main/java/cn/jzvd/demo/ActivityMain.java
rename to demo/src/main/java/cn/jzvd/demo/ActivityMain.java
diff --git a/app/src/main/java/cn/jzvd/demo/ActivityPreloading.java b/demo/src/main/java/cn/jzvd/demo/ActivityPreloading.java
similarity index 100%
rename from app/src/main/java/cn/jzvd/demo/ActivityPreloading.java
rename to demo/src/main/java/cn/jzvd/demo/ActivityPreloading.java
diff --git a/app/src/main/java/cn/jzvd/demo/ActivityPreloadingList.java b/demo/src/main/java/cn/jzvd/demo/ActivityPreloadingList.java
similarity index 100%
rename from app/src/main/java/cn/jzvd/demo/ActivityPreloadingList.java
rename to demo/src/main/java/cn/jzvd/demo/ActivityPreloadingList.java
diff --git a/app/src/main/java/cn/jzvd/demo/ActivityScreenRotate.java b/demo/src/main/java/cn/jzvd/demo/ActivityScreenRotate.java
similarity index 100%
rename from app/src/main/java/cn/jzvd/demo/ActivityScreenRotate.java
rename to demo/src/main/java/cn/jzvd/demo/ActivityScreenRotate.java
diff --git a/app/src/main/java/cn/jzvd/demo/ActivityTinyWindow.java b/demo/src/main/java/cn/jzvd/demo/ActivityTinyWindow.java
similarity index 100%
rename from app/src/main/java/cn/jzvd/demo/ActivityTinyWindow.java
rename to demo/src/main/java/cn/jzvd/demo/ActivityTinyWindow.java
diff --git a/app/src/main/java/cn/jzvd/demo/ActivityTinyWindowRecycleView.java b/demo/src/main/java/cn/jzvd/demo/ActivityTinyWindowRecycleView.java
similarity index 100%
rename from app/src/main/java/cn/jzvd/demo/ActivityTinyWindowRecycleView.java
rename to demo/src/main/java/cn/jzvd/demo/ActivityTinyWindowRecycleView.java
diff --git a/app/src/main/java/cn/jzvd/demo/ActivityTinyWindowRecycleViewMultiHolder.java b/demo/src/main/java/cn/jzvd/demo/ActivityTinyWindowRecycleViewMultiHolder.java
similarity index 100%
rename from app/src/main/java/cn/jzvd/demo/ActivityTinyWindowRecycleViewMultiHolder.java
rename to demo/src/main/java/cn/jzvd/demo/ActivityTinyWindowRecycleViewMultiHolder.java
diff --git a/app/src/main/java/cn/jzvd/demo/ActivityWebView.java b/demo/src/main/java/cn/jzvd/demo/ActivityWebView.java
similarity index 100%
rename from app/src/main/java/cn/jzvd/demo/ActivityWebView.java
rename to demo/src/main/java/cn/jzvd/demo/ActivityWebView.java
diff --git a/app/src/main/java/cn/jzvd/demo/AdapterComment.java b/demo/src/main/java/cn/jzvd/demo/AdapterComment.java
similarity index 100%
rename from app/src/main/java/cn/jzvd/demo/AdapterComment.java
rename to demo/src/main/java/cn/jzvd/demo/AdapterComment.java
diff --git a/app/src/main/java/cn/jzvd/demo/AdapterListView.java b/demo/src/main/java/cn/jzvd/demo/AdapterListView.java
similarity index 100%
rename from app/src/main/java/cn/jzvd/demo/AdapterListView.java
rename to demo/src/main/java/cn/jzvd/demo/AdapterListView.java
diff --git a/app/src/main/java/cn/jzvd/demo/AdapterRecyclerView.java b/demo/src/main/java/cn/jzvd/demo/AdapterRecyclerView.java
similarity index 100%
rename from app/src/main/java/cn/jzvd/demo/AdapterRecyclerView.java
rename to demo/src/main/java/cn/jzvd/demo/AdapterRecyclerView.java
diff --git a/app/src/main/java/cn/jzvd/demo/AdapterRecyclerViewTiny.java b/demo/src/main/java/cn/jzvd/demo/AdapterRecyclerViewTiny.java
similarity index 100%
rename from app/src/main/java/cn/jzvd/demo/AdapterRecyclerViewTiny.java
rename to demo/src/main/java/cn/jzvd/demo/AdapterRecyclerViewTiny.java
diff --git a/app/src/main/java/cn/jzvd/demo/AdapterSmoothRecyclerView.java b/demo/src/main/java/cn/jzvd/demo/AdapterSmoothRecyclerView.java
similarity index 100%
rename from app/src/main/java/cn/jzvd/demo/AdapterSmoothRecyclerView.java
rename to demo/src/main/java/cn/jzvd/demo/AdapterSmoothRecyclerView.java
diff --git a/app/src/main/java/cn/jzvd/demo/ApplicationDemo.java b/demo/src/main/java/cn/jzvd/demo/ApplicationDemo.java
similarity index 100%
rename from app/src/main/java/cn/jzvd/demo/ApplicationDemo.java
rename to demo/src/main/java/cn/jzvd/demo/ApplicationDemo.java
diff --git a/demo/src/main/java/cn/jzvd/demo/BigUIChangeAG/AGEpsodeEntity.java b/demo/src/main/java/cn/jzvd/demo/BigUIChangeAG/AGEpsodeEntity.java
new file mode 100644
index 00000000..f776ec16
--- /dev/null
+++ b/demo/src/main/java/cn/jzvd/demo/BigUIChangeAG/AGEpsodeEntity.java
@@ -0,0 +1,37 @@
+package cn.jzvd.demo.BigUIChangeAG;
+
+public class AGEpsodeEntity {
+ private String videoUrl;
+ private String videoName;
+ /**是否被选中播放(默认没有播放)*/
+ private boolean isPlay=false;
+
+ public AGEpsodeEntity(String videoUrl, String videoName) {
+ this.videoUrl = videoUrl;
+ this.videoName = videoName;
+ }
+
+ public boolean isPlay() {
+ return isPlay;
+ }
+
+ public void setPlay(boolean play) {
+ isPlay = play;
+ }
+
+ public String getVideoUrl() {
+ return videoUrl;
+ }
+
+ public void setVideoUrl(String videoUrl) {
+ this.videoUrl = videoUrl;
+ }
+
+ public String getVideoName() {
+ return videoName;
+ }
+
+ public void setVideoName(String videoName) {
+ this.videoName = videoName;
+ }
+}
diff --git a/demo/src/main/java/cn/jzvd/demo/BigUIChangeAG/AGVideo.java b/demo/src/main/java/cn/jzvd/demo/BigUIChangeAG/AGVideo.java
new file mode 100644
index 00000000..2f43157b
--- /dev/null
+++ b/demo/src/main/java/cn/jzvd/demo/BigUIChangeAG/AGVideo.java
@@ -0,0 +1,805 @@
+package cn.jzvd.demo.BigUIChangeAG;
+
+import android.content.Context;
+import android.graphics.Color;
+import android.util.AttributeSet;
+import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.WindowManager;
+import android.widget.CheckBox;
+import android.widget.CompoundButton;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.PopupWindow;
+import android.widget.RelativeLayout;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import java.util.Timer;
+import java.util.TimerTask;
+
+import cn.jzvd.JZDataSource;
+import cn.jzvd.JZUtils;
+import cn.jzvd.JzvdStd;
+import cn.jzvd.demo.R;
+import cn.jzvd.demo.utils.NetworkUtils;
+import cn.jzvd.demo.widget.LoadingView;
+
+public class AGVideo extends JzvdStd {
+ private JzVideoListener jzVideoListener;
+ //视频控制布局
+ private RelativeLayout videoPlayControlLayout;
+ private ImageView screenIV, quickRetreat, fastForward, start_bottom, next_bottom;
+ private CheckBox lock;
+ private TextView tvSpeed, tvSelectPart,next_set;
+ private LinearLayout startLayout;
+ //无网络布局
+ private LoadingView loadingView;
+
+ //是否锁屏状态
+ private boolean isLock = false;
+ //是否有下一集
+ private boolean isNext;
+ private int nextTimerDate=3;
+ private Timer mDismissLockViewTimer,mDismissNextViewTimer;
+ protected DismissLockViewTimerTask mDismissLockViewTimerTask;
+ private DismissNextViewTimerTask mDismissNextViewTimerTask;
+
+ public AGVideo(Context context) {
+ super(context);
+ }
+
+ public AGVideo(Context context, AttributeSet attrs) {
+ super(context, attrs);
+ }
+
+ public JzVideoListener getJzVideoListener() {
+ return jzVideoListener;
+ }
+
+ public void setJzVideoListener(JzVideoListener jzVideoListener) {
+ this.jzVideoListener = jzVideoListener;
+ }
+
+ @Override
+ public int getLayoutId() {
+ return R.layout.layout_ag_video;
+ }
+
+ @Override
+ public void init(Context context) {
+ super.init(context);
+ loadingView = findViewById(R.id.player_newLoading);
+
+ videoPlayControlLayout = findViewById(R.id.video_control_layout);
+ tvSpeed = findViewById(R.id.tv_speed);
+ tvSelectPart = findViewById(R.id.tv_select_parts);
+ screenIV = findViewById(R.id.screen);
+ startLayout = findViewById(R.id.start_layout);
+ quickRetreat = findViewById(R.id.quick_retreat);
+ fastForward = findViewById(R.id.fast_forward);
+ start_bottom = findViewById(R.id.start_bottom);
+ next_bottom = findViewById(R.id.next_bottom);
+ lock = findViewById(R.id.lock);
+ next_set = findViewById(R.id.next_set);
+
+ next_set.setOnClickListener(this);
+ replayTextView.setOnClickListener(this);
+ tvSpeed.setOnClickListener(this);
+ tvSelectPart.setOnClickListener(this);
+ start_bottom.setOnClickListener(this);
+ next_bottom.setOnClickListener(this);
+ quickRetreat.setOnClickListener(this);
+ fastForward.setOnClickListener(this);
+ screenIV.setOnClickListener(this);
+ lock.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
+ @Override
+ public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
+ isLock = isChecked;
+ if (isChecked) {
+ //锁屏按钮单独延迟隐藏
+ goneLock();
+ //隐藏其他功能
+ dissmissControlView();
+ } else {
+ cancelDismissControlViewTimer();
+ startDismissControlViewTimer();
+ //取消锁屏按钮的单独延迟隐藏,使锁屏按钮的延迟隐藏和其他功能按钮相同
+ cancelGoneLock();
+ onClickUiToggle();
+ }
+ }
+ });
+ }
+
+ private void cancelGoneLock() {
+ cancelDismissLockViewTimer();
+ }
+
+ private void goneLock() {
+ startDismissLockViewTimer();
+ }
+
+ @Override
+ public void onClick(View v) {
+ int id = v.getId();
+ switch (id) {
+ case R.id.start:
+ if (jzDataSource == null || jzDataSource.urlsMap.isEmpty() || jzDataSource.getCurrentUrl() == null) {
+ Toast.makeText(getContext(), getResources().getString(cn.jzvd.R.string.no_url), Toast.LENGTH_SHORT).show();
+ return;
+ }
+ if (state == STATE_NORMAL) {
+ if (!jzDataSource.getCurrentUrl().toString().startsWith("file") && !
+ jzDataSource.getCurrentUrl().toString().startsWith("/") &&
+ !JZUtils.isWifiConnected(getContext()) && !WIFI_TIP_DIALOG_SHOWED) {//这个可以放到std中
+ showWifiDialog();
+ return;
+ }
+ startVideo();
+ } else if (state == STATE_PLAYING) {
+ Log.d(TAG, "pauseVideo [" + this.hashCode() + "] ");
+ mediaInterface.pause();
+ onStatePause();
+ } else if (state == STATE_PAUSE) {
+ mediaInterface.start();
+ onStatePlaying();
+ } else if (state == STATE_AUTO_COMPLETE) {
+ startVideo();
+ }
+ break;
+ case R.id.poster:
+ if (jzDataSource == null || jzDataSource.urlsMap.isEmpty() || jzDataSource.getCurrentUrl() == null) {
+ Toast.makeText(getContext(), getResources().getString(cn.jzvd.R.string.no_url), Toast.LENGTH_SHORT).show();
+ return;
+ }
+ if (state == STATE_NORMAL) {
+ if (!jzDataSource.getCurrentUrl().toString().startsWith("file") &&
+ !jzDataSource.getCurrentUrl().toString().startsWith("/") &&
+ !JZUtils.isWifiConnected(getContext()) && !WIFI_TIP_DIALOG_SHOWED) {
+ showWifiDialog();
+ return;
+ }
+ startVideo();
+ } else if (state == STATE_AUTO_COMPLETE) {
+ onClickUiToggle();
+ }
+ break;
+ case R.id.surface_container:
+ startDismissControlViewTimer();
+ break;
+ case R.id.back_tiny:
+ clearFloatScreen();
+ break;
+ case R.id.clarity:
+ LayoutInflater inflater = (LayoutInflater) getContext()
+ .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+ final LinearLayout layout = (LinearLayout) inflater.inflate(cn.jzvd.R.layout.jz_layout_clarity, null);
+
+ OnClickListener mQualityListener = v1 -> {
+ int index = (int) v1.getTag();
+
+// this.seekToInAdvance = getCurrentPositionWhenPlaying();
+ jzDataSource.currentUrlIndex = index;
+// onStatePreparingChangeUrl();
+
+ changeUrl(jzDataSource, getCurrentPositionWhenPlaying());
+
+
+ clarity.setText(jzDataSource.getCurrentKey().toString());
+ for (int j = 0; j < layout.getChildCount(); j++) {//设置点击之后的颜色
+ if (j == jzDataSource.currentUrlIndex) {
+ ((TextView) layout.getChildAt(j)).setTextColor(Color.parseColor("#fff85959"));
+ } else {
+ ((TextView) layout.getChildAt(j)).setTextColor(Color.parseColor("#ffffff"));
+ }
+ }
+ if (clarityPopWindow != null) {
+ clarityPopWindow.dismiss();
+ }
+ };
+
+ for (int j = 0; j < jzDataSource.urlsMap.size(); j++) {
+ String key = jzDataSource.getKeyFromDataSource(j);
+ TextView clarityItem = (TextView) View.inflate(getContext(), cn.jzvd.R.layout.jz_layout_clarity_item, null);
+ clarityItem.setText(key);
+ clarityItem.setTag(j);
+ layout.addView(clarityItem, j);
+ clarityItem.setOnClickListener(mQualityListener);
+ if (j == jzDataSource.currentUrlIndex) {
+ clarityItem.setTextColor(Color.parseColor("#fff85959"));
+ }
+ }
+
+ clarityPopWindow = new PopupWindow(layout, LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, true);
+ clarityPopWindow.setContentView(layout);
+ clarityPopWindow.showAsDropDown(clarity);
+ layout.measure(View.MeasureSpec.UNSPECIFIED, View.MeasureSpec.UNSPECIFIED);
+ int offsetX = clarity.getMeasuredWidth() / 3;
+ int offsetY = clarity.getMeasuredHeight() / 3;
+ clarityPopWindow.update(clarity, -offsetX, -offsetY, Math.round(layout.getMeasuredWidth() * 2), layout.getMeasuredHeight());
+ break;
+ case R.id.retry_btn:
+ if (jzDataSource.urlsMap.isEmpty() || jzDataSource.getCurrentUrl() == null) {
+ Toast.makeText(getContext(), getResources().getString(cn.jzvd.R.string.no_url), Toast.LENGTH_SHORT).show();
+ return;
+ }
+ if (!jzDataSource.getCurrentUrl().toString().startsWith("file") && !
+ jzDataSource.getCurrentUrl().toString().startsWith("/") &&
+ !JZUtils.isWifiConnected(getContext()) && !WIFI_TIP_DIALOG_SHOWED) {
+ showWifiDialog();
+ return;
+ }
+ addTextureView();
+ onStatePreparing();
+ break;
+
+ case R.id.replay_text:
+ if (state == STATE_AUTO_COMPLETE) {
+ replayTextView.setVisibility(View.GONE);
+ next_set.setVisibility(View.GONE);
+ //点击重播,取消下一集倒计时
+ dismissNextView();
+ cancelDismissNextViewTimer();
+ resetProgressAndTime();
+ mediaInterface.seekTo(0);
+ }
+ break;
+ case R.id.next_set:
+ dismissNextView();
+ cancelDismissNextViewTimer();
+ if (jzVideoListener != null) {
+ jzVideoListener.nextClick();
+ }
+ break;
+ case R.id.back:
+ case R.id.top_back:
+ if (jzVideoListener != null) {
+ jzVideoListener.backClick();
+ }
+ break;
+ case R.id.tv_speed:
+ if (jzVideoListener != null) {
+ jzVideoListener.speedClick();
+ }
+ break;
+ case R.id.tv_select_parts:
+ if (jzVideoListener != null) {
+ jzVideoListener.selectPartsClick();
+ }
+ break;
+ case R.id.next_bottom:
+ if (jzVideoListener != null) {
+ jzVideoListener.nextClick();
+ }
+ break;
+ case R.id.start_bottom:
+ if (jzDataSource == null || jzDataSource.urlsMap.isEmpty() || jzDataSource.getCurrentUrl() == null) {
+ Toast.makeText(getContext(), getResources().getString(cn.jzvd.R.string.no_url), Toast.LENGTH_SHORT).show();
+ return;
+ }
+ if (state == STATE_NORMAL) {
+ if (!jzDataSource.getCurrentUrl().toString().startsWith("file") && !
+ jzDataSource.getCurrentUrl().toString().startsWith("/") &&
+ !JZUtils.isWifiConnected(getContext()) && !WIFI_TIP_DIALOG_SHOWED) {//这个可以放到std中
+ showWifiDialog();
+ return;
+ }
+ startVideo();
+ } else if (state == STATE_PLAYING) {
+ Log.d(TAG, "pauseVideo [" + this.hashCode() + "] ");
+ mediaInterface.pause();
+ onStatePause();
+ } else if (state == STATE_PAUSE) {
+ mediaInterface.start();
+ onStatePlaying();
+ } else if (state == STATE_AUTO_COMPLETE) {
+ startVideo();
+ }
+ break;
+ case R.id.fast_forward:
+ //总时间长度
+ long duration = getDuration();
+ //当前时间
+ long currentPositionWhenPlaying = getCurrentPositionWhenPlaying();
+ //快进(15S)
+ long fastForwardProgress = currentPositionWhenPlaying + 15 * 1000;
+ if (duration > fastForwardProgress) {
+ mediaInterface.seekTo(fastForwardProgress);
+ } else {
+ mediaInterface.seekTo(duration);
+ }
+ break;
+ case R.id.quick_retreat:
+ //当前时间
+ long quickRetreatCurrentPositionWhenPlaying = getCurrentPositionWhenPlaying();
+ //快退(15S)
+ long quickRetreatProgress = quickRetreatCurrentPositionWhenPlaying - 15 * 1000;
+ if (quickRetreatProgress > 0) {
+ mediaInterface.seekTo(quickRetreatProgress);
+ } else {
+ mediaInterface.seekTo(0);
+ }
+ break;
+ case R.id.fullscreen:
+ if (state == STATE_AUTO_COMPLETE) return;
+ if (screen == SCREEN_FULLSCREEN) {
+ //quit fullscreen
+ backPress();
+ } else {
+ gotoScreenFullscreen();
+ }
+ break;
+ case R.id.screen:
+ if (jzVideoListener != null) {
+ jzVideoListener.throwingScreenClick();
+ }
+ break;
+ }
+ }
+
+
+ @Override
+ public void changeUrl(JZDataSource jzDataSource, long seekToInAdvance) {
+ next_set.setVisibility(GONE);
+ showProgress();
+ super.changeUrl(jzDataSource, seekToInAdvance);
+// //切换播放地址之后继续以1倍速播放
+ if (jzDataSource.objects == null) {
+ Object[] object = {1};
+ jzDataSource.objects = object;
+ }
+ speedChange(1.0f);
+ resetProgressAndTime();
+ }
+
+ @Override
+ public void dissmissControlView() {
+ if (state != STATE_NORMAL
+ && state != STATE_ERROR
+ && state != STATE_AUTO_COMPLETE) {
+ post(() -> {
+ bottomContainer.setVisibility(View.INVISIBLE);
+ topContainer.setVisibility(View.INVISIBLE);
+ startButton.setVisibility(View.INVISIBLE);
+ fastForward.setVisibility(View.INVISIBLE);
+ quickRetreat.setVisibility(View.INVISIBLE);
+ if (!isLock) {
+ lock.setVisibility(View.INVISIBLE);
+ }
+ if (clarityPopWindow != null) {
+ clarityPopWindow.dismiss();
+ }
+ if (screen != SCREEN_TINY && screen != SCREEN_FULLSCREEN) {
+ bottomProgressBar.setVisibility(View.VISIBLE);
+ }
+ });
+ }
+ }
+
+ public void dismissLockView() {
+ if (state != STATE_NORMAL
+ && state != STATE_ERROR
+ && state != STATE_AUTO_COMPLETE) {
+ post(() -> {
+ lock.setVisibility(GONE);
+ });
+ }
+ }
+
+
+ @Override
+ public void changeUiToPreparing() {
+ switch (screen) {
+ case SCREEN_NORMAL:
+ case SCREEN_FULLSCREEN:
+ screenIV.setVisibility(GONE);
+ titleTextView.setVisibility(GONE);
+ batteryTimeLayout.setVisibility(GONE);
+ setAllControlsVisiblity(View.VISIBLE, View.INVISIBLE, View.INVISIBLE,
+ View.VISIBLE, View.VISIBLE, View.INVISIBLE, View.INVISIBLE);
+ updateStartImage();
+ break;
+ case SCREEN_TINY:
+ break;
+ }
+
+ }
+
+
+ @Override
+ public void updateStartImage() {
+ Log.e("AGVideo","state:"+state);
+ if (state == STATE_PLAYING) {
+ startButton.setVisibility(VISIBLE);
+ startButton.setImageResource(R.mipmap.ag_btn_movie_suspend);
+ start_bottom.setImageResource(R.mipmap.ag_btn_movie_stop_bottom);
+ fastForward.setVisibility(VISIBLE);
+ quickRetreat.setVisibility(VISIBLE);
+ replayTextView.setVisibility(GONE);
+ } else if (state == STATE_PREPARING) {
+ backButton.setVisibility(VISIBLE);
+ } else if (state == STATE_ERROR) {
+ startButton.setVisibility(INVISIBLE);
+ replayTextView.setVisibility(GONE);
+ fastForward.setVisibility(GONE);
+ quickRetreat.setVisibility(GONE);
+ } else if (state == STATE_AUTO_COMPLETE) {
+ //视频播放完成状态
+ startButton.setVisibility(View.GONE);
+ replayTextView.setVisibility(VISIBLE);
+ if (isNext) {
+ next_set.setVisibility(VISIBLE);
+ }
+ fastForward.setVisibility(GONE);
+ quickRetreat.setVisibility(GONE);
+ } else {
+ startButton.setImageResource(R.mipmap.ag_btn_movie_play);
+ start_bottom.setImageResource(R.mipmap.ag_btn_movie_play_bottom);
+ replayTextView.setVisibility(GONE);
+ fastForward.setVisibility(GONE);
+ quickRetreat.setVisibility(GONE);
+ }
+ }
+
+ @Override
+ public void setScreenNormal() {
+ screen = SCREEN_NORMAL;
+ fullscreenButton.setImageResource(cn.jzvd.R.drawable.jz_enlarge);
+ backButton.setVisibility(View.VISIBLE);
+ tinyBackImageView.setVisibility(View.INVISIBLE);
+ changeStartButtonSize((int) getResources().getDimension(cn.jzvd.R.dimen.jz_start_button_w_h_normal));
+ batteryTimeLayout.setVisibility(View.GONE);
+ clarity.setVisibility(View.GONE);
+ fullscreenButton.setVisibility(View.VISIBLE);
+ next_bottom.setVisibility(View.GONE);
+ tvSpeed.setVisibility(View.GONE);
+ tvSelectPart.setVisibility(View.GONE);
+ lock.setVisibility(View.GONE);
+ changeUiToPlayingShow();
+ startDismissControlViewTimer();
+ }
+
+ @Override
+ public void setScreenFullscreen() {
+ super.setScreenFullscreen();
+ next_bottom.setVisibility(View.VISIBLE);
+ tvSpeed.setVisibility(View.VISIBLE);
+ tvSelectPart.setVisibility(View.VISIBLE);
+ fullscreenButton.setVisibility(View.GONE);
+ lock.setVisibility(View.VISIBLE);
+ changeUiToPlayingShow();
+ startDismissControlViewTimer();
+ if (jzDataSource.objects == null) {
+ Object[] object = {1};
+ jzDataSource.objects = object;
+ }
+ }
+
+ @Override
+ public void onStatePlaying() {
+ super.onStatePlaying();
+ titleTextView.setVisibility(VISIBLE);
+ screenIV.setVisibility(VISIBLE);
+ }
+
+ @Override
+ public void onAutoCompletion() {
+ Runtime.getRuntime().gc();
+ Log.i(TAG, "onAutoCompletion " + " [" + this.hashCode() + "] ");
+ cancelProgressTimer();
+ dismissBrightnessDialog();
+ dismissProgressDialog();
+ dismissVolumeDialog();
+ onStateAutoComplete();
+ JZUtils.scanForActivity(getContext()).getWindow().clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
+ JZUtils.saveProgress(getContext(), jzDataSource.getCurrentUrl(), 0);
+ cancelDismissControlViewTimer();
+ }
+
+ @Override
+ public void onStateAutoComplete() {
+ super.onStateAutoComplete();
+ if (isNext){
+ startDismissNextViewTimer();
+ }
+ }
+
+ @Override
+ public void changeUiToPlayingShow() {
+ switch (screen) {
+ case SCREEN_NORMAL:
+ setAllControlsVisiblity(View.VISIBLE, View.VISIBLE, View.VISIBLE,
+ View.INVISIBLE, View.INVISIBLE, View.INVISIBLE, View.INVISIBLE);
+ updateStartImage();
+ break;
+ case SCREEN_FULLSCREEN:
+ if (!isLock) {
+ setAllControlsVisiblity(View.VISIBLE, View.VISIBLE, View.VISIBLE,
+ View.INVISIBLE, View.INVISIBLE, View.INVISIBLE, View.INVISIBLE);
+ updateStartImage();
+ }
+ lock.setVisibility(View.VISIBLE);
+ break;
+ case SCREEN_TINY:
+ break;
+ }
+ }
+
+
+ @Override
+ public void changeUiToPlayingClear() {
+ switch (screen) {
+ case SCREEN_NORMAL:
+ setAllControlsVisiblity(View.INVISIBLE, View.INVISIBLE, View.INVISIBLE,
+ View.INVISIBLE, View.INVISIBLE, View.VISIBLE, View.INVISIBLE);
+ break;
+ case SCREEN_FULLSCREEN:
+ setAllControlsVisiblity(View.INVISIBLE, View.INVISIBLE, View.INVISIBLE,
+ View.INVISIBLE, View.INVISIBLE, View.INVISIBLE, View.INVISIBLE);
+ lock.setVisibility(View.INVISIBLE);
+ break;
+ case SCREEN_TINY:
+ break;
+ }
+ }
+
+ @Override
+ public void changeUiToPauseShow() {
+ switch (screen) {
+ case SCREEN_NORMAL:
+ setAllControlsVisiblity(View.VISIBLE, View.VISIBLE, View.VISIBLE,
+ View.INVISIBLE, View.INVISIBLE, View.INVISIBLE, View.INVISIBLE);
+ updateStartImage();
+ break;
+ case SCREEN_FULLSCREEN:
+ setAllControlsVisiblity(View.VISIBLE, View.VISIBLE, View.VISIBLE,
+ View.INVISIBLE, View.INVISIBLE, View.INVISIBLE, View.INVISIBLE);
+ lock.setVisibility(View.VISIBLE);
+ updateStartImage();
+ break;
+ case SCREEN_TINY:
+ break;
+ }
+
+ }
+
+ @Override
+ public void changeUiToPauseClear() {
+ switch (screen) {
+ case SCREEN_NORMAL:
+ setAllControlsVisiblity(View.INVISIBLE, View.INVISIBLE, View.INVISIBLE,
+ View.INVISIBLE, View.INVISIBLE, View.VISIBLE, View.INVISIBLE);
+ break;
+ case SCREEN_FULLSCREEN:
+ setAllControlsVisiblity(View.INVISIBLE, View.INVISIBLE, View.INVISIBLE,
+ View.INVISIBLE, View.INVISIBLE, View.VISIBLE, View.INVISIBLE);
+ lock.setVisibility(View.INVISIBLE);
+ break;
+ case SCREEN_TINY:
+ break;
+ }
+ }
+
+ @Override
+ public void changeUiToComplete() {
+ switch (screen) {
+ case SCREEN_NORMAL:
+ setAllControlsVisiblity(View.VISIBLE, View.INVISIBLE, View.VISIBLE,
+ View.INVISIBLE, View.INVISIBLE, View.INVISIBLE, View.INVISIBLE);
+ updateStartImage();
+ break;
+ case SCREEN_FULLSCREEN:
+ setAllControlsVisiblity(View.VISIBLE, View.INVISIBLE, View.VISIBLE,
+ View.INVISIBLE, View.INVISIBLE, View.INVISIBLE, View.INVISIBLE);
+ updateStartImage();
+ break;
+ case SCREEN_TINY:
+ break;
+ }
+ }
+
+ @Override
+ public void onClickUiToggle() {
+ if (bottomContainer.getVisibility() != View.VISIBLE) {
+ setSystemTimeAndBattery();
+ clarity.setText(jzDataSource.getCurrentKey().toString());
+ }
+ if (state == STATE_PREPARING) {
+ changeUiToPreparing();
+ if (bottomContainer.getVisibility() == View.VISIBLE) {
+ } else {
+ setSystemTimeAndBattery();
+ }
+ } else if (state == STATE_PLAYING) {
+ if (isLock) {
+ if (lock.getVisibility() == View.VISIBLE) {
+ lock.setVisibility(INVISIBLE);
+ } else {
+ lock.setVisibility(View.VISIBLE);
+ goneLock();
+ }
+ } else {
+ if (bottomContainer.getVisibility() == View.VISIBLE) {
+ changeUiToPlayingClear();
+ } else {
+ changeUiToPlayingShow();
+ }
+ }
+ } else if (state == STATE_PAUSE) {
+ if (isLock) {
+ if (lock.getVisibility() == View.VISIBLE) {
+ lock.setVisibility(INVISIBLE);
+ } else {
+ lock.setVisibility(View.VISIBLE);
+ goneLock();
+ }
+ } else {
+ if (bottomContainer.getVisibility() == View.VISIBLE) {
+ changeUiToPauseClear();
+ } else {
+ changeUiToPauseShow();
+ }
+ }
+ }
+ }
+
+ @Override
+ public void changeStartButtonSize(int size) {
+ //修改框架原本的图标大小
+ size = (int) getResources().getDimension(R.dimen.jz_start_button_w_h_normal_ag);
+ ViewGroup.LayoutParams lp = startButton.getLayoutParams();
+ lp.height = size;
+ lp.width = size;
+ lp = loadingProgressBar.getLayoutParams();
+ lp.height = size;
+ lp.width = size;
+ }
+
+ @Override
+ public void setAllControlsVisiblity(int topCon, int bottomCon, int startBtn, int loadingPro, int thumbImg, int bottomPro, int retryLayout) {
+ topContainer.setVisibility(topCon);
+ bottomContainer.setVisibility(bottomCon);
+ startButton.setVisibility(startBtn);
+ loadingView.setVisibility(loadingPro);
+ posterImageView.setVisibility(thumbImg);
+ bottomProgressBar.setVisibility(bottomPro);
+ mRetryLayout.setVisibility(retryLayout);
+ fastForward.setVisibility(startBtn);
+ quickRetreat.setVisibility(startBtn);
+ }
+
+ /**
+ * 是否有网络并显示布局
+ */
+ public boolean isHaveNetWork() {
+ if (!NetworkUtils.isConnected(this.getApplicationContext()) || !NetworkUtils.isAvailable(this.getApplicationContext())) {
+ return false;
+ }
+ return true;
+ }
+
+
+ /**
+ * 点击播放下一集时设置按钮状态
+ *
+ * @param isNext
+ */
+ public void changeNextBottonUi(boolean isNext) {
+ this.isNext = isNext;
+ if (isNext) {
+ next_bottom.setImageResource(R.mipmap.ag_btn_movie_next);
+ next_bottom.setClickable(true);
+ } else {
+ next_bottom.setImageResource(R.mipmap.ag_btn_movie_unll_next);
+ next_bottom.setClickable(false);
+ }
+ }
+
+
+ public void hideProgress() {
+ if (loadingView != null) {
+ loadingView.setVisibility(GONE);
+ }
+ }
+
+ public void showProgress() {
+ if (loadingView.getVisibility() != View.VISIBLE) {
+ loadingView.setVisibility(VISIBLE);
+ }
+ }
+
+ public class DismissLockViewTimerTask extends TimerTask {
+
+ @Override
+ public void run() {
+ dismissLockView();
+ }
+ }
+
+ public class DismissNextViewTimerTask extends TimerTask{
+
+ @Override
+ public void run() {
+ post(()->{
+ if (nextTimerDate<=0){
+ dismissNextView();
+ cancelDismissNextViewTimer();
+ if (jzVideoListener != null) {
+ jzVideoListener.nextClick();
+ }
+ }else {
+ next_set.setText(nextTimerDate + "秒后播放下一集");
+ nextTimerDate--;
+ }
+ });
+ }
+ }
+
+
+ public void startDismissLockViewTimer() {
+ cancelDismissLockViewTimer();
+ mDismissLockViewTimer = new Timer();
+ mDismissLockViewTimerTask = new DismissLockViewTimerTask();
+ mDismissLockViewTimer.schedule(mDismissLockViewTimerTask, 2500);
+ }
+
+ public void cancelDismissLockViewTimer() {
+ if (mDismissLockViewTimer != null) {
+ mDismissLockViewTimer.cancel();
+ }
+ if (mDismissLockViewTimerTask != null) {
+ mDismissLockViewTimerTask.cancel();
+ }
+
+ }
+
+ public void startDismissNextViewTimer() {
+ cancelDismissLockViewTimer();
+ nextTimerDate=3;
+ mDismissNextViewTimer = new Timer();
+ mDismissNextViewTimerTask = new DismissNextViewTimerTask();
+ mDismissNextViewTimer.schedule(mDismissNextViewTimerTask, 0,1000);
+ }
+
+ public void cancelDismissNextViewTimer() {
+ if (mDismissNextViewTimer != null) {
+ mDismissNextViewTimer.cancel();
+ }
+ if (mDismissNextViewTimerTask != null) {
+ mDismissNextViewTimerTask.cancel();
+ }
+ }
+
+ private void dismissNextView(){
+ replayTextView.setVisibility(GONE);
+ next_set.setVisibility(View.GONE);
+ }
+
+ /**
+ * 改变倍数之后
+ */
+ public void speedChange(float speed) {
+ if (speed == 1f) {
+ tvSpeed.setText("倍数");
+ } else {
+ tvSpeed.setText(speed + "X");
+ }
+ }
+
+ public interface JzVideoListener {
+
+ void nextClick();
+
+ void backClick();
+
+ void throwingScreenClick();
+
+ void selectPartsClick();
+
+ void speedClick();
+
+ }
+}
diff --git a/demo/src/main/java/cn/jzvd/demo/BigUIChangeAG/ActivityApiUIBigChangeAG.java b/demo/src/main/java/cn/jzvd/demo/BigUIChangeAG/ActivityApiUIBigChangeAG.java
new file mode 100644
index 00000000..ab77cbc1
--- /dev/null
+++ b/demo/src/main/java/cn/jzvd/demo/BigUIChangeAG/ActivityApiUIBigChangeAG.java
@@ -0,0 +1,341 @@
+package cn.jzvd.demo.BigUIChangeAG;
+
+import android.os.Bundle;
+import android.view.Gravity;
+import android.view.MenuItem;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import androidx.annotation.Nullable;
+import androidx.appcompat.app.AppCompatActivity;
+
+import com.google.android.material.tabs.TabLayout;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import cn.jzvd.JZDataSource;
+import cn.jzvd.Jzvd;
+import cn.jzvd.JzvdStd;
+import cn.jzvd.demo.CustomMedia.JZMediaExo;
+import cn.jzvd.demo.R;
+import cn.jzvd.demo.ScreenRotateUtils;
+
+public class ActivityApiUIBigChangeAG extends AppCompatActivity implements AGVideo.JzVideoListener, ScreenRotateUtils.OrientationChangeListener
+,VideoSpeedPopup.SpeedChangeListener,VideoEpisodePopup.EpisodeClickListener{
+ private AGVideo mPlayer;
+ private JZDataSource mJzDataSource;
+ private List episodeList;
+ private TabLayout episodes;
+ private int playingNum=0;
+ //倍数弹窗
+ private VideoSpeedPopup videoSpeedPopup;
+ private VideoEpisodePopup videoEpisodePopup;
+ @Override
+ protected void onCreate(@Nullable Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ getSupportActionBar().hide();
+ setContentView(R.layout.activity_ui_big_change_ag);
+ initVideoData();
+ initView();
+ ScreenRotateUtils.getInstance(this.getApplicationContext()).setOrientationChangeListener(this);
+ }
+
+ private void initView(){
+ episodes = findViewById(R.id.video_episodes);
+ mPlayer=findViewById(R.id.ag_player);
+ initEpisodesTablayout();
+ mPlayer.setJzVideoListener(this);
+ mJzDataSource = new JZDataSource(episodeList.get(0).getVideoUrl(), episodeList.get(0).getVideoName());
+ mPlayer.setUp(mJzDataSource
+ , JzvdStd.SCREEN_NORMAL, JZMediaExo.class);
+ mPlayer.startVideo();
+ }
+
+ private void initEpisodesTablayout(){
+ episodes.clearOnTabSelectedListeners();
+ episodes.removeAllTabs();
+ for (int i = 0; i < episodeList.size(); i++) {
+ episodes.addTab(episodes.newTab().setText(String.valueOf((i + 1))));
+ }
+ //用来循环适配器中的视图总数
+ for (int i = 0; i < episodes.getTabCount(); i++) {
+ //获取每一个tab对象
+ TabLayout.Tab tabAt = episodes.getTabAt(i);
+ //将每一个条目设置我们自定义的视图
+ tabAt.setCustomView(R.layout.tab_video_episodes);
+ //通过tab对象找到自定义视图的ID
+ TextView textView = tabAt.getCustomView().findViewById(R.id.tab_video_episodes_tv);
+ //设置tab上的文字
+ textView.setText(episodes.getTabAt(i).getText());
+ int current = playingNum;
+ if (i == current) {
+ //选中后字体
+ textView.setTextColor(getResources().getColor(R.color.ThemeColor));
+ } else {
+ textView.setTextColor(getResources().getColor(R.color.font_color));
+
+ }
+ }
+
+ episodes.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
+ @Override
+ public void onTabSelected(TabLayout.Tab tab) {
+ //定义方法,判断是否选中
+ int tag = Integer.parseInt(tab.getText().toString());
+ AGEpsodeEntity entity=episodeList.get(tag-1);
+ mJzDataSource=new JZDataSource(entity.getVideoUrl(),entity.getVideoName());
+ updateTabView(tab, true);
+ playChangeUrl();
+ isNext(tab.getPosition());
+ }
+
+ @Override
+ public void onTabUnselected(TabLayout.Tab tab) {
+ //定义方法,判断是否选中
+ updateTabView(tab, false);
+ }
+
+ @Override
+ public void onTabReselected(TabLayout.Tab tab) {
+ }
+ });
+ isNext(episodes.getSelectedTabPosition());
+ }
+
+
+
+
+ @Override
+ protected void onResume() {
+ Jzvd.goOnPlayOnResume();
+ super.onResume();
+ ScreenRotateUtils.getInstance(this).start(this);
+ }
+
+ @Override
+ public void onBackPressed() {
+ if (Jzvd.backPress()) {
+ return;
+ }
+ super.onBackPressed();
+ }
+
+ @Override
+ protected void onPause() {
+ super.onPause();
+ ScreenRotateUtils.getInstance(this).stop();
+ Jzvd.goOnPlayOnPause();
+ }
+
+ @Override
+ protected void onDestroy() {
+ super.onDestroy();
+ Jzvd.releaseAllVideos();
+ ScreenRotateUtils.getInstance(this.getApplicationContext()).setOrientationChangeListener(null);
+ }
+
+ /**
+ * 用来改变tabLayout选中后的字体大小及颜色
+ *
+ * @param tab
+ * @param isSelect
+ */
+ private void updateTabView(TabLayout.Tab tab, boolean isSelect) {
+ //找到自定义视图的控件ID
+ TextView tv_tab = tab.getCustomView().findViewById(R.id.tab_video_episodes_tv);
+ if (isSelect) {
+ //设置标签选中
+ tv_tab.setSelected(true);
+ //选中后字体
+ tv_tab.setTextColor(getResources().getColor(R.color.ThemeColor));
+ } else {
+ //设置标签取消选中
+ tv_tab.setSelected(false);
+ //恢复为默认字体
+ tv_tab.setTextColor(getResources().getColor(R.color.font_color));
+ }
+ }
+
+ /**
+ * 判断是否有下一集
+ */
+ private void isNext(int position) {
+ //判断是否还有下一集
+ if (position == (episodeList.size() - 1)) {
+ mPlayer.changeNextBottonUi(false);
+ } else {
+ mPlayer.changeNextBottonUi(true);
+ }
+ }
+
+ /**
+ * 更换播放地址
+ */
+ private void playChangeUrl() {
+ long progress = 0;
+ mPlayer.changeUrl(mJzDataSource, progress);
+ }
+
+ @Override
+ public void orientationChange(int orientation) {
+ if (Jzvd.CURRENT_JZVD != null
+ && (mPlayer.state == Jzvd.STATE_PLAYING || mPlayer.state == Jzvd.STATE_PAUSE)
+ && mPlayer.screen != Jzvd.SCREEN_TINY) {
+ if (orientation >= 45 && orientation <= 315 && mPlayer.screen == Jzvd.SCREEN_NORMAL) {
+ changeScreenFullLandscape(ScreenRotateUtils.orientationDirection);
+ } else if (((orientation >= 0 &&orientation <45) || orientation > 315) && mPlayer.screen == Jzvd.SCREEN_FULLSCREEN) {
+ changeScrenNormal();
+ }
+ }
+ }
+
+
+ /**
+ * 竖屏并退出全屏
+ */
+ private void changeScrenNormal() {
+ if (mPlayer != null && mPlayer.screen == Jzvd.SCREEN_FULLSCREEN) {
+ mPlayer.autoQuitFullscreen();
+ }
+ }
+
+ /**
+ * 横屏
+ */
+ private void changeScreenFullLandscape(float x) {
+ //从竖屏状态进入横屏
+ if (mPlayer != null && mPlayer.screen != Jzvd.SCREEN_FULLSCREEN) {
+ if ((System.currentTimeMillis() - Jzvd.lastAutoFullscreenTime) > 2000) {
+ mPlayer.autoFullscreen(x);
+ Jzvd.lastAutoFullscreenTime = System.currentTimeMillis();
+ }
+ }
+ }
+
+
+ /**
+ * 关闭倍速播放弹窗和选集弹窗
+ */
+ private void dismissSpeedPopAndEpisodePop() {
+ if (videoSpeedPopup != null) {
+ videoSpeedPopup.dismiss();
+ }
+ if (videoEpisodePopup != null) {
+ videoEpisodePopup.dismiss();
+ }
+ }
+
+ /**
+ * 改变播放倍速
+ *
+ * @param speed
+ */
+ private void changeSpeed(float speed) {
+ Object[] object = {speed};
+ mPlayer.mediaInterface.setSpeed(speed);
+ mJzDataSource.objects[0] = object;
+ Toast.makeText(this,"正在以" + speed + "X倍速播放",Toast.LENGTH_SHORT).show();
+ mPlayer.speedChange(speed);
+ }
+
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ switch (item.getItemId()) {
+ case android.R.id.home:
+ finish();
+ break;
+ }
+ return super.onOptionsItemSelected(item);
+ }
+
+
+ @Override
+ public void nextClick() {
+ int position = episodes.getSelectedTabPosition() + 1;
+ AGEpsodeEntity entity=episodeList.get(position);
+ mJzDataSource=new JZDataSource(entity.getVideoUrl(),entity.getVideoName());
+ TabLayout.Tab tab = episodes.getTabAt(position);
+ if (tab != null) {
+ tab.select();
+ }
+ }
+
+ @Override
+ public void backClick() {
+ if (mPlayer.screen == mPlayer.SCREEN_FULLSCREEN) {
+ dismissSpeedPopAndEpisodePop();
+ AGVideo.backPress();
+ } else {
+ finish();
+ }
+ }
+
+ @Override
+ public void throwingScreenClick() {
+ Toast.makeText(this, "投屏", Toast.LENGTH_SHORT).show();
+ }
+
+
+ @Override
+ public void selectPartsClick() {
+ if (videoEpisodePopup == null) {
+ videoEpisodePopup = new VideoEpisodePopup(this, episodeList);
+ videoEpisodePopup.setEpisondeClickListener(this);
+ }
+ videoEpisodePopup.setPlayNum(1);
+ videoEpisodePopup.showAtLocation(getWindow().getDecorView(), Gravity.RIGHT,0,0);
+ }
+
+ @Override
+ public void speedClick() {
+ if (videoSpeedPopup==null){
+ videoSpeedPopup=new VideoSpeedPopup(this);
+ videoSpeedPopup.setSpeedChangeListener(this);
+ }
+ videoSpeedPopup.showAtLocation(getWindow().getDecorView(), Gravity.RIGHT,0,0);
+ }
+
+
+
+ @Override
+ public void speedChange(float speed) {
+ changeSpeed(speed);
+ }
+
+ @Override
+ public void onEpisodeClickListener(AGEpsodeEntity entity, int position) {
+ TabLayout.Tab tab=episodes.getTabAt(position);
+ if (tab!=null){
+ tab.select();
+ }
+ }
+ private void initVideoData(){
+ episodeList=new ArrayList<>();
+ episodeList.add(new AGEpsodeEntity("http://agmjjzyi.ixibeiren.com/20181108/QSeTc4nj/index.m3u8?wsSecret=3158b8e5e257118f6132f86cf45bf8aa&wsTime=1584361106","小谢尔顿 第一季 第01集"));
+ episodeList.add(new AGEpsodeEntity("http://agmjjzyi.ixibeiren.com/20181108/Qtgy7SjP/index.m3u8?wsSecret=3158b8e5e257118f6132f86cf45bf8aa&wsTime=1584361106","小谢尔顿 第一季 第02集"));
+ episodeList.add(new AGEpsodeEntity("http://agmjjzyi.ixibeiren.com/20181108/AXkWBoLb/index.m3u8?wsSecret=3158b8e5e257118f6132f86cf45bf8aa&wsTime=1584361106","小谢尔顿 第一季 第03集"));
+ episodeList.add(new AGEpsodeEntity("http://agmjjzyi.ixibeiren.com/20181108/P6oGsmgK/index.m3u8?wsSecret=3158b8e5e257118f6132f86cf45bf8aa&wsTime=1584361106","小谢尔顿 第一季 第04集"));
+ episodeList.add(new AGEpsodeEntity("http://agmjjzyi.ixibeiren.com/20181108/PdWWKahH/index.m3u8?wsSecret=3158b8e5e257118f6132f86cf45bf8aa&wsTime=1584361106","小谢尔顿 第一季 第05集"));
+ episodeList.add(new AGEpsodeEntity("http://agmjjzyi.ixibeiren.com/20181108/eoCI1M65/index.m3u8?wsSecret=3158b8e5e257118f6132f86cf45bf8aa&wsTime=1584361106","小谢尔顿 第一季 第06集"));
+ episodeList.add(new AGEpsodeEntity("http://agmjjzyi.ixibeiren.com/20181108/pXP2NPFc/index.m3u8?wsSecret=3158b8e5e257118f6132f86cf45bf8aa&wsTime=1584361106","小谢尔顿 第一季 第07集"));
+ episodeList.add(new AGEpsodeEntity("http://agmjjzyi.ixibeiren.com/20181108/aA6UwOvW/index.m3u8?wsSecret=3158b8e5e257118f6132f86cf45bf8aa&wsTime=1584361106","谢尔顿 第一季 第08集"));
+ episodeList.add(new AGEpsodeEntity("http://agmjjzyi.ixibeiren.com/20181108/lLmVLxJQ/index.m3u8?wsSecret=3158b8e5e257118f6132f86cf45bf8aa&wsTime=1584361106","小谢尔顿 第一季 第09集"));
+ episodeList.add(new AGEpsodeEntity("http://agmjjzyi.ixibeiren.com/20181108/Ddt92vAR/index.m3u8?wsSecret=3158b8e5e257118f6132f86cf45bf8aa&wsTime=1584361106","小谢尔顿 第一季 第10集"));
+ episodeList.add(new AGEpsodeEntity("http://agmjjzyi.ixibeiren.com/20181108/90R6x9rF/index.m3u8?wsSecret=3158b8e5e257118f6132f86cf45bf8aa&wsTime=1584361106","小谢尔顿 第一季 第11集"));
+ episodeList.add(new AGEpsodeEntity("http://agmjjzyi.ixibeiren.com/20181108/nMfWnUQr/index.m3u8?wsSecret=3158b8e5e257118f6132f86cf45bf8aa&wsTime=1584361106","小谢尔顿 第一季 第12集"));
+ episodeList.add(new AGEpsodeEntity("http://agmjjzyi.ixibeiren.com/20181108/myJUPq6V/index.m3u8?wsSecret=3158b8e5e257118f6132f86cf45bf8aa&wsTime=1584361106","小谢尔顿 第一季 第13集"));
+ episodeList.add(new AGEpsodeEntity("http://agmjjzyi.ixibeiren.com/20181108/fC10illG/index.m3u8?wsSecret=3158b8e5e257118f6132f86cf45bf8aa&wsTime=1584361106","小谢尔顿 第一季 第14集"));
+ episodeList.add(new AGEpsodeEntity("http://agmjjzyi.ixibeiren.com/20181108/7jA5lpyB/index.m3u8?wsSecret=3158b8e5e257118f6132f86cf45bf8aa&wsTime=1584361106","小谢尔顿 第一季 第15集"));
+ episodeList.add(new AGEpsodeEntity("http://agmjjzyi.ixibeiren.com/20181108/6MKcJRT3/index.m3u8?wsSecret=3158b8e5e257118f6132f86cf45bf8aa&wsTime=1584361106","小谢尔顿 第一季 第16集"));
+ episodeList.add(new AGEpsodeEntity("http://agmjjzyi.ixibeiren.com/20181108/qPeGRErs/index.m3u8?wsSecret=3158b8e5e257118f6132f86cf45bf8aa&wsTime=1584361106","小谢尔顿 第一季 第17集"));
+ episodeList.add(new AGEpsodeEntity("http://agmjjzyi.ixibeiren.com/20181108/mhBHwiIw/index.m3u8?wsSecret=3158b8e5e257118f6132f86cf45bf8aa&wsTime=1584361106","小谢尔顿 第一季 第18集"));
+ episodeList.add(new AGEpsodeEntity("http://agmjjzyi.ixibeiren.com/20181108/vAYMt0AA/index.m3u8?wsSecret=3158b8e5e257118f6132f86cf45bf8aa&wsTime=1584361106","小谢尔顿 第一季 第19集"));
+ episodeList.add(new AGEpsodeEntity("http://agmjjzyi.ixibeiren.com/20181108/7R1KU2R2/index.m3u8?wsSecret=3158b8e5e257118f6132f86cf45bf8aa&wsTime=1584361106","小谢尔顿 第一季 第20集"));
+ episodeList.add(new AGEpsodeEntity("http://agmjjzyi.ixibeiren.com/20181108/bkuLrOEX/index.m3u8?wsSecret=3158b8e5e257118f6132f86cf45bf8aa&wsTime=1584361106","小谢尔顿 第一季 第21集"));
+ episodeList.add(new AGEpsodeEntity("http://agmjjzyi.ixibeiren.com/20181108/SuL66DB3/index.m3u8?wsSecret=3158b8e5e257118f6132f86cf45bf8aa&wsTime=1584361106","小谢尔顿 第一季 第22集"));
+ }
+
+
+
+}
diff --git a/demo/src/main/java/cn/jzvd/demo/BigUIChangeAG/VideoEpisodeAdapter.java b/demo/src/main/java/cn/jzvd/demo/BigUIChangeAG/VideoEpisodeAdapter.java
new file mode 100644
index 00000000..b355814a
--- /dev/null
+++ b/demo/src/main/java/cn/jzvd/demo/BigUIChangeAG/VideoEpisodeAdapter.java
@@ -0,0 +1,76 @@
+package cn.jzvd.demo.BigUIChangeAG;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.TextView;
+
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.RecyclerView;
+
+import java.util.List;
+
+import cn.jzvd.demo.R;
+
+public class VideoEpisodeAdapter extends RecyclerView.Adapter {
+ private Context mC;
+ private List entities;
+ private OnItemClickListener mOnItemClickListener;
+
+ public VideoEpisodeAdapter(Context context,List entities) {
+ this.mC=context;
+ this.entities = entities;
+ }
+
+ public void setmOnItemClickListener(OnItemClickListener mOnItemClickListener) {
+ this.mOnItemClickListener = mOnItemClickListener;
+ }
+
+ @NonNull
+ @Override
+ public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
+ View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_video_episode,parent,false);
+ ViewHolder holder = new ViewHolder(view);
+ return holder;
+ }
+
+ @Override
+ public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
+ holder.textView.setText(position+1+"");
+ if (entities.get(position).isPlay()){
+ holder.textView.setTextColor(mC.getResources().getColor(R.color.ThemeColor));
+ holder.textView.setBackground(mC.getResources().getDrawable(R.drawable.bg_video_episodes_check));
+ }else {
+ holder.textView.setTextColor(mC.getResources().getColor(R.color.colorWhite));
+ holder.textView.setBackground(mC.getResources().getDrawable(R.drawable.bg_video_episodes_uncheck));
+ }
+
+ holder.textView.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ if (mOnItemClickListener!=null){
+ mOnItemClickListener.onItemClicked(v,position);
+ }
+ }
+ });
+ }
+
+ @Override
+ public int getItemCount() {
+ return entities.size();
+ }
+
+ class ViewHolder extends RecyclerView.ViewHolder{
+ TextView textView;
+ public ViewHolder(@NonNull View itemView) {
+ super(itemView);
+ textView=itemView.findViewById(R.id.item_episodeNum);
+ }
+ }
+
+
+ public interface OnItemClickListener {
+ void onItemClicked(View view, int position);
+ }
+}
diff --git a/demo/src/main/java/cn/jzvd/demo/BigUIChangeAG/VideoEpisodePopup.java b/demo/src/main/java/cn/jzvd/demo/BigUIChangeAG/VideoEpisodePopup.java
new file mode 100644
index 00000000..b3d47b1c
--- /dev/null
+++ b/demo/src/main/java/cn/jzvd/demo/BigUIChangeAG/VideoEpisodePopup.java
@@ -0,0 +1,169 @@
+package cn.jzvd.demo.BigUIChangeAG;
+
+import android.content.Context;
+import android.graphics.drawable.BitmapDrawable;
+import android.os.Handler;
+import android.os.Message;
+import android.view.LayoutInflater;
+import android.view.MotionEvent;
+import android.view.View;
+import android.view.WindowManager;
+import android.widget.LinearLayout;
+import android.widget.PopupWindow;
+
+import androidx.recyclerview.widget.GridLayoutManager;
+import androidx.recyclerview.widget.RecyclerView;
+
+import java.util.List;
+import java.util.Timer;
+import java.util.TimerTask;
+
+import cn.jzvd.demo.R;
+import cn.jzvd.demo.utils.DpOrPxUtils;
+
+public class VideoEpisodePopup extends PopupWindow {
+ private static final int COMPLETED = 0;
+ private Context mC;
+ private LinearLayout main;
+ private LayoutInflater inflater;
+ private View contentView;
+ private RecyclerView episodeRecycler;
+ private VideoEpisodeAdapter episodeAdapter;
+ private List episodeList;
+ private EpisodeClickListener episondeClickListener;
+ /**
+ * 当前正在播放的集数
+ */
+ private int playNum = 0;
+ private Timer mDismissTimer;
+ protected DismissTimerTask mDismissTimerTask;
+ public EpisodeClickListener getEpisondeClickListener() {
+ return episondeClickListener;
+ }
+
+ public void setEpisondeClickListener(EpisodeClickListener episondeClickListener) {
+ this.episondeClickListener = episondeClickListener;
+ }
+
+ public VideoEpisodePopup(Context context, List entities){
+ super(context);
+ this.mC=context;
+ mC=context;
+ this.episodeList=entities;
+ inflater=(LayoutInflater)mC.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+ contentView=inflater.inflate(R.layout.popup_video_episode,null);
+ setContentView(contentView);
+ setHeight(WindowManager.LayoutParams.MATCH_PARENT);
+ setWidth(DpOrPxUtils.dip2px(context,320));
+ setOutsideTouchable(true);
+ //不设置该属性,弹窗于屏幕边框会有缝隙并且背景不是半透明
+ setBackgroundDrawable(new BitmapDrawable());
+ main=contentView.findViewById(R.id.video_main);
+ episodeRecycler = contentView.findViewById(R.id.video_episode);
+ episodeRecycler.setLayoutManager(new GridLayoutManager(context, 5));
+ episodeAdapter = new VideoEpisodeAdapter(mC,episodeList);
+ episodeRecycler.setAdapter(episodeAdapter);
+
+ episodeAdapter.setmOnItemClickListener(new VideoEpisodeAdapter.OnItemClickListener() {
+ @Override
+ public void onItemClicked(View view, int position) {
+ if (episondeClickListener!=null){
+ episondeClickListener.onEpisodeClickListener(episodeList.get(position),position);
+ }
+ //更换当前正在播放的集数
+ if (playNum<1){
+ playNum=1;
+ }
+ episodeList.get(playNum - 1).setPlay(false);
+ playNum = position + 1;
+ episodeList.get(playNum - 1).setPlay(true);
+ episodeAdapter.notifyDataSetChanged();
+ }
+ });
+
+ main.setOnTouchListener(new View.OnTouchListener() {
+ @Override
+ public boolean onTouch(View v, MotionEvent event) {
+ startDismissTimer();
+ return false;
+ }
+ });
+ episodeRecycler.setOnTouchListener(new View.OnTouchListener() {
+ @Override
+ public boolean onTouch(View v, MotionEvent event) {
+ startDismissTimer();
+ return false;
+ }
+ });
+ }
+
+ @Override
+ public void showAtLocation(View parent, int gravity, int x, int y) {
+ super.showAtLocation(parent, gravity, x, y);
+ startDismissTimer();
+ }
+
+ @Override
+ public void dismiss() {
+ super.dismiss();
+ cancelDismissTimer();
+ }
+
+ public void setPlayNum(int playNum) {
+ if (this.playNum != 0) {
+ episodeList.get(this.playNum - 1).setPlay(false);
+ this.playNum = playNum;
+ episodeList.get(playNum - 1).setPlay(true);
+ } else {
+ this.playNum = playNum;
+ episodeList.get(this.playNum - 1).setPlay(true);
+ }
+ }
+
+ public void startDismissTimer() {
+ cancelDismissTimer();
+ mDismissTimer = new Timer();
+ mDismissTimerTask = new DismissTimerTask();
+ mDismissTimer.schedule(mDismissTimerTask, 2500);
+ }
+
+ public void cancelDismissTimer() {
+ if (mDismissTimer != null) {
+ mDismissTimer.cancel();
+ }
+ if (mDismissTimerTask != null) {
+ mDismissTimerTask.cancel();
+ }
+
+ }
+
+
+ public interface EpisodeClickListener {
+ /**
+ * 选集发生变化
+ * @param entity
+ * @param position
+ */
+ void onEpisodeClickListener(AGEpsodeEntity entity, int position);
+ }
+
+ public class DismissTimerTask extends TimerTask {
+
+ @Override
+ public void run() {
+ Message message = new Message();
+ message.what = COMPLETED;
+ handler.sendMessage(message);
+ }
+ }
+
+ private Handler handler = new Handler(){
+ @Override
+ public void handleMessage(Message msg) {
+ if (msg.what == COMPLETED) {
+ dismiss();
+
+ }
+ }
+ };
+}
diff --git a/demo/src/main/java/cn/jzvd/demo/BigUIChangeAG/VideoSpeedPopup.java b/demo/src/main/java/cn/jzvd/demo/BigUIChangeAG/VideoSpeedPopup.java
new file mode 100644
index 00000000..9b7da996
--- /dev/null
+++ b/demo/src/main/java/cn/jzvd/demo/BigUIChangeAG/VideoSpeedPopup.java
@@ -0,0 +1,159 @@
+package cn.jzvd.demo.BigUIChangeAG;
+
+import android.content.Context;
+import android.graphics.drawable.BitmapDrawable;
+import android.os.Handler;
+import android.os.Message;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.WindowManager;
+import android.widget.PopupWindow;
+import android.widget.TextView;
+
+import java.util.Timer;
+import java.util.TimerTask;
+
+import cn.jzvd.demo.R;
+import cn.jzvd.demo.utils.DpOrPxUtils;
+
+public class VideoSpeedPopup extends PopupWindow implements View.OnClickListener {
+ private static final int COMPLETED = 0;
+ private TextView speedOne,speedTwo,speedThree,speedFour,speedFive;
+ private SpeedChangeListener speedChangeListener;
+ private Context mC;
+ private LayoutInflater inflater;
+ private View contentView;
+ private Timer mDismissTimer;
+ protected DismissTimerTask mDismissTimerTask;
+ public VideoSpeedPopup(Context context){
+ super(context);
+ mC=context;
+ inflater=(LayoutInflater)mC.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+ contentView=inflater.inflate(R.layout.popup_video_speed,null);
+ setContentView(contentView);
+ setHeight(WindowManager.LayoutParams.MATCH_PARENT);
+ setWidth(DpOrPxUtils.dip2px(context,200));
+ speedOne=contentView.findViewById(R.id.pop_speed_1);
+ speedTwo=contentView.findViewById(R.id.pop_speed_1_25);
+ speedThree=contentView.findViewById(R.id.pop_speed_1_5);
+ speedFour=contentView.findViewById(R.id.pop_speed_1_75);
+ speedFive=contentView.findViewById(R.id.pop_speed_2);
+ setOutsideTouchable(true);
+ //不设置该属性,弹窗于屏幕边框会有缝隙并且背景不是半透明
+ setBackgroundDrawable(new BitmapDrawable());
+ speedOne.setOnClickListener(this);
+ speedTwo.setOnClickListener(this);
+ speedThree.setOnClickListener(this);
+ speedFour.setOnClickListener(this);
+ speedFive.setOnClickListener(this);
+ }
+
+ @Override
+ public void onClick(View v) {
+ if (speedChangeListener!=null){
+ switch (v.getId()){
+ case R.id.pop_speed_1:
+ speedOne.setTextColor(mC.getResources().getColor(R.color.ThemeColor));
+ speedTwo.setTextColor(mC.getResources().getColor(R.color.colorWhite));
+ speedThree.setTextColor(mC.getResources().getColor(R.color.colorWhite));
+ speedFour.setTextColor(mC.getResources().getColor(R.color.colorWhite));
+ speedFive.setTextColor(mC.getResources().getColor(R.color.colorWhite));
+ speedChangeListener.speedChange(1f);
+ break;
+ case R.id.pop_speed_1_25:
+ speedOne.setTextColor(mC.getResources().getColor(R.color.colorWhite));
+ speedTwo.setTextColor(mC.getResources().getColor(R.color.ThemeColor));
+ speedThree.setTextColor(mC.getResources().getColor(R.color.colorWhite));
+ speedFour.setTextColor(mC.getResources().getColor(R.color.colorWhite));
+ speedFive.setTextColor(mC.getResources().getColor(R.color.colorWhite));
+ speedChangeListener.speedChange(1.25f);
+ break;
+ case R.id.pop_speed_1_5:
+ speedOne.setTextColor(mC.getResources().getColor(R.color.colorWhite));
+ speedTwo.setTextColor(mC.getResources().getColor(R.color.colorWhite));
+ speedThree.setTextColor(mC.getResources().getColor(R.color.ThemeColor));
+ speedFour.setTextColor(mC.getResources().getColor(R.color.colorWhite));
+ speedFive.setTextColor(mC.getResources().getColor(R.color.colorWhite));
+ speedChangeListener.speedChange(1.5f);
+ break;
+ case R.id.pop_speed_1_75:
+ speedOne.setTextColor(mC.getResources().getColor(R.color.colorWhite));
+ speedTwo.setTextColor(mC.getResources().getColor(R.color.colorWhite));
+ speedThree.setTextColor(mC.getResources().getColor(R.color.colorWhite));
+ speedFour.setTextColor(mC.getResources().getColor(R.color.ThemeColor));
+ speedFive.setTextColor(mC.getResources().getColor(R.color.colorWhite));
+ speedChangeListener.speedChange(1.75f);
+ break;
+ case R.id.pop_speed_2:
+ speedOne.setTextColor(mC.getResources().getColor(R.color.colorWhite));
+ speedTwo.setTextColor(mC.getResources().getColor(R.color.colorWhite));
+ speedThree.setTextColor(mC.getResources().getColor(R.color.colorWhite));
+ speedFour.setTextColor(mC.getResources().getColor(R.color.colorWhite));
+ speedFive.setTextColor(mC.getResources().getColor(R.color.ThemeColor));
+ speedChangeListener.speedChange(2f);
+ break;
+ }
+ }
+ }
+
+ @Override
+ public void showAtLocation(View parent, int gravity, int x, int y) {
+ super.showAtLocation(parent, gravity, x, y);
+ startDismissTimer();
+ }
+
+ @Override
+ public void dismiss() {
+ super.dismiss();
+ cancelDismissTimer();
+ }
+
+ public void startDismissTimer() {
+ cancelDismissTimer();
+ mDismissTimer = new Timer();
+ mDismissTimerTask = new DismissTimerTask();
+ mDismissTimer.schedule(mDismissTimerTask, 2500);
+ }
+
+ public void cancelDismissTimer() {
+ if (mDismissTimer != null) {
+ mDismissTimer.cancel();
+ }
+ if (mDismissTimerTask != null) {
+ mDismissTimerTask.cancel();
+ }
+
+ }
+
+ public SpeedChangeListener getSpeedChangeListener() {
+ return speedChangeListener;
+ }
+
+ public void setSpeedChangeListener(SpeedChangeListener speedChangeListener) {
+ this.speedChangeListener = speedChangeListener;
+ }
+
+ public interface SpeedChangeListener{
+ void speedChange(float speed);
+ }
+
+ public class DismissTimerTask extends TimerTask {
+
+ @Override
+ public void run() {
+ Message message = new Message();
+ message.what = COMPLETED;
+ handler.sendMessage(message);
+ }
+ }
+
+ private Handler handler = new Handler(){
+ @Override
+ public void handleMessage(Message msg) {
+ if (msg.what == COMPLETED) {
+ dismiss();
+
+ }
+ }
+ };
+}
diff --git a/app/src/main/java/cn/jzvd/demo/CustomJzvd/AutoPlayUtils.java b/demo/src/main/java/cn/jzvd/demo/CustomJzvd/AutoPlayUtils.java
similarity index 100%
rename from app/src/main/java/cn/jzvd/demo/CustomJzvd/AutoPlayUtils.java
rename to demo/src/main/java/cn/jzvd/demo/CustomJzvd/AutoPlayUtils.java
diff --git a/app/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdAssert.java b/demo/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdAssert.java
similarity index 100%
rename from app/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdAssert.java
rename to demo/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdAssert.java
diff --git a/app/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdAutoCompleteAfterFullscreen.java b/demo/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdAutoCompleteAfterFullscreen.java
similarity index 100%
rename from app/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdAutoCompleteAfterFullscreen.java
rename to demo/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdAutoCompleteAfterFullscreen.java
diff --git a/app/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdList.java b/demo/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdList.java
similarity index 100%
rename from app/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdList.java
rename to demo/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdList.java
diff --git a/app/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdLockScreen.java b/demo/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdLockScreen.java
similarity index 100%
rename from app/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdLockScreen.java
rename to demo/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdLockScreen.java
diff --git a/app/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdMp3.java b/demo/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdMp3.java
similarity index 100%
rename from app/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdMp3.java
rename to demo/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdMp3.java
diff --git a/app/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdRv.java b/demo/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdRv.java
similarity index 100%
rename from app/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdRv.java
rename to demo/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdRv.java
diff --git a/app/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdShowShareButtonAfterFullscreen.java b/demo/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdShowShareButtonAfterFullscreen.java
similarity index 100%
rename from app/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdShowShareButtonAfterFullscreen.java
rename to demo/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdShowShareButtonAfterFullscreen.java
diff --git a/app/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdShowTextureViewAfterAutoComplete.java b/demo/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdShowTextureViewAfterAutoComplete.java
similarity index 100%
rename from app/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdShowTextureViewAfterAutoComplete.java
rename to demo/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdShowTextureViewAfterAutoComplete.java
diff --git a/app/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdShowTitleAfterFullscreen.java b/demo/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdShowTitleAfterFullscreen.java
similarity index 100%
rename from app/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdShowTitleAfterFullscreen.java
rename to demo/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdShowTitleAfterFullscreen.java
diff --git a/app/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdSpeed.java b/demo/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdSpeed.java
similarity index 100%
rename from app/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdSpeed.java
rename to demo/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdSpeed.java
diff --git a/app/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdTikTok.java b/demo/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdTikTok.java
similarity index 93%
rename from app/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdTikTok.java
rename to demo/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdTikTok.java
index 9ee5f093..d5102ab5 100644
--- a/app/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdTikTok.java
+++ b/demo/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdTikTok.java
@@ -80,17 +80,17 @@ public void onClickUiToggle() {
public void updateStartImage() {
if (state == STATE_PLAYING) {
startButton.setVisibility(VISIBLE);
- startButton.setImageResource(R.drawable.ic_play_tiktok);
+ startButton.setImageResource(R.drawable.tiktok_play_tiktok);
replayTextView.setVisibility(GONE);
} else if (state == STATE_ERROR) {
startButton.setVisibility(INVISIBLE);
replayTextView.setVisibility(GONE);
} else if (state == STATE_AUTO_COMPLETE) {
startButton.setVisibility(VISIBLE);
- startButton.setImageResource(R.drawable.ic_play_tiktok);
+ startButton.setImageResource(R.drawable.tiktok_play_tiktok);
replayTextView.setVisibility(VISIBLE);
} else {
- startButton.setImageResource(R.drawable.ic_play_tiktok);
+ startButton.setImageResource(R.drawable.tiktok_play_tiktok);
replayTextView.setVisibility(GONE);
}
}
diff --git a/app/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdTinyWindow.java b/demo/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdTinyWindow.java
similarity index 100%
rename from app/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdTinyWindow.java
rename to demo/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdTinyWindow.java
diff --git a/app/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdVolumeAfterFullscreen.java b/demo/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdVolumeAfterFullscreen.java
similarity index 100%
rename from app/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdVolumeAfterFullscreen.java
rename to demo/src/main/java/cn/jzvd/demo/CustomJzvd/JzvdStdVolumeAfterFullscreen.java
diff --git a/app/src/main/java/cn/jzvd/demo/CustomJzvd/MyJzvdStd.java b/demo/src/main/java/cn/jzvd/demo/CustomJzvd/MyJzvdStd.java
similarity index 100%
rename from app/src/main/java/cn/jzvd/demo/CustomJzvd/MyJzvdStd.java
rename to demo/src/main/java/cn/jzvd/demo/CustomJzvd/MyJzvdStd.java
diff --git a/app/src/main/java/cn/jzvd/demo/CustomJzvd/ViewAttr.java b/demo/src/main/java/cn/jzvd/demo/CustomJzvd/ViewAttr.java
similarity index 100%
rename from app/src/main/java/cn/jzvd/demo/CustomJzvd/ViewAttr.java
rename to demo/src/main/java/cn/jzvd/demo/CustomJzvd/ViewAttr.java
diff --git a/app/src/main/java/cn/jzvd/demo/CustomMedia/JZMediaExo.java b/demo/src/main/java/cn/jzvd/demo/CustomMedia/JZMediaExo.java
similarity index 92%
rename from app/src/main/java/cn/jzvd/demo/CustomMedia/JZMediaExo.java
rename to demo/src/main/java/cn/jzvd/demo/CustomMedia/JZMediaExo.java
index b2c59244..e22b8fe9 100755
--- a/app/src/main/java/cn/jzvd/demo/CustomMedia/JZMediaExo.java
+++ b/demo/src/main/java/cn/jzvd/demo/CustomMedia/JZMediaExo.java
@@ -38,6 +38,7 @@
import cn.jzvd.JZMediaInterface;
import cn.jzvd.Jzvd;
+import cn.jzvd.demo.BigUIChangeAG.AGVideo;
import cn.jzvd.demo.R;
/**
@@ -112,7 +113,12 @@ public void prepare() {
simpleExoPlayer.setPlayWhenReady(true);
callback = new onBufferingUpdate();
- simpleExoPlayer.setVideoSurface(new Surface(jzvd.textureView.getSurfaceTexture()));
+ if (jzvd.textureView != null) {
+ SurfaceTexture surfaceTexture=jzvd.textureView.getSurfaceTexture();
+ if (surfaceTexture!=null){
+ simpleExoPlayer.setVideoSurface(new Surface(surfaceTexture));
+ }
+ }
});
}
@@ -139,10 +145,19 @@ public boolean isPlaying() {
@Override
public void seekTo(long time) {
+ if (simpleExoPlayer==null){
+ return;
+ }
if (time != previousSeek) {
+ if (time >= simpleExoPlayer.getBufferedPosition()) {
+ if (jzvd instanceof AGVideo) {
+ ((AGVideo) jzvd).showProgress();
+ }
+ }
simpleExoPlayer.seekTo(time);
previousSeek = time;
jzvd.seekToInAdvance = time;
+
}
}
@@ -217,6 +232,9 @@ public void onPlayerStateChanged(final boolean playWhenReady, final int playback
}
break;
case Player.STATE_BUFFERING: {
+ if (jzvd instanceof AGVideo) {
+ ((AGVideo) jzvd).showProgress();
+ }
handler.post(callback);
}
break;
@@ -268,7 +286,11 @@ public void onSeekProcessed() {
@Override
public void setSurface(Surface surface) {
- simpleExoPlayer.setVideoSurface(surface);
+ if (simpleExoPlayer!=null){
+ simpleExoPlayer.setVideoSurface(surface);
+ }else {
+ Log.e("AGVideo","simpleExoPlayer为空");
+ }
}
@Override
diff --git a/app/src/main/java/cn/jzvd/demo/CustomMedia/JZMediaIjk.java b/demo/src/main/java/cn/jzvd/demo/CustomMedia/JZMediaIjk.java
similarity index 100%
rename from app/src/main/java/cn/jzvd/demo/CustomMedia/JZMediaIjk.java
rename to demo/src/main/java/cn/jzvd/demo/CustomMedia/JZMediaIjk.java
diff --git a/app/src/main/java/cn/jzvd/demo/CustomMedia/JZMediaSystemAssertFolder.java b/demo/src/main/java/cn/jzvd/demo/CustomMedia/JZMediaSystemAssertFolder.java
similarity index 100%
rename from app/src/main/java/cn/jzvd/demo/CustomMedia/JZMediaSystemAssertFolder.java
rename to demo/src/main/java/cn/jzvd/demo/CustomMedia/JZMediaSystemAssertFolder.java
diff --git a/app/src/main/java/cn/jzvd/demo/FragmentDemo.java b/demo/src/main/java/cn/jzvd/demo/FragmentDemo.java
similarity index 100%
rename from app/src/main/java/cn/jzvd/demo/FragmentDemo.java
rename to demo/src/main/java/cn/jzvd/demo/FragmentDemo.java
diff --git a/app/src/main/java/cn/jzvd/demo/ScreenRotateUtils.java b/demo/src/main/java/cn/jzvd/demo/ScreenRotateUtils.java
similarity index 95%
rename from app/src/main/java/cn/jzvd/demo/ScreenRotateUtils.java
rename to demo/src/main/java/cn/jzvd/demo/ScreenRotateUtils.java
index e116ffab..340b7ecb 100644
--- a/app/src/main/java/cn/jzvd/demo/ScreenRotateUtils.java
+++ b/demo/src/main/java/cn/jzvd/demo/ScreenRotateUtils.java
@@ -45,11 +45,11 @@ public static ScreenRotateUtils getInstance(Context context) {
return instance;
}
- void setOrientationChangeListener(OrientationChangeListener changeListener) {
+ public void setOrientationChangeListener(OrientationChangeListener changeListener) {
this.changeListener = changeListener;
}
- interface OrientationChangeListener {
+ public interface OrientationChangeListener {
void orientationChange(int orientation);
}
@@ -113,7 +113,7 @@ public void onAccuracyChanged(Sensor sensor, int i) {
*
* @param activity
*/
- void start(Activity activity) {
+ public void start(Activity activity) {
mActivity = activity;
sm.registerListener(listener, sensor, SensorManager.SENSOR_DELAY_NORMAL);
}
@@ -121,7 +121,7 @@ void start(Activity activity) {
/**
* 注销监听
*/
- void stop() {
+ public void stop() {
sm.unregisterListener(listener);
mActivity = null; // 防止内存泄漏
}
diff --git a/app/src/main/java/cn/jzvd/demo/VideoConstant.java b/demo/src/main/java/cn/jzvd/demo/VideoConstant.java
similarity index 99%
rename from app/src/main/java/cn/jzvd/demo/VideoConstant.java
rename to demo/src/main/java/cn/jzvd/demo/VideoConstant.java
index 9950ee6a..fc6d0c29 100644
--- a/app/src/main/java/cn/jzvd/demo/VideoConstant.java
+++ b/demo/src/main/java/cn/jzvd/demo/VideoConstant.java
@@ -1,5 +1,7 @@
package cn.jzvd.demo;
+import cn.jzvd.demo.BigUIChangeAG.AGVideo;
+
/**
* Created by shengjun on 16/9/10.
*/
@@ -265,5 +267,4 @@ public class VideoConstant {
"饺子好喜欢"
}
};
-
}
diff --git a/app/src/main/java/cn/jzvd/demo/ViewMoveHelper.java b/demo/src/main/java/cn/jzvd/demo/ViewMoveHelper.java
similarity index 100%
rename from app/src/main/java/cn/jzvd/demo/ViewMoveHelper.java
rename to demo/src/main/java/cn/jzvd/demo/ViewMoveHelper.java
diff --git a/app/src/main/java/cn/jzvd/demo/tiktok/ActivityTikTok.java b/demo/src/main/java/cn/jzvd/demo/tiktok/ActivityTikTok.java
similarity index 100%
rename from app/src/main/java/cn/jzvd/demo/tiktok/ActivityTikTok.java
rename to demo/src/main/java/cn/jzvd/demo/tiktok/ActivityTikTok.java
diff --git a/app/src/main/java/cn/jzvd/demo/tiktok/AdapterTikTokRecyclerView.java b/demo/src/main/java/cn/jzvd/demo/tiktok/AdapterTikTokRecyclerView.java
similarity index 100%
rename from app/src/main/java/cn/jzvd/demo/tiktok/AdapterTikTokRecyclerView.java
rename to demo/src/main/java/cn/jzvd/demo/tiktok/AdapterTikTokRecyclerView.java
diff --git a/demo/src/main/java/cn/jzvd/demo/utils/DpOrPxUtils.java b/demo/src/main/java/cn/jzvd/demo/utils/DpOrPxUtils.java
new file mode 100644
index 00000000..89b89ce6
--- /dev/null
+++ b/demo/src/main/java/cn/jzvd/demo/utils/DpOrPxUtils.java
@@ -0,0 +1,18 @@
+package cn.jzvd.demo.utils;
+
+import android.content.Context;
+
+/**
+ * @author HRR
+ * @date 2019/12/19
+ */
+public class DpOrPxUtils {
+ public static int dip2px(Context context, float dpValue) {
+ final float scale = context.getResources().getDisplayMetrics().density;
+ return (int) (dpValue * scale + 0.5f);
+ }
+ public static int px2dip(Context context, float pxValue) {
+ final float scale = context.getResources().getDisplayMetrics().density;
+ return (int) (pxValue / scale + 0.5f);
+ }
+}
diff --git a/demo/src/main/java/cn/jzvd/demo/utils/NetworkUtils.java b/demo/src/main/java/cn/jzvd/demo/utils/NetworkUtils.java
new file mode 100644
index 00000000..be592e92
--- /dev/null
+++ b/demo/src/main/java/cn/jzvd/demo/utils/NetworkUtils.java
@@ -0,0 +1,44 @@
+package cn.jzvd.demo.utils;
+
+import android.content.Context;
+import android.net.ConnectivityManager;
+import android.net.NetworkInfo;
+
+public class NetworkUtils {
+ /**
+ * 判断网络是否连接
+ * 需添加权限 {@code }
+ *
+ * @param context 上下文
+ * @return {@code true}: 是
{@code false}: 否
+ */
+ public static boolean isConnected(Context context) {
+ NetworkInfo info = getActiveNetworkInfo(context);
+ return info != null && info.isConnected();
+ }
+
+ /**
+ * 获取活动网络信息
+ *
+ * @param context 上下文
+ * @return NetworkInfo
+ */
+ private static NetworkInfo getActiveNetworkInfo(Context context) {
+ ConnectivityManager cm = (ConnectivityManager) context
+ .getSystemService(Context.CONNECTIVITY_SERVICE);
+ return cm.getActiveNetworkInfo();
+ }
+
+
+ /**
+ * 判断网络是否可用
+ * 需添加权限 {@code }
+ *
+ * @param context 上下文
+ * @return {@code true}: 可用
{@code false}: 不可用
+ */
+ public static boolean isAvailable(Context context) {
+ NetworkInfo info = getActiveNetworkInfo(context);
+ return info != null && info.isAvailable();
+ }
+}
diff --git a/demo/src/main/java/cn/jzvd/demo/widget/LoadingView.java b/demo/src/main/java/cn/jzvd/demo/widget/LoadingView.java
new file mode 100644
index 00000000..6ba50a84
--- /dev/null
+++ b/demo/src/main/java/cn/jzvd/demo/widget/LoadingView.java
@@ -0,0 +1,110 @@
+package cn.jzvd.demo.widget;
+
+import android.animation.AnimatorSet;
+import android.animation.ObjectAnimator;
+import android.animation.ValueAnimator;
+import android.content.Context;
+import android.graphics.Canvas;
+import android.graphics.Paint;
+import android.graphics.RectF;
+import android.util.AttributeSet;
+import android.view.View;
+import android.view.animation.CycleInterpolator;
+import android.view.animation.LinearInterpolator;
+
+import androidx.annotation.Nullable;
+
+import cn.jzvd.demo.R;
+import cn.jzvd.demo.utils.DpOrPxUtils;
+
+
+/**
+ * @author HRR
+ * @date 2019/12/19
+ */
+public class LoadingView extends View {
+ //画笔
+ private Paint mPaint;
+ //圆圈边框宽度
+ private int borderWidth = DpOrPxUtils.dip2px(getContext(), 2);
+ //圆形的矩形轮廓
+ RectF rectF;
+ //圆弧扫过的角度
+ float sweepAngle;
+ float rotateAngle;
+ ObjectAnimator objectAnimator;
+ ObjectAnimator rotateAnimator;
+ AnimatorSet animatorSet;
+
+ public LoadingView(Context context) {
+ super(context);
+ init();
+ }
+
+ public LoadingView(Context context, @Nullable AttributeSet attrs) {
+ super(context, attrs);
+ init();
+ }
+
+ public LoadingView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
+ super(context, attrs, defStyleAttr);
+ init();
+ }
+
+ private void init() {
+ mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
+ mPaint.setStrokeCap(Paint.Cap.ROUND);
+ mPaint.setStrokeWidth(borderWidth);
+ mPaint.setStyle(Paint.Style.STROKE);
+ mPaint.setColor(getContext().getResources().getColor(R.color.ThemeColor));
+ rectF = new RectF();
+ objectAnimator = ObjectAnimator.ofFloat(
+ this,
+ "sweepAngle",
+ 0, 180);
+ objectAnimator.setRepeatCount(ValueAnimator.INFINITE);
+ objectAnimator.setInterpolator(new CycleInterpolator(0.5f));
+ rotateAnimator = ObjectAnimator.ofFloat(this,"rotateAngle",0,720);
+ rotateAnimator.setInterpolator(new LinearInterpolator());
+ rotateAnimator.setRepeatCount(ValueAnimator.INFINITE);
+ animatorSet = new AnimatorSet();
+ animatorSet.playTogether(objectAnimator,rotateAnimator);
+ animatorSet.setDuration(1000);
+ animatorSet.start();
+ }
+
+
+ @Override
+ protected void onDraw(Canvas canvas) {
+ //绘制圆弧
+ canvas.rotate(rotateAngle,getHeight()/2,getWidth()/2);
+ canvas.drawArc(rectF, 0, sweepAngle, false, mPaint);
+ super.onDraw(canvas);
+ }
+
+ @Override
+ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
+ super.onMeasure(widthMeasureSpec, heightMeasureSpec);
+ //圆形的矩形轮廓
+ rectF.set(borderWidth, borderWidth, getMeasuredWidth() - borderWidth, getMeasuredHeight() - borderWidth);
+ }
+
+ public float getSweepAngle() {
+ return sweepAngle;
+ }
+
+ public void setSweepAngle(float sweepAngle) {
+ this.sweepAngle = sweepAngle;
+ postInvalidate();
+ }
+
+ public float getRotateAngle() {
+ return rotateAngle;
+ }
+
+ public void setRotateAngle(float rotateAngle) {
+ this.rotateAngle = rotateAngle;
+ postInvalidate();
+ }
+
+}
\ No newline at end of file
diff --git a/app/src/main/java/cn/jzvd/demo/widget/OnViewPagerListener.java b/demo/src/main/java/cn/jzvd/demo/widget/OnViewPagerListener.java
similarity index 100%
rename from app/src/main/java/cn/jzvd/demo/widget/OnViewPagerListener.java
rename to demo/src/main/java/cn/jzvd/demo/widget/OnViewPagerListener.java
diff --git a/app/src/main/java/cn/jzvd/demo/widget/ViewPagerLayoutManager.java b/demo/src/main/java/cn/jzvd/demo/widget/ViewPagerLayoutManager.java
similarity index 100%
rename from app/src/main/java/cn/jzvd/demo/widget/ViewPagerLayoutManager.java
rename to demo/src/main/java/cn/jzvd/demo/widget/ViewPagerLayoutManager.java
diff --git a/demo/src/main/res/drawable-xxhdpi/tiktok_comment_normal.png b/demo/src/main/res/drawable-xxhdpi/tiktok_comment_normal.png
new file mode 100644
index 00000000..0f164a7d
Binary files /dev/null and b/demo/src/main/res/drawable-xxhdpi/tiktok_comment_normal.png differ
diff --git a/demo/src/main/res/drawable-xxhdpi/tiktok_douyin_icon.png b/demo/src/main/res/drawable-xxhdpi/tiktok_douyin_icon.png
new file mode 100644
index 00000000..b2ed5470
Binary files /dev/null and b/demo/src/main/res/drawable-xxhdpi/tiktok_douyin_icon.png differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_music_play.png b/demo/src/main/res/drawable-xxhdpi/tiktok_music_play.png
similarity index 100%
rename from app/src/main/res/drawable-xxhdpi/ic_music_play.png
rename to demo/src/main/res/drawable-xxhdpi/tiktok_music_play.png
diff --git a/app/src/main/res/drawable-xxhdpi/ic_play_tiktok.png b/demo/src/main/res/drawable-xxhdpi/tiktok_play_tiktok.png
similarity index 100%
rename from app/src/main/res/drawable-xxhdpi/ic_play_tiktok.png
rename to demo/src/main/res/drawable-xxhdpi/tiktok_play_tiktok.png
diff --git a/demo/src/main/res/drawable-xxhdpi/tiktok_star_normal.png b/demo/src/main/res/drawable-xxhdpi/tiktok_star_normal.png
new file mode 100644
index 00000000..88872ede
Binary files /dev/null and b/demo/src/main/res/drawable-xxhdpi/tiktok_star_normal.png differ
diff --git a/demo/src/main/res/drawable-xxhdpi/tiktok_star_selected.png b/demo/src/main/res/drawable-xxhdpi/tiktok_star_selected.png
new file mode 100644
index 00000000..d4f6b5ff
Binary files /dev/null and b/demo/src/main/res/drawable-xxhdpi/tiktok_star_selected.png differ
diff --git a/demo/src/main/res/drawable/bg_tab_video_episodes.xml b/demo/src/main/res/drawable/bg_tab_video_episodes.xml
new file mode 100644
index 00000000..3ca2eac4
--- /dev/null
+++ b/demo/src/main/res/drawable/bg_tab_video_episodes.xml
@@ -0,0 +1,9 @@
+
+
+ -
+
+
+
+
+
+
\ No newline at end of file
diff --git a/demo/src/main/res/drawable/bg_video_button.xml b/demo/src/main/res/drawable/bg_video_button.xml
new file mode 100644
index 00000000..62ec6aa9
--- /dev/null
+++ b/demo/src/main/res/drawable/bg_video_button.xml
@@ -0,0 +1,10 @@
+
+
+ -
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/demo/src/main/res/drawable/bg_video_episodes_check.xml b/demo/src/main/res/drawable/bg_video_episodes_check.xml
new file mode 100644
index 00000000..8a1c473c
--- /dev/null
+++ b/demo/src/main/res/drawable/bg_video_episodes_check.xml
@@ -0,0 +1,9 @@
+
+
+ -
+
+
+
+
+
+
\ No newline at end of file
diff --git a/demo/src/main/res/drawable/bg_video_episodes_uncheck.xml b/demo/src/main/res/drawable/bg_video_episodes_uncheck.xml
new file mode 100644
index 00000000..7bf1007d
--- /dev/null
+++ b/demo/src/main/res/drawable/bg_video_episodes_uncheck.xml
@@ -0,0 +1,9 @@
+
+
+ -
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/ic_border_white.xml b/demo/src/main/res/drawable/ic_border_white.xml
similarity index 100%
rename from app/src/main/res/drawable/ic_border_white.xml
rename to demo/src/main/res/drawable/ic_border_white.xml
diff --git a/app/src/main/res/drawable/ic_circle_red.xml b/demo/src/main/res/drawable/ic_circle_red.xml
similarity index 100%
rename from app/src/main/res/drawable/ic_circle_red.xml
rename to demo/src/main/res/drawable/ic_circle_red.xml
diff --git a/demo/src/main/res/drawable/ic_star_selector.xml b/demo/src/main/res/drawable/ic_star_selector.xml
new file mode 100644
index 00000000..dd84df80
--- /dev/null
+++ b/demo/src/main/res/drawable/ic_star_selector.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/demo/src/main/res/drawable/player_ag_bg_retry.xml b/demo/src/main/res/drawable/player_ag_bg_retry.xml
new file mode 100644
index 00000000..ecebf098
--- /dev/null
+++ b/demo/src/main/res/drawable/player_ag_bg_retry.xml
@@ -0,0 +1,12 @@
+
+
+ -
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/demo/src/main/res/drawable/player_ag_bottom_progress.xml b/demo/src/main/res/drawable/player_ag_bottom_progress.xml
new file mode 100644
index 00000000..c8f00a33
--- /dev/null
+++ b/demo/src/main/res/drawable/player_ag_bottom_progress.xml
@@ -0,0 +1,28 @@
+
+
+ -
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/skin_seek_progress.xml b/demo/src/main/res/drawable/player_ag_bottom_seek_progress.xml
similarity index 66%
rename from app/src/main/res/drawable/skin_seek_progress.xml
rename to demo/src/main/res/drawable/player_ag_bottom_seek_progress.xml
index 75d77cb7..84621f26 100644
--- a/app/src/main/res/drawable/skin_seek_progress.xml
+++ b/demo/src/main/res/drawable/player_ag_bottom_seek_progress.xml
@@ -2,16 +2,16 @@
-
-
-
+
+
-
-
-
+
+
@@ -19,10 +19,10 @@
-
-
-
+
+
-
+
\ No newline at end of file
diff --git a/demo/src/main/res/drawable/player_ag_lock.xml b/demo/src/main/res/drawable/player_ag_lock.xml
new file mode 100644
index 00000000..0bad846f
--- /dev/null
+++ b/demo/src/main/res/drawable/player_ag_lock.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/share_selector.xml b/demo/src/main/res/drawable/share_selector.xml
similarity index 100%
rename from app/src/main/res/drawable/share_selector.xml
rename to demo/src/main/res/drawable/share_selector.xml
diff --git a/app/src/main/res/layout/activity_api.xml b/demo/src/main/res/layout/activity_api.xml
similarity index 98%
rename from app/src/main/res/layout/activity_api.xml
rename to demo/src/main/res/layout/activity_api.xml
index 79ad0acd..ab974746 100644
--- a/app/src/main/res/layout/activity_api.xml
+++ b/demo/src/main/res/layout/activity_api.xml
@@ -95,7 +95,7 @@
android:layout_gravity="center_horizontal"
android:layout_marginBottom="8dp"
android:onClick="clickScreenRotate"
- android:text="ScreenRotate" />
+ android:text="Screen Rotate" />
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_api_custom_mediaplayer.xml b/demo/src/main/res/layout/activity_api_custom_mediaplayer.xml
similarity index 100%
rename from app/src/main/res/layout/activity_api_custom_mediaplayer.xml
rename to demo/src/main/res/layout/activity_api_custom_mediaplayer.xml
diff --git a/app/src/main/res/layout/activity_api_rotation_videosize.xml b/demo/src/main/res/layout/activity_api_rotation_videosize.xml
similarity index 100%
rename from app/src/main/res/layout/activity_api_rotation_videosize.xml
rename to demo/src/main/res/layout/activity_api_rotation_videosize.xml
diff --git a/app/src/main/res/layout/activity_auto_tiny.xml b/demo/src/main/res/layout/activity_auto_tiny.xml
similarity index 100%
rename from app/src/main/res/layout/activity_auto_tiny.xml
rename to demo/src/main/res/layout/activity_auto_tiny.xml
diff --git a/app/src/main/res/layout/activity_auto_tiny_list.xml b/demo/src/main/res/layout/activity_auto_tiny_list.xml
similarity index 100%
rename from app/src/main/res/layout/activity_auto_tiny_list.xml
rename to demo/src/main/res/layout/activity_auto_tiny_list.xml
diff --git a/app/src/main/res/layout/activity_directly_play.xml b/demo/src/main/res/layout/activity_directly_play.xml
similarity index 100%
rename from app/src/main/res/layout/activity_directly_play.xml
rename to demo/src/main/res/layout/activity_directly_play.xml
diff --git a/app/src/main/res/layout/activity_extends_normal.xml b/demo/src/main/res/layout/activity_extends_normal.xml
similarity index 100%
rename from app/src/main/res/layout/activity_extends_normal.xml
rename to demo/src/main/res/layout/activity_extends_normal.xml
diff --git a/app/src/main/res/layout/activity_listview.xml b/demo/src/main/res/layout/activity_listview.xml
similarity index 95%
rename from app/src/main/res/layout/activity_listview.xml
rename to demo/src/main/res/layout/activity_listview.xml
index f193e643..0c715963 100644
--- a/app/src/main/res/layout/activity_listview.xml
+++ b/demo/src/main/res/layout/activity_listview.xml
@@ -42,14 +42,14 @@
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:onClick="clickListSmoothToDetail"
- android:text="ListSmoothToDetail" />
+ android:text="List Smooth To Detail" />
+ android:text="List Auto Play" />
+ android:src="@mipmap/tiktok_bg_add" />
+
+
+
\ No newline at end of file
diff --git a/demo/src/main/res/layout/activity_ui_big_change_ag.xml b/demo/src/main/res/layout/activity_ui_big_change_ag.xml
new file mode 100644
index 00000000..6862e67d
--- /dev/null
+++ b/demo/src/main/res/layout/activity_ui_big_change_ag.xml
@@ -0,0 +1,37 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_ui_small_change.xml b/demo/src/main/res/layout/activity_ui_small_change.xml
similarity index 100%
rename from app/src/main/res/layout/activity_ui_small_change.xml
rename to demo/src/main/res/layout/activity_ui_small_change.xml
diff --git a/app/src/main/res/layout/activity_webview.xml b/demo/src/main/res/layout/activity_webview.xml
similarity index 100%
rename from app/src/main/res/layout/activity_webview.xml
rename to demo/src/main/res/layout/activity_webview.xml
diff --git a/app/src/main/res/layout/header_auto_tiny_normal.xml b/demo/src/main/res/layout/header_auto_tiny_normal.xml
similarity index 100%
rename from app/src/main/res/layout/header_auto_tiny_normal.xml
rename to demo/src/main/res/layout/header_auto_tiny_normal.xml
diff --git a/app/src/main/res/layout/item_comment.xml b/demo/src/main/res/layout/item_comment.xml
similarity index 100%
rename from app/src/main/res/layout/item_comment.xml
rename to demo/src/main/res/layout/item_comment.xml
diff --git a/app/src/main/res/layout/item_smooth_videoview.xml b/demo/src/main/res/layout/item_smooth_videoview.xml
similarity index 100%
rename from app/src/main/res/layout/item_smooth_videoview.xml
rename to demo/src/main/res/layout/item_smooth_videoview.xml
diff --git a/app/src/main/res/layout/item_textview.xml b/demo/src/main/res/layout/item_textview.xml
similarity index 100%
rename from app/src/main/res/layout/item_textview.xml
rename to demo/src/main/res/layout/item_textview.xml
diff --git a/app/src/main/res/layout/item_tiktok.xml b/demo/src/main/res/layout/item_tiktok.xml
similarity index 92%
rename from app/src/main/res/layout/item_tiktok.xml
rename to demo/src/main/res/layout/item_tiktok.xml
index 52a1f4f4..3af5a1aa 100755
--- a/app/src/main/res/layout/item_tiktok.xml
+++ b/demo/src/main/res/layout/item_tiktok.xml
@@ -41,7 +41,7 @@
android:layout_width="120dp"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
- android:drawableLeft="@drawable/ic_douyin_icon"
+ android:drawableLeft="@drawable/tiktok_douyin_icon"
android:drawablePadding="5dp"
android:ellipsize="marquee"
android:marqueeRepeatLimit="marquee_forever"
@@ -83,9 +83,9 @@
android:background="@drawable/ic_circle_red">
+ android:layout_width="12dp"
+ android:layout_height="12dp"
+ android:background="@mipmap/tiktok_add_star" />
@@ -110,7 +110,7 @@
android:gravity="center"
android:textColor="@android:color/white"
android:textSize="12sp"
- android:drawableTop="@drawable/ic_comment_normal"
+ android:drawableTop="@drawable/tiktok_comment_normal"
android:text="1.1w" />
@@ -128,7 +128,7 @@
android:gravity="center"
android:textColor="@android:color/white"
android:textSize="12sp"
- android:drawableTop="@mipmap/btn_share_to"
+ android:drawableTop="@mipmap/tiktok_btn_share"
android:text="1111" />
+ android:background="@drawable/tiktok_music_play" />
diff --git a/demo/src/main/res/layout/item_video_episode.xml b/demo/src/main/res/layout/item_video_episode.xml
new file mode 100644
index 00000000..9c9e27b0
--- /dev/null
+++ b/demo/src/main/res/layout/item_video_episode.xml
@@ -0,0 +1,16 @@
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/item_videoview.xml b/demo/src/main/res/layout/item_videoview.xml
similarity index 100%
rename from app/src/main/res/layout/item_videoview.xml
rename to demo/src/main/res/layout/item_videoview.xml
diff --git a/app/src/main/res/layout/item_videoview_tiny.xml b/demo/src/main/res/layout/item_videoview_tiny.xml
similarity index 100%
rename from app/src/main/res/layout/item_videoview_tiny.xml
rename to demo/src/main/res/layout/item_videoview_tiny.xml
diff --git a/app/src/main/res/layout/jz_layout_standard_mp3.xml b/demo/src/main/res/layout/jz_layout_standard_mp3.xml
similarity index 99%
rename from app/src/main/res/layout/jz_layout_standard_mp3.xml
rename to demo/src/main/res/layout/jz_layout_standard_mp3.xml
index a934b952..dfc08c2a 100644
--- a/app/src/main/res/layout/jz_layout_standard_mp3.xml
+++ b/demo/src/main/res/layout/jz_layout_standard_mp3.xml
@@ -231,7 +231,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
- android:background="@drawable/retry_bg"
+ android:background="@drawable/jz_retry"
android:paddingLeft="9dp"
android:paddingTop="4dp"
android:paddingRight="9dp"
diff --git a/demo/src/main/res/layout/layout_ag_video.xml b/demo/src/main/res/layout/layout_ag_video.xml
new file mode 100644
index 00000000..a5a5f759
--- /dev/null
+++ b/demo/src/main/res/layout/layout_ag_video.xml
@@ -0,0 +1,390 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/layout_list.xml b/demo/src/main/res/layout/layout_list.xml
similarity index 100%
rename from app/src/main/res/layout/layout_list.xml
rename to demo/src/main/res/layout/layout_list.xml
diff --git a/app/src/main/res/layout/layout_std_speed.xml b/demo/src/main/res/layout/layout_std_speed.xml
similarity index 99%
rename from app/src/main/res/layout/layout_std_speed.xml
rename to demo/src/main/res/layout/layout_std_speed.xml
index 0c19ed6c..d4e4a2a3 100644
--- a/app/src/main/res/layout/layout_std_speed.xml
+++ b/demo/src/main/res/layout/layout_std_speed.xml
@@ -240,7 +240,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
- android:background="@drawable/retry_bg"
+ android:background="@drawable/jz_retry"
android:paddingLeft="9dp"
android:paddingTop="4dp"
android:paddingRight="9dp"
diff --git a/app/src/main/res/layout/layout_std_with_share_button.xml b/demo/src/main/res/layout/layout_std_with_share_button.xml
similarity index 99%
rename from app/src/main/res/layout/layout_std_with_share_button.xml
rename to demo/src/main/res/layout/layout_std_with_share_button.xml
index 27fc01ff..6c85117b 100755
--- a/app/src/main/res/layout/layout_std_with_share_button.xml
+++ b/demo/src/main/res/layout/layout_std_with_share_button.xml
@@ -244,7 +244,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
- android:background="@drawable/retry_bg"
+ android:background="@drawable/jz_retry"
android:paddingLeft="9dp"
android:paddingTop="4dp"
android:paddingRight="9dp"
diff --git a/app/src/main/res/layout/lock_screen_jz_layout_std.xml b/demo/src/main/res/layout/lock_screen_jz_layout_std.xml
similarity index 99%
rename from app/src/main/res/layout/lock_screen_jz_layout_std.xml
rename to demo/src/main/res/layout/lock_screen_jz_layout_std.xml
index c9f234fe..fbf2f8a0 100644
--- a/app/src/main/res/layout/lock_screen_jz_layout_std.xml
+++ b/demo/src/main/res/layout/lock_screen_jz_layout_std.xml
@@ -244,7 +244,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
- android:background="@drawable/retry_bg"
+ android:background="@drawable/jz_retry"
android:paddingLeft="9dp"
android:paddingTop="4dp"
android:paddingRight="9dp"
diff --git a/demo/src/main/res/layout/popup_video_episode.xml b/demo/src/main/res/layout/popup_video_episode.xml
new file mode 100644
index 00000000..223cffb5
--- /dev/null
+++ b/demo/src/main/res/layout/popup_video_episode.xml
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/demo/src/main/res/layout/popup_video_speed.xml b/demo/src/main/res/layout/popup_video_speed.xml
new file mode 100644
index 00000000..34f2aaf5
--- /dev/null
+++ b/demo/src/main/res/layout/popup_video_speed.xml
@@ -0,0 +1,76 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/demo/src/main/res/layout/tab_video_episodes.xml b/demo/src/main/res/layout/tab_video_episodes.xml
new file mode 100644
index 00000000..6c39629f
--- /dev/null
+++ b/demo/src/main/res/layout/tab_video_episodes.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher.png b/demo/src/main/res/mipmap-hdpi/ic_launcher.png
similarity index 100%
rename from app/src/main/res/mipmap-hdpi/ic_launcher.png
rename to demo/src/main/res/mipmap-hdpi/ic_launcher.png
diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher.png b/demo/src/main/res/mipmap-mdpi/ic_launcher.png
similarity index 100%
rename from app/src/main/res/mipmap-mdpi/ic_launcher.png
rename to demo/src/main/res/mipmap-mdpi/ic_launcher.png
diff --git a/demo/src/main/res/mipmap-xhdpi/ag_btn_back_off_15s.png b/demo/src/main/res/mipmap-xhdpi/ag_btn_back_off_15s.png
new file mode 100644
index 00000000..1bc304dd
Binary files /dev/null and b/demo/src/main/res/mipmap-xhdpi/ag_btn_back_off_15s.png differ
diff --git a/demo/src/main/res/mipmap-xhdpi/ag_btn_fast_forward_15s.png b/demo/src/main/res/mipmap-xhdpi/ag_btn_fast_forward_15s.png
new file mode 100644
index 00000000..32d47745
Binary files /dev/null and b/demo/src/main/res/mipmap-xhdpi/ag_btn_fast_forward_15s.png differ
diff --git a/demo/src/main/res/mipmap-xhdpi/ag_btn_locking.png b/demo/src/main/res/mipmap-xhdpi/ag_btn_locking.png
new file mode 100644
index 00000000..c66fe501
Binary files /dev/null and b/demo/src/main/res/mipmap-xhdpi/ag_btn_locking.png differ
diff --git a/demo/src/main/res/mipmap-xhdpi/ag_btn_locking_pre.png b/demo/src/main/res/mipmap-xhdpi/ag_btn_locking_pre.png
new file mode 100644
index 00000000..45a900e8
Binary files /dev/null and b/demo/src/main/res/mipmap-xhdpi/ag_btn_locking_pre.png differ
diff --git a/demo/src/main/res/mipmap-xhdpi/ag_btn_movie_next.png b/demo/src/main/res/mipmap-xhdpi/ag_btn_movie_next.png
new file mode 100644
index 00000000..fc43dc44
Binary files /dev/null and b/demo/src/main/res/mipmap-xhdpi/ag_btn_movie_next.png differ
diff --git a/demo/src/main/res/mipmap-xhdpi/ag_btn_movie_play.png b/demo/src/main/res/mipmap-xhdpi/ag_btn_movie_play.png
new file mode 100644
index 00000000..f268af78
Binary files /dev/null and b/demo/src/main/res/mipmap-xhdpi/ag_btn_movie_play.png differ
diff --git a/demo/src/main/res/mipmap-xhdpi/ag_btn_movie_play_bottom.png b/demo/src/main/res/mipmap-xhdpi/ag_btn_movie_play_bottom.png
new file mode 100644
index 00000000..0b7dc1fd
Binary files /dev/null and b/demo/src/main/res/mipmap-xhdpi/ag_btn_movie_play_bottom.png differ
diff --git a/demo/src/main/res/mipmap-xhdpi/ag_btn_movie_stop_bottom.png b/demo/src/main/res/mipmap-xhdpi/ag_btn_movie_stop_bottom.png
new file mode 100644
index 00000000..3a30dd46
Binary files /dev/null and b/demo/src/main/res/mipmap-xhdpi/ag_btn_movie_stop_bottom.png differ
diff --git a/demo/src/main/res/mipmap-xhdpi/ag_btn_movie_suspend.png b/demo/src/main/res/mipmap-xhdpi/ag_btn_movie_suspend.png
new file mode 100644
index 00000000..2861cb07
Binary files /dev/null and b/demo/src/main/res/mipmap-xhdpi/ag_btn_movie_suspend.png differ
diff --git a/demo/src/main/res/mipmap-xhdpi/ag_btn_movie_unll_next.png b/demo/src/main/res/mipmap-xhdpi/ag_btn_movie_unll_next.png
new file mode 100644
index 00000000..8c4aea3f
Binary files /dev/null and b/demo/src/main/res/mipmap-xhdpi/ag_btn_movie_unll_next.png differ
diff --git a/demo/src/main/res/mipmap-xhdpi/ag_nav_return_1.png b/demo/src/main/res/mipmap-xhdpi/ag_nav_return_1.png
new file mode 100644
index 00000000..e4a1fab5
Binary files /dev/null and b/demo/src/main/res/mipmap-xhdpi/ag_nav_return_1.png differ
diff --git a/demo/src/main/res/mipmap-xhdpi/ag_nav_return_2.png b/demo/src/main/res/mipmap-xhdpi/ag_nav_return_2.png
new file mode 100644
index 00000000..a080f053
Binary files /dev/null and b/demo/src/main/res/mipmap-xhdpi/ag_nav_return_2.png differ
diff --git a/demo/src/main/res/mipmap-xhdpi/ag_throwing_screen.png b/demo/src/main/res/mipmap-xhdpi/ag_throwing_screen.png
new file mode 100644
index 00000000..67eda1ad
Binary files /dev/null and b/demo/src/main/res/mipmap-xhdpi/ag_throwing_screen.png differ
diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/demo/src/main/res/mipmap-xhdpi/ic_launcher.png
similarity index 100%
rename from app/src/main/res/mipmap-xhdpi/ic_launcher.png
rename to demo/src/main/res/mipmap-xhdpi/ic_launcher.png
diff --git a/demo/src/main/res/mipmap-xhdpi/lock.png b/demo/src/main/res/mipmap-xhdpi/lock.png
new file mode 100644
index 00000000..129fcef5
Binary files /dev/null and b/demo/src/main/res/mipmap-xhdpi/lock.png differ
diff --git a/demo/src/main/res/mipmap-xhdpi/share_normal.png b/demo/src/main/res/mipmap-xhdpi/share_normal.png
new file mode 100644
index 00000000..c67baa74
Binary files /dev/null and b/demo/src/main/res/mipmap-xhdpi/share_normal.png differ
diff --git a/demo/src/main/res/mipmap-xhdpi/share_pressed.png b/demo/src/main/res/mipmap-xhdpi/share_pressed.png
new file mode 100644
index 00000000..67ef7aee
Binary files /dev/null and b/demo/src/main/res/mipmap-xhdpi/share_pressed.png differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_add_star.png b/demo/src/main/res/mipmap-xhdpi/tiktok_add_star.png
similarity index 100%
rename from app/src/main/res/drawable-xxhdpi/ic_add_star.png
rename to demo/src/main/res/mipmap-xhdpi/tiktok_add_star.png
diff --git a/demo/src/main/res/mipmap-xhdpi/tiktok_bg_add.png b/demo/src/main/res/mipmap-xhdpi/tiktok_bg_add.png
new file mode 100644
index 00000000..275bc9eb
Binary files /dev/null and b/demo/src/main/res/mipmap-xhdpi/tiktok_bg_add.png differ
diff --git a/demo/src/main/res/mipmap-xhdpi/tiktok_btn_share.png b/demo/src/main/res/mipmap-xhdpi/tiktok_btn_share.png
new file mode 100644
index 00000000..5641f76b
Binary files /dev/null and b/demo/src/main/res/mipmap-xhdpi/tiktok_btn_share.png differ
diff --git a/demo/src/main/res/mipmap-xhdpi/unlock.png b/demo/src/main/res/mipmap-xhdpi/unlock.png
new file mode 100644
index 00000000..b56e83a2
Binary files /dev/null and b/demo/src/main/res/mipmap-xhdpi/unlock.png differ
diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/demo/src/main/res/mipmap-xxhdpi/ic_launcher.png
similarity index 100%
rename from app/src/main/res/mipmap-xxhdpi/ic_launcher.png
rename to demo/src/main/res/mipmap-xxhdpi/ic_launcher.png
diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/demo/src/main/res/mipmap-xxxhdpi/ic_launcher.png
similarity index 100%
rename from app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
rename to demo/src/main/res/mipmap-xxxhdpi/ic_launcher.png
diff --git a/app/src/main/res/values-w820dp/dimens.xml b/demo/src/main/res/values-w820dp/dimens.xml
similarity index 100%
rename from app/src/main/res/values-w820dp/dimens.xml
rename to demo/src/main/res/values-w820dp/dimens.xml
diff --git a/app/src/main/res/values/colors.xml b/demo/src/main/res/values/colors.xml
similarity index 65%
rename from app/src/main/res/values/colors.xml
rename to demo/src/main/res/values/colors.xml
index e1a56948..b97c57ef 100644
--- a/app/src/main/res/values/colors.xml
+++ b/demo/src/main/res/values/colors.xml
@@ -4,4 +4,7 @@
#303F9F
#FF4081
#9900ff00
+ #ff5c00
+ #333333
+ #ffffff
diff --git a/app/src/main/res/values/dimens.xml b/demo/src/main/res/values/dimens.xml
similarity index 63%
rename from app/src/main/res/values/dimens.xml
rename to demo/src/main/res/values/dimens.xml
index 47c82246..ed80efda 100644
--- a/app/src/main/res/values/dimens.xml
+++ b/demo/src/main/res/values/dimens.xml
@@ -2,4 +2,6 @@
16dp
16dp
+ 50dp
+ 50dp
diff --git a/app/src/main/res/values/ids.xml b/demo/src/main/res/values/ids.xml
similarity index 100%
rename from app/src/main/res/values/ids.xml
rename to demo/src/main/res/values/ids.xml
diff --git a/app/src/main/res/values/strings.xml b/demo/src/main/res/values/strings.xml
similarity index 100%
rename from app/src/main/res/values/strings.xml
rename to demo/src/main/res/values/strings.xml
diff --git a/app/src/main/res/values/styles.xml b/demo/src/main/res/values/styles.xml
similarity index 100%
rename from app/src/main/res/values/styles.xml
rename to demo/src/main/res/values/styles.xml
diff --git a/gradle.properties b/gradle.properties
new file mode 100755
index 00000000..017bba2a
--- /dev/null
+++ b/gradle.properties
@@ -0,0 +1,4 @@
+#org.gradle.jvmargs=-Xmx1536M
+
+android.useAndroidX = true
+android.enableJetifier = true
\ No newline at end of file
diff --git a/gradle/build_upload.gradle b/gradle/build_upload.gradle
index d14dd515..a1bf96ae 100644
--- a/gradle/build_upload.gradle
+++ b/gradle/build_upload.gradle
@@ -8,7 +8,7 @@ signing {
group = "cn.jzvd"
archivesBaseName = "jiaozivideoplayer"
-version = "7.2.2"
+version = "7.2.3"
uploadArchives {
repositories {
@@ -20,6 +20,30 @@ uploadArchives {
pom.project {
name 'jiaozivideoplayer'
packaging 'aar'
+ // optionally artifactId can be defined here
+ description 'android videoplayer videoview 安卓视频播放器 全屏 播放器列表全屏 仿今日头条UI'
+ url 'https://github.com/Jzvd/JiaoZiVideoPlayer'
+
+ scm {
+ connection 'https://github.com/Jzvd/JiaoZiVideoPlayer'
+ developerConnection 'https://github.com/Jzvd/JiaoZiVideoPlayer'
+ url 'https://github.com/Jzvd/JiaoZiVideoPlayer'
+ }
+
+ licenses {
+ license {
+ name 'MIT'
+ url 'http://mit-license.org/'
+ }
+ }
+
+ developers {
+ developer {
+ id 'Nathen'
+ name 'Nathen'
+ email '1066666651@qq.com'
+ }
+ }
}
}
}
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 7a33c7e9..793a5bd4 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-6.2.2-all.zip
diff --git a/jiaozivideoplayer/build.gradle b/library/build.gradle
similarity index 74%
rename from jiaozivideoplayer/build.gradle
rename to library/build.gradle
index f4b4f780..a190fb2d 100644
--- a/jiaozivideoplayer/build.gradle
+++ b/library/build.gradle
@@ -2,12 +2,13 @@ apply plugin: 'com.android.library'
android {
compileSdkVersion 29
+ buildToolsVersion = '29.0.3'
defaultConfig {
minSdkVersion 16
targetSdkVersion 29
- versionCode 97
- versionName "7.2.2"
+ versionCode 98
+ versionName "7.2.3"
}
compileOptions {
@@ -22,8 +23,6 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
- testImplementation 'junit:junit:4.12'
- compileOnly 'androidx.appcompat:appcompat:1.1.0'
}
apply from: '../gradle/build_upload.gradle'
diff --git a/jiaozivideoplayer/src/main/AndroidManifest.xml b/library/src/main/AndroidManifest.xml
similarity index 100%
rename from jiaozivideoplayer/src/main/AndroidManifest.xml
rename to library/src/main/AndroidManifest.xml
diff --git a/jiaozivideoplayer/src/main/java/cn/jzvd/JZDataSource.java b/library/src/main/java/cn/jzvd/JZDataSource.java
similarity index 100%
rename from jiaozivideoplayer/src/main/java/cn/jzvd/JZDataSource.java
rename to library/src/main/java/cn/jzvd/JZDataSource.java
diff --git a/jiaozivideoplayer/src/main/java/cn/jzvd/JZMediaInterface.java b/library/src/main/java/cn/jzvd/JZMediaInterface.java
similarity index 100%
rename from jiaozivideoplayer/src/main/java/cn/jzvd/JZMediaInterface.java
rename to library/src/main/java/cn/jzvd/JZMediaInterface.java
diff --git a/jiaozivideoplayer/src/main/java/cn/jzvd/JZMediaSystem.java b/library/src/main/java/cn/jzvd/JZMediaSystem.java
similarity index 96%
rename from jiaozivideoplayer/src/main/java/cn/jzvd/JZMediaSystem.java
rename to library/src/main/java/cn/jzvd/JZMediaSystem.java
index 09c1a424..477dfaf6 100644
--- a/jiaozivideoplayer/src/main/java/cn/jzvd/JZMediaSystem.java
+++ b/library/src/main/java/cn/jzvd/JZMediaSystem.java
@@ -4,13 +4,10 @@
import android.media.AudioManager;
import android.media.MediaPlayer;
import android.media.PlaybackParams;
-import android.os.Build;
import android.os.Handler;
import android.os.HandlerThread;
import android.view.Surface;
-import androidx.annotation.RequiresApi;
-
import java.lang.reflect.Method;
import java.util.Map;
@@ -127,12 +124,13 @@ public void setVolume(float leftVolume, float rightVolume) {
});
}
- @RequiresApi(api = Build.VERSION_CODES.M)
@Override
public void setSpeed(float speed) {
- PlaybackParams pp = mediaPlayer.getPlaybackParams();
- pp.setSpeed(speed);
- mediaPlayer.setPlaybackParams(pp);
+ if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M) {
+ PlaybackParams pp = mediaPlayer.getPlaybackParams();
+ pp.setSpeed(speed);
+ mediaPlayer.setPlaybackParams(pp);
+ }
}
@Override
diff --git a/jiaozivideoplayer/src/main/java/cn/jzvd/JZTextureView.java b/library/src/main/java/cn/jzvd/JZTextureView.java
similarity index 100%
rename from jiaozivideoplayer/src/main/java/cn/jzvd/JZTextureView.java
rename to library/src/main/java/cn/jzvd/JZTextureView.java
diff --git a/jiaozivideoplayer/src/main/java/cn/jzvd/JZUtils.java b/library/src/main/java/cn/jzvd/JZUtils.java
similarity index 86%
rename from jiaozivideoplayer/src/main/java/cn/jzvd/JZUtils.java
rename to library/src/main/java/cn/jzvd/JZUtils.java
index 6bcf5d96..d3feba7b 100755
--- a/jiaozivideoplayer/src/main/java/cn/jzvd/JZUtils.java
+++ b/library/src/main/java/cn/jzvd/JZUtils.java
@@ -12,9 +12,6 @@
import android.view.Window;
import android.view.WindowManager;
-import androidx.appcompat.app.AppCompatActivity;
-import androidx.appcompat.view.ContextThemeWrapper;
-
import java.util.Formatter;
import java.util.Locale;
@@ -73,25 +70,9 @@ public static Activity scanForActivity(Context context) {
return null;
}
- /**
- * Get AppCompatActivity from context
- *
- * @param context context
- * @return AppCompatActivity if it's not null
- */
- public static AppCompatActivity getAppCompActivity(Context context) {
- if (context == null) return null;
- if (context instanceof AppCompatActivity) {
- return (AppCompatActivity) context;
- } else if (context instanceof ContextThemeWrapper) {
- return getAppCompActivity(((ContextThemeWrapper) context).getBaseContext());
- }
- return null;
- }
-
public static void setRequestedOrientation(Context context, int orientation) {
- if (JZUtils.getAppCompActivity(context) != null) {
- JZUtils.getAppCompActivity(context).setRequestedOrientation(
+ if (JZUtils.scanForActivity(context) != null) {
+ JZUtils.scanForActivity(context).setRequestedOrientation(
orientation);
} else {
JZUtils.scanForActivity(context).setRequestedOrientation(
@@ -100,8 +81,8 @@ public static void setRequestedOrientation(Context context, int orientation) {
}
public static Window getWindow(Context context) {
- if (JZUtils.getAppCompActivity(context) != null) {
- return JZUtils.getAppCompActivity(context).getWindow();
+ if (JZUtils.scanForActivity(context) != null) {
+ return JZUtils.scanForActivity(context).getWindow();
} else {
return JZUtils.scanForActivity(context).getWindow();
}
diff --git a/jiaozivideoplayer/src/main/java/cn/jzvd/Jzvd.java b/library/src/main/java/cn/jzvd/Jzvd.java
similarity index 99%
rename from jiaozivideoplayer/src/main/java/cn/jzvd/Jzvd.java
rename to library/src/main/java/cn/jzvd/Jzvd.java
index 7acf5dc1..b041a0e0 100644
--- a/jiaozivideoplayer/src/main/java/cn/jzvd/Jzvd.java
+++ b/library/src/main/java/cn/jzvd/Jzvd.java
@@ -29,6 +29,8 @@
import java.util.Timer;
import java.util.TimerTask;
+import javax.sql.DataSource;
+
/**
* Created by Nathen on 16/7/30.
*/
@@ -361,6 +363,12 @@ public void onStatePreparingChangeUrl() {
// mediaInterface.prepare();
}
+ public void changeUrl(JZDataSource jzDataSource, long seekToInAdvance) {
+ this.jzDataSource = jzDataSource;
+ this.seekToInAdvance = seekToInAdvance;
+ onStatePreparingChangeUrl();
+ }
+
public void onPrepared() {
Log.i(TAG, "onPrepared " + " [" + this.hashCode() + "] ");
state = STATE_PREPARED;
@@ -510,8 +518,7 @@ public void reset() {
/**
* 里面的的onState...()其实就是setState...(),因为要可以被复写,所以参考Activity的onCreate(),onState..()的方式看着舒服一些,老铁们有何高见。
- *
- * @param state
+ * @param state stateId
*/
public void setState(int state) {
switch (state) {
diff --git a/jiaozivideoplayer/src/main/java/cn/jzvd/JzvdStd.java b/library/src/main/java/cn/jzvd/JzvdStd.java
similarity index 99%
rename from jiaozivideoplayer/src/main/java/cn/jzvd/JzvdStd.java
rename to library/src/main/java/cn/jzvd/JzvdStd.java
index a05e8cf2..47611e2c 100644
--- a/jiaozivideoplayer/src/main/java/cn/jzvd/JzvdStd.java
+++ b/library/src/main/java/cn/jzvd/JzvdStd.java
@@ -280,9 +280,11 @@ public void onClick(View v) {
OnClickListener mQualityListener = v1 -> {
int index = (int) v1.getTag();
- this.seekToInAdvance = getCurrentPositionWhenPlaying();
+// this.seekToInAdvance = getCurrentPositionWhenPlaying();
jzDataSource.currentUrlIndex = index;
- onStatePreparingChangeUrl();
+// onStatePreparingChangeUrl();
+
+ changeUrl(jzDataSource, getCurrentPositionWhenPlaying());
clarity.setText(jzDataSource.getCurrentKey().toString());
for (int j = 0; j < layout.getChildCount(); j++) {//设置点击之后的颜色
diff --git a/jiaozivideoplayer/src/main/res/drawable-xhdpi/jz_add_volume.png b/library/src/main/res/drawable-xhdpi/jz_add_volume.png
similarity index 100%
rename from jiaozivideoplayer/src/main/res/drawable-xhdpi/jz_add_volume.png
rename to library/src/main/res/drawable-xhdpi/jz_add_volume.png
diff --git a/jiaozivideoplayer/src/main/res/drawable-xhdpi/jz_back_normal.png b/library/src/main/res/drawable-xhdpi/jz_back_normal.png
similarity index 100%
rename from jiaozivideoplayer/src/main/res/drawable-xhdpi/jz_back_normal.png
rename to library/src/main/res/drawable-xhdpi/jz_back_normal.png
diff --git a/jiaozivideoplayer/src/main/res/drawable-xhdpi/jz_back_pressed.png b/library/src/main/res/drawable-xhdpi/jz_back_pressed.png
similarity index 100%
rename from jiaozivideoplayer/src/main/res/drawable-xhdpi/jz_back_pressed.png
rename to library/src/main/res/drawable-xhdpi/jz_back_pressed.png
diff --git a/jiaozivideoplayer/src/main/res/drawable-xhdpi/jz_back_tiny_normal.png b/library/src/main/res/drawable-xhdpi/jz_back_tiny_normal.png
similarity index 100%
rename from jiaozivideoplayer/src/main/res/drawable-xhdpi/jz_back_tiny_normal.png
rename to library/src/main/res/drawable-xhdpi/jz_back_tiny_normal.png
diff --git a/jiaozivideoplayer/src/main/res/drawable-xhdpi/jz_back_tiny_pressed.png b/library/src/main/res/drawable-xhdpi/jz_back_tiny_pressed.png
similarity index 100%
rename from jiaozivideoplayer/src/main/res/drawable-xhdpi/jz_back_tiny_pressed.png
rename to library/src/main/res/drawable-xhdpi/jz_back_tiny_pressed.png
diff --git a/jiaozivideoplayer/src/main/res/drawable-xhdpi/jz_backward_icon.png b/library/src/main/res/drawable-xhdpi/jz_backward_icon.png
similarity index 100%
rename from jiaozivideoplayer/src/main/res/drawable-xhdpi/jz_backward_icon.png
rename to library/src/main/res/drawable-xhdpi/jz_backward_icon.png
diff --git a/jiaozivideoplayer/src/main/res/drawable-xhdpi/jz_battery_level_10.png b/library/src/main/res/drawable-xhdpi/jz_battery_level_10.png
similarity index 100%
rename from jiaozivideoplayer/src/main/res/drawable-xhdpi/jz_battery_level_10.png
rename to library/src/main/res/drawable-xhdpi/jz_battery_level_10.png
diff --git a/jiaozivideoplayer/src/main/res/drawable-xhdpi/jz_battery_level_100.png b/library/src/main/res/drawable-xhdpi/jz_battery_level_100.png
similarity index 100%
rename from jiaozivideoplayer/src/main/res/drawable-xhdpi/jz_battery_level_100.png
rename to library/src/main/res/drawable-xhdpi/jz_battery_level_100.png
diff --git a/jiaozivideoplayer/src/main/res/drawable-xhdpi/jz_battery_level_30.png b/library/src/main/res/drawable-xhdpi/jz_battery_level_30.png
similarity index 100%
rename from jiaozivideoplayer/src/main/res/drawable-xhdpi/jz_battery_level_30.png
rename to library/src/main/res/drawable-xhdpi/jz_battery_level_30.png
diff --git a/jiaozivideoplayer/src/main/res/drawable-xhdpi/jz_battery_level_50.png b/library/src/main/res/drawable-xhdpi/jz_battery_level_50.png
similarity index 100%
rename from jiaozivideoplayer/src/main/res/drawable-xhdpi/jz_battery_level_50.png
rename to library/src/main/res/drawable-xhdpi/jz_battery_level_50.png
diff --git a/jiaozivideoplayer/src/main/res/drawable-xhdpi/jz_battery_level_70.png b/library/src/main/res/drawable-xhdpi/jz_battery_level_70.png
similarity index 100%
rename from jiaozivideoplayer/src/main/res/drawable-xhdpi/jz_battery_level_70.png
rename to library/src/main/res/drawable-xhdpi/jz_battery_level_70.png
diff --git a/jiaozivideoplayer/src/main/res/drawable-xhdpi/jz_battery_level_90.png b/library/src/main/res/drawable-xhdpi/jz_battery_level_90.png
similarity index 100%
rename from jiaozivideoplayer/src/main/res/drawable-xhdpi/jz_battery_level_90.png
rename to library/src/main/res/drawable-xhdpi/jz_battery_level_90.png
diff --git a/jiaozivideoplayer/src/main/res/drawable-xhdpi/jz_brightness_video.png b/library/src/main/res/drawable-xhdpi/jz_brightness_video.png
similarity index 100%
rename from jiaozivideoplayer/src/main/res/drawable-xhdpi/jz_brightness_video.png
rename to library/src/main/res/drawable-xhdpi/jz_brightness_video.png
diff --git a/jiaozivideoplayer/src/main/res/drawable-xhdpi/jz_clarity_popwindow_bg.9.png b/library/src/main/res/drawable-xhdpi/jz_clarity_popwindow_bg.9.png
similarity index 100%
rename from jiaozivideoplayer/src/main/res/drawable-xhdpi/jz_clarity_popwindow_bg.9.png
rename to library/src/main/res/drawable-xhdpi/jz_clarity_popwindow_bg.9.png
diff --git a/jiaozivideoplayer/src/main/res/drawable-xhdpi/jz_close_volume.png b/library/src/main/res/drawable-xhdpi/jz_close_volume.png
similarity index 100%
rename from jiaozivideoplayer/src/main/res/drawable-xhdpi/jz_close_volume.png
rename to library/src/main/res/drawable-xhdpi/jz_close_volume.png
diff --git a/jiaozivideoplayer/src/main/res/drawable-xhdpi/jz_enlarge.png b/library/src/main/res/drawable-xhdpi/jz_enlarge.png
similarity index 100%
rename from jiaozivideoplayer/src/main/res/drawable-xhdpi/jz_enlarge.png
rename to library/src/main/res/drawable-xhdpi/jz_enlarge.png
diff --git a/jiaozivideoplayer/src/main/res/drawable-xhdpi/jz_forward_icon.png b/library/src/main/res/drawable-xhdpi/jz_forward_icon.png
similarity index 100%
rename from jiaozivideoplayer/src/main/res/drawable-xhdpi/jz_forward_icon.png
rename to library/src/main/res/drawable-xhdpi/jz_forward_icon.png
diff --git a/jiaozivideoplayer/src/main/res/drawable-xhdpi/jz_loading_bg.png b/library/src/main/res/drawable-xhdpi/jz_loading_bg.png
similarity index 100%
rename from jiaozivideoplayer/src/main/res/drawable-xhdpi/jz_loading_bg.png
rename to library/src/main/res/drawable-xhdpi/jz_loading_bg.png
diff --git a/jiaozivideoplayer/src/main/res/drawable-xhdpi/jz_pause_normal.png b/library/src/main/res/drawable-xhdpi/jz_pause_normal.png
similarity index 100%
rename from jiaozivideoplayer/src/main/res/drawable-xhdpi/jz_pause_normal.png
rename to library/src/main/res/drawable-xhdpi/jz_pause_normal.png
diff --git a/jiaozivideoplayer/src/main/res/drawable-xhdpi/jz_pause_pressed.png b/library/src/main/res/drawable-xhdpi/jz_pause_pressed.png
similarity index 100%
rename from jiaozivideoplayer/src/main/res/drawable-xhdpi/jz_pause_pressed.png
rename to library/src/main/res/drawable-xhdpi/jz_pause_pressed.png
diff --git a/jiaozivideoplayer/src/main/res/drawable-xhdpi/jz_play_normal.png b/library/src/main/res/drawable-xhdpi/jz_play_normal.png
similarity index 100%
rename from jiaozivideoplayer/src/main/res/drawable-xhdpi/jz_play_normal.png
rename to library/src/main/res/drawable-xhdpi/jz_play_normal.png
diff --git a/jiaozivideoplayer/src/main/res/drawable-xhdpi/jz_play_pressed.png b/library/src/main/res/drawable-xhdpi/jz_play_pressed.png
similarity index 100%
rename from jiaozivideoplayer/src/main/res/drawable-xhdpi/jz_play_pressed.png
rename to library/src/main/res/drawable-xhdpi/jz_play_pressed.png
diff --git a/jiaozivideoplayer/src/main/res/drawable-xhdpi/jz_restart_normal.png b/library/src/main/res/drawable-xhdpi/jz_restart_normal.png
similarity index 100%
rename from jiaozivideoplayer/src/main/res/drawable-xhdpi/jz_restart_normal.png
rename to library/src/main/res/drawable-xhdpi/jz_restart_normal.png
diff --git a/jiaozivideoplayer/src/main/res/drawable-xhdpi/jz_restart_pressed.png b/library/src/main/res/drawable-xhdpi/jz_restart_pressed.png
similarity index 100%
rename from jiaozivideoplayer/src/main/res/drawable-xhdpi/jz_restart_pressed.png
rename to library/src/main/res/drawable-xhdpi/jz_restart_pressed.png
diff --git a/jiaozivideoplayer/src/main/res/drawable-xhdpi/jz_share_normal.png b/library/src/main/res/drawable-xhdpi/jz_share_normal.png
similarity index 100%
rename from jiaozivideoplayer/src/main/res/drawable-xhdpi/jz_share_normal.png
rename to library/src/main/res/drawable-xhdpi/jz_share_normal.png
diff --git a/jiaozivideoplayer/src/main/res/drawable-xhdpi/jz_share_pressed.png b/library/src/main/res/drawable-xhdpi/jz_share_pressed.png
similarity index 100%
rename from jiaozivideoplayer/src/main/res/drawable-xhdpi/jz_share_pressed.png
rename to library/src/main/res/drawable-xhdpi/jz_share_pressed.png
diff --git a/jiaozivideoplayer/src/main/res/drawable-xhdpi/jz_shrink.png b/library/src/main/res/drawable-xhdpi/jz_shrink.png
similarity index 100%
rename from jiaozivideoplayer/src/main/res/drawable-xhdpi/jz_shrink.png
rename to library/src/main/res/drawable-xhdpi/jz_shrink.png
diff --git a/jiaozivideoplayer/src/main/res/drawable-xhdpi/jz_volume_icon.png b/library/src/main/res/drawable-xhdpi/jz_volume_icon.png
similarity index 100%
rename from jiaozivideoplayer/src/main/res/drawable-xhdpi/jz_volume_icon.png
rename to library/src/main/res/drawable-xhdpi/jz_volume_icon.png
diff --git a/jiaozivideoplayer/src/main/res/drawable/jz_bottom_bg.9.png b/library/src/main/res/drawable/jz_bottom_bg.9.png
similarity index 100%
rename from jiaozivideoplayer/src/main/res/drawable/jz_bottom_bg.9.png
rename to library/src/main/res/drawable/jz_bottom_bg.9.png
diff --git a/jiaozivideoplayer/src/main/res/drawable/jz_bottom_progress.xml b/library/src/main/res/drawable/jz_bottom_progress.xml
similarity index 100%
rename from jiaozivideoplayer/src/main/res/drawable/jz_bottom_progress.xml
rename to library/src/main/res/drawable/jz_bottom_progress.xml
diff --git a/jiaozivideoplayer/src/main/res/drawable/jz_bottom_seek_poster.xml b/library/src/main/res/drawable/jz_bottom_seek_poster.xml
similarity index 100%
rename from jiaozivideoplayer/src/main/res/drawable/jz_bottom_seek_poster.xml
rename to library/src/main/res/drawable/jz_bottom_seek_poster.xml
diff --git a/jiaozivideoplayer/src/main/res/drawable/jz_bottom_seek_progress.xml b/library/src/main/res/drawable/jz_bottom_seek_progress.xml
similarity index 100%
rename from jiaozivideoplayer/src/main/res/drawable/jz_bottom_seek_progress.xml
rename to library/src/main/res/drawable/jz_bottom_seek_progress.xml
diff --git a/jiaozivideoplayer/src/main/res/drawable-xxhdpi/jz_clarity_popwindow_bg.9.png b/library/src/main/res/drawable/jz_clarity_popwindow_bg.9.png
similarity index 100%
rename from jiaozivideoplayer/src/main/res/drawable-xxhdpi/jz_clarity_popwindow_bg.9.png
rename to library/src/main/res/drawable/jz_clarity_popwindow_bg.9.png
diff --git a/jiaozivideoplayer/src/main/res/drawable/jz_click_back_selector.xml b/library/src/main/res/drawable/jz_click_back_selector.xml
similarity index 100%
rename from jiaozivideoplayer/src/main/res/drawable/jz_click_back_selector.xml
rename to library/src/main/res/drawable/jz_click_back_selector.xml
diff --git a/jiaozivideoplayer/src/main/res/drawable/jz_click_back_tiny_selector.xml b/library/src/main/res/drawable/jz_click_back_tiny_selector.xml
similarity index 100%
rename from jiaozivideoplayer/src/main/res/drawable/jz_click_back_tiny_selector.xml
rename to library/src/main/res/drawable/jz_click_back_tiny_selector.xml
diff --git a/jiaozivideoplayer/src/main/res/drawable/jz_click_pause_selector.xml b/library/src/main/res/drawable/jz_click_pause_selector.xml
similarity index 100%
rename from jiaozivideoplayer/src/main/res/drawable/jz_click_pause_selector.xml
rename to library/src/main/res/drawable/jz_click_pause_selector.xml
diff --git a/jiaozivideoplayer/src/main/res/drawable/jz_click_play_selector.xml b/library/src/main/res/drawable/jz_click_play_selector.xml
similarity index 100%
rename from jiaozivideoplayer/src/main/res/drawable/jz_click_play_selector.xml
rename to library/src/main/res/drawable/jz_click_play_selector.xml
diff --git a/jiaozivideoplayer/src/main/res/drawable/jz_click_replay_selector.xml b/library/src/main/res/drawable/jz_click_replay_selector.xml
similarity index 100%
rename from jiaozivideoplayer/src/main/res/drawable/jz_click_replay_selector.xml
rename to library/src/main/res/drawable/jz_click_replay_selector.xml
diff --git a/jiaozivideoplayer/src/main/res/drawable/jz_click_share_selector.xml b/library/src/main/res/drawable/jz_click_share_selector.xml
similarity index 100%
rename from jiaozivideoplayer/src/main/res/drawable/jz_click_share_selector.xml
rename to library/src/main/res/drawable/jz_click_share_selector.xml
diff --git a/jiaozivideoplayer/src/main/res/drawable/jz_dialog_progress.xml b/library/src/main/res/drawable/jz_dialog_progress.xml
similarity index 100%
rename from jiaozivideoplayer/src/main/res/drawable/jz_dialog_progress.xml
rename to library/src/main/res/drawable/jz_dialog_progress.xml
diff --git a/jiaozivideoplayer/src/main/res/drawable/jz_dialog_progress_bg.xml b/library/src/main/res/drawable/jz_dialog_progress_bg.xml
similarity index 100%
rename from jiaozivideoplayer/src/main/res/drawable/jz_dialog_progress_bg.xml
rename to library/src/main/res/drawable/jz_dialog_progress_bg.xml
diff --git a/jiaozivideoplayer/src/main/res/drawable/jz_loading.xml b/library/src/main/res/drawable/jz_loading.xml
similarity index 100%
rename from jiaozivideoplayer/src/main/res/drawable/jz_loading.xml
rename to library/src/main/res/drawable/jz_loading.xml
diff --git a/jiaozivideoplayer/src/main/res/drawable/retry_bg.xml b/library/src/main/res/drawable/jz_retry.xml
similarity index 100%
rename from jiaozivideoplayer/src/main/res/drawable/retry_bg.xml
rename to library/src/main/res/drawable/jz_retry.xml
diff --git a/jiaozivideoplayer/src/main/res/drawable/jz_seek_poster_normal.xml b/library/src/main/res/drawable/jz_seek_poster_normal.xml
similarity index 100%
rename from jiaozivideoplayer/src/main/res/drawable/jz_seek_poster_normal.xml
rename to library/src/main/res/drawable/jz_seek_poster_normal.xml
diff --git a/jiaozivideoplayer/src/main/res/drawable/jz_seek_poster_pressed.xml b/library/src/main/res/drawable/jz_seek_poster_pressed.xml
similarity index 100%
rename from jiaozivideoplayer/src/main/res/drawable/jz_seek_poster_pressed.xml
rename to library/src/main/res/drawable/jz_seek_poster_pressed.xml
diff --git a/jiaozivideoplayer/src/main/res/drawable/jz_title_bg.9.png b/library/src/main/res/drawable/jz_title_bg.9.png
similarity index 100%
rename from jiaozivideoplayer/src/main/res/drawable/jz_title_bg.9.png
rename to library/src/main/res/drawable/jz_title_bg.9.png
diff --git a/jiaozivideoplayer/src/main/res/drawable/jz_volume_progress_bg.xml b/library/src/main/res/drawable/jz_volume_progress_bg.xml
similarity index 100%
rename from jiaozivideoplayer/src/main/res/drawable/jz_volume_progress_bg.xml
rename to library/src/main/res/drawable/jz_volume_progress_bg.xml
diff --git a/jiaozivideoplayer/src/main/res/layout/jz_dialog_brightness.xml b/library/src/main/res/layout/jz_dialog_brightness.xml
similarity index 100%
rename from jiaozivideoplayer/src/main/res/layout/jz_dialog_brightness.xml
rename to library/src/main/res/layout/jz_dialog_brightness.xml
diff --git a/jiaozivideoplayer/src/main/res/layout/jz_dialog_progress.xml b/library/src/main/res/layout/jz_dialog_progress.xml
similarity index 100%
rename from jiaozivideoplayer/src/main/res/layout/jz_dialog_progress.xml
rename to library/src/main/res/layout/jz_dialog_progress.xml
diff --git a/jiaozivideoplayer/src/main/res/layout/jz_dialog_volume.xml b/library/src/main/res/layout/jz_dialog_volume.xml
similarity index 100%
rename from jiaozivideoplayer/src/main/res/layout/jz_dialog_volume.xml
rename to library/src/main/res/layout/jz_dialog_volume.xml
diff --git a/jiaozivideoplayer/src/main/res/layout/jz_layout_clarity.xml b/library/src/main/res/layout/jz_layout_clarity.xml
similarity index 100%
rename from jiaozivideoplayer/src/main/res/layout/jz_layout_clarity.xml
rename to library/src/main/res/layout/jz_layout_clarity.xml
diff --git a/jiaozivideoplayer/src/main/res/layout/jz_layout_clarity_item.xml b/library/src/main/res/layout/jz_layout_clarity_item.xml
similarity index 100%
rename from jiaozivideoplayer/src/main/res/layout/jz_layout_clarity_item.xml
rename to library/src/main/res/layout/jz_layout_clarity_item.xml
diff --git a/jiaozivideoplayer/src/main/res/layout/jz_layout_std.xml b/library/src/main/res/layout/jz_layout_std.xml
similarity index 99%
rename from jiaozivideoplayer/src/main/res/layout/jz_layout_std.xml
rename to library/src/main/res/layout/jz_layout_std.xml
index ffd31558..384a7265 100644
--- a/jiaozivideoplayer/src/main/res/layout/jz_layout_std.xml
+++ b/library/src/main/res/layout/jz_layout_std.xml
@@ -233,7 +233,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
- android:background="@drawable/retry_bg"
+ android:background="@drawable/jz_retry"
android:paddingLeft="9dp"
android:paddingTop="4dp"
android:paddingRight="9dp"
diff --git a/jiaozivideoplayer/src/main/res/values-es/strings.xml b/library/src/main/res/values-es/strings.xml
similarity index 100%
rename from jiaozivideoplayer/src/main/res/values-es/strings.xml
rename to library/src/main/res/values-es/strings.xml
diff --git a/jiaozivideoplayer/src/main/res/values-ja-rJP/strings.xml b/library/src/main/res/values-ja-rJP/strings.xml
similarity index 100%
rename from jiaozivideoplayer/src/main/res/values-ja-rJP/strings.xml
rename to library/src/main/res/values-ja-rJP/strings.xml
diff --git a/jiaozivideoplayer/src/main/res/values-ko-rKR/strings.xml b/library/src/main/res/values-ko-rKR/strings.xml
similarity index 100%
rename from jiaozivideoplayer/src/main/res/values-ko-rKR/strings.xml
rename to library/src/main/res/values-ko-rKR/strings.xml
diff --git a/jiaozivideoplayer/src/main/res/values-pt/strings.xml b/library/src/main/res/values-pt/strings.xml
similarity index 100%
rename from jiaozivideoplayer/src/main/res/values-pt/strings.xml
rename to library/src/main/res/values-pt/strings.xml
diff --git a/jiaozivideoplayer/src/main/res/values-tr/strings.xml b/library/src/main/res/values-tr/strings.xml
similarity index 100%
rename from jiaozivideoplayer/src/main/res/values-tr/strings.xml
rename to library/src/main/res/values-tr/strings.xml
diff --git a/jiaozivideoplayer/src/main/res/values-zh/strings.xml b/library/src/main/res/values-zh/strings.xml
similarity index 100%
rename from jiaozivideoplayer/src/main/res/values-zh/strings.xml
rename to library/src/main/res/values-zh/strings.xml
diff --git a/jiaozivideoplayer/src/main/res/values/dimens.xml b/library/src/main/res/values/dimens.xml
similarity index 100%
rename from jiaozivideoplayer/src/main/res/values/dimens.xml
rename to library/src/main/res/values/dimens.xml
diff --git a/jiaozivideoplayer/src/main/res/values/strings.xml b/library/src/main/res/values/strings.xml
similarity index 100%
rename from jiaozivideoplayer/src/main/res/values/strings.xml
rename to library/src/main/res/values/strings.xml
diff --git a/jiaozivideoplayer/src/main/res/values/styles.xml b/library/src/main/res/values/styles.xml
similarity index 100%
rename from jiaozivideoplayer/src/main/res/values/styles.xml
rename to library/src/main/res/values/styles.xml
diff --git a/jiaozivideoplayer/src/main/res/xml/jz_network_security_config.xml b/library/src/main/res/xml/jz_network_security_config.xml
similarity index 100%
rename from jiaozivideoplayer/src/main/res/xml/jz_network_security_config.xml
rename to library/src/main/res/xml/jz_network_security_config.xml
diff --git a/settings.gradle b/settings.gradle
index 0e1dd8d6..462ba77a 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -1 +1 @@
-include ':app', ':jiaozivideoplayer'
+include ':demo', ':library'