Skip to content

Commit

Permalink
update sdk and demo
Browse files Browse the repository at this point in the history
  • Loading branch information
xinbaicheng committed Nov 9, 2016
1 parent 6fd6f9d commit 1cb1145
Show file tree
Hide file tree
Showing 209 changed files with 5,315 additions and 8,710 deletions.
1 change: 1 addition & 0 deletions LiveDemo/.gitignore → KSYLiveDemo/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
.DS_Store
/build
/captures
.externalNativeBuild
File renamed without changes.
File renamed without changes.
8 changes: 2 additions & 6 deletions LiveDemo/.idea/gradle.xml → KSYLiveDemo/.idea/gradle.xml

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

16 changes: 16 additions & 0 deletions LiveDemo/.idea/misc.xml → KSYLiveDemo/.idea/misc.xml

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

3 changes: 2 additions & 1 deletion LiveDemo/.idea/modules.xml → KSYLiveDemo/.idea/modules.xml

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

File renamed without changes.
File renamed without changes.
19 changes: 5 additions & 14 deletions LiveDemo/app/build.gradle → KSYLiveDemo/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,27 @@ apply plugin: 'com.android.application'

android {
compileSdkVersion 24
buildToolsVersion "24.0.0"

buildToolsVersion "24.0.1"
defaultConfig {
applicationId "com.ksyun.live.demo"
minSdkVersion 16
minSdkVersion 15
targetSdkVersion 24
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

sourceSets{
main{
jniLibs.srcDir 'libs'
}
}
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.1.1'
compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.android.support:design:24.1.1'
compile project(':libksylive')
compile files('libs/zxing.jar')
compile files('libs/bugly_crash_release.jar')
compile project(':livelib')
}
File renamed without changes.
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/liubohua/Library/Android/sdk/tools/proguard/proguard-android.txt
# in /Users/le/Library/Android/sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ksyun.live.demo">



<uses-feature android:glEsVersion="0x00020000" android:required="true" />
<supports-gl-texture android:name="GL_OES_compressed_ETC1_RGB8_texture" />
<supports-gl-texture android:name="GL_OES_compressed_paletted_texture" />

package="com.ksyun.live.demo"
android:installLocation="preferExternal">

<!-- 往sdcard中写入数据的权限 -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission-sdk-23 android:name="android.permission.READ_EXTERNAL_STORAGE" />
<!-- 在sdcard中创建/删除文件的权限 -->
<uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS" />
<!-- 使用权限 -->
Expand All @@ -33,66 +28,61 @@
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.FLASHLIGHT" />


<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">

<activity android:name="com.ksyun.live.demo.MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<activity
android:name="com.ksyun.live.demo.StreamActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:launchMode="singleTop" />
<activity
android:name="com.ksyun.live.demo.CameraActivityAudioEffect"
android:configChanges="orientation|keyboardHidden|screenSize"
android:launchMode="singleTop" />
<activity
android:name="com.ksyun.live.demo.CameraActivityPip"
android:configChanges="orientation|keyboardHidden|screenSize"
android:launchMode="singleTop" />
<activity
android:name="com.ksyun.live.demo.CameraActivityOther"
android:configChanges="orientation|keyboardHidden|screenSize"
android:launchMode="singleTop" />
<activity
android:name="com.ksyun.live.demo.CameraActivityWaterLogo"
android:name="com.ksyun.live.demo.player.activity.TextureVideoActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:launchMode="singleTop" />
<activity
android:name="com.ksyun.live.demo.CameraActivityAudioMix"

<activity android:name="com.ksyun.live.demo.player.activity.TextureViewMediaActivity"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:configChanges="orientation|keyboardHidden|screenSize"
android:launchMode="singleTop" />
/>
<activity
android:name="com.ksyun.live.demo.CameraActivityBeauty"
android:name="com.ksyun.live.demo.player.activity.SurfaceActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:launchMode="singleTop" />


<activity android:name=".activity.PlayerActivity"></activity>

<activity android:name=".activity.NetMediaActivty" />
<activity android:name=".activity.VideoPlayerActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
/>
<activity android:name=".activity.SettingActivity"></activity>
<activity android:name=".player.activity.PlayerActivity" ></activity>
<activity android:name="com.ksyun.live.demo.player.activity.NetMediaActivty" ></activity>
<activity android:name="com.ksyun.live.demo.player.activity.SettingActivity"></activity>
<activity
android:configChanges="orientation|keyboardHidden"
android:name=".activity.CaptureActivity"
android:name="com.ksyun.live.demo.player.activity.CaptureActivity"
android:screenOrientation="portrait"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:windowSoftInputMode="stateAlwaysHidden" >
</activity>
<activity android:name=".activity.HistoryActivity"></activity>
<activity android:name="com.ksyun.live.demo.player.activity.HistoryActivity"></activity>

<activity
android:name="com.ksyun.media.streamer.demo.DemoActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:launchMode="singleTop"
android:screenOrientation="portrait"
android:theme="@style/Theme.RiseAnimation">
</activity>
<activity
android:name="com.ksyun.media.streamer.demo.CameraActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:launchMode="singleTop"
android:theme="@style/Theme.RiseAnimation">
</activity>

</application>

</manifest>
</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import android.view.View;
import android.widget.Button;

import com.ksyun.live.demo.activity.PlayerActivity;
import com.tencent.bugly.crashreport.CrashReport;
import com.ksyun.live.demo.player.activity.PlayerActivity;
import com.ksyun.media.streamer.demo.DemoActivity;


public class MainActivity extends AppCompatActivity {
Expand All @@ -20,14 +20,13 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

CrashReport.initCrashReport(getApplicationContext(), "900040861", true);
btn_player = (Button)findViewById(R.id.btn_player);
btn_stream = (Button)findViewById(R.id.btn_stream);

btn_stream.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(MainActivity.this,StreamActivity.class);
Intent intent = new Intent(MainActivity.this,DemoActivity.class);
startActivity(intent);
}
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ksyun.live.demo.activity;
package com.ksyun.live.demo.player.activity;

import android.app.Activity;
import android.content.Intent;
Expand All @@ -21,16 +21,16 @@
import com.google.zxing.BarcodeFormat;
import com.google.zxing.Result;
import com.ksyun.live.demo.R;
import com.ksyun.live.demo.zxing.camera.CameraManager;
import com.ksyun.live.demo.zxing.decoding.CaptureActivityHandler;
import com.ksyun.live.demo.zxing.decoding.InactivityTimer;
import com.ksyun.live.demo.zxing.view.ViewfinderView;

import com.ksyun.live.demo.player.zxing.camera.CameraManager;
import com.ksyun.live.demo.player.zxing.decoding.CaptureActivityHandler;
import com.ksyun.live.demo.player.zxing.decoding.InactivityTimer;
import com.ksyun.live.demo.player.zxing.view.ViewfinderView;

import java.io.IOException;
import java.util.Vector;



/**
* Initial the camera
* @author Ryan.Tang
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ksyun.live.demo.activity;
package com.ksyun.live.demo.player.activity;

import android.app.Activity;
import android.content.Context;
Expand All @@ -8,64 +8,71 @@
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.SimpleAdapter;

import com.ksyun.live.demo.R;
import com.ksyun.live.demo.model.NetDbAdapter;
import com.ksyun.live.demo.util.Settings;
import com.ksyun.live.demo.player.model.NetDbAdapter;
import com.ksyun.live.demo.player.util.Settings;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

/**
* Created by liubohua on 16/7/20.
*/
public class HistoryActivity extends Activity{
private ListView hislist;
private ArrayList<Map<String,String>> listurl;
private ArrayList<String> listurl;
private Cursor cursor;
private NetDbAdapter NetDb;

private SharedPreferences settings;
private String choosevr;


@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_history);
listurl = new ArrayList<Map<String,String>>();
settings = getSharedPreferences("SETTINGS", Context.MODE_PRIVATE);
choosevr = settings.getString("choose_vr","信息为空");
listurl = new ArrayList<String>();

hislist = (ListView) findViewById(R.id.list_history);
NetDb = new NetDbAdapter(HistoryActivity.this);
NetDb.open();
cursor = NetDb.getAllData();
cursor.moveToFirst();
if(cursor.getCount()>0){
Map<String,String> map = new HashMap<String,String>();
map.put("url", cursor.getString(cursor.getColumnIndex(NetDbAdapter.KEY_PATH)));
listurl.add(map);
listurl.add( cursor.getString(cursor.getColumnIndex(NetDbAdapter.KEY_PATH)));
}
while(cursor.moveToNext()){
Map<String,String> map = new HashMap<String,String>();
map.put("url", cursor.getString(cursor.getColumnIndex(NetDbAdapter.KEY_PATH)));
listurl.add(map);
listurl.add( cursor.getString(cursor.getColumnIndex(NetDbAdapter.KEY_PATH)));
}
SimpleAdapter adapter = new SimpleAdapter(this,listurl,R.layout.list_history,new String[]{"url"},new int[]{R.id.list_history_txt});

ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,android.R.layout.simple_expandable_list_item_1,listurl);
hislist.setAdapter(adapter);
hislist.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
String path = listurl.get(i).get("url");
Intent intent = new Intent(HistoryActivity.this,VideoPlayerActivity.class);
String path = listurl.get(i);

String chooseview;
settings = getSharedPreferences("SETTINGS", Context.MODE_PRIVATE);
chooseview = settings.getString("choose_view","undefind");

if(chooseview.equals(Settings.USEKSYTEXTURE)){
Intent intent = new Intent(HistoryActivity.this,TextureVideoActivity.class);
intent.putExtra("path",path);
startActivity(intent);

}
else if (chooseview.equals(Settings.USEKGLRENDER)){
Intent intent = new Intent(HistoryActivity.this,TextureViewMediaActivity.class);
intent.putExtra("path",path);
startActivity(intent);
}
else{
Intent intent = new Intent(HistoryActivity.this,SurfaceActivity.class);
intent.putExtra("path",path);
startActivity(intent);
}
}
});

Expand Down
Loading

0 comments on commit 1cb1145

Please sign in to comment.