Skip to content
This repository has been archived by the owner on Aug 9, 2022. It is now read-only.

Commit

Permalink
Merge branch 'release/v6.1.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathen committed Oct 28, 2017
2 parents d6ac0e0 + efb92a0 commit d0f90ae
Show file tree
Hide file tree
Showing 20 changed files with 112 additions and 133 deletions.
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ gradle.properties
/local.properties
.idea
.DS_Store
/build
build
/captures
*.asc
projectFilesBackup
projectFilesBackup
release
8 changes: 4 additions & 4 deletions README-ZH.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
--
<p align="center">
<a href="http://developer.android.com/index.html"><img src="https://img.shields.io/badge/platform-android-green.svg"></a>
<a href="http://search.maven.org/#artifactdetails%7Ccn.jzvd%7Cjiaozivideoplayer%7C5.8.2%7Caar"><img src="https://img.shields.io/badge/Maven%20Central-6.1.0_preview-green.svg"></a>
<a href="http://search.maven.org/#artifactdetails%7Ccn.jzvd%7Cjiaozivideoplayer%7C5.8.2%7Caar"><img src="https://img.shields.io/badge/Maven%20Central-6.1.1-green.svg"></a>
<a href="http://choosealicense.com/licenses/mit/"><img src="https://img.shields.io/badge/license-MIT-green.svg"></a>
<a href="https://android-arsenal.com/details/1/3269"><img src="https://img.shields.io/badge/Android%20Arsenal-jiaozivideoplayer-green.svg?style=true"></a>
</p>
Expand All @@ -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]

Expand All @@ -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
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
--
<p align="center">
<a href="http://developer.android.com/index.html"><img src="https://img.shields.io/badge/platform-android-green.svg"></a>
<a href="http://search.maven.org/#artifactdetails%7Ccn.jzvd%7Cjiaozivideoplayer%7C5.8.2%7Caar"><img src="https://img.shields.io/badge/Maven%20Central-6.1.0_preview-green.svg"></a>
<a href="http://search.maven.org/#artifactdetails%7Ccn.jzvd%7Cjiaozivideoplayer%7C5.8.2%7Caar"><img src="https://img.shields.io/badge/Maven%20Central-6.1.1-green.svg"></a>
<a href="http://choosealicense.com/licenses/mit/"><img src="https://img.shields.io/badge/license-MIT-green.svg"></a>
<a href="https://android-arsenal.com/details/1/3269"><img src="https://img.shields.io/badge/Android%20Arsenal-jiaozivideoplayer-green.svg?style=true"></a>
</p>

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

Expand All @@ -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]

Expand All @@ -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
Expand Down Expand Up @@ -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
[2]: https://user-images.githubusercontent.com/2038071/29978804-45c321ba-8f75-11e7-9040-776d3b6dca1f.jpg
1 change: 0 additions & 1 deletion app/.gitignore

This file was deleted.

31 changes: 20 additions & 11 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -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'
}
Binary file added app/jzvd-keystore
Binary file not shown.
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
android:configChanges="orientation|screenSize|keyboardHidden"
android:screenOrientation="portrait" />
<activity
android:name=".ListViewFragmentViewpagerActivity"
android:name=".ListViewFragmentViewPagerActivity"
android:configChanges="orientation|screenSize|keyboardHidden"
android:screenOrientation="portrait" />
<activity
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,6 @@ public void startVideo() {
super.startVideo();
}

/**
* onPrepared
*/
@Override
public void onVideoRendingStart() {
super.onVideoRendingStart();
}

@Override
public void onStateNormal() {
super.onStateNormal();
Expand Down
13 changes: 13 additions & 0 deletions app/src/main/java/cn/jzvd/demo/DemoFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AbsListView;
import android.widget.ListView;

import cn.jzvd.JZVideoPlayer;
import cn.jzvd.demo.R;

/**
Expand Down Expand Up @@ -36,6 +38,17 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
VideoConstant.videoUrls[index],
VideoConstant.videoTitles[index],
VideoConstant.videoThumbs[index]));
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.onScrollAutoTiny(view, firstVisibleItem, visibleItemCount, totalItemCount);
}
});
return listView;
}
}
2 changes: 1 addition & 1 deletion app/src/main/java/cn/jzvd/demo/ListViewActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public void onClick(View v) {
startActivity(new Intent(ListViewActivity.this, ListViewNormalAutoTinyActivity.class));
break;
case R.id.listview_fragment_viewpager:
startActivity(new Intent(ListViewActivity.this, ListViewFragmentViewpagerActivity.class));
startActivity(new Intent(ListViewActivity.this, ListViewFragmentViewPagerActivity.class));
break;
case R.id.multiholder:
startActivity(new Intent(ListViewActivity.this, ListViewMultiHolderActivity.class));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* Created by Nathen
* On 2016/02/07 01:01
*/
public class ListViewFragmentViewpagerActivity extends AppCompatActivity implements ViewPager.OnPageChangeListener {
public class ListViewFragmentViewPagerActivity extends AppCompatActivity implements ViewPager.OnPageChangeListener {
List<DemoFragment> fragmentList = new ArrayList<>();

@Override
Expand All @@ -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));
Expand Down
19 changes: 14 additions & 5 deletions app/src/main/java/cn/jzvd/demo/ListViewMultiHolderActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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) {
Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
4 changes: 3 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -15,6 +16,7 @@ buildscript {
allprojects {
repositories {
jcenter()
google()
}
}

Expand Down
2 changes: 1 addition & 1 deletion gradle/maven_push.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ signing {

group = "cn.jzvd"
archivesBaseName = "jiaozivideoplayer"
version = "6.1.0_preview"
version = "6.1.1"

uploadArchives {
repositories {
Expand Down
1 change: 0 additions & 1 deletion jiaozivideoplayer/.gitignore

This file was deleted.

12 changes: 6 additions & 6 deletions jiaozivideoplayer/build.gradle
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -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'
3 changes: 3 additions & 0 deletions jiaozivideoplayer/src/main/java/cn/jzvd/JZUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Loading

0 comments on commit d0f90ae

Please sign in to comment.