Skip to content

Commit 2389239

Browse files
authored
Merge pull request #183 from ksvc/update
Update
2 parents 13101ff + 6c0ff7d commit 2389239

File tree

328 files changed

+10600
-572
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

328 files changed

+10600
-572
lines changed

KsyunPlayerDemo/.idea/gradle.xml

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

KsyunPlayerDemo/.idea/misc.xml

Lines changed: 1 addition & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

KsyunPlayerDemo/.idea/modules.xml

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

KsyunPlayerDemo/app/build.gradle

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
apply plugin: 'com.android.application'
2-
2+
apply plugin: 'android-apt'
33
android {
4-
compileSdkVersion 24
5-
buildToolsVersion '25.0.0'
4+
compileSdkVersion 25
5+
buildToolsVersion "25.0.0"
66

77
defaultConfig {
88
applicationId "com.ksyun.player.demo"
99
minSdkVersion 16
1010
targetSdkVersion 22
11-
versionCode 204
12-
versionName "2.0.4"
11+
versionCode 205
12+
versionName "2.0.5"
13+
1314
ndk {
1415
abiFilters 'armeabi-v7a', 'arm64-v8a'
1516
}
17+
1618
}
1719
buildTypes {
1820
release {
@@ -21,26 +23,34 @@ android {
2123
}
2224
}
2325
sourceSets.main {
24-
jniLibs.srcDirs 'src/main/libs'
26+
jniLibs.srcDirs 'libs'
2527
jni.srcDirs = [] // This prevents the auto generation of Android.mk
28+
manifest.srcFile 'src/main/AndroidManifest.xml'
2629
}
27-
2830
}
29-
3031
repositories {
3132
flatDir {
32-
dirs 'src/main/libs'
33+
dirs 'libs'
3334
}
3435
}
3536

3637
dependencies {
38+
compile fileTree(dir: 'libs', include: ['*.jar'])
3739
compile fileTree(include: ['*.jar'], dir: 'libs')
3840
compile fileTree(include: '*/so', dir: 'libs/armeabi-v7a')
3941
compile fileTree(include: '*/so', dir: 'libs/arm64-v8a')
40-
compile files('src/main/libs/zxing.jar')
4142
compile(name:'bugly_crashreport_upgrade-1.3.1', ext:'aar')
42-
testCompile 'junit:junit:4.12'
43-
compile 'com.android.support:appcompat-v7:24.0.0'
44-
compile 'com.android.support:design:24.0.0'
43+
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
44+
exclude group: 'com.android.support', module: 'support-annotations'
45+
})
46+
compile project(':oldplayerdemo')
47+
compile project(':newplayerdemo')
4548
compile project(':playerlib')
49+
50+
compile 'com.android.support:appcompat-v7:25.3.1'
51+
compile 'com.android.support:design:25.3.1'
52+
compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha7'
53+
testCompile 'junit:junit:4.12'
54+
compile 'com.github.mzule.activityrouter:activityrouter:1.2.2'
55+
apt 'com.github.mzule.activityrouter:compiler:1.1.7'
4656
}
File renamed without changes.
File renamed without changes.

KsyunPlayerDemo/app/src/main/libs/bugly_crashreport_upgrade-1.3.1.aar renamed to KsyunPlayerDemo/app/libs/bugly_crashreport_upgrade-1.3.1.aar

File renamed without changes.

KsyunPlayerDemo/app/proguard-rules.pro

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Add project specific ProGuard rules here.
22
# By default, the flags in this file are appended to flags specified
3-
# in /Users/xbc/Library/Android/sdk/tools/proguard/proguard-android.txt
3+
# in /Users/zhangyunlong/Documents/android-sdk-macosx/tools/proguard/proguard-android.txt
44
# You can edit the include path and order by changing the proguardFiles
55
# directive in build.gradle.
66
#
@@ -15,3 +15,11 @@
1515
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
1616
# public *;
1717
#}
18+
19+
# Uncomment this to preserve the line number information for
20+
# debugging stack traces.
21+
#-keepattributes SourceFile,LineNumberTable
22+
23+
# If you keep the line number information, uncomment this to
24+
# hide the original source file name.
25+
#-renamesourcefileattribute SourceFile

KsyunPlayerDemo/app/src/main/AndroidManifest.xml

Lines changed: 10 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -2,73 +2,26 @@
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
33
package="com.ksyun.player.demo">
44

5-
<!-- 往sdcard中写入数据的权限 -->
6-
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
7-
<!-- 在sdcard中创建/删除文件的权限 -->
8-
<uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS" />
9-
<uses-permission android:name="android.permission.INTERNET" />
10-
<uses-permission android:name="android.permission.WAKE_LOCK" />
11-
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
12-
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
13-
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
14-
<uses-permission android:name="android.permission.READ_LOGS" />
15-
<uses-permission android:name="android.permission.CAMERA"/>
16-
<uses-permission android:name="android.permission.VIBRATE" />
17-
<uses-permission android:name="android.permission.FLASHLIGHT" />
18-
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
19-
205
<application
216
android:name=".PlayerApplication"
227
android:allowBackup="true"
238
android:icon="@mipmap/ic_launcher"
249
android:label="@string/app_name"
25-
android:supportsRtl="true"
26-
android:theme="@style/AppTheme">
27-
<activity android:name=".ui.activity.MainActivity"
28-
android:screenOrientation="portrait">
10+
android:roundIcon="@mipmap/ic_launcher_round"
11+
android:supportsRtl="true">
12+
<activity
13+
android:name=".ChooseActivity"
14+
android:screenOrientation="portrait"
15+
android:theme="@style/Theme.AppCompat.Light.NoActionBar" />
16+
<activity
17+
android:name=".SplashActivity"
18+
android:screenOrientation="portrait"
19+
android:theme="@style/Theme.AppCompat.Light.NoActionBar">
2920
<intent-filter>
3021
<action android:name="android.intent.action.MAIN" />
31-
3222
<category android:name="android.intent.category.LAUNCHER" />
3323
</intent-filter>
3424
</activity>
35-
<activity android:name=".ui.activity.NetMediaActivty" />
36-
<activity android:name=".ui.activity.player.TextureVideoActivity"
37-
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
38-
android:configChanges="orientation|keyboardHidden|screenSize"
39-
/>
40-
<activity android:name=".ui.activity.player.TextureVodActivity"
41-
android:screenOrientation="landscape"
42-
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
43-
android:configChanges="orientation|keyboardHidden|screenSize"
44-
android:launchMode="singleTop">
45-
</activity>
46-
47-
<activity android:name=".ui.activity.player.MediaPlayerActivity"
48-
android:screenOrientation="landscape"
49-
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
50-
android:configChanges="orientation|keyboardHidden|screenSize"></activity>
51-
52-
<activity android:name=".ui.activity.player.FloatingVideoActivity"
53-
android:screenOrientation="landscape"
54-
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
55-
android:configChanges="orientation|keyboardHidden|screenSize"
56-
/>
57-
<activity android:name=".ui.activity.player.FloatingPlayingActivity"
58-
android:screenOrientation="portrait"
59-
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
60-
android:configChanges="orientation|keyboardHidden|screenSize"
61-
/>
62-
63-
<activity android:name=".ui.activity.SettingActivity"></activity>
64-
<activity
65-
android:configChanges="orientation|keyboardHidden|screenSize"
66-
android:name=".ui.activity.CaptureActivity"
67-
android:screenOrientation="portrait"
68-
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
69-
android:windowSoftInputMode="stateAlwaysHidden" >
70-
</activity>
71-
<activity android:name=".ui.activity.HistoryActivity"></activity>
7225
</application>
7326

7427
</manifest>
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
package com.ksyun.player.demo;
2+
3+
import android.content.Intent;
4+
import android.net.Uri;
5+
import android.os.Build;
6+
import android.os.Bundle;
7+
import android.provider.Settings;
8+
import android.support.v7.app.AppCompatActivity;
9+
import android.view.View;
10+
import android.view.WindowManager;
11+
import android.widget.ImageView;
12+
import android.widget.LinearLayout;
13+
import android.widget.Toast;
14+
15+
import com.github.mzule.activityrouter.router.Routers;
16+
import com.ksyun.player.now.utils.Setting;
17+
18+
19+
public class ChooseActivity extends AppCompatActivity implements View.OnClickListener {
20+
21+
private static final int OVERLAY_PERMISSION_RESULT_CODE = 170;
22+
23+
private LinearLayout toOldVersion;
24+
25+
private ImageView vodImagView,liveImageView;
26+
@Override
27+
protected void onCreate(Bundle savedInstanceState) {
28+
super.onCreate(savedInstanceState);
29+
setContentView(R.layout.activity_choose);
30+
if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.KITKAT){
31+
this.getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
32+
}
33+
initView();
34+
checkPermission();
35+
}
36+
private void initView(){
37+
toOldVersion=(LinearLayout)findViewById(R.id.to_old_version);
38+
vodImagView=(ImageView)findViewById(R.id.vod);
39+
liveImageView=(ImageView)findViewById(R.id.live);
40+
toOldVersion.setOnClickListener(this);
41+
liveImageView.setOnClickListener(this);
42+
vodImagView.setOnClickListener(this);
43+
}
44+
45+
private void checkPermission() {
46+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && !Settings.canDrawOverlays(this)) {
47+
Intent intent = new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION,
48+
Uri.parse("package:" + getPackageName()));
49+
startActivityForResult(intent, OVERLAY_PERMISSION_RESULT_CODE);
50+
}
51+
}
52+
53+
@Override
54+
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
55+
if (requestCode == OVERLAY_PERMISSION_RESULT_CODE) {
56+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M)
57+
if (!Settings.canDrawOverlays(this))
58+
Toast.makeText(this, "Permission SYSTEM_ALERT_WINDOW not granted", Toast.LENGTH_SHORT).show();
59+
}
60+
}
61+
62+
@Override
63+
public void onClick(View view) {
64+
switch (view.getId()){
65+
case R.id.to_old_version:
66+
Routers.open(ChooseActivity.this, "oldVersionMain://oldMain");
67+
break;
68+
case R.id.vod:
69+
Routers.open(ChooseActivity.this, "vod://vodMain");
70+
break;
71+
case R.id.live:
72+
Routers.open(ChooseActivity.this, "live://liveMain");
73+
break;
74+
default:
75+
break;
76+
}
77+
}
78+
}

0 commit comments

Comments
 (0)