Gets if the audio track is muted or not.
If no audio track is available, this returns true
.
The actual audio / video stream.
Gets if the remote source 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 { Publisher, Room, Source } from '@millicast/sdk-interactivity';
const room = new Room({
streamName,
streamAccountId,
});
room.on('sourceAdded', async (publisher: Publisher, source: Source) => {
// Request to receive the source
await source.receive();
// Display the source on the UI
const videoElement = document.getElementById('remote-video');
videoElement.srcObject = new MediaStream([source.videoTrack]);
videoElement.play();
setInterval(async () => {
const isSpeaking = await source.isSpeaking();
console.log('is speaking', isSpeaking);
}, 1000);
});
await room.watch();
Gets the source identifier.