Skip to content

Commit

Permalink
Merge pull request #183 from ksvc/update
Browse files Browse the repository at this point in the history
Update
  • Loading branch information
FirmianaRain authored Sep 14, 2017
2 parents 13101ff + 6c0ff7d commit 2389239
Show file tree
Hide file tree
Showing 328 changed files with 10,600 additions and 572 deletions.
2 changes: 2 additions & 0 deletions KsyunPlayerDemo/.idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 1 addition & 4 deletions KsyunPlayerDemo/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions KsyunPlayerDemo/.idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 23 additions & 13 deletions KsyunPlayerDemo/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
apply plugin: 'com.android.application'

apply plugin: 'android-apt'
android {
compileSdkVersion 24
buildToolsVersion '25.0.0'
compileSdkVersion 25
buildToolsVersion "25.0.0"

defaultConfig {
applicationId "com.ksyun.player.demo"
minSdkVersion 16
targetSdkVersion 22
versionCode 204
versionName "2.0.4"
versionCode 205
versionName "2.0.5"

ndk {
abiFilters 'armeabi-v7a', 'arm64-v8a'
}

}
buildTypes {
release {
Expand All @@ -21,26 +23,34 @@ android {
}
}
sourceSets.main {
jniLibs.srcDirs 'src/main/libs'
jniLibs.srcDirs 'libs'
jni.srcDirs = [] // This prevents the auto generation of Android.mk
manifest.srcFile 'src/main/AndroidManifest.xml'
}

}

repositories {
flatDir {
dirs 'src/main/libs'
dirs 'libs'
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile fileTree(include: ['*.jar'], dir: 'libs')
compile fileTree(include: '*/so', dir: 'libs/armeabi-v7a')
compile fileTree(include: '*/so', dir: 'libs/arm64-v8a')
compile files('src/main/libs/zxing.jar')
compile(name:'bugly_crashreport_upgrade-1.3.1', ext:'aar')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.0.0'
compile 'com.android.support:design:24.0.0'
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile project(':oldplayerdemo')
compile project(':newplayerdemo')
compile project(':playerlib')

compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha7'
testCompile 'junit:junit:4.12'
compile 'com.github.mzule.activityrouter:activityrouter:1.2.2'
apt 'com.github.mzule.activityrouter:compiler:1.1.7'
}
File renamed without changes.
File renamed without changes.
10 changes: 9 additions & 1 deletion KsyunPlayerDemo/app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /Users/xbc/Library/Android/sdk/tools/proguard/proguard-android.txt
# in /Users/zhangyunlong/Documents/android-sdk-macosx/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
Expand All @@ -15,3 +15,11 @@
#-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
67 changes: 10 additions & 57 deletions KsyunPlayerDemo/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,73 +2,26 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ksyun.player.demo">

<!-- 往sdcard中写入数据的权限 -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<!-- 在sdcard中创建/删除文件的权限 -->
<uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.READ_LOGS" />
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.FLASHLIGHT" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />

<application
android:name=".PlayerApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".ui.activity.MainActivity"
android:screenOrientation="portrait">
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true">
<activity
android:name=".ChooseActivity"
android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.Light.NoActionBar" />
<activity
android:name=".SplashActivity"
android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.Light.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".ui.activity.NetMediaActivty" />
<activity android:name=".ui.activity.player.TextureVideoActivity"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:configChanges="orientation|keyboardHidden|screenSize"
/>
<activity android:name=".ui.activity.player.TextureVodActivity"
android:screenOrientation="landscape"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:configChanges="orientation|keyboardHidden|screenSize"
android:launchMode="singleTop">
</activity>

<activity android:name=".ui.activity.player.MediaPlayerActivity"
android:screenOrientation="landscape"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:configChanges="orientation|keyboardHidden|screenSize"></activity>

<activity android:name=".ui.activity.player.FloatingVideoActivity"
android:screenOrientation="landscape"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:configChanges="orientation|keyboardHidden|screenSize"
/>
<activity android:name=".ui.activity.player.FloatingPlayingActivity"
android:screenOrientation="portrait"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:configChanges="orientation|keyboardHidden|screenSize"
/>

<activity android:name=".ui.activity.SettingActivity"></activity>
<activity
android:configChanges="orientation|keyboardHidden|screenSize"
android:name=".ui.activity.CaptureActivity"
android:screenOrientation="portrait"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:windowSoftInputMode="stateAlwaysHidden" >
</activity>
<activity android:name=".ui.activity.HistoryActivity"></activity>
</application>

</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
package com.ksyun.player.demo;

import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.provider.Settings;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.view.WindowManager;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.Toast;

import com.github.mzule.activityrouter.router.Routers;
import com.ksyun.player.now.utils.Setting;


public class ChooseActivity extends AppCompatActivity implements View.OnClickListener {

private static final int OVERLAY_PERMISSION_RESULT_CODE = 170;

private LinearLayout toOldVersion;

private ImageView vodImagView,liveImageView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_choose);
if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.KITKAT){
this.getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
}
initView();
checkPermission();
}
private void initView(){
toOldVersion=(LinearLayout)findViewById(R.id.to_old_version);
vodImagView=(ImageView)findViewById(R.id.vod);
liveImageView=(ImageView)findViewById(R.id.live);
toOldVersion.setOnClickListener(this);
liveImageView.setOnClickListener(this);
vodImagView.setOnClickListener(this);
}

private void checkPermission() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && !Settings.canDrawOverlays(this)) {
Intent intent = new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION,
Uri.parse("package:" + getPackageName()));
startActivityForResult(intent, OVERLAY_PERMISSION_RESULT_CODE);
}
}

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == OVERLAY_PERMISSION_RESULT_CODE) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M)
if (!Settings.canDrawOverlays(this))
Toast.makeText(this, "Permission SYSTEM_ALERT_WINDOW not granted", Toast.LENGTH_SHORT).show();
}
}

@Override
public void onClick(View view) {
switch (view.getId()){
case R.id.to_old_version:
Routers.open(ChooseActivity.this, "oldVersionMain://oldMain");
break;
case R.id.vod:
Routers.open(ChooseActivity.this, "vod://vodMain");
break;
case R.id.live:
Routers.open(ChooseActivity.this, "live://liveMain");
break;
default:
break;
}
}
}
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
package com.ksyun.player.demo;

import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.os.Build;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.TextView;

import com.github.mzule.activityrouter.annotation.Module;
import com.github.mzule.activityrouter.annotation.Modules;

import java.util.Timer;
import java.util.TimerTask;



@Modules({"app", "oldplayerdemo", "newplayerdemo"})
@Module("app")
public class SplashActivity extends AppCompatActivity {

private Button button;
private TextView textView;
private Timer timer;
private TimerTask timerTask;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash);
if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.KITKAT){
this.getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
}
button=(Button)findViewById(R.id.button);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
jumpToNext();

}
});
textView=(TextView)findViewById(R.id.sdk_version);
String version=getVersion();
if(!version.equals("error")){
textView.setText("SDK V"+version+"版本");
}
setTimer();
}
private void setTimer(){
timerTask=new MyTimerTask();
timer=new Timer();
timer.schedule(timerTask,3000);
}
private void jumpToNext(){
Intent intent=new Intent(SplashActivity.this, ChooseActivity.class);
startActivity(intent);
timer.cancel();
finish();
}
private String getVersion(){
try {
PackageManager manager=getPackageManager();
PackageInfo packageInfo=manager.getPackageInfo(getPackageName(),0);
String version=packageInfo.versionName;
return version;
} catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
return "error";
}

}
private class MyTimerTask extends TimerTask
{
@Override
public void run() {
jumpToNext();
}
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions KsyunPlayerDemo/app/src/main/res/drawable/to_old_version.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/white" android:state_pressed="true" />
<item android:drawable="@color/colorAccent" android:state_pressed="false" />
<item android:drawable="@color/white" />
</selector>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 2389239

Please sign in to comment.