File tree 1 file changed +6
-1
lines changed 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -83,6 +83,7 @@ class RTCVideoRenderer {
83
83
x.autoplay = true ;
84
84
x.muted = false ;
85
85
x.srcObject = stream.jsStream;
86
+ x.id = stream.id;
86
87
_htmlVideoElement = x;
87
88
_videoViews.add (x);
88
89
return x;
@@ -139,7 +140,11 @@ class RTCVideoRenderer {
139
140
if (_htmlVideoElement != null ) return _htmlVideoElement;
140
141
final fltPv = HTML .document.getElementsByTagName ('flt-platform-view' );
141
142
if (fltPv.isEmpty) return null ;
142
- return (fltPv.first as HTML .Element ).shadowRoot.lastChild;
143
+ final lastChild = (fltPv.first as HTML .Element ).shadowRoot.lastChild;
144
+ if (! (lastChild is HTML .VideoElement )) return null ;
145
+ final videoElement = lastChild as HTML .VideoElement ;
146
+ if (_srcObject != null && videoElement.id != _srcObject.id) return null ;
147
+ return lastChild;
143
148
}
144
149
145
150
Future <Null > dispose () async {
You can’t perform that action at this time.
0 commit comments