Skip to content

Commit

Permalink
Merge pull request #205 from ShaoLongFei/master
Browse files Browse the repository at this point in the history
Release v3.3.0
  • Loading branch information
BoleLiu authored Oct 11, 2021
2 parents 1eaef83 + 28383f2 commit 4eadbc2
Show file tree
Hide file tree
Showing 353 changed files with 1,750 additions and 3,727 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# PLDroidShortVideo

PLDroidShortVideo 是七牛推出的一款适用于 Android 平台的短视频 SDK,提供了包括美颜、滤镜、水印、断点录制、分段回删、视频编辑、混音特效、本地/云端存储在内的多种功能,支持高度定制以及二次开发。我们提供 80+ 功能供开发使用,[点击此处](https://portal.qiniu.com/sdk/licenses?showDrawer&ref=www.qiniu.com) 即可获得 **0 元体验**
PLDroidShortVideo 是七牛推出的一款适用于 Android 平台的短视频 SDK,提供了包括美颜、滤镜、水印、断点录制、分段回删、视频编辑、混音特效、本地/云端存储在内的多种功能,支持高度定制以及二次开发。我们提供 80+ 功能供开发使用,申请 **0 元体验**可联系销售或[填写表单](https://jinshuju.net/f/IeOD89?ref=www.qiniu.com)获得产品试用权限

## 1. 多版本功能分布
短视频SDK主要区分精简版、基础版、进阶版、专业版 4 个版本,不同版本的功能区别见如下表格
Expand Down Expand Up @@ -90,7 +90,7 @@ PLDroidShortVideo 是七牛推出的一款适用于 Android 平台的短视频 S

请参考开发者中心文档:[PLDroidShortVideo 文档](https://developer.qiniu.com/pili/sdk/3734/short-video-android-sdk)

**注意:若无法 clone 本 repo,可点击[下载](https://sdk-release.qnsdk.com/PLDroidShortVideo-v3.2.2.zip)**
**注意:若无法 clone 本 repo,可点击[下载](https://sdk-release.qnsdk.com/PLDroidShortVideo-v3.3.0.zip)**

## 4. 声明

Expand All @@ -101,4 +101,4 @@ PLDroidShortVideo 是七牛推出的一款适用于 Android 平台的短视频 S
当你遇到任何问题时,可以通过在 GitHub 的 repo 提交 issues 来反馈问题,请尽可能的描述清楚遇到的问题,如果有错误信息也一同附带,并且在 Labels 中指明类型为 bug 或者其他。

[通过这里查看已有的 issues 和提交 Bug](https://github.com/pili-engineering/PLDroidShortVideo/issues)
~
~
4 changes: 0 additions & 4 deletions ReleaseNotes/release-notes-3.1.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ PLDroidShortVideo 是七牛推出的一款适用于 Android 平台的短视频 S
* 修复个别视频在 Android Q 上拼图卡住的问题
* 修复偶现的空指针问题

### 七牛短视频

* 发布七牛短视频 APP V2.0 版本,详情请见 [ShortVideo](https://github.com/pili-engineering/PLDroidShortVideo/tree/master/ShortVideo)

### 注意事项

* 从 v3.1.0 版本开始,需要在 Application 中初始化 sdk:
Expand Down
41 changes: 41 additions & 0 deletions ReleaseNotes/release-notes-3.3.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# PLDroidShortVideo Release Notes for 3.3.0

### 简介

PLDroidShortVideo 是七牛推出的一款适用于 Android 平台的短视频 SDK,提供了包括美颜、滤镜、水印、断点录制、分段回删、视频编辑、混音特效、本地/云端存储在内的多种功能,支持高度定制以及二次开发。

### 版本

* 发布 pldroid-shortvideo-3.3.0.jar
* 更新上传库依赖版本到 v8.3.2

### 功能

* 转码支持时间段裁剪
* 重构了草稿箱功能

### 缺陷

* 修复软编时可能出现的空指针异常
* 修复个别机型合拍录制中出现的回删异常问题
* 修复预览与编辑之间产生的色差问题
* 修复个别机型二次录屏时会失败的问题
* 修复编辑个别视频出现闪退的问题
* 修复编辑界面预览混音时长与实际不符的问题
* 修复转码时的视频裁剪不生效的问题
* 修复 GIF 图位置偏移的问题

### 注意事项

* 从 v3.1.0 版本开始,需要在 Application 中初始化 sdk:

```java
PLShortVideoEnv.init(getApplicationContext());
```

* 七牛短视频 SDK 自 v3.0.0 版本起, 划分为精简版、基础版、进阶版、专业版。不同版本 SDK 可以使用的功能点数量有差别,请按照购买的 License 版本使用对应的短视频 SDK 版本。
* 上传 SDK 的依赖需要更新到如下版本:

```java
compile 'com.qiniu:qiniu-android-sdk:8.3.2'
```
24 changes: 11 additions & 13 deletions ShortVideoFunctionDemo/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ repositories {

android {
compileSdkVersion 30
buildToolsVersion "30.0.2"
buildToolsVersion "30.0.3"

defaultConfig {
applicationId "com.qiniu.pili.droid.shortvideo.demo"
minSdkVersion 21
targetSdkVersion 30
versionCode 33
versionName "3.2.2"
versionCode 34
versionName "3.3.0"
multiDexEnabled true
vectorDrawables.useSupportLibrary = true
buildConfigField "long", "BUILD_TIMESTAMP", System.currentTimeMillis() + "L"
Expand All @@ -40,27 +40,25 @@ android {

dependencies {
// 上传 sdk ,不使用上传功能无需依赖
implementation 'com.qiniu:qiniu-android-sdk:7.6.4'
implementation 'com.qiniu:qiniu-android-sdk:8.3.2'
// 播放器 sdk ,非必须
implementation files('libs/pldroid-player-2.1.8.jar')
implementation files('libs/pldroid-player-2.2.2.jar')
// UI 控件库,非必须
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.7'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.2.1'
implementation 'androidx.constraintlayout:constraintlayout:2.0.2'
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.0'
implementation 'com.h6ah4i.android.widget.advrecyclerview:advrecyclerview:0.10.6'
// 图片加载库,非必须
implementation files('libs/universal-image-loader-1.9.4.jar')
implementation 'com.github.bumptech.glide:glide:4.9.0'
implementation 'com.github.bumptech.glide:glide:4.11.0'
// 为了规避单个 DEX 64K 方法数上限,非必须
implementation 'androidx.multidex:multidex:2.0.1'

if (buildWithShortVideoLibrary) {
implementation project(':library')
} else {
// 短视频 SDK jar 包,必须依赖
implementation files('libs/pldroid-shortvideo-3.2.2.jar')
implementation files('libs/pldroid-shortvideo-3.3.0.jar')
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion ShortVideoFunctionDemo/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
android:name=".ShortVideoApplication"
android:allowBackup="true"
android:hardwareAccelerated="true"
android:icon="@drawable/ic_launcher"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:largeHeap="true"
android:supportsRtl="true"
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import com.qiniu.pili.droid.shortvideo.PLShortVideoEnv;
import com.qiniu.pili.droid.shortvideo.demo.utils.Config;
import com.qiniu.pili.droid.shortvideo.demo.utils.ToastUtils;

public class ShortVideoApplication extends MultiDexApplication {

Expand All @@ -13,5 +14,6 @@ public void onCreate() {
// init resources needed by short video sdk
PLShortVideoEnv.init(getApplicationContext());
Config.init(this);
ToastUtils.init(this);
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
package com.qiniu.pili.droid.shortvideo.demo.activity;

import android.app.Activity;
import android.content.DialogInterface;
import android.media.AudioFormat;
import android.os.Bundle;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
Expand Down Expand Up @@ -42,6 +40,7 @@ public class AudioRecordActivity extends Activity implements PLRecordStateListen
private View mConcatBtn;

private String mRecordErrorMsg;
private boolean mSectionBegan;

@Override
protected void onCreate(Bundle savedInstanceState) {
Expand All @@ -53,18 +52,13 @@ protected void onCreate(Bundle savedInstanceState) {
int encodingModePos = getIntent().getIntExtra(ENCODING_MODE, 0);
int audioChannelNumPos = getIntent().getIntExtra(AUDIO_CHANNEL_NUM, 0);

mSectionProgressBar = (SectionProgressBar) findViewById(R.id.record_progressbar);
mSectionProgressBar = findViewById(R.id.record_progressbar);
mRecordBtn = findViewById(R.id.record);
mDeleteBtn = findViewById(R.id.delete);
mConcatBtn = findViewById(R.id.concat);

mProcessingDialog = new CustomProgressDialog(this);
mProcessingDialog.setOnCancelListener(new DialogInterface.OnCancelListener() {
@Override
public void onCancel(DialogInterface dialog) {
mShortAudioRecorder.cancelConcat();
}
});
mProcessingDialog.setOnCancelListener(dialog -> mShortAudioRecorder.cancelConcat());

mShortAudioRecorder = new PLShortAudioRecorder();
mShortAudioRecorder.setRecordStateListener(this);
Expand All @@ -87,22 +81,16 @@ public void onCancel(DialogInterface dialog) {
mSectionProgressBar.setFirstPointTime(RecordSettings.DEFAULT_MIN_RECORD_DURATION);
mSectionProgressBar.setTotalTime(this, recordSetting.getMaxRecordDuration());

mRecordBtn.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
int action = event.getAction();
if (action == MotionEvent.ACTION_DOWN) {
if (mShortAudioRecorder.beginSection()) {
updateRecordingBtns(true);
} else {
ToastUtils.showShortToast(AudioRecordActivity.this, "无法开始视频段录制");
}
} else if (action == MotionEvent.ACTION_UP || action == MotionEvent.ACTION_CANCEL) {
mShortAudioRecorder.endSection();
updateRecordingBtns(false);
mRecordBtn.setOnClickListener(v -> {
if (mSectionBegan) {
mShortAudioRecorder.endSection();
updateRecordingBtns(false);
} else {
if (mShortAudioRecorder.beginSection()) {
updateRecordingBtns(true);
} else {
ToastUtils.showShortToast("无法开始音频段录制");
}

return false;
}
});
onSectionCountChanged(0, 0);
Expand Down Expand Up @@ -134,20 +122,21 @@ protected void onDestroy() {

public void onClickDelete(View v) {
if (!mShortAudioRecorder.deleteLastSection()) {
ToastUtils.showShortToast(this, "回删视频段失败");
ToastUtils.showShortToast("回删视频段失败");
}
}

public void onClickConcat(View v) {
mProcessingDialog.show();
mProcessingDialog.setProgress(0);
mShortAudioRecorder.concatSections(AudioRecordActivity.this);
}

@Override
public void onReady() {
runOnUiThread(() -> {
mRecordBtn.setEnabled(true);
ToastUtils.showShortToast(AudioRecordActivity.this, "可以开始录音咯");
ToastUtils.showShortToast("可以开始录音咯");
});
}

Expand All @@ -156,23 +145,26 @@ public void onError(int code) {
if (code == PLErrorCode.ERROR_SETUP_MICROPHONE_FAILED) {
mRecordErrorMsg = "麦克风配置错误";
}
runOnUiThread(() -> ToastUtils.showShortToast(AudioRecordActivity.this, mRecordErrorMsg));
runOnUiThread(() -> ToastUtils.showShortToast(mRecordErrorMsg));
}

@Override
public void onDurationTooShort() {
runOnUiThread(() -> ToastUtils.showShortToast(AudioRecordActivity.this, "该视频段太短了"));
mSectionProgressBar.removeLastBreakPoint();
runOnUiThread(() -> ToastUtils.showShortToast("该视频段太短了"));
}

@Override
public void onRecordStarted() {
Log.i(TAG, "record start time: " + System.currentTimeMillis());
mSectionBegan = true;
mSectionProgressBar.setCurrentState(SectionProgressBar.State.START);
}

@Override
public void onRecordStopped() {
Log.i(TAG, "record stop time: " + System.currentTimeMillis());
mSectionBegan = false;
mSectionProgressBar.setCurrentState(SectionProgressBar.State.PAUSE);
}

Expand All @@ -198,7 +190,7 @@ public void onSectionDecreased(long decDuration, long totalDuration, int section

@Override
public void onRecordCompleted() {
runOnUiThread(() -> ToastUtils.showShortToast(AudioRecordActivity.this, "已达到拍摄总时长"));
runOnUiThread(() -> ToastUtils.showShortToast("已达到拍摄总时长"));
}

@Override
Expand All @@ -210,7 +202,7 @@ public void onProgressUpdate(final float percentage) {
public void onSaveVideoFailed(final int errorCode) {
runOnUiThread(() -> {
mProcessingDialog.dismiss();
ToastUtils.showShortToast(AudioRecordActivity.this, "拼接视频段失败: " + errorCode);
ToastUtils.showShortToast("拼接视频段失败: " + errorCode);
});
}

Expand Down
Loading

0 comments on commit 4eadbc2

Please sign in to comment.