Skip to content

Commit ee34157

Browse files
committed
fix bug remoterender when disconnecting/connecting
1 parent 1284af6 commit ee34157

8 files changed

Lines changed: 100 additions & 10 deletions

File tree

.idea/copyright/Apache2_0.xml

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

.idea/copyright/profiles_settings.xml

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

.idea/misc.xml

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

app/src/main/java/fr/pchab/androidrtc/RtcActivity.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ public void onLocalStream(MediaStream localStream) {
173173
VideoRendererGui.update(localRender,
174174
LOCAL_X_CONNECTING, LOCAL_Y_CONNECTING,
175175
LOCAL_WIDTH_CONNECTING, LOCAL_HEIGHT_CONNECTING,
176-
VideoRendererGui.ScalingType.SCALE_ASPECT_FIT);
176+
scalingType);
177177
}
178178

179179
@Override
@@ -185,15 +185,14 @@ public void onAddRemoteStream(MediaStream remoteStream, int endPoint) {
185185
VideoRendererGui.update(localRender,
186186
LOCAL_X_CONNECTED, LOCAL_Y_CONNECTED,
187187
LOCAL_WIDTH_CONNECTED, LOCAL_HEIGHT_CONNECTED,
188-
VideoRendererGui.ScalingType.SCALE_ASPECT_FIT);
188+
scalingType);
189189
}
190190

191191
@Override
192192
public void onRemoveRemoteStream(int endPoint) {
193-
VideoRendererGui.remove(remoteRender);
194193
VideoRendererGui.update(localRender,
195194
LOCAL_X_CONNECTING, LOCAL_Y_CONNECTING,
196195
LOCAL_WIDTH_CONNECTING, LOCAL_HEIGHT_CONNECTING,
197-
VideoRendererGui.ScalingType.SCALE_ASPECT_FIT);
196+
scalingType);
198197
}
199198
}

build.gradle

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ buildscript {
55
jcenter()
66
}
77
dependencies {
8-
classpath 'com.android.tools.build:gradle:1.1.0'
9-
8+
classpath 'com.android.tools.build:gradle:1.1.2'
9+
classpath 'com.github.dcendents:android-maven-plugin:1.2'
10+
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.1"
1011
// NOTE: Do not place your application dependencies here; they belong
1112
// in the individual module build.gradle files
1213
}

webrtc-client/build.gradle

Lines changed: 60 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
apply plugin: 'android-library'
1+
apply plugin: 'com.android.library'
2+
apply plugin: 'com.github.dcendents.android-maven'
3+
apply plugin: 'com.jfrog.bintray'
4+
5+
// This is the library version used when deploying the artifact
6+
version = "1.0.0"
27

38
android {
49
compileSdkVersion 22
@@ -18,8 +23,62 @@ android {
1823
}
1924
}
2025

26+
def siteUrl = 'https://github.com/pchab/AndroidRTC' // Homepage URL of the library
27+
def gitUrl = 'https://github.com/pchab/AndroidRTC.git' // Git repository URL
28+
group = "fr.pchab" // Maven Group ID for the artifact
29+
30+
install {
31+
repositories.mavenInstaller {
32+
// This generates POM.xml with proper parameters
33+
pom {
34+
project {
35+
packaging 'aar'
36+
37+
// Add your description here
38+
name 'webrtc-client'
39+
url siteUrl
40+
41+
// Set your license
42+
licenses {
43+
license {
44+
name 'The Apache Software License, Version 2.0'
45+
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
46+
}
47+
}
48+
developers {
49+
developer {
50+
id 'fr.pchab'
51+
name 'Pierre Chabardes'
52+
53+
}
54+
}
55+
}
56+
}
57+
}
58+
}
59+
2160
dependencies {
2261
compile 'com.android.support:appcompat-v7:22.0.0'
2362
compile 'com.github.nkzawa:socket.io-client:0.4.2'
2463
compile 'io.pristine:libjingle:8689@aar'
2564
}
65+
66+
task sourcesJar(type: Jar) {
67+
from android.sourceSets.main.java.srcDirs
68+
classifier = 'sources'
69+
}
70+
71+
task javadoc(type: Javadoc) {
72+
source = android.sourceSets.main.java.srcDirs
73+
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
74+
}
75+
76+
task javadocJar(type: Jar, dependsOn: javadoc) {
77+
classifier = 'javadoc'
78+
from javadoc.destinationDir
79+
}
80+
81+
artifacts {
82+
archives javadocJar
83+
archives sourcesJar
84+
}

webrtc-client/src/main/java/fr/pchab/webrtcclient/WebRtcClient.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ private Peer addPeer(String id, int endPoint) {
248248
private void removePeer(String id) {
249249
Peer peer = peers.get(id);
250250
mListener.onRemoveRemoteStream(peer.endPoint);
251+
peer.pc.close();
251252
peers.remove(peer.id);
252253
endPoints[peer.endPoint] = false;
253254
}

webrtc-client/webrtc-client.iml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<module external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" external.system.module.group="AndroidRTC" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
2+
<module external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" external.system.module.group="fr.pchab" external.system.module.version="1.0.0" type="JAVA_MODULE" version="4">
33
<component name="FacetManager">
44
<facet type="android-gradle" name="Android-Gradle">
55
<configuration>
@@ -18,7 +18,7 @@
1818
<option name="ALLOW_USER_CONFIGURATION" value="false" />
1919
<option name="MANIFEST_FILE_RELATIVE_PATH" value="/src/main/AndroidManifest.xml" />
2020
<option name="RES_FOLDER_RELATIVE_PATH" value="/src/main/res" />
21-
<option name="RES_FOLDERS_RELATIVE_PATH" value="file://$MODULE_DIR$/src/main/res" />
21+
<option name="RES_FOLDERS_RELATIVE_PATH" value="" />
2222
<option name="ASSETS_FOLDER_RELATIVE_PATH" value="/src/main/assets" />
2323
<option name="LIBRARY_PROJECT" value="true" />
2424
</configuration>
@@ -62,6 +62,7 @@
6262
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
6363
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
6464
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
65+
<excludeFolder url="file://$MODULE_DIR$/build/docs" />
6566
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
6667
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/bundles" />
6768
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
@@ -81,7 +82,9 @@
8182
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
8283
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
8384
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
85+
<excludeFolder url="file://$MODULE_DIR$/build/libs" />
8486
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
87+
<excludeFolder url="file://$MODULE_DIR$/build/poms" />
8588
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
8689
</content>
8790
<orderEntry type="jdk" jdkName="Android API 22 Platform" jdkType="Android SDK" />

0 commit comments

Comments
 (0)