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.2.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathen committed Dec 3, 2017
2 parents b869013 + a90f11d commit 1c0a8d0
Show file tree
Hide file tree
Showing 15 changed files with 141 additions and 104 deletions.
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.2.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.2.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 @@ -26,7 +26,7 @@

## 效果

**[jiaozivideoplayer-6.2.0_preview.apk](https://github.com/lipangit/JiaoZiVideoPlayer/releases/download/v6.2.0_preview/jiaozivideoplayer-6.2.0_preview.apk)**
**[jiaozivideoplayer-6.2.1.apk](https://github.com/lipangit/JiaoZiVideoPlayer/releases/download/v6.2.1/jiaozivideoplayer-6.2.1.apk)**

![Demo Screenshot][1]

Expand All @@ -38,10 +38,10 @@

1.添加类库
```gradle
compile 'cn.jzvd:jiaozivideoplayer:6.2.0_preview'
compile 'cn.jzvd:jiaozivideoplayer:6.2.1'
```

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

2.添加布局
```xml
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
--
<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.2.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.2.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>


# [斗鱼直播](https://www.douyu.com/1667893)

周一到周六每天上午9:30开始直播写代码,回答大家的使用问题,请大家进入直播间后提问,直播期间不再手动打字回复
周一到周六每天上午10:00开始直播写代码,回答大家的使用问题,请大家进入直播间后提问,直播期间不再手动打字回复

完美的列表滑动的检测(已完成),自定义播放引擎可以将系统的播放器换成Ijkplayer Exoplayer Vitamio等(测试版本)

Expand All @@ -37,7 +37,7 @@ For small and medium-sized companies, I think the final solution to video in and

## Effect

**[jiaozivideoplayer-6.2.0_preview.apk](https://github.com/lipangit/JiaoZiVideoPlayer/releases/download/v6.2.0_preview/jiaozivideoplayer-6.2.0_preview.apk)**
**[jiaozivideoplayer-6.2.1.apk](https://github.com/lipangit/JiaoZiVideoPlayer/releases/download/v6.2.1/jiaozivideoplayer-6.2.1.apk)**

![Demo Screenshot][1]

Expand All @@ -49,10 +49,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.2.0_preview'
compile 'cn.jzvd:jiaozivideoplayer:6.2.1'
```

Or download [lib](https://github.com/lipangit/JiaoZiVideoPlayer/releases/tag/v6.2.0_preview) (not recommended)
Or download [lib](https://github.com/lipangit/JiaoZiVideoPlayer/releases/tag/v6.2.1) (not recommended)

2.Add JZVideoPlayer in your layout
```xml
Expand Down
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ android {
applicationId "cn.jzvd.demo"
minSdkVersion 16
targetSdkVersion 27
versionCode 71
versionName "6.2.0_preview"
versionCode 72
versionName "6.2.1"
}
signingConfigs {
releaseConfig {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ public boolean isPlaying() {
}

@Override
public void seekTo(int time) {
mediaPlayer.seekTo(time);
public void seekTo(long time) {
mediaPlayer.seekTo((int) time);
}

@Override
Expand All @@ -66,12 +66,12 @@ public void release() {
}

@Override
public int getCurrentPosition() {
public long getCurrentPosition() {
return mediaPlayer.getCurrentPosition();
}

@Override
public int getDuration() {
public long getDuration() {
return mediaPlayer.getDuration();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public boolean isPlaying() {
}

@Override
public void seekTo(int time) {
public void seekTo(long time) {
ijkMediaPlayer.seekTo(time);
}

Expand All @@ -77,13 +77,13 @@ public void release() {
}

@Override
public int getCurrentPosition() {
return (int) ijkMediaPlayer.getCurrentPosition();
public long getCurrentPosition() {
return ijkMediaPlayer.getCurrentPosition();
}

@Override
public int getDuration() {
return (int) ijkMediaPlayer.getDuration();
public long getDuration() {
return ijkMediaPlayer.getDuration();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
package cn.jzvd.demo.CustomView;

import android.content.Context;
import android.media.AudioManager;
import android.util.AttributeSet;
import android.util.Log;
import android.view.WindowManager;

import cn.jzvd.JZMediaManager;
import cn.jzvd.JZUtils;
import cn.jzvd.JZVideoPlayerManager;
import cn.jzvd.JZVideoPlayerStandard;

/**
* 全屏状态播放完成,不退出全屏
* Created by Nathen on 2016/11/26.
*/

public class JZVideoPlayerStandardAutoCompleteAfterFullscreen extends JZVideoPlayerStandard {
public JZVideoPlayerStandardAutoCompleteAfterFullscreen(Context context) {
super(context);
Expand All @@ -17,32 +23,33 @@ public JZVideoPlayerStandardAutoCompleteAfterFullscreen(Context context) {
public JZVideoPlayerStandardAutoCompleteAfterFullscreen(Context context, AttributeSet attrs) {
super(context, attrs);
}
//
// @Override
// public void startVideo() {
// if (currentScreen == SCREEN_WINDOW_FULLSCREEN) {
// Log.d(TAG, "startVideo [" + this.hashCode() + "] ");
// initTextureView();
// addTextureView();
// AudioManager mAudioManager = (AudioManager) getContext().getSystemService(Context.AUDIO_SERVICE);
// mAudioManager.requestAudioFocus(onAudioFocusChangeListener, AudioManager.STREAM_MUSIC, AudioManager.AUDIOFOCUS_GAIN_TRANSIENT);
// JZUtils.scanForActivity(getContext()).getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
// JZMediaManager.CURRENT_PLAYING_URL = JZUtils.getCurrentUrlFromMap(urlMap, currentUrlMapIndex);
// JZMediaManager.CURRENT_PLING_LOOP = loop;
// JZMediaManager.MAP_HEADER_DATA = headData;
// onStatePreparing();
// } else {
// super.startVideo();
// }
// }
//
// @Override
// public void onAutoCompletion() {
// if (currentScreen == SCREEN_WINDOW_FULLSCREEN) {
// onStateAutoComplete();
// } else {
// super.onAutoCompletion();
// }
//
// }

@Override
public void startVideo() {
if (currentScreen == SCREEN_WINDOW_FULLSCREEN) {
Log.d(TAG, "startVideo [" + this.hashCode() + "] ");
initTextureView();
addTextureView();
AudioManager mAudioManager = (AudioManager) getContext().getSystemService(Context.AUDIO_SERVICE);
mAudioManager.requestAudioFocus(onAudioFocusChangeListener, AudioManager.STREAM_MUSIC, AudioManager.AUDIOFOCUS_GAIN_TRANSIENT);
JZUtils.scanForActivity(getContext()).getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);

JZMediaManager.setDataSource(dataSourceObjects);
JZMediaManager.setCurrentDataSource(JZUtils.getCurrentFromDataSource(dataSourceObjects, currentUrlMapIndex));
JZMediaManager.instance().positionInList = positionInList;
onStatePreparing();
} else {
super.startVideo();
}
}

@Override
public void onAutoCompletion() {
if (currentScreen == SCREEN_WINDOW_FULLSCREEN) {
onStateAutoComplete();
} else {
super.onAutoCompletion();
}

}
}
34 changes: 32 additions & 2 deletions app/src/main/res/layout/layout_standard_with_share_button.xml
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,8 @@
android:src="@drawable/jz_click_play_selector" />
</LinearLayout>


<TextView
android:id="@+id/retry_text"
android:id="@+id/replay_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/start_layout"
Expand All @@ -222,4 +221,35 @@
android:textColor="#ffffff"
android:textSize="12sp"
android:visibility="invisible" />

<LinearLayout
android:id="@+id/retry_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:gravity="center_horizontal"
android:orientation="vertical">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="视频加载失败"
android:textColor="@android:color/white"
android:textSize="14sp" />

<TextView
android:id="@+id/retry_btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:background="@drawable/retry_bg"
android:paddingBottom="4dp"
android:paddingLeft="9dp"
android:paddingRight="9dp"
android:paddingTop="4dp"
android:text="点击重试"
android:textColor="@android:color/white"
android:textSize="14sp" />
</LinearLayout>
</RelativeLayout>
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.2.0_preview"
version = "6.2.1"

uploadArchives {
repositories {
Expand Down
4 changes: 2 additions & 2 deletions jiaozivideoplayer/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
defaultConfig {
minSdkVersion 16
targetSdkVersion 27
versionCode 71
versionName "6.2.0_preview"
versionCode 72
versionName "6.2.1"
}
buildTypes {
release {
Expand Down
6 changes: 3 additions & 3 deletions jiaozivideoplayer/src/main/java/cn/jzvd/JZMediaInterface.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ public abstract class JZMediaInterface {

public abstract boolean isPlaying();

public abstract void seekTo(int time);
public abstract void seekTo(long time);

public abstract void release();

public abstract int getCurrentPosition();
public abstract long getCurrentPosition();

public abstract int getDuration();
public abstract long getDuration();

public abstract void setSurface(Surface surface);
}
8 changes: 5 additions & 3 deletions jiaozivideoplayer/src/main/java/cn/jzvd/JZMediaManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ public JZMediaManager() {
mMediaHandlerThread.start();
mMediaHandler = new MediaHandler(mMediaHandlerThread.getLooper());
mainThreadHandler = new Handler();
if (jzMediaInterface == null)
jzMediaInterface = new JZMediaSystem();
}

public static JZMediaManager instance() {
Expand Down Expand Up @@ -64,15 +66,15 @@ public static void setCurrentDataSource(Object currentDataSource) {
instance().jzMediaInterface.currentDataSource = currentDataSource;
}

public static int getCurrentPosition() {
public static long getCurrentPosition() {
return instance().jzMediaInterface.getCurrentPosition();
}

public static int getDuration() {
public static long getDuration() {
return instance().jzMediaInterface.getDuration();
}

public static void seekTo(int time) {
public static void seekTo(long time) {
instance().jzMediaInterface.seekTo(time);
}

Expand Down
8 changes: 4 additions & 4 deletions jiaozivideoplayer/src/main/java/cn/jzvd/JZMediaSystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ public boolean isPlaying() {
}

@Override
public void seekTo(int time) {
mediaPlayer.seekTo(time);
public void seekTo(long time) {
mediaPlayer.seekTo((int) time);
}

@Override
Expand All @@ -71,12 +71,12 @@ public void release() {
}

@Override
public int getCurrentPosition() {
public long getCurrentPosition() {
return mediaPlayer.getCurrentPosition();
}

@Override
public int getDuration() {
public long getDuration() {
return mediaPlayer.getDuration();
}

Expand Down
Loading

0 comments on commit 1c0a8d0

Please sign in to comment.