File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -83,6 +83,7 @@ class RTCVideoRenderer {
8383 x.autoplay = true ;
8484 x.muted = false ;
8585 x.srcObject = stream.jsStream;
86+ x.id = stream.id;
8687 _htmlVideoElement = x;
8788 _videoViews.add (x);
8889 return x;
@@ -139,7 +140,11 @@ class RTCVideoRenderer {
139140 if (_htmlVideoElement != null ) return _htmlVideoElement;
140141 final fltPv = HTML .document.getElementsByTagName ('flt-platform-view' );
141142 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;
143148 }
144149
145150 Future <Null > dispose () async {
You can’t perform that action at this time.
0 commit comments