Gets the audio track.
Gets if the audio track is muted or not.
If no audio track is available, this returns true
.
Gets the Millicast Publish object used to publish the source to the stream.
Gets the SourceIdentifier object representing the source identifier.
Gets the video track.
Gets if the publisher is considered to be speaking or not.
A Promise whose fulfillment handler receives a flag indicating if the publisher is considered to be speaking.
import { Room } from '@millicast/sdk-interactivity';
const room = new Room({
streamName,
streamAccountId,
});
const localSource = await room.connect({
publishToken,
publisherName,
constraints: {
audio: true,
video: true,
},
});
const videoElement = document.getElementById("local-video");
videoElement.srcObject = new MediaStream([localSource.videoTrack]);
videoElement.play();
setInterval(async () => {
const isSpeaking = await localSource.isSpeaking();
console.log('is speaking', isSpeaking);
}, 1000);
Represents a published source.