Skip to content

Commit adcb0ba

Browse files
authored
feat: expose audio attributes for android (#19)
1 parent 8ed1041 commit adcb0ba

File tree

4 files changed

+51
-26
lines changed

4 files changed

+51
-26
lines changed

android/build.gradle

Lines changed: 44 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,54 @@
1-
import java.nio.file.Paths
2-
31
buildscript {
4-
ext.getExtOrDefault = {name, fallback ->
5-
return rootProject.ext.has(name) ? rootProject.ext.get(name) : fallback
6-
}
2+
ext.getExtOrDefault = {name, fallback ->
3+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : fallback
4+
}
75

8-
repositories {
9-
google()
10-
mavenCentral()
11-
maven { url 'https://central.sonatype.com/repository/maven-snapshots/' }
12-
}
13-
14-
dependencies {
15-
classpath("com.android.tools.build:gradle:7.3.1")
16-
// noinspection DifferentKotlinGradleVersion
17-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${getExtOrDefault('kotlinVersion', '1.8.10')}"
18-
}
6+
repositories {
7+
google()
8+
mavenCentral()
9+
}
10+
11+
dependencies {
12+
classpath("com.android.tools.build:gradle:7.3.1")
13+
// noinspection DifferentKotlinGradleVersion
14+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${getExtOrDefault('kotlinVersion', '1.8.10')}"
15+
}
1916
}
2017

2118
apply plugin: "com.android.library"
2219
apply plugin: "kotlin-android"
2320

21+
rootProject.allprojects {
22+
repositories {
23+
maven {
24+
name = 'Central Portal Snapshots'
25+
url = 'https://central.sonatype.com/repository/maven-snapshots/'
26+
content {
27+
// This efficiently tells Gradle to only look for this specific dependency here
28+
includeModule('io.getstream', 'stream-webrtc-android')
29+
}
30+
}
31+
}
32+
}
33+
34+
repositories {
35+
mavenCentral()
36+
google()
37+
}
38+
39+
40+
2441
def safeExtGet(prop, fallback) {
2542
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
2643
}
2744

2845
def supportsNamespace() {
29-
def parsed = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')
30-
def major = parsed[0].toInteger()
31-
def minor = parsed[1].toInteger()
46+
def parsed = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')
47+
def major = parsed[0].toInteger()
48+
def minor = parsed[1].toInteger()
3249

33-
// Namespace support was added in 7.3.0
34-
return (major == 7 && minor >= 3) || major >= 8
50+
// Namespace support was added in 7.3.0
51+
return (major == 7 && minor >= 3) || major >= 8
3552
}
3653

3754
android {
@@ -63,9 +80,13 @@ android {
6380
}
6481
}
6582

83+
def kotlin_version = getExtOrDefault('kotlinVersion', '1.8.10')
84+
85+
println "Building Stream WebRTC React Native module with Kotlin version: $kotlin_version"
86+
6687
dependencies {
67-
api 'io.getstream:stream-webrtc-android:1.3.9'
88+
api 'io.getstream:stream-webrtc-android:1.3.10-SNAPSHOT'
6889
implementation 'com.facebook.react:react-native:+'
69-
implementation "org.jetbrains.kotlin:kotlin-stdlib:${getExtOrDefault('kotlinVersion', '1.8.10')}"
90+
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
7091
implementation "androidx.core:core:1.7.0"
7192
}

android/src/main/java/com/oney/WebRTCModule/WebRTCModule.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,10 @@ public String getName() {
123123
return "WebRTCModule";
124124
}
125125

126+
public AudioDeviceModule getAudioDeviceModule() {
127+
return mAudioDeviceModule;
128+
}
129+
126130
private PeerConnection getPeerConnection(int id) {
127131
PeerConnectionObserver pco = mPeerConnectionObservers.get(id);
128132
return (pco == null) ? null : pco.getPeerConnection();

package-lock.json

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@stream-io/react-native-webrtc",
3-
"version": "125.4.3",
3+
"version": "125.4.4-alpha.1",
44
"repository": {
55
"type": "git",
66
"url": "git+https://github.com/GetStream/react-native-webrtc.git"

0 commit comments

Comments
 (0)