Skip to content

Commit

Permalink
Merge pull request #167 from Johnny1994/dev
Browse files Browse the repository at this point in the history
Release v3.0.0
  • Loading branch information
KevinHuo authored Oct 12, 2019
2 parents 49cd6c4 + 702d51b commit c261552
Show file tree
Hide file tree
Showing 85 changed files with 805 additions and 408 deletions.
4 changes: 2 additions & 2 deletions PLDroidShortVideoDemo/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ android {
minSdkVersion 18
targetSdkVersion 25
versionCode 26
versionName "2.2.1"
versionName "3.0.0"
multiDexEnabled true
buildConfigField "long", "BUILD_TIMESTAMP", System.currentTimeMillis() + "L"
ndk {
Expand All @@ -32,7 +32,7 @@ android {

dependencies {
compile 'com.qiniu:qiniu-android-sdk:7.3.11'
compile files('libs/pldroid-shortvideo-2.2.1.jar')
compile files('libs/pldroid-shortvideo-3.0.0.jar')
compile files('libs/pldroid-player-2.1.8.jar')
compile files('libs/EasyAR.jar')
compile files('libs/EasyAR3D.jar')
Expand Down
Binary file not shown.
4 changes: 4 additions & 0 deletions PLDroidShortVideoDemo/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
android:largeHeap="true"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".activity.ConfigActivity"></activity>
<activity android:name=".activity.MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand All @@ -38,6 +39,9 @@
<activity
android:name=".activity.VideoEditActivity"
android:screenOrientation="portrait" />
<activity
android:name=".activity.ImportAndEditActivity"
android:screenOrientation="portrait" />
<activity
android:name=".activity.VideoTranscodeActivity"
android:screenOrientation="portrait"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
package com.qiniu.pili.droid.shortvideo.demo.activity;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Spinner;

import com.qiniu.pili.droid.shortvideo.demo.R;
import com.qiniu.pili.droid.shortvideo.demo.utils.RecordSettings;

public class ConfigActivity extends AppCompatActivity {

private Spinner mPreviewSizeRatioSpinner;
private Spinner mPreviewSizeLevelSpinner;
private Spinner mEncodingModeLevelSpinner;
private Spinner mEncodingSizeLevelSpinner;
private Spinner mEncodingBitrateLevelSpinner;
private Spinner mAudioChannelNumSpinner;

public static int PREVIEW_SIZE_RATIO_POS = 0;
public static int PREVIEW_SIZE_LEVEL_POS = 3;
public static int ENCODING_MODE_LEVEL_POS = 0;
public static int ENCODING_SIZE_LEVEL_POS = 7;
public static int ENCODING_BITRATE_LEVEL_POS = 2;
public static int AUDIO_CHANNEL_NUM_POS = 0;

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

mPreviewSizeRatioSpinner = (Spinner) findViewById(R.id.PreviewSizeRatioSpinner);
mPreviewSizeLevelSpinner = (Spinner) findViewById(R.id.PreviewSizeLevelSpinner);
mEncodingModeLevelSpinner = (Spinner) findViewById(R.id.EncodingModeLevelSpinner);
mEncodingSizeLevelSpinner = (Spinner) findViewById(R.id.EncodingSizeLevelSpinner);
mEncodingBitrateLevelSpinner = (Spinner) findViewById(R.id.EncodingBitrateLevelSpinner);
mAudioChannelNumSpinner = (Spinner) findViewById(R.id.AudioChannelNumSpinner);

ArrayAdapter<String> adapter = new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, RecordSettings.PREVIEW_SIZE_RATIO_TIPS_ARRAY);
mPreviewSizeRatioSpinner.setAdapter(adapter);
mPreviewSizeRatioSpinner.setSelection(PREVIEW_SIZE_RATIO_POS);
mPreviewSizeRatioSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
PREVIEW_SIZE_RATIO_POS = position;
}
@Override
public void onNothingSelected(AdapterView<?> parent) {}
});

adapter = new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, RecordSettings.PREVIEW_SIZE_LEVEL_TIPS_ARRAY);
mPreviewSizeLevelSpinner.setAdapter(adapter);
mPreviewSizeLevelSpinner.setSelection(PREVIEW_SIZE_LEVEL_POS);
mPreviewSizeLevelSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
PREVIEW_SIZE_LEVEL_POS = position;
}

@Override
public void onNothingSelected(AdapterView<?> parent) {

}
});

adapter = new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, RecordSettings.ENCODING_MODE_LEVEL_TIPS_ARRAY);
mEncodingModeLevelSpinner.setAdapter(adapter);
mEncodingModeLevelSpinner.setSelection(ENCODING_MODE_LEVEL_POS);
mEncodingModeLevelSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
ENCODING_MODE_LEVEL_POS = position;
}

@Override
public void onNothingSelected(AdapterView<?> parent) {

}
});

adapter = new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, RecordSettings.ENCODING_SIZE_LEVEL_TIPS_ARRAY);
mEncodingSizeLevelSpinner.setAdapter(adapter);
mEncodingSizeLevelSpinner.setSelection(ENCODING_SIZE_LEVEL_POS);
mEncodingSizeLevelSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
ENCODING_SIZE_LEVEL_POS = position;
}

@Override
public void onNothingSelected(AdapterView<?> parent) {

}
});

adapter = new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, RecordSettings.ENCODING_BITRATE_LEVEL_TIPS_ARRAY);
mEncodingBitrateLevelSpinner.setAdapter(adapter);
mEncodingBitrateLevelSpinner.setSelection(ENCODING_BITRATE_LEVEL_POS);
mEncodingBitrateLevelSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
ENCODING_BITRATE_LEVEL_POS = position;
}

@Override
public void onNothingSelected(AdapterView<?> parent) {

}
});

adapter = new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, RecordSettings.AUDIO_CHANNEL_NUM_TIPS_ARRAY);
mAudioChannelNumSpinner.setAdapter(adapter);
mAudioChannelNumSpinner.setSelection(AUDIO_CHANNEL_NUM_POS);
mAudioChannelNumSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
AUDIO_CHANNEL_NUM_POS = position;
}

@Override
public void onNothingSelected(AdapterView<?> parent) {

}
});
}

public void onClickBack(View view) {
finish();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
package com.qiniu.pili.droid.shortvideo.demo.activity;

import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.View;

import com.qiniu.pili.droid.shortvideo.demo.R;
import com.qiniu.pili.droid.shortvideo.demo.utils.PermissionChecker;
import com.qiniu.pili.droid.shortvideo.demo.utils.ToastUtils;

public class ImportAndEditActivity extends AppCompatActivity {

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_import_and_edit);
}

public void onClickImport(View v) {
if (isPermissionOK()) {
jumpToActivity(VideoTrimActivity.class);
}
}

public void onClickTransitionMake(View v) {
if (isPermissionOK()) {
jumpToActivity(VideoDivideActivity.class);
}
}

public void onClickVideoCompose(View v) {
if (isPermissionOK()) {
jumpToActivity(VideoComposeActivity.class);
}
}

public void onClickTranscode(View v) {
if (isPermissionOK()) {
jumpToActivity(VideoTranscodeActivity.class);
}
}

public void onClickMultipleCompose(View v) {
if (isPermissionOK()) {
jumpToActivity(MultipleComposeActivity.class);
}
}

public void onClickExternalMediaRecord(View v) {
if (isPermissionOK()) {
jumpToActivity(ExternalMediaRecordActivity.class);
}
}

private boolean isPermissionOK() {
PermissionChecker checker = new PermissionChecker(this);
boolean isPermissionOK = Build.VERSION.SDK_INT < Build.VERSION_CODES.M || checker.checkPermission();
if (!isPermissionOK) {
ToastUtils.s(this, "Some permissions is not approved !!!");
}
return isPermissionOK;
}

private void jumpToActivity(Class<?> cls) {
Intent intent = new Intent(ImportAndEditActivity.this, cls);
startActivity(intent);
}

public void onClickBack(View view) {
finish();
}
}
Loading

0 comments on commit c261552

Please sign in to comment.