File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -875,7 +875,12 @@ export default class LocalParticipant extends Participant {
875875 track : getLogContextFromTrack ( track ) ,
876876 } ) ;
877877 const onSignalConnected = async ( ) => {
878- return this . publish ( track , opts , isStereo ) . then ( resolve ) . catch ( reject ) ;
878+ try {
879+ const publication = await this . publish ( track , opts , isStereo ) ;
880+ resolve ( publication ) ;
881+ } catch ( e ) {
882+ reject ( e ) ;
883+ }
879884 } ;
880885 setTimeout ( ( ) => {
881886 this . engine . off ( EngineEvent . SignalConnected , onSignalConnected ) ;
@@ -892,7 +897,12 @@ export default class LocalParticipant extends Participant {
892897 reject ( new PublishTrackError ( 'publishing rejected as engine closed' , 499 ) ) ;
893898 } ) ;
894899 } else {
895- return await this . publish ( track , opts , isStereo ) ;
900+ try {
901+ const publication = await this . publish ( track , opts , isStereo ) ;
902+ resolve ( publication ) ;
903+ } catch ( e ) {
904+ reject ( e ) ;
905+ }
896906 }
897907 } catch ( e ) {
898908 reject ( e ) ;
You can’t perform that action at this time.
0 commit comments