Skip to content

Commit

Permalink
Merge pull request #866 from zshbleaker/master
Browse files Browse the repository at this point in the history
Release 2.1.1
  • Loading branch information
geeklok authored Mar 9, 2018
2 parents c7554d1 + 2637635 commit ba677b1
Show file tree
Hide file tree
Showing 16 changed files with 70 additions and 2 deletions.
4 changes: 2 additions & 2 deletions PLDroidPlayerDemo/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ android {
minSdkVersion 14
targetSdkVersion 27
versionCode 10
versionName "2.1.0"
versionName "2.1.1"
buildConfigField "long", "BUILD_TIMESTAMP", System.currentTimeMillis() + "L"
}
buildTypes {
Expand All @@ -27,7 +27,7 @@ android {
}

dependencies {
implementation files('libs/pldroid-player-2.1.0.jar')
implementation files('libs/pldroid-player-2.1.1.jar')
implementation 'com.android.support:appcompat-v7:27.0.2'
implementation 'com.android.support:recyclerview-v7:27.0.2'
implementation 'com.journeyapps:zxing-android-embedded:3.0.2@aar'
Expand Down
Binary file removed PLDroidPlayerDemo/app/libs/pldroid-player-2.1.0.jar
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
import com.pili.pldroid.playerdemo.widget.MediaController;
import com.pili.pldroid.playerdemo.widget.MediaController.OnClickSpeedAdjustListener;

import java.util.Arrays;

/**
* This is a demo activity of PLVideoView
*/
Expand Down Expand Up @@ -61,6 +63,7 @@ protected void onCreate(Bundle savedInstanceState) {
options.setInteger(AVOptions.KEY_MEDIACODEC, codec);
options.setInteger(AVOptions.KEY_LIVE_STREAMING, mIsLiveStreaming ? 1 : 0);
boolean disableLog = getIntent().getBooleanExtra("disable-log", false);
// options.setString(AVOptions.KEY_DNS_SERVER, "127.0.0.1");
options.setInteger(AVOptions.KEY_LOG_LEVEL, disableLog ? 5 : 0);
boolean cache = getIntent().getBooleanExtra("cache", false);
if (!mIsLiveStreaming && cache) {
Expand Down Expand Up @@ -237,6 +240,19 @@ public void onVideoSizeChanged(int width, int height) {
@Override
public void onVideoFrameAvailable(byte[] data, int size, int width, int height, int format, long ts) {
Log.i(TAG, "onVideoFrameAvailable: " + size + ", " + width + " x " + height + ", " + format + ", " + ts);
if (format == PLOnVideoFrameListener.VIDEO_FORMAT_SEI && bytesToHex(Arrays.copyOfRange(data, 19, 23)).equals("ts64")) {
// If the RTMP stream is from Qiniu
// Add &addtssei=true to the end of URL to enable SEI timestamp.
// Format of the byte array:
// 0: SEI TYPE This is part of h.264 standard.
// 1: unregistered user data This is part of h.264 standard.
// 2: payload length This is part of h.264 standard.
// 3-18: uuid This is part of h.264 standard.
// 19-22: ts64 Magic string to mark this stream is from Qiniu
// 23-30: timestamp The timestamp
// 31: 0x80 Magic hex in ffmpeg
Log.i(TAG, " timestamp: " + Long.valueOf(bytesToHex(Arrays.copyOfRange(data, 23, 31)), 16));
}
}
};

Expand Down Expand Up @@ -267,6 +283,17 @@ public void onClickSlower() {
}
};

private String bytesToHex(byte[] bytes) {
char[] hexArray = "0123456789ABCDEF".toCharArray();
char[] hexChars = new char[bytes.length * 2];
for (int j = 0; j < bytes.length; j++) {
int v = bytes[j] & 0xFF;
hexChars[j * 2] = hexArray[v >>> 4];
hexChars[j * 2 + 1] = hexArray[v & 0x0F];
}
return new String(hexChars);
}

private void showToastTips(final String tips) {
runOnUiThread(new Runnable() {
@Override
Expand Down
Binary file not shown.
Binary file modified PLDroidPlayerDemo/app/src/main/jniLibs/armeabi-v7a/libQPlayer.so
Binary file not shown.
Binary file modified PLDroidPlayerDemo/app/src/main/jniLibs/armeabi/libQPlayer.so
Binary file not shown.
Binary file modified PLDroidPlayerDemo/app/src/main/jniLibs/x86/libQPlayer.so
Binary file not shown.
3 changes: 3 additions & 0 deletions PLDroidPlayerDemo/app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@
android:orientation="horizontal">

<Button
android:id="@+id/button_local"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="onClickLocalFile"
Expand All @@ -174,6 +175,7 @@
android:layout_marginLeft="5dp" />

<Button
android:id="@+id/button_play"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="onClickPlay"
Expand All @@ -182,6 +184,7 @@
android:layout_marginLeft="5dp"/>

<Button
android:id="@+id/button_list"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="onClickList"
Expand Down
38 changes: 38 additions & 0 deletions ReleaseNotes/release-notes-2.1.1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# PLDroidPlayer Release Notes for 2.1.1

本次更新:

## 说明

- 从 v2.0.0 版本开始,全面升级为七牛自研的播放器内核,拥有更优异的性能

## 版本

- 发布 pldroid-player-2.1.1.jar
- 更新 libQPlayer.so

## 新增

- `PLVideoView` 新增 `setZOrderOnTop` 方法
- `PLVideoView` 新增 `setZOrderMediaOverlay` 方法

## 缺陷

- 修复部分点播视频加载过慢的问题
- 修复了销毁播放器后的内存泄漏问题
- 修复 8.0+ 系统上播放 HLS 流时销毁播放器的 crash 问题
- 修复部分 HLS 流打开失败的问题
- 修复部分 HLS 流退出时 ANR 的问题
- 修复一些情况下 `PLOnBufferingUpdateListener` 可能不准确的问题


## 更新注意事项

从 2.1.0 开始:
- SDK 所有公开方法的参数名不再混淆,可以直接通过 IDE 查看
- 所有 Listener 类与相关常量从 `PLMediaPlayer` 下调整为单独的接口,并添加 PL 前缀
- 所有 Listener 类的回调方法中的 `PLMediaPlayer` 参数均被移除
- `PLOnInfoListener.onInfo` 方法返回类型由 `boolean` 修改为 `void`
- 在一次 `seekTo` 未完成时进行下一次 `seekTo`,SDK 的回调由 `PLOnErrorListener.ERROR_SEEK_FAILED` 更改为 `PLOnInfoListener.MEDIA_INFO_IS_SEEKING`,不会修改 `PlayerState` 的状态
- `PLNetworkManager` 类被移除,请删除应用层的相关调用,并移除 happydns 的依赖。如需管理 DNS 缓存或自定义 DNS 服务器,请通过 `AVOptions.KEY_DOMAIN_LIST``AVOptions.KEY_DNS_SERVER` 进行设置
- 移除 `setDebugLoggingEnabled` 方法,日志选项统一通过 `AVOptions.KEY_LOG_LEVEL` 控制
Binary file modified releases/arm64-v8a/libQPlayer.so
Binary file not shown.
Binary file modified releases/armeabi-v7a/libQPlayer.so
Binary file not shown.
Binary file modified releases/armeabi/libQPlayer.so
Binary file not shown.
Binary file removed releases/pldroid-player-2.1.0.jar
Binary file not shown.
Binary file added releases/pldroid-player-2.1.1.jar
Binary file not shown.
Binary file modified releases/x86/libQPlayer.so
Binary file not shown.

0 comments on commit ba677b1

Please sign in to comment.