8000 Add addTransceiver for web. · adteven/flutter-webrtc@2d6bf0c · GitHub
[go: up one dir, main page]

Skip to content

Commit 2d6bf0c

Browse files
committed
Add addTransceiver for web.
1 parent 6739db4 commit 2d6bf0c

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

lib/web/rtc_peerconnection.dart

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,4 +222,12 @@ class RTCPeerConnection {
222222
_jsPc.close();
223223
return Future.value();
224224
}
225+
226+
//'audio|video', { 'direction': 'recvonly|sendonly|sendrecv' }
227+
void addTransceiver(String type, Map<String, String> options) {
228+
if (JSUtils.hasProperty(_jsPc, "addTransceiver")) {
229+
final JS.JsObject jsOptions = JS.JsObject.jsify(options);
230+
JSUtils.callMethod(_jsPc, "addTransceiver", [type, jsOptions]);
231+
}
232+
}
225233
}

lib/web/rtc_video_view.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ class RTCVideoRenderer {
8181
ui.platformViewRegistry.registerViewFactory(stream.id, (int viewId) {
8282
final x = HTML.VideoElement();
8383
x.autoplay = true;
84-
x.muted = true;
84+
x.muted = false;
8585
x.srcObject = stream.jsStream;
8686
_htmlVideoElement = x;
8787
_videoViews.add(x);

0 commit comments

Comments
 (0)
0