Skip to content

Commit

Permalink
Merge pull request #752 from zshbleaker/master
Browse files Browse the repository at this point in the history
Release 2.0.4
  • Loading branch information
Jhuster authored Nov 28, 2017
2 parents a95ae9d + 00c648a commit 5c43980
Show file tree
Hide file tree
Showing 21 changed files with 70 additions and 6 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 26
versionCode 10
versionName "2.0.3"
versionName "2.0.4"
buildConfigField "long", "BUILD_TIMESTAMP", System.currentTimeMillis() + "L"
}
buildTypes {
Expand All @@ -27,7 +27,7 @@ android {
}

dependencies {
compile files('libs/pldroid-player-2.0.3.jar')
compile files('libs/pldroid-player-2.0.4.jar')
compile 'com.android.support:appcompat-v7:26+'
compile 'com.qiniu:happy-dns:0.2.+'
compile 'com.journeyapps:zxing-android-embedded:3.0.2@aar'
Expand Down
Binary file removed PLDroidPlayerDemo/app/libs/pldroid-player-2.0.3.jar
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public class MainActivity extends AppCompatActivity {
private CheckBox mLoopCheckBox;
private CheckBox mVideoDataCallback;
private CheckBox mAudioDataCallback;
private CheckBox mDisableCheckBox;

public static final String[] TEST_ACTIVITY_ARRAY = {
"PLMediaPlayerActivity",
Expand Down Expand Up @@ -82,6 +83,7 @@ protected void onCreate(Bundle savedInstanceState) {
mLoopCheckBox = (CheckBox) findViewById(R.id.LoopCheckBox);
mVideoDataCallback = (CheckBox) findViewById(R.id.VideoCallback);
mAudioDataCallback = (CheckBox) findViewById(R.id.AudioCallback);
mDisableCheckBox = (CheckBox) findViewById(R.id.DisableLog);

mVideoCacheCheckBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
Expand Down Expand Up @@ -173,6 +175,7 @@ public void jumpToPlayerActivity(String videopath) {
intent.putExtra("loop", mLoopCheckBox.isChecked());
intent.putExtra("video-data-callback", mVideoDataCallback.isChecked());
intent.putExtra("audio-data-callback", mAudioDataCallback.isChecked());
intent.putExtra("disable-log", mDisableCheckBox.isChecked());
startActivity(intent);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ public class PLMediaPlayerActivity extends VideoPlayerBaseActivity {

private long mLastUpdateStatTime = 0;

private boolean mDisableLog = false;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Expand Down Expand Up @@ -78,6 +80,8 @@ protected void onCreate(Bundle savedInstanceState) {
if (!isLiveStreaming && cache) {
mAVOptions.setString(AVOptions.KEY_CACHE_DIR, Config.DEFAULT_CACHE_DIR);
}
mDisableLog = getIntent().getBooleanExtra("disable-log", false);
mAVOptions.setInteger(AVOptions.KEY_LOG_LEVEL, mDisableLog ? 5 : 0);

AudioManager audioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
audioManager.requestAudioFocus(null, AudioManager.STREAM_MUSIC, AudioManager.AUDIOFOCUS_GAIN);
Expand Down Expand Up @@ -160,6 +164,7 @@ private void prepare() {
mMediaPlayer.setOnErrorListener(mOnErrorListener);
mMediaPlayer.setOnInfoListener(mOnInfoListener);
mMediaPlayer.setOnBufferingUpdateListener(mOnBufferingUpdateListener);
mMediaPlayer.setDebugLoggingEnabled(!mDisableLog);
// set replay if completed
// mMediaPlayer.setLooping(true);
mMediaPlayer.setWakeMode(getApplicationContext(), PowerManager.PARTIAL_WAKE_LOCK);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,13 @@ public class PLVideoTextureActivity extends VideoPlayerBaseActivity {
private TextView mStatInfoTextView;
private boolean mIsLiveStreaming;

String videoPath;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_pl_video_texture);

String videoPath = getIntent().getStringExtra("videoPath");
videoPath = getIntent().getStringExtra("videoPath");
mIsLiveStreaming = getIntent().getIntExtra("liveStreaming", 1) == 1;

mVideoView = (PLVideoTextureView) findViewById(R.id.VideoView);
Expand Down Expand Up @@ -62,12 +63,14 @@ protected void onCreate(Bundle savedInstanceState) {
options.setInteger(AVOptions.KEY_LIVE_STREAMING, mIsLiveStreaming ? 1 : 0);
// 1 -> hw codec enable, 0 -> disable [recommended]
options.setInteger(AVOptions.KEY_MEDIACODEC, codec);
boolean disableLog = getIntent().getBooleanExtra("disable-log", false);
options.setInteger(AVOptions.KEY_LOG_LEVEL, disableLog ? 5 : 0);
boolean cache = getIntent().getBooleanExtra("cache", false);
if (!mIsLiveStreaming && cache) {
options.setString(AVOptions.KEY_CACHE_DIR, Config.DEFAULT_CACHE_DIR);
}
mVideoView.setAVOptions(options);
mVideoView.setDebugLoggingEnabled(true);
mVideoView.setDebugLoggingEnabled(!disableLog);

// You can mirror the display
// mVideoView.setMirror(true);
Expand All @@ -82,6 +85,8 @@ protected void onCreate(Bundle savedInstanceState) {
mVideoView.setOnBufferingUpdateListener(mOnBufferingUpdateListener);
mVideoView.setOnCompletionListener(mOnCompletionListener);
mVideoView.setOnErrorListener(mOnErrorListener);
//mVideoView.setOnPreparedListener(mOnPreparedListener);
//mVideoView.setOnSeekCompleteListener(mOnSeekCompleteListener);

mVideoView.setLooping(getIntent().getBooleanExtra("loop", false));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ protected void onCreate(Bundle savedInstanceState) {

mStatInfoTextView = (TextView) findViewById(R.id.StatInfoTextView);


// 1 -> hw codec enable, 0 -> disable [recommended]
int codec = getIntent().getIntExtra("mediaCodec", AVOptions.MEDIA_CODEC_SW_DECODE);
AVOptions options = new AVOptions();
Expand All @@ -55,6 +56,8 @@ protected void onCreate(Bundle savedInstanceState) {
// 1 -> hw codec enable, 0 -> disable [recommended]
options.setInteger(AVOptions.KEY_MEDIACODEC, codec);
options.setInteger(AVOptions.KEY_LIVE_STREAMING, mIsLiveStreaming ? 1 : 0);
boolean disableLog = getIntent().getBooleanExtra("disable-log", false);
options.setInteger(AVOptions.KEY_LOG_LEVEL, disableLog ? 5 : 0);
boolean cache = getIntent().getBooleanExtra("cache", false);
if (!mIsLiveStreaming && cache) {
options.setString(AVOptions.KEY_CACHE_DIR, Config.DEFAULT_CACHE_DIR);
Expand All @@ -68,7 +71,7 @@ protected void onCreate(Bundle savedInstanceState) {
options.setInteger(AVOptions.KEY_AUDIO_DATA_CALLBACK, 1);
}
mVideoView.setAVOptions(options);
mVideoView.setDebugLoggingEnabled(true);
mVideoView.setDebugLoggingEnabled(!disableLog);

// Set some listeners
mVideoView.setOnInfoListener(mOnInfoListener);
Expand Down
Binary file modified PLDroidPlayerDemo/app/src/main/jniLibs/arm64-v8a/libQPlayer.so
Binary file not shown.
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.
6 changes: 6 additions & 0 deletions PLDroidPlayerDemo/app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,12 @@
android:layout_marginLeft="15dp"
android:layout_marginTop="5dp" >

<CheckBox
android:id="@+id/DisableLog"
android:text="@string/disable_log"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />

<CheckBox
android:id="@+id/VideoCallback"
android:layout_width="wrap_content"
Expand Down
1 change: 1 addition & 0 deletions PLDroidPlayerDemo/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<string name="loop">循环播放(点播)</string>
<string name="vcallback">视频数据回调</string>
<string name="acallback">音频数据回调</string>
<string name="disable_log">关闭日志</string>

<string name="dlg_ok">OK</string>
<string name="dlg_cancel">Cancel</string>
Expand Down
3 changes: 2 additions & 1 deletion PLDroidPlayerDemo/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@

buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
classpath 'com.android.tools.build:gradle:3.0.1'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
40 changes: 40 additions & 0 deletions ReleaseNotes/release-notes-2.0.4.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# PLDroidPlayer Release Notes for 2.0.4

本次更新:

## 说明

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

## 版本

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

## 功能

- 新增 `AVOptions.KEY_LOG_LEVEL` 字段
- 新增 `PLMediaPlayer.MEDIA_INFO_LOOP_DONE` 字段
- 新增 `PLVideoTextureView.disableSplitMode` 方法
- 新增 `getRtmpVideoTimestamp``getRtmpAudioTimestamp` 方法

## 缺陷

- 修复了一些情况下开启 `PLNetowrkManager.startDnsCacheService` 后无法播放的问题
- 修复了一些设备上无法加载 `libqcCodec.so` 的问题
- 修复了播放一些 flv 直播流时卡顿的问题
- 修复了一些情况下循环播放时卡顿的问题
- 修复了一些情况下 `PLVideoTextureView` 画面不刷新的问题
- 修复了一些情况下不会收到 `OnSeekComplete` 的问题
- 修复了一些情况下出现 `ERROR_CODE_SEEK_FAILED` 的问题
- 修复了一些情况下开启 `PLVideoTextureView.setSplitMode` 后 view 尺寸错误的问题
- 修复了一些情况下频繁 `seekTo` 可能 crash 的问题
- 修复了播放地址过长时离线缓存失败的问题
- 修复了播放完成后时间可能继续增长的问题
- 修复了 `setDebuggingLogEnabled``false` 时仍会产生大量 log 的问题

## 更新注意事项

由于 Android 7.0 使用 BoringSSL 替换了 OpenSSL,一些依赖系统内建 OpenSSL 的程序在一些 7.0+ 的 ROM 里可能会崩溃。如果您的应用 targetSdkVersion >= 24,那么强烈推荐将 libqcOpenSSL.so 加入至 jniLibs 目录。

如果从旧版本升级,建议参考 v2.0.0 版本及后续的 [ReleaseNote](https://github.com/pili-engineering/PLDroidPlayer/blob/master/ReleaseNotes/release-notes-2.0.0.md) ,查看注意事项
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.0.3.jar
Binary file not shown.
Binary file added releases/pldroid-player-2.0.4.jar
Binary file not shown.
Binary file modified releases/x86/libQPlayer.so
Binary file not shown.

0 comments on commit 5c43980

Please sign in to comment.