@@ -215,30 +215,32 @@ define(['jquery', 'underscore', 'text!partials/audiovideo.html', 'text!partials/
215215
216216 mediaStream . webrtc . e . on ( "done" , function ( ) {
217217
218- $scope . hasUsermedia = false ;
219- $scope . isActive = false ;
220- $scope . peersTalking = { } ;
221- if ( BigScreen . enabled ) {
222- BigScreen . exit ( ) ;
223- }
224- _ . delay ( function ( ) {
225- if ( $scope . isActive ) {
226- return ;
218+ $scope . $apply ( function ( ) {
219+ $scope . hasUsermedia = false ;
220+ $scope . isActive = false ;
221+ $scope . peersTalking = { } ;
222+ if ( BigScreen . enabled ) {
223+ BigScreen . exit ( ) ;
227224 }
228- $scope . localVideo . src = '' ;
229- $scope . miniVideo . src = '' ;
230- $ ( $scope . remoteVideos ) . children ( ".remoteVideo" ) . remove ( ) ;
231- } , 1500 ) ;
232- $ ( $scope . mini ) . removeClass ( "visible" ) ;
233- $scope . localVideo . style . opacity = 0 ;
234- $scope . remoteVideos . style . opacity = 0 ;
235- $element . removeClass ( 'active' ) ;
236- _ . each ( streams , function ( scope , k ) {
237- scope . $destroy ( ) ;
238- delete streams [ k ] ;
225+ _ . delay ( function ( ) {
226+ if ( $scope . isActive ) {
227+ return ;
228+ }
229+ $scope . localVideo . src = '' ;
230+ $scope . miniVideo . src = '' ;
231+ $ ( $scope . remoteVideos ) . children ( ".remoteVideo" ) . remove ( ) ;
232+ } , 1500 ) ;
233+ $ ( $scope . mini ) . removeClass ( "visible" ) ;
234+ $scope . localVideo . style . opacity = 0 ;
235+ $scope . remoteVideos . style . opacity = 0 ;
236+ $element . removeClass ( 'active' ) ;
237+ _ . each ( streams , function ( scope , k ) {
238+ scope . $destroy ( ) ;
239+ delete streams [ k ] ;
240+ } ) ;
241+ $scope . rendererName = $scope . defaultRendererName ;
242+ $scope . haveStreams = false ;
239243 } ) ;
240- $scope . rendererName = $scope . defaultRendererName ;
241- $scope . haveStreams = false ;
242244
243245 } ) ;
244246
0 commit comments