File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -204,13 +204,10 @@ audioInputSelect.onchange = videoSelect.onchange = async (e) => {
204204 const audioTrack = stream . getAudioTracks ( ) [ 0 ] ;
205205 const videoTrack = stream . getVideoTracks ( ) [ 0 ] ;
206206
207+ app . selfPlayer . stream = stream ;
208+ app . playStream ( stream , app . selfPlayer ) ;
207209 app . selfPlayer . analyser = null ;
208210
209- if ( e . target . id == 'videoSource' ) {
210- app . selfPlayer . stream = stream ;
211- playStream ( stream , app . selfPlayer ) ;
212- }
213-
214211 app . mediasoupClient . producerTransport . handler . _pc . getSenders ( ) . forEach ( ( s ) => {
215212 if ( s . track . kind == videoTrack . kind ) {
216213 console . log ( 'replacing video!' ) ;
Original file line number Diff line number Diff line change @@ -54,6 +54,10 @@ export class Player {
5454 }
5555
5656 addVideo ( element ) {
57+ if ( this . $video != null ) {
58+ this . $video . remove ( ) ;
59+ }
60+
5761 this . $video = element ;
5862 this . $elem . appendChild ( element ) ;
5963 }
You can’t perform that action at this time.
0 commit comments