pull/109/merge
Martin 2018-09-03 08:44:23 +00:00 committed by GitHub
commit 304f9849dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 25 additions and 0 deletions

View File

@ -374,6 +374,31 @@ export class Publisher extends StreamManager {
resolve();
};
// Check if new constraints need to be generated
// No constraints needed if...
// - video track is given and no audio
// - audio track is given and no video
// - both video and audio tracks are given
if ((this.openvidu.isMediaStreamTrack(this.properties.videoSource) && !this.properties.audioSource)
|| (!this.properties.videoSource && this.openvidu.isMediaStreamTrack(this.properties.audioSource))
|| (this.openvidu.isMediaStreamTrack(this.properties.videoSource) && this.openvidu.isMediaStreamTrack(this.properties.audioSource))) {
var mediaStream = new MediaStream;
if (this.openvidu.isMediaStreamTrack(this.properties.videoSource))
mediaStream.addTrack((<MediaStreamTrack>this.properties.videoSource));
if (this.openvidu.isMediaStreamTrack(this.properties.audioSource))
mediaStream.addTrack((<MediaStreamTrack>this.properties.audioSource));
// MediaStreamTracks are handled within callback - just call callback with new MediaStream() and let it
// handle the sources
successCallback(mediaStream);
// Return as we do not need to process further
return;
}
this.openvidu.generateMediaConstraints(this.properties)
.then(constraints => {