Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit dccf264

Browse files
author
chenyouwei
committed
feat:新增webrtc模块
1 parent 4c322c3 commit dccf264

File tree

13 files changed

+155
-6
lines changed

13 files changed

+155
-6
lines changed

‎.idea/gradle.xml‎

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

‎app/build.gradle‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,5 @@ dependencies {
5858
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
5959
implementation "com.zhl.commonadapter:commonadapter:0.4.0"
6060
implementation project(':libsoundtouch')
61+
implementation project(':libwebrtc')
6162
}

‎app/src/main/java/com/hugh/audiofun/MainActivity.java‎

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import android.widget.ListView;
1111
import android.widget.TextView;
1212

13+
import com.hugh.libwebrtc.RtcActivity;
1314
import com.hugh.sound.SoundTouch;
1415
import com.hugh.sound.SoundTouchActivity;
1516
import com.zhl.commonadapter.BaseViewHolder;
@@ -65,9 +66,12 @@ public BaseViewHolder<Item> createViewHolder(int type) {
6566
play3D(path);
6667
break;
6768
case TYPE_GO:
68-
Intent intent =new Intent(MainActivity.this,SoundTouchActivity.class);
69+
Intent intent =new Intent(MainActivity.this,SoundTouchActivity.class);
6970
startActivity(intent);
7071
break;
72+
case TYPE_GO_WEBRTC:
73+
startActivity(new Intent(MainActivity.this, RtcActivity.class));
74+
break;
7175
default:
7276
break;
7377
}
@@ -77,22 +81,22 @@ public BaseViewHolder<Item> createViewHolder(int type) {
7781
// goToSoundTouch();
7882
}
7983

80-
private void goToSoundTouch(){
84+
private void goToSoundTouch(){
8185
Intent intent = new Intent(MainActivity.this, SoundTouchActivity.class);
8286
startActivity(intent);
8387
}
8488

85-
private void play3D(String path){
86-
FmodSound.play3DSound(path);
89+
private void play3D(String path){
90+
FmodSound.play3DSound(path);
8791
}
8892

8993
enum Item {
9094
TYPE_GO("进入soundTouch"),
9195
TYPE_PLAY_1("播放萝莉"),
9296
TYPE_PLAY_2("播放空灵"),
9397
TYPE_PLAY_3("播放颤音"),
94-
TYPE_PLAY_4("混响功能使用");
95-
98+
TYPE_PLAY_4("混响功能使用"),
99+
TYPE_GO_WEBRTC("进入webRtc");
96100

97101

98102
private String title;

‎libwebrtc/.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

‎libwebrtc/build.gradle‎

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
apply plugin: 'com.android.library'
2+
3+
android {
4+
compileSdkVersion 29
5+
buildToolsVersion "29.0.3"
6+
7+
defaultConfig {
8+
minSdkVersion 16
9+
targetSdkVersion 29
10+
versionCode 1
11+
versionName "1.0"
12+
13+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
14+
consumerProguardFiles 'consumer-rules.pro'
15+
}
16+
17+
buildTypes {
18+
release {
19+
minifyEnabled false
20+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
21+
}
22+
}
23+
24+
}
25+
26+
dependencies {
27+
implementation fileTree(dir: 'libs', include: ['*.jar'])
28+
29+
implementation 'androidx.appcompat:appcompat:1.1.0'
30+
testImplementation 'junit:junit:4.12'
31+
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
32+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
33+
implementation 'org.webrtc:google-webrtc:1.0.28513'
34+
implementation 'org.java-websocket:Java-WebSocket:1.4.0'
35+
}

‎libwebrtc/consumer-rules.pro‎

Whitespace-only changes.

‎libwebrtc/proguard-rules.pro‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Add project specific ProGuard rules here.
2+
# You can control the set of applied configuration files using the
3+
# proguardFiles setting in build.gradle.
4+
#
5+
# For more details, see
6+
# http://developer.android.com/guide/developing/tools/proguard.html
7+
8+
# If your project uses WebView with JS, uncomment the following
9+
# and specify the fully qualified class name to the JavaScript interface
10+
# class:
11+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12+
# public *;
13+
#}
14+
15+
# Uncomment this to preserve the line number information for
16+
# debugging stack traces.
17+
#-keepattributes SourceFile,LineNumberTable
18+
19+
# If you keep the line number information, uncomment this to
20+
# hide the original source file name.
21+
#-renamesourcefileattribute SourceFile
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package com.hugh.libwebrtc;
2+
3+
import android.content.Context;
4+
5+
import androidx.test.platform.app.InstrumentationRegistry;
6+
import androidx.test.ext.junit.runners.AndroidJUnit4;
7+
8+
import org.junit.Test;
9+
import org.junit.runner.RunWith;
10+
11+
import static org.junit.Assert.*;
12+
13+
/**
14+
* Instrumented test, which will execute on an Android device.
15+
*
16+
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
17+
*/
18+
@RunWith(AndroidJUnit4.class)
19+
public class ExampleInstrumentedTest {
20+
@Test
21+
public void useAppContext() {
22+
// Context of the app under test.
23+
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
24+
25+
assertEquals("com.hugh.libwebrtc.test", appContext.getPackageName());
26+
}
27+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2+
package="com.hugh.libwebrtc" >
3+
<application >
4+
<activity android:name=".RtcActivity"/>
5+
</application>
6+
</manifest>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package com.hugh.libwebrtc;
2+
3+
import android.os.Bundle;
4+
5+
import org.webrtc.PeerConnection;
6+
7+
import androidx.annotation.Nullable;
8+
import androidx.appcompat.app.AppCompatActivity;
9+
10+
/**
11+
* Created by chenyw on 2020年7月24日.
12+
*/
13+
public class RtcActivity extends AppCompatActivity {
14+
15+
@Override
16+
protected void onCreate(@Nullable Bundle savedInstanceState) {
17+
super.onCreate(savedInstanceState);
18+
19+
20+
setContentView(R.layout.module_rtc_activity_main);
21+
}
22+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /