...
Code Block |
---|
|
session.createStream({
name: streamName,
display: localVideo,
constraints: {video: true, audio: false}
...
}).publish(); |
Audio only stream publishing
In most cases, it is enough to set the constraints to publish audio only stream:
Code Block |
---|
|
session.createStream({
name: streamName,
display: localVideo,
constraints: {video: false, audio: true}
...
}).publish(); |
Audio only stream publishing in Safari browser
When audio only stream is published from iOS Safari browser with constraints, browser does not send audio packets. To workaround this, a stream should be published with video, then video should be muted:
Code Block |
---|
|
session.createStream({
name: streamName,
display: localVideo,
constraints: {video: true, audio: true}
...
}).on(STREAM_STATUS.PUBLISHING, function (stream) {
stream.muteVideo();
...
}).publish(); |
In this case, iOS Safari browser will send emply video packets (blank screen) and audio packets.
Disable resolution constraints normalization in Safari browser
...
exclude H264 for publishing or playing on clent client side
Code Block |
---|
|
publishStream = session.createStream({
...
stripCodecs: "h264,H264"
}).on(STREAM_STATUS.PUBLISHING, function (publishStream) {
...
});
publishStream.publish(); |
...