diff --git a/.gitignore b/.gitignore
index 70568af6b..680c1a544 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,7 +5,8 @@ gradle.properties
/local.properties
.idea
.DS_Store
-/build
+build
/captures
*.asc
-projectFilesBackup
\ No newline at end of file
+projectFilesBackup
+release
\ No newline at end of file
diff --git a/README-ZH.md b/README-ZH.md
index 4a25659fd..c061a5bc1 100644
--- a/README-ZH.md
+++ b/README-ZH.md
@@ -2,7 +2,7 @@
--
-
+
@@ -29,7 +29,7 @@
## 效果
-**[jiaozivideoplayer-6.1.0_preview.apk](https://github.com/lipangit/JieCaoVideoPlayer/releases/download/v6.1.0_preview/jiaozivideoplayer-6.1.0_preview.apk)**
+**[jiaozivideoplayer-6.1.1.apk](https://github.com/lipangit/JiaoZiVideoPlayer/releases/download/6.1.1/jiaozivideoplayer-6.1.1.apk)**
![Demo Screenshot][1]
@@ -39,10 +39,10 @@
1.添加类库
```gradle
-compile 'cn.jzvd:jiaozivideoplayer:6.1.0_preview'
+compile 'cn.jzvd:jiaozivideoplayer:6.1.1'
```
-[或直接下载jar包](https://github.com/lipangit/JiaoZiVideoPlayer/releases/tag/v6.1.0_preview) 不建议
+[或直接下载jar包](https://github.com/lipangit/JiaoZiVideoPlayer/releases/tag/v6.1.1) 不建议
2.添加布局
```xml
diff --git a/README.md b/README.md
index 0f7ad5ab0..2d992a6fa 100644
--- a/README.md
+++ b/README.md
@@ -2,16 +2,16 @@
--
-
+
-* This project need translators, you can change everything edit readme, release note, formate variable and annotation.
+* This project needs translators, you can change everything editing readme, release note, formate variable and annotation.
-#### Ambition is become the most widely used video playback control. Q群:490442439 验证信息:jzvd
+#### Ambition is becoming the most widely used video playback control. Q群:490442439 验证信息:jzvd
-I think the final solution for play video in android is android.media.MediaPlayer, other player is not in the trend, even if the android.media.MediaPlayer have disavantages we should make concession, if android.media.MediaPlayer have defect we will think to change other player.
+I think the final solution to video in android is `android.media.MediaPlayer`, other players are not in the trend, even if the `android.media.MediaPlayer` has disavantages we should make concession, if `android.media.MediaPlayer` has defect we will consider to change other player.
[中文文档](README-ZH.md) [WorkPlan](https://github.com/lipangit/JiaoZiVideoPlayer/projects/2) [Weibo](http://weibo.com/2342820395/profile?topnav=1&wvr=6&is_all=1) [VideoTutorial](https://github.com/lipangit/JiaoZiVideoPlayer/wiki/%E8%A7%86%E9%A2%91%E6%95%99%E7%A8%8B)
@@ -31,7 +31,7 @@ I think the final solution for play video in android is android.media.MediaPlaye
## Effect
-**[jiaozivideoplayer-6.1.0_preview.apk](https://github.com/lipangit/JieCaoVideoPlayer/releases/download/v6.1.0_preview/jiaozivideoplayer-6.1.0_preview.apk)**
+**[jiaozivideoplayer-6.1.1.apk](https://github.com/lipangit/JiaoZiVideoPlayer/releases/download/6.1.1/jiaozivideoplayer-6.1.1.apk)**
![Demo Screenshot][1]
@@ -41,10 +41,10 @@ Even the custom UI, or has changed to the Library, is also the five steps to use
1.Import library
```gradle
-compile 'cn.jzvd:jiaozivideoplayer:6.1.0_preview'
+compile 'cn.jzvd:jiaozivideoplayer:6.1.1'
```
-[Or download lib](https://github.com/lipangit/JiaoZiVideoPlayer/releases/tag/v6.1.0_preview) not recommended
+[Or download lib](https://github.com/lipangit/JiaoZiVideoPlayer/releases/tag/v6.1.1) not recommended
2.Add JZVideoPlayer in your layout
```xml
@@ -150,4 +150,4 @@ The above copyright notice and this permission notice shall be included in all c
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
[1]: https://user-images.githubusercontent.com/2038071/31045150-a077cc8a-a5a2-11e7-8dc2-7a0e3a9f3e62.jpg
-[2]: https://user-images.githubusercontent.com/2038071/29978804-45c321ba-8f75-11e7-9040-776d3b6dca1f.jpg
\ No newline at end of file
+[2]: https://user-images.githubusercontent.com/2038071/29978804-45c321ba-8f75-11e7-9040-776d3b6dca1f.jpg
diff --git a/app/.gitignore b/app/.gitignore
deleted file mode 100644
index 796b96d1c..000000000
--- a/app/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/build
diff --git a/app/build.gradle b/app/build.gradle
index 3ae5dfaf3..eccba311a 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -1,20 +1,29 @@
apply plugin: 'com.android.application'
android {
- compileSdkVersion 26
- buildToolsVersion '26.0.1'
+ compileSdkVersion 27
+ buildToolsVersion '27.0.0'
defaultConfig {
applicationId "cn.jzvd.demo"
minSdkVersion 16
- targetSdkVersion 26
- versionCode 68
- versionName "6.1.0_preview"
+ targetSdkVersion 27
+ versionCode 69
+ versionName "6.1.1"
+ }
+ signingConfigs {
+ releaseConfig {
+ storeFile file("jzvd-keystore")
+ storePassword "123456"
+ keyAlias "key0"
+ keyPassword "123456"
+ }
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+ signingConfig signingConfigs.releaseConfig
}
}
lintOptions {
@@ -25,13 +34,13 @@ android {
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
- compile 'com.android.support:appcompat-v7:25.3.1'
+ compile 'com.android.support:appcompat-v7:27.0.0'
compile project(':jiaozivideoplayer')
- compile 'com.squareup.picasso:picasso:2.5.1'
+ compile 'com.squareup.picasso:picasso:2.5.2'
- debugCompile 'com.squareup.leakcanary:leakcanary-android:1.4-beta2'
- releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta2'
- testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta2'
+ debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5'
+ releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'
+ testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'
- compile 'com.android.support:recyclerview-v7:25.3.1'
+ compile 'com.android.support:recyclerview-v7:27.0.0'
}
diff --git a/app/jzvd-keystore b/app/jzvd-keystore
new file mode 100644
index 000000000..efe061247
Binary files /dev/null and b/app/jzvd-keystore differ
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index a99bcb6d0..2cc47f836 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -40,7 +40,7 @@
android:configChanges="orientation|screenSize|keyboardHidden"
android:screenOrientation="portrait" />
fragmentList = new ArrayList<>();
@Override
@@ -28,7 +28,7 @@ protected void onCreate(Bundle savedInstanceState) {
getSupportActionBar().setDisplayShowHomeEnabled(true);
getSupportActionBar().setDisplayShowTitleEnabled(true);
getSupportActionBar().setDisplayUseLogoEnabled(false);
- getSupportActionBar().setTitle("ViewPagerAndListView");
+ getSupportActionBar().setTitle("ListViewFragmentViewPagerActivity");
fragmentList.add(new DemoFragment().setIndex(0));
fragmentList.add(new DemoFragment().setIndex(1));
diff --git a/app/src/main/java/cn/jzvd/demo/ListViewMultiHolderActivity.java b/app/src/main/java/cn/jzvd/demo/ListViewMultiHolderActivity.java
index 67a817720..539b25af5 100755
--- a/app/src/main/java/cn/jzvd/demo/ListViewMultiHolderActivity.java
+++ b/app/src/main/java/cn/jzvd/demo/ListViewMultiHolderActivity.java
@@ -7,6 +7,7 @@
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
+import android.widget.AbsListView;
import android.widget.BaseAdapter;
import android.widget.ListView;
import android.widget.TextView;
@@ -38,6 +39,18 @@ protected void onCreate(Bundle savedInstanceState) {
listView = (ListView) findViewById(R.id.listview);
mAdapter = new VideoListAdapter(this);
listView.setAdapter(mAdapter);
+
+ listView.setOnScrollListener(new AbsListView.OnScrollListener() {
+ @Override
+ public void onScrollStateChanged(AbsListView view, int scrollState) {
+
+ }
+
+ @Override
+ public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
+ JZVideoPlayer.onScrollReleaseAllVideos(view, firstVisibleItem, visibleItemCount, totalItemCount);
+ }
+ });
}
@Override
@@ -93,10 +106,6 @@ public long getItemId(int position) {
@Override
public View getView(int position, View convertView, ViewGroup parent) {
- //This is the point
- if (convertView != null && convertView.getTag() != null && convertView.getTag() instanceof VideoHolder) {
- ((VideoHolder) convertView.getTag()).jzVideoPlayer.release();
- }
if (getItemViewType(position) == 1) {
VideoHolder viewHolder;
if (convertView != null && convertView.getTag() != null && convertView.getTag() instanceof VideoHolder) {
@@ -111,7 +120,7 @@ public View getView(int position, View convertView, ViewGroup parent) {
viewHolder.jzVideoPlayer.setUp(
VideoConstant.videoUrls[0][position], JZVideoPlayer.SCREEN_LAYOUT_LIST,
VideoConstant.videoTitles[0][position]);
-
+ viewHolder.jzVideoPlayer.positionInList = position;
Picasso.with(ListViewMultiHolderActivity.this)
.load(VideoConstant.videoThumbs[0][position])
.into(viewHolder.jzVideoPlayer.thumbImageView);
diff --git a/app/src/main/java/cn/jzvd/demo/RecyclerViewNormalActivity.java b/app/src/main/java/cn/jzvd/demo/RecyclerViewNormalActivity.java
index f806b1f4f..d31c5be54 100644
--- a/app/src/main/java/cn/jzvd/demo/RecyclerViewNormalActivity.java
+++ b/app/src/main/java/cn/jzvd/demo/RecyclerViewNormalActivity.java
@@ -42,7 +42,6 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
@Override
public void onChildViewAttachedToWindow(View view) {
if (JZVideoPlayerManager.getCurrentJzvd() != null && JZVideoPlayerManager.getCurrentJzvd().currentScreen == JZVideoPlayer.SCREEN_WINDOW_TINY) {
- Log.e("jzvd", "onChildViewAttachedToWindow: attached");
JZVideoPlayer videoPlayer = view.findViewById(R.id.videoplayer);
if (JZUtils.getCurrentUrlFromMap(videoPlayer.urlMap, videoPlayer.currentUrlMapIndex).equals(JZMediaManager.CURRENT_PLAYING_URL)) {
JZVideoPlayer.backPress();
diff --git a/build.gradle b/build.gradle
index c2eea8e27..f93d60811 100644
--- a/build.gradle
+++ b/build.gradle
@@ -3,9 +3,10 @@
buildscript {
repositories {
jcenter()
+ google()
}
dependencies {
- classpath 'com.android.tools.build:gradle:2.3.3'
+ classpath 'com.android.tools.build:gradle:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
@@ -15,6 +16,7 @@ buildscript {
allprojects {
repositories {
jcenter()
+ google()
}
}
diff --git a/gradle/maven_push.gradle b/gradle/maven_push.gradle
index f1f089286..8fb115b9e 100644
--- a/gradle/maven_push.gradle
+++ b/gradle/maven_push.gradle
@@ -22,7 +22,7 @@ signing {
group = "cn.jzvd"
archivesBaseName = "jiaozivideoplayer"
-version = "6.1.0_preview"
+version = "6.1.1"
uploadArchives {
repositories {
diff --git a/jiaozivideoplayer/.gitignore b/jiaozivideoplayer/.gitignore
deleted file mode 100644
index 796b96d1c..000000000
--- a/jiaozivideoplayer/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/build
diff --git a/jiaozivideoplayer/build.gradle b/jiaozivideoplayer/build.gradle
index 76ada50eb..9dfbd08fb 100644
--- a/jiaozivideoplayer/build.gradle
+++ b/jiaozivideoplayer/build.gradle
@@ -1,14 +1,14 @@
apply plugin: 'com.android.library'
android {
- compileSdkVersion 26
- buildToolsVersion '26.0.1'
+ compileSdkVersion 27
+ buildToolsVersion '27.0.0'
defaultConfig {
minSdkVersion 16
- targetSdkVersion 26
- versionCode 68
- versionName "6.1.0_preview"
+ targetSdkVersion 27
+ versionCode 69
+ versionName "6.1.1"
}
buildTypes {
release {
@@ -24,7 +24,7 @@ android {
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
- provided 'com.android.support:appcompat-v7:25.3.1'
+ provided 'com.android.support:appcompat-v7:27.0.0'
}
apply from: '../gradle/maven_push.gradle'
diff --git a/jiaozivideoplayer/src/main/java/cn/jzvd/JZUtils.java b/jiaozivideoplayer/src/main/java/cn/jzvd/JZUtils.java
index dd8378bb0..e30a17194 100644
--- a/jiaozivideoplayer/src/main/java/cn/jzvd/JZUtils.java
+++ b/jiaozivideoplayer/src/main/java/cn/jzvd/JZUtils.java
@@ -113,6 +113,9 @@ public static int dip2px(Context context, float dpValue) {
public static void saveProgress(Context context, String url, int progress) {
if (!JZVideoPlayer.SAVE_PROGRESS) return;
Log.i(TAG, "saveProgress: " + progress);
+ if (progress < 6000) {
+ progress = 0;
+ }
SharedPreferences spn = context.getSharedPreferences("JZVD_PROGRESS",
Context.MODE_PRIVATE);
SharedPreferences.Editor editor = spn.edit();
diff --git a/jiaozivideoplayer/src/main/java/cn/jzvd/JZVideoPlayer.java b/jiaozivideoplayer/src/main/java/cn/jzvd/JZVideoPlayer.java
index d814f61bc..d262a2244 100644
--- a/jiaozivideoplayer/src/main/java/cn/jzvd/JZVideoPlayer.java
+++ b/jiaozivideoplayer/src/main/java/cn/jzvd/JZVideoPlayer.java
@@ -323,9 +323,7 @@ public void setUp(LinkedHashMap urlMap, int defaultUrlMapIndex, int screen, Obje
TextUtils.equals(JZUtils.getCurrentUrlFromMap(this.urlMap, currentUrlMapIndex), JZUtils.getCurrentUrlFromMap(urlMap, currentUrlMapIndex))) {
return;
}
- //setUp的几种情况
- if (isCurrentJZVD() && urlMap.containsValue(JZMediaManager.CURRENT_PLAYING_URL)) {//即使也是
- //滑出屏幕记录位置 -- 这个应该在releaseAllVideos之前 是也不是的分类
+ if (isCurrentJZVD() && urlMap.containsValue(JZMediaManager.CURRENT_PLAYING_URL)) {
int position = 0;
try {
position = JZMediaManager.instance().mediaPlayer.getCurrentPosition();
@@ -336,20 +334,15 @@ public void setUp(LinkedHashMap urlMap, int defaultUrlMapIndex, int screen, Obje
JZUtils.saveProgress(getContext(), JZMediaManager.CURRENT_PLAYING_URL, position);
}
JZMediaManager.instance().releaseMediaPlayer();
- } else if (isCurrentJZVD() && !urlMap.containsValue(JZMediaManager.CURRENT_PLAYING_URL)) {//是也不是
- Log.e("jzvd", "setUp: 列表复用");//要么releaseAllVideos,要么进入小窗
-// JZVideoPlayer.releaseAllVideos();
+ } else if (isCurrentJZVD() && !urlMap.containsValue(JZMediaManager.CURRENT_PLAYING_URL)) {
startWindowTiny();
- } else if (!isCurrentJZVD() && urlMap.containsValue(JZMediaManager.CURRENT_PLAYING_URL)) {//不是也是 进入全屏或者需要退出小窗
- Log.e("jzvd", "setUp: 列表复用 不是也是");//进入小窗或者全屏了,但是下面的判断进不去
+ } else if (!isCurrentJZVD() && urlMap.containsValue(JZMediaManager.CURRENT_PLAYING_URL)) {
if (JZVideoPlayerManager.getCurrentJzvd() != null &&
JZVideoPlayerManager.getCurrentJzvd().currentScreen == JZVideoPlayer.SCREEN_WINDOW_TINY) {
//需要退出小窗退到我这里,我这里是第一层级
tmp_test_back = true;
- Log.e("jzvd", "setUp: tmp_test_back=true");
}
- } else if (!isCurrentJZVD() && !urlMap.containsValue(JZMediaManager.CURRENT_PLAYING_URL)) {//都不是
-
+ } else if (!isCurrentJZVD() && !urlMap.containsValue(JZMediaManager.CURRENT_PLAYING_URL)) {
}
this.urlMap = urlMap;
this.currentUrlMapIndex = defaultUrlMapIndex;
@@ -550,26 +543,9 @@ public void startVideo() {
public void onPrepared() {
Log.i(TAG, "onPrepared " + " [" + this.hashCode() + "] ");
if (JZUtils.getCurrentUrlFromMap(urlMap, currentUrlMapIndex).toLowerCase().contains("mp3")) {
- onVideoRendingStart();
- }
- }
-
- public void onVideoRendingStart() {
- Log.i(TAG, "onVideoRendingStart " + " [" + this.hashCode() + "] ");
- isVideoRendingStart = true;
- if (currentState != CURRENT_STATE_PREPARING && currentState != CURRENT_STATE_PREPARING_CHANGING_URL)
- return;
- if (seekToInAdvance != 0) {
- JZMediaManager.instance().mediaPlayer.seekTo(seekToInAdvance);
- seekToInAdvance = 0;
- } else {
- int position = JZUtils.getSavedProgress(getContext(), JZUtils.getCurrentUrlFromMap(urlMap, currentUrlMapIndex));
- if (position != 0) {
- JZMediaManager.instance().mediaPlayer.seekTo(position);
- }
+ onStatePrepared();
+ onStatePlaying();
}
- startProgressTimer();
- onStatePlaying();
}
public void setState(int state) {
@@ -624,6 +600,19 @@ public void onStatePreparingChangingUrl(int urlMapIndex, int seekToInAdvance) {
JZMediaManager.instance().prepare();
}
+ public void onStatePrepared() {//因为这个紧接着就会进入播放状态,所以不设置state
+ isVideoRendingStart = true;
+ if (seekToInAdvance != 0) {
+ JZMediaManager.instance().mediaPlayer.seekTo(seekToInAdvance);
+ seekToInAdvance = 0;
+ } else {
+ int position = JZUtils.getSavedProgress(getContext(), JZUtils.getCurrentUrlFromMap(urlMap, currentUrlMapIndex));
+ if (position != 0) {
+ JZMediaManager.instance().mediaPlayer.seekTo(position);
+ }
+ }
+ }
+
public void onStatePlaying() {
Log.i(TAG, "onStatePlaying " + " [" + this.hashCode() + "] ");
currentState = CURRENT_STATE_PLAYING;
@@ -653,7 +642,8 @@ public void onStateAutoComplete() {
public void onInfo(int what, int extra) {
Log.d(TAG, "onInfo what - " + what + " extra - " + extra);
if (what == MediaPlayer.MEDIA_INFO_VIDEO_RENDERING_START) {
- onVideoRendingStart();
+ onStatePrepared();
+ onStatePlaying();
}
}
@@ -688,7 +678,6 @@ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
}
public void onAutoCompletion() {
- //加上这句,避免循环播放video的时候,内存不断飙升。
Runtime.getRuntime().gc();
Log.i(TAG, "onAutoCompletion " + " [" + this.hashCode() + "] ");
onEvent(JZUserAction.ON_AUTO_COMPLETE);
@@ -707,14 +696,12 @@ public void onAutoCompletion() {
public void onCompletion() {
Log.i(TAG, "onCompletion " + " [" + this.hashCode() + "] ");
- //save position
if (currentState == CURRENT_STATE_PLAYING || currentState == CURRENT_STATE_PAUSE) {
int position = getCurrentPositionWhenPlaying();
JZUtils.saveProgress(getContext(), JZUtils.getCurrentUrlFromMap(urlMap, currentUrlMapIndex), position);
}
cancelProgressTimer();
onStateNormal();
- // 清理缓存变量
textureViewContainer.removeView(JZMediaManager.textureView);
JZMediaManager.instance().currentVideoWidth = 0;
JZMediaManager.instance().currentVideoHeight = 0;
@@ -801,6 +788,7 @@ public void onVideoSizeChanged() {
}
public void startProgressTimer() {
+ Log.e(TAG, "startProgressTimer: ");
cancelProgressTimer();
UPDATE_PROGRESS_TIMER = new Timer();
mProgressTimerTask = new ProgressTimerTask();
@@ -915,6 +903,8 @@ public void startWindowFullscreen() {
FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
vp.addView(jzVideoPlayer, lp);
+ jzVideoPlayer.setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
+ | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY | View.SYSTEM_UI_FLAG_FULLSCREEN);
jzVideoPlayer.setUp(urlMap, currentUrlMapIndex, JZVideoPlayerStandard.SCREEN_WINDOW_FULLSCREEN, objects);
jzVideoPlayer.setState(currentState);
jzVideoPlayer.addTextureView();
@@ -961,15 +951,12 @@ public void startWindowTiny() {
}
}
- //isCurrentPlay and isCurrenPlayUrl should be two logic methods,isCurrentPlay is for different jzvd with same
- //url when fullscreen or tiny screen. isCurrenPlayUrl is to find where is myself when back from tiny screen.
- //Sometimes they are overlap.
- public boolean isCurrentPlay() {//虽然看这个函数很不爽,但是干不掉
+ public boolean isCurrentPlay() {
return isCurrentJZVD()
&& urlMap.containsValue(JZMediaManager.CURRENT_PLAYING_URL);//不仅正在播放的url不能一样,并且各个清晰度也不能一样
}
- public boolean isCurrentJZVD() {//是否是当前实例
+ public boolean isCurrentJZVD() {
return JZVideoPlayerManager.getCurrentJzvd() != null
&& JZVideoPlayerManager.getCurrentJzvd() == this;
}
@@ -982,7 +969,6 @@ public void playOnThisJzvd() {
currentUrlMapIndex = JZVideoPlayerManager.getSecondFloor().currentUrlMapIndex;
clearFloatScreen();
//2.在本jzvd上播放
- Log.e("jzvd", "jklf: " + currentState);
setState(currentState);
addTextureView();
}
@@ -1024,18 +1010,15 @@ public static void onScrollAutoTiny(AbsListView view, int firstVisibleItem, int
int currentPlayPosition = JZMediaManager.instance().positionInList;
if (currentPlayPosition >= 0) {
if ((currentPlayPosition < firstVisibleItem || currentPlayPosition > (lastVisibleItem - 1))) {
- //划出屏幕 要么release 要么进入小窗
- //JZVideoPlayer.releaseAllVideos();
if (JZVideoPlayerManager.getCurrentJzvd() != null &&
JZVideoPlayerManager.getCurrentJzvd().currentScreen != JZVideoPlayer.SCREEN_WINDOW_TINY) {
- Log.e("jzvd", "onScroll: 划出屏幕");
+ Log.e(TAG, "onScroll: out screen");
JZVideoPlayerManager.getCurrentJzvd().startWindowTiny();
}
} else {
- //滑入屏幕,这个会频繁回调,判断是否在屏幕中
if (JZVideoPlayerManager.getCurrentJzvd() != null &&
JZVideoPlayerManager.getCurrentJzvd().currentScreen == JZVideoPlayer.SCREEN_WINDOW_TINY) {
- Log.e("jzvd", "onScroll: 划入屏幕");
+ Log.e(TAG, "onScroll: into screen");
JZVideoPlayer.backPress();
}
}
@@ -1047,20 +1030,7 @@ public static void onScrollReleaseAllVideos(AbsListView view, int firstVisibleIt
int currentPlayPosition = JZMediaManager.instance().positionInList;
if (currentPlayPosition >= 0) {
if ((currentPlayPosition < firstVisibleItem || currentPlayPosition > (lastVisibleItem - 1))) {
- //划出屏幕 要么release 要么进入小窗
JZVideoPlayer.releaseAllVideos();
-// if (JZVideoPlayerManager.getCurrentJzvd() != null &&
-// JZVideoPlayerManager.getCurrentJzvd().currentScreen != JZVideoPlayer.SCREEN_WINDOW_TINY) {
-// Log.e("jzvd", "onScroll: 划出屏幕");
-// JZVideoPlayerManager.getCurrentJzvd().startWindowTiny();
-// }
- } else {
- //滑入屏幕,这个会频繁回调,判断是否在屏幕中
-// if (JZVideoPlayerManager.getCurrentJzvd() != null &&
-// JZVideoPlayerManager.getCurrentJzvd().currentScreen == JZVideoPlayer.SCREEN_WINDOW_TINY) {
-// Log.e("jzvd", "onScroll: 划入屏幕");
-// JZVideoPlayer.backPress();
-// }
}
}
}
@@ -1124,7 +1094,7 @@ public class ProgressTimerTask extends TimerTask {
@Override
public void run() {
if (currentState == CURRENT_STATE_PLAYING || currentState == CURRENT_STATE_PAUSE) {
-// Log.v(TAG, "onProgressUpdate " + position + "/" + duration + " [" + this.hashCode() + "] ");
+// Log.v(TAG, "onProgressUpdate " + "[" + this.hashCode() + "] ");
mHandler.post(new Runnable() {
@Override
public void run() {
diff --git a/jiaozivideoplayer/src/main/java/cn/jzvd/JZVideoPlayerStandard.java b/jiaozivideoplayer/src/main/java/cn/jzvd/JZVideoPlayerStandard.java
index ec04c8c53..fe2a86394 100644
--- a/jiaozivideoplayer/src/main/java/cn/jzvd/JZVideoPlayerStandard.java
+++ b/jiaozivideoplayer/src/main/java/cn/jzvd/JZVideoPlayerStandard.java
@@ -104,7 +104,6 @@ public JZVideoPlayerStandard(Context context, AttributeSet attrs) {
@Override
public void init(Context context) {
super.init(context);
-
batteryTimeLayout = findViewById(R.id.battery_time_layout);
bottomProgressBar = findViewById(R.id.bottom_progress);
titleTextView = findViewById(R.id.title);
@@ -121,7 +120,6 @@ public void init(Context context) {
backButton.setOnClickListener(this);
tinyBackImageView.setOnClickListener(this);
clarity.setOnClickListener(this);
-
}
public void setUp(LinkedHashMap urlMap, int defaultUrlMapIndex, int screen, Object... objects) {
@@ -160,12 +158,8 @@ public void setUp(LinkedHashMap urlMap, int defaultUrlMapIndex, int screen, Obje
if (tmp_test_back) {
tmp_test_back = false;
- //更新jzvd第一层,然后backpress
JZVideoPlayerManager.setFirstFloor(this);
- Log.e("jzvd", "setUp: tmp_test_back=true 启动线程");
- //等着setUp的子类setUp执行完毕
- Log.e("jzvd", "setUp: tmp_test_back=true 执行backPress");
- isVideoRendingStart = true;//表示可以渲染图像
+ isVideoRendingStart = true;
backPress();
}
}
@@ -194,7 +188,6 @@ public void onStateNormal() {
public void onStatePreparing() {
super.onStatePreparing();
changeUiToPreparing();
- startDismissControlViewTimer();
}
@Override
@@ -207,8 +200,7 @@ public void onStatePreparingChangingUrl(int urlMapIndex, int seekToInAdvance) {
@Override
public void onStatePlaying() {
super.onStatePlaying();
- changeUiToPlayingShow();
- startDismissControlViewTimer();
+ changeUiToPlayingClear();
}
@Override
@@ -471,7 +463,6 @@ public void resetProgressAndTime() {
bottomProgressBar.setSecondaryProgress(0);
}
- //Unified management Ui
public void changeUiToNormal() {
switch (currentScreen) {
case SCREEN_LAYOUT_NORMAL:
@@ -494,11 +485,11 @@ public void changeUiToPreparing() {
switch (currentScreen) {
case SCREEN_LAYOUT_NORMAL:
case SCREEN_LAYOUT_LIST:
- setAllControlsVisiblity(View.VISIBLE, View.INVISIBLE, View.INVISIBLE,
+ setAllControlsVisiblity(View.INVISIBLE, View.INVISIBLE, View.INVISIBLE,
View.VISIBLE, View.VISIBLE, View.INVISIBLE);
break;
case SCREEN_WINDOW_FULLSCREEN:
- setAllControlsVisiblity(View.VISIBLE, View.INVISIBLE, View.INVISIBLE,
+ setAllControlsVisiblity(View.INVISIBLE, View.INVISIBLE, View.INVISIBLE,
View.VISIBLE, View.VISIBLE, View.INVISIBLE);
break;
case SCREEN_WINDOW_TINY:
@@ -507,14 +498,6 @@ public void changeUiToPreparing() {
}
- @Override
- public void onVideoRendingStart() {
- super.onVideoRendingStart();
- setAllControlsVisiblity(View.VISIBLE, View.INVISIBLE, View.INVISIBLE,
- View.INVISIBLE, View.INVISIBLE, View.VISIBLE);
- startDismissControlViewTimer();
- }
-
public void changeUiToPlayingShow() {
switch (currentScreen) {
case SCREEN_LAYOUT_NORMAL: