Commit ebcabd06 authored by Hanruisong's avatar Hanruisong
Browse files

feat: 更新到 v3.13.0

1.新增防拖拽功能。
parent 7025d666
apply plugin: 'com.android.application'
apply plugin: 'io.objectbox'
android {
compileSdkVersion 29
defaultConfig {
applicationId "com.bokecc.vod"
minSdkVersion 17
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
//使用投屏功能时需要添加此配置
packagingOptions {
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/beans.xml'
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
//获得场景视频SDK,必须引入
implementation 'com.bokecc:vod:3.13.0'
//必须引用commonLib
implementation 'com.bokecc:commonLib:0.1.12'
//必须引用
implementation 'com.bokecc:drm:1.2.1'
//使用DWIjkMediaPlayer 倍速播放器引入
implementation 'com.bokecc:hdplayer:1.1.0_lite'
//上传视频时使用压缩功能时需要引用
implementation 'com.bokecc:compressvideo:1.0.0'
//使用Vr播放功能时需要引入
implementation 'com.bokecc:vrplay:1.0.0'
//使用投屏功能需要引用
implementation 'com.bokecc:projection:1.7.0'
//弹幕
implementation 'com.github.ctiao:DanmakuFlameMaster:0.9.25'
//noinspection GradleCompatible
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.github.bumptech.glide:glide:4.9.0'
implementation 'com.squareup.picasso:picasso:2.5.2'
}
apply plugin: 'com.android.application'
apply plugin: 'io.objectbox'
android {
compileSdkVersion 29
defaultConfig {
applicationId "com.bokecc.vod"
minSdkVersion 17
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
//使用投屏功能时需要添加此配置
packagingOptions {
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/beans.xml'
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
//获得场景视频SDK,必须引入
implementation 'com.bokecc:vod:3.13.0'
//必须引用commonLib
implementation 'com.bokecc:commonLib:0.1.12'
//必须引用
implementation 'com.bokecc:drm:1.2.1'
//使用DWIjkMediaPlayer 倍速播放器引入
implementation 'com.bokecc:hdplayer:1.1.0_lite'
//上传视频时使用压缩功能时需要引用
implementation 'com.bokecc:compressvideo:1.0.0'
//使用Vr播放功能时需要引入
implementation 'com.bokecc:vrplay:1.0.0'
//使用投屏功能需要引用
implementation 'com.bokecc:projection:1.7.0'
//弹幕
implementation 'com.github.ctiao:DanmakuFlameMaster:0.9.25'
//noinspection GradleCompatible
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.github.bumptech.glide:glide:4.9.0'
implementation 'com.squareup.picasso:picasso:2.5.2'
}
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
package com.bokecc.vod;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.bokecc.vod", appContext.getPackageName());
}
}
package com.bokecc.vod;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.bokecc.vod", appContext.getPackageName());
}
}
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.bokecc.vod">
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE" />
<uses-permission android:name="android.permission.VIBRATE"/>
<application
android:name=".HuodeApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/Theme.AppCompat.DayNight.NoActionBar"
android:usesCleartextTraffic="true"
android:requestLegacyExternalStorage="true">
<activity
android:name=".MainActivity"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".play.SpeedPlayActivity"
android:configChanges="orientation|keyboardHidden|screenSize|smallestScreenSize|screenLayout"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan|stateHidden|adjustResize"
android:supportsPictureInPicture="true" />
<activity
android:name=".play.MediaPlayActivity"
android:configChanges="orientation|keyboardHidden|screenSize|smallestScreenSize|screenLayout"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan|stateHidden|adjustResize"
android:supportsPictureInPicture="true" />
<activity
android:name=".play.VrPlayActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:screenOrientation="portrait" />
<activity
android:name=".AccountInfoActivity"
android:screenOrientation="portrait" />
<service android:name=".download.DownloadService" />
<activity
android:name=".download.DownloadListActivity"
android:screenOrientation="portrait" />
<activity
android:name=".upload.UploadManageActivity"
android:screenOrientation="portrait" />
<activity
android:name=".upload.EditVideoInfoActivity"
android:screenOrientation="portrait" />
<service android:name=".upload.UploadService" />
<!--使用投屏功能时需要配置ProjectionUpnpService-->
<service
android:name="com.bokecc.projection.ProjectionUpnpService"
android:exported="false" />
<!--使用投屏功能时需要配置ProjectionSystemService-->
<service
android:name="com.bokecc.projection.ProjectionSystemService"
android:exported="false" />
</application>
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.bokecc.vod">
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE" />
<uses-permission android:name="android.permission.VIBRATE"/>
<application
android:name=".HuodeApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/Theme.AppCompat.DayNight.NoActionBar"
android:usesCleartextTraffic="true"
android:requestLegacyExternalStorage="true">
<activity
android:name=".MainActivity"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".play.SpeedPlayActivity"
android:configChanges="orientation|keyboardHidden|screenSize|smallestScreenSize|screenLayout"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan|stateHidden|adjustResize"
android:supportsPictureInPicture="true" />
<activity
android:name=".play.MediaPlayActivity"
android:configChanges="orientation|keyboardHidden|screenSize|smallestScreenSize|screenLayout"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan|stateHidden|adjustResize"
android:supportsPictureInPicture="true" />
<activity
android:name=".play.VrPlayActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:screenOrientation="portrait" />
<activity
android:name=".AccountInfoActivity"
android:screenOrientation="portrait" />
<service android:name=".download.DownloadService" />
<activity
android:name=".download.DownloadListActivity"
android:screenOrientation="portrait" />
<activity
android:name=".upload.UploadManageActivity"
android:screenOrientation="portrait" />
<activity
android:name=".upload.EditVideoInfoActivity"
android:screenOrientation="portrait" />
<service android:name=".upload.UploadService" />
<!--使用投屏功能时需要配置ProjectionUpnpService-->
<service
android:name="com.bokecc.projection.ProjectionUpnpService"
android:exported="false" />
<!--使用投屏功能时需要配置ProjectionSystemService-->
<service
android:name="com.bokecc.projection.ProjectionSystemService"
android:exported="false" />
</application>
</manifest>
\ No newline at end of file
package com.bokecc.vod;
import android.app.Activity;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.text.TextUtils;
import android.view.View;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;
import com.bokecc.vod.utils.MultiUtils;
public class AccountInfoActivity extends AppCompatActivity {
private Activity activity;
private TextView tv_user_id, tv_api_key;
private EditText et_verification_code;
private ImageView iv_back;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_account_info);
MultiUtils.setStatusBarColor(this, R.color.transparent, true);
activity = this;
initView();
}
private void initView() {
tv_user_id = findViewById(R.id.tv_user_id);
tv_api_key = findViewById(R.id.tv_api_key);
et_verification_code = findViewById(R.id.et_verification_code);
iv_back = findViewById(R.id.iv_back);
if (!TextUtils.isEmpty(MultiUtils.getVerificationCode())) {
et_verification_code.setText(MultiUtils.getVerificationCode());
}
tv_user_id.setText(ConfigUtil.USERID);
tv_api_key.setText(ConfigUtil.API_KEY);
iv_back.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
}
@Override
protected void onDestroy() {
super.onDestroy();
String code = et_verification_code.getText().toString().trim();
MultiUtils.setVerificationCode(code);
}
}
package com.bokecc.vod;
import android.app.Activity;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.text.TextUtils;
import android.view.View;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;
import com.bokecc.vod.utils.MultiUtils;
public class AccountInfoActivity extends AppCompatActivity {
private Activity activity;
private TextView tv_user_id, tv_api_key;
private EditText et_verification_code;
private ImageView iv_back;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_account_info);
MultiUtils.setStatusBarColor(this, R.color.transparent, true);
activity = this;
initView();
}
private void initView() {
tv_user_id = findViewById(R.id.tv_user_id);
tv_api_key = findViewById(R.id.tv_api_key);
et_verification_code = findViewById(R.id.et_verification_code);
iv_back = findViewById(R.id.iv_back);
if (!TextUtils.isEmpty(MultiUtils.getVerificationCode())) {
et_verification_code.setText(MultiUtils.getVerificationCode());
}
tv_user_id.setText(ConfigUtil.USERID);
tv_api_key.setText(ConfigUtil.API_KEY);
iv_back.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
}
@Override
protected void onDestroy() {
super.onDestroy();
String code = et_verification_code.getText().toString().trim();
MultiUtils.setVerificationCode(code);
}
}
package com.bokecc.vod;
public class ConfigUtil {
//账号ID 可以替换为自己的USERID
public static final String USERID = "391E6E3340A00767";
//可以替换为自己的API_KEY
public static final String API_KEY = "T8WdOUuvFEiOsou1xjDr4U73v12M7iNa";
//获取视频信息的地址
public final static String DATA_URL = "https://p.bokecc.com/demo/videoinfo.json";
// 配置下载文件路径
public final static String DOWNLOAD_PATH = "HuodeDownload";
//下载重试次数
public final static int DOWNLOAD_RECONNECT_LIMIT = 60;
// 配置同时下载个数
public final static int DOWNLOADING_MAX = 2;
// 配置同时上传个数
public final static int UPLOADING_MAX = 2;
public final static int DOWNLOAD_FRAGMENT_MAX_TAB_SIZE = 2;
public final static String ACTION_UPLOAD = "video.upload";
// 配置视频回调地址
public final static String NOTIFY_URL = "http://www.example.com";
}
package com.bokecc.vod;
public class ConfigUtil {
//账号ID 可以替换为自己的USERID
public static final String USERID = "391E6E3340A00767";
//可以替换为自己的API_KEY
public static final String API_KEY = "T8WdOUuvFEiOsou1xjDr4U73v12M7iNa";
//获取视频信息的地址
public final static String DATA_URL = "https://p.bokecc.com/demo/videoinfo.json";
// 配置下载文件路径
public final static String DOWNLOAD_PATH = "HuodeDownload";
//下载重试次数
public final static int DOWNLOAD_RECONNECT_LIMIT = 60;
// 配置同时下载个数
public final static int DOWNLOADING_MAX = 2;
// 配置同时上传个数
public final static int UPLOADING_MAX = 2;
public final static int DOWNLOAD_FRAGMENT_MAX_TAB_SIZE = 2;
public final static String ACTION_UPLOAD = "video.upload";
// 配置视频回调地址
public final static String NOTIFY_URL = "http://www.example.com";
}
package com.bokecc.vod;
import android.app.Application;
import android.content.Context;
import android.content.SharedPreferences;
import android.util.Log;
import android.widget.Toast;
import com.bokecc.sdk.mobile.download.VodDownloadManager;
import com.bokecc.sdk.mobile.drm.DRMServer;
import com.bokecc.sdk.mobile.util.DWSdkStorage;
import com.bokecc.sdk.mobile.util.DWStorageUtil;
import com.bokecc.sdk.mobile.util.HttpUtil;
import com.bokecc.vod.data.ObjectBox;
import com.bokecc.vod.utils.MultiUtils;
public class HuodeApplication extends Application {
private static DRMServer drmServer;
public static Context context;
private static int drmServerPort;
public static SharedPreferences sp;
@Override
public void onCreate() {