This repository was archived by the owner on Oct 25, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -77,20 +77,20 @@ export class ConferencePeerConnectionChannel extends EventDispatcher {
77
77
78
78
publish ( stream , options ) {
79
79
if ( options === undefined ) {
80
- options = { audio : ! ! stream . mediaStream . getAudioTracks ( ) , video : ! ! stream
81
- . mediaStream . getVideoTracks ( ) } ;
80
+ options = { audio : ! ! stream . mediaStream . getAudioTracks ( ) . length , video : ! ! stream
81
+ . mediaStream . getVideoTracks ( ) . length } ;
82
82
}
83
83
if ( typeof options !== 'object' ) {
84
84
return Promise . reject ( new TypeError ( 'Options should be an object.' ) ) ;
85
85
}
86
86
if ( options . audio === undefined ) {
87
- options . audio = ! ! stream . mediaStream . getAudioTracks ( ) ;
87
+ options . audio = ! ! stream . mediaStream . getAudioTracks ( ) . length ;
88
88
}
89
89
if ( options . video === undefined ) {
90
- options . video = ! ! stream . mediaStream . getVideoTracks ( ) ;
90
+ options . video = ! ! stream . mediaStream . getVideoTracks ( ) . length ;
91
91
}
92
- if ( ! ! options . audio === ! stream . mediaStream . getAudioTracks ( ) . length || ! !
93
- options . video === ! stream . mediaStream . getVideoTracks ( ) . length ) {
92
+ if ( ( ! ! options . audio && ! stream . mediaStream . getAudioTracks ( ) . length ) ||
93
+ ( ! ! options . video && ! stream . mediaStream . getVideoTracks ( ) . length ) ) {
94
94
return Promise . reject ( new ConferenceError (
95
95
'options.audio/video is inconsistent with tracks presented in the ' +
96
96
'MediaStream.'
You can’t perform that action at this time.
0 commit comments