Skip to content

Commit

Permalink
Merge branch 'release/v7.4.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
lipangit committed May 24, 2020
2 parents cae0ff5 + 38a6937 commit 15f1616
Show file tree
Hide file tree
Showing 11 changed files with 280 additions and 24 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
--
<p align="center">
<a href="http://developer.android.com/index.html"><img src="https://img.shields.io/badge/platform-android-green.svg"></a>
<a href="http://search.maven.org/#artifactdetails%7Ccn.jzvd%7Cjiaozivideoplayer%7C7.3.1%7Caar"><img src="https://img.shields.io/badge/Maven%20Central-7.3.1-green.svg"></a>
<a href="http://search.maven.org/#artifactdetails%7Ccn.jzvd%7Cjiaozivideoplayer%7C7.4.0%7Caar"><img src="https://img.shields.io/badge/Maven%20Central-7.4.0-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 @@ -23,7 +23,7 @@

## 文档

- [文档 - API](https://github.com/Jzvd/JiaoZiVideoPlayer/wiki/%E6%96%87%E6%A1%A3-%E2%80%94-API),下载安装[Demo jiaozivideoplayer-7.3.1.apk](https://github.com/Jzvd/JiaoZiVideoPlayer/releases/download/v7.3.1/jiaozivideoplayer-7.3.1.apk),仔细过一遍Demo
- [文档 - API](https://github.com/Jzvd/JiaoZiVideoPlayer/wiki/%E6%96%87%E6%A1%A3-%E2%80%94-API),下载安装[Demo jiaozivideoplayer-7.4.0.apk](https://github.com/Jzvd/JiaoZiVideoPlayer/releases/download/v7.4.0/jiaozivideoplayer-7.4.0.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),测试哪个播放内核适合自己的项目

Expand All @@ -37,7 +37,7 @@

1.添加类库
```gradle
implementation 'cn.jzvd:jiaozivideoplayer:7.3.1'
implementation 'cn.jzvd:jiaozivideoplayer:7.4.0'
```

2.添加布局
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.2'
classpath 'com.android.tools.build:gradle:3.6.3'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
4 changes: 2 additions & 2 deletions demo/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 29
versionCode 101
versionName "7.3.1"
versionCode 102
versionName "7.4.0"
ndk {
// add support lib
abiFilters 'armeabi-v7a' //, 'arm64-v8a'//, "mips" //,'armeabi''x86',, 'x86_64',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package cn.jzvd.demo.CustomJzvd;

import android.content.Context;
import android.util.AttributeSet;

import cn.jzvd.demo.R;

public class MyJzvdStdNoTitleNoClarity extends MyJzvdStd {

public MyJzvdStdNoTitleNoClarity(Context context) {
super(context);
}

public MyJzvdStdNoTitleNoClarity(Context context, AttributeSet attrs) {
super(context, attrs);
}

@Override
public int getLayoutId() {
return R.layout.layout_jzstd_notitle;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public class SmallChangeUiActivity extends AppCompatActivity {
JzvdStdVolume jzvdStdVolume;

JzvdStd jzvdStd_1_1, jzvdStd_16_9;
JzvdStd jzNoTitle;

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
Expand All @@ -48,6 +49,10 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
getSupportActionBar().setTitle("SmallChangeUI");
setContentView(R.layout.activity_ui_small_change);

jzNoTitle = findViewById(R.id.jz_notitle);
jzNoTitle.setUp("http://jzvd.nathen.cn/342a5f7ef6124a4a8faf00e738b8bee4/cf6d9db0bd4d41f59d09ea0a81e918fd-5287d2089db37e62345123a1be272f8b.mp4"
, "饺子叫啥也显示不出来啊");
Glide.with(this).load("http://jzvd-pic.nathen.cn/jzvd-pic/1bb2ebbe-140d-4e2e-abd2-9e7e564f71ac.png").into(jzNoTitle.posterImageView);

lockScreen = findViewById(R.id.lock_screen);
lockScreen.setUp("http://jzvd.nathen.cn/342a5f7ef6124a4a8faf00e738b8bee4/cf6d9db0bd4d41f59d09ea0a81e918fd-5287d2089db37e62345123a1be272f8b.mp4"
Expand Down
18 changes: 18 additions & 0 deletions demo/src/main/res/layout/activity_ui_small_change.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,24 @@
android:layout_height="wrap_content"
android:orientation="vertical">

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="3dp"
android:text="extends JzvdStd and delete some parent views" />

<cn.jzvd.demo.CustomJzvd.MyJzvdStdNoTitleNoClarity
android:id="@+id/jz_notitle"
android:layout_width="match_parent"
android:layout_height="200dp" />

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="3dp"
android:text="Standard ui but delete some parent views " />


<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand Down
142 changes: 142 additions & 0 deletions demo/src/main/res/layout/layout_jzstd_notitle.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/black"
android:descendantFocusability="afterDescendants">

<FrameLayout
android:id="@+id/surface_container"
android:layout_width="match_parent"
android:layout_height="match_parent">

</FrameLayout>

<ImageView
android:id="@+id/poster"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_alignParentBottom="true"
android:adjustViewBounds="true"
android:background="#000000"
android:scaleType="fitXY" />

<RelativeLayout
android:id="@+id/layout_bottom"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_alignParentBottom="true"
android:background="@drawable/jz_bottom_bg"
android:gravity="center_vertical|right"
android:orientation="horizontal"
android:visibility="invisible">


<ImageView
android:id="@+id/fullscreen"
android:layout_width="52.5dp"
android:layout_height="fill_parent"
android:paddingLeft="14dp"
android:paddingRight="14dp"
android:scaleType="centerInside"
android:src="@drawable/jz_enlarge" />
</RelativeLayout>


<RelativeLayout
android:id="@+id/layout_top"
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:background="@drawable/jz_title_bg"
android:paddingStart="10dp"
android:paddingLeft="10dp"
android:visibility="gone">

<ImageView
android:id="@+id/back"
android:layout_width="26dp"
android:layout_height="26dp"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginTop="12dp"
android:padding="3dp"
android:scaleType="centerInside"
android:src="@drawable/jz_click_back_selector" />

</RelativeLayout>

<ProgressBar
android:id="@+id/loading"
android:layout_width="@dimen/jz_start_button_w_h_normal"
android:layout_height="@dimen/jz_start_button_w_h_normal"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:indeterminateDrawable="@drawable/jz_loading"
android:visibility="invisible" />

<LinearLayout
android:id="@+id/start_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_gravity="center_vertical">

<ImageView
android:id="@+id/start"
android:layout_width="@dimen/jz_start_button_w_h_normal"
android:layout_height="@dimen/jz_start_button_w_h_normal"
android:src="@drawable/jz_click_play_selector" />
</LinearLayout>


<TextView
android:id="@+id/replay_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/start_layout"
android:layout_centerHorizontal="true"
android:layout_marginTop="6dp"
android:text="@string/replay"
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"
android:visibility="invisible">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/video_loading_failed"
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/jz_retry"
android:paddingLeft="9dp"
android:paddingTop="4dp"
android:paddingRight="9dp"
android:paddingBottom="4dp"
android:text="@string/click_to_restart"
android:textColor="@android:color/white"
android:textSize="14sp" />
</LinearLayout>
</RelativeLayout>
2 changes: 1 addition & 1 deletion gradle/build_upload.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ signing {

group = "cn.jzvd"
archivesBaseName = "jiaozivideoplayer"
version = "7.3.1"
version = "7.4.0"

uploadArchives {
repositories {
Expand Down
4 changes: 2 additions & 2 deletions library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
defaultConfig {
minSdkVersion 16
targetSdkVersion 29
versionCode 101
versionName "7.3.1"
versionCode 102
versionName "7.4.0"
}

compileOptions {
Expand Down
38 changes: 33 additions & 5 deletions library/src/main/java/cn/jzvd/Jzvd.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
import android.view.WindowManager;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.SeekBar;
import android.widget.TextView;
import android.widget.Toast;
Expand Down Expand Up @@ -259,6 +261,31 @@ public void init(Context context) {
textureViewContainer = findViewById(R.id.surface_container);
topContainer = findViewById(R.id.layout_top);

if (startButton == null) {
startButton = new ImageView(context);
}
if (fullscreenButton == null) {
fullscreenButton = new ImageView(context);
}
if (progressBar == null) {
progressBar = new SeekBar(context);
}
if (currentTimeTextView == null) {
currentTimeTextView = new TextView(context);
}
if (totalTimeTextView == null) {
totalTimeTextView = new TextView(context);
}
if (bottomContainer == null) {
bottomContainer = new LinearLayout(context);
}
if (textureViewContainer == null) {
textureViewContainer = new FrameLayout(context);
}
if (topContainer == null) {
topContainer = new RelativeLayout(context);
}

startButton.setOnClickListener(this);
fullscreenButton.setOnClickListener(this);
progressBar.setOnSeekBarChangeListener(this);
Expand Down Expand Up @@ -312,7 +339,7 @@ public void onClick(View v) {
}
}

private void clickFullscreen() {
protected void clickFullscreen() {
Log.i(TAG, "onClick fullscreen [" + this.hashCode() + "] ");
if (state == STATE_AUTO_COMPLETE) return;
if (screen == SCREEN_FULLSCREEN) {
Expand All @@ -324,7 +351,7 @@ private void clickFullscreen() {
}
}

private void clickStart() {
protected void clickStart() {
Log.i(TAG, "onClick start [" + this.hashCode() + "] ");
if (jzDataSource == null || jzDataSource.urlsMap.isEmpty() || jzDataSource.getCurrentUrl() == null) {
Toast.makeText(getContext(), getResources().getString(R.string.no_url), Toast.LENGTH_SHORT).show();
Expand Down Expand Up @@ -371,7 +398,7 @@ public boolean onTouch(View v, MotionEvent event) {
return false;
}

private void touchActionUp() {
protected void touchActionUp() {
Log.i(TAG, "onTouch surfaceContainer actionUp [" + this.hashCode() + "] ");
mTouchingProgressBar = false;
dismissProgressDialog();
Expand All @@ -389,7 +416,7 @@ private void touchActionUp() {
startProgressTimer();
}

private void touchActionMove(float x, float y) {
protected void touchActionMove(float x, float y) {
Log.i(TAG, "onTouch surfaceContainer actionMove [" + this.hashCode() + "] ");
float deltaX = x - mDownX;
float deltaY = y - mDownY;
Expand Down Expand Up @@ -473,7 +500,7 @@ private void touchActionMove(float x, float y) {
}
}

private void touchActionDown(float x, float y) {
protected void touchActionDown(float x, float y) {
Log.i(TAG, "onTouch surfaceContainer actionDown [" + this.hashCode() + "] ");
mTouchingProgressBar = true;

Expand Down Expand Up @@ -945,6 +972,7 @@ public void cloneAJzvd(ViewGroup vg) {
public void gotoScreenFullscreen() {
gotoFullscreenTime = System.currentTimeMillis();
ViewGroup vg = (ViewGroup) getParent();
jzvdContext = vg.getContext();
blockLayoutParams = getLayoutParams();
blockIndex = vg.indexOfChild(this);
blockWidth = getWidth();
Expand Down
Loading

0 comments on commit 15f1616

Please sign in to comment.