Skip to content

Commit e92fe2a

Browse files
author
lastpeony
committed
users can send consequent publish/play requests. Even if WS is not
connected. faster reconnection for play.
1 parent 51a41b9 commit e92fe2a

25 files changed

+328
-77
lines changed

webrtc-android-framework/src/main/java/io/antmedia/webrtcandroidframework/api/DefaultWebRTCListener.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,12 @@ public void onPeerConnectionCreated(String streamId) {
8888
callbackCalled(messageText);
8989
}
9090

91+
@Override
92+
public void onPeerConnectionClosed() {
93+
String messageText = "Peer Connection closed";
94+
callbackCalled(messageText);
95+
}
96+
9197
@Override
9298
public void onIceDisconnected(String streamId) {
9399
String messageText = "Ice disconnected for " + streamId;

webrtc-android-framework/src/main/java/io/antmedia/webrtcandroidframework/api/IWebRTCClient.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ static WebRTCClientBuilder builder() {
3232
}
3333

3434
/**
35-
* This is used to strart a WebRTC publish stream
35+
* This is used to start a WebRTC publish stream
3636
* @param streamId: any name
3737
*/
3838
void publish(String streamId);
3939

4040

4141
/**
42-
* This is used to strart a WebRTC publish stream
42+
* This is used to start a WebRTC publish stream
4343
* @param streamId: id for the stream to publish
4444
* @param token: token to authenticate
4545
* @param videoCallEnabled: true if it's a video call

webrtc-android-framework/src/main/java/io/antmedia/webrtcandroidframework/api/IWebRTCListener.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,4 +195,8 @@ public interface IWebRTCListener {
195195
*/
196196
void onWebSocketConnected();
197197

198+
/**
199+
* It's called when peer connection is closed.
200+
*/
201+
void onPeerConnectionClosed();
198202
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
package io.antmedia.webrtcandroidframework.core;
2+
3+
public class PlayRequest {
4+
private String streamId;
5+
private String token;
6+
private String[] tracks;
7+
private String subscriberId;
8+
private String subscriberCode;
9+
private String viewerInfo;
10+
11+
public PlayRequest(String streamId, String token, String[] tracks,
12+
String subscriberId, String subscriberCode, String viewerInfo) {
13+
this.streamId = streamId;
14+
this.token = token;
15+
this.tracks = tracks;
16+
this.subscriberId = subscriberId;
17+
this.subscriberCode = subscriberCode;
18+
this.viewerInfo = viewerInfo;
19+
}
20+
21+
public String getStreamId() {
22+
return streamId;
23+
}
24+
25+
public String getToken() {
26+
return token;
27+
}
28+
29+
public String[] getTracks() {
30+
return tracks;
31+
}
32+
33+
public String getSubscriberId() {
34+
return subscriberId;
35+
}
36+
37+
public String getSubscriberCode() {
38+
return subscriberCode;
39+
}
40+
41+
public String getViewerInfo() {
42+
return viewerInfo;
43+
}
44+
}
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
package io.antmedia.webrtcandroidframework.core;
2+
3+
public class PublishRequest {
4+
private String streamId;
5+
private String token;
6+
private boolean videoCallEnabled;
7+
private boolean audioCallEnabled;
8+
private String subscriberId;
9+
private String subscriberCode;
10+
private String streamName;
11+
private String mainTrackId;
12+
13+
public PublishRequest(String streamId, String token, boolean videoCallEnabled, boolean audioCallEnabled,
14+
String subscriberId, String subscriberCode, String streamName, String mainTrackId) {
15+
this.streamId = streamId;
16+
this.token = token;
17+
this.videoCallEnabled = videoCallEnabled;
18+
this.audioCallEnabled = audioCallEnabled;
19+
this.subscriberId = subscriberId;
20+
this.subscriberCode = subscriberCode;
21+
this.streamName = streamName;
22+
this.mainTrackId = mainTrackId;
23+
}
24+
25+
public String getStreamId() {
26+
return streamId;
27+
}
28+
29+
public String getToken() {
30+
return token;
31+
}
32+
33+
public boolean isVideoCallEnabled() {
34+
return videoCallEnabled;
35+
}
36+
37+
public boolean isAudioCallEnabled() {
38+
return audioCallEnabled;
39+
}
40+
41+
public String getSubscriberId() {
42+
return subscriberId;
43+
}
44+
45+
public String getSubscriberCode() {
46+
return subscriberCode;
47+
}
48+
49+
public String getStreamName() {
50+
return streamName;
51+
}
52+
53+
public String getMainTrackId() {
54+
return mainTrackId;
55+
}
56+
}

0 commit comments

Comments
 (0)