I has a code that handles the following stage events:
const stage = new Stage(token, strategyRef.current);
stage.on(StageEvents.STAGE_CONNECTION_STATE_CHANGED, handleConnectionStateChange);
stage.on(StageEvents.STAGE_PARTICIPANT_JOINED, handleParticipantJoin);
stage.on(StageEvents.STAGE_PARTICIPANT_LEFT, handleParticipantLeave);
stage.on(StageEvents.STAGE_PARTICIPANT_STREAMS_ADDED, handleMediaAdded);
stage.on(StageEvents.STAGE_PARTICIPANT_STREAMS_REMOVED, handleMediaRemoved);
stage.on(StageEvents.STAGE_STREAM_MUTE_CHANGED, handleParticipantMuteChange);
In handleMediaRemoved function:
const handleMediaRemoved = (participantInfo, streams) => {
const { id } = participantInfo;
// remove media from the broadcast
if (!isLocalParticipant(participantInfo)) {
let participant = participants.get(id);
const newStreams = participant.streams.filter(
(existingStream) => !streams.find((removedStream) => existingStream.id === removedStream.id)
);
participant = { ...participant, streams: newStreams };
console.log('handleMediaRemoved', participantInfo, streams);
}
};
However, the library under neath calls DELETE REST function and failure every time the handleMediaRemoved is called. Is it a bug?
The js console displays
DELETE: https://video-rtx-5b5372.jfk04.rtx.live-video.net/sKPIj_O9pTIqkgZj/session/ga2DRCfyevVL/737d6033-9d8f-40eb-babc-55bc519d8489 404 (Not Found)
There are no costs associated with the
DELETE
call. The only charges for Amazon IVS stages are related to participant hours. Please refer to the pricing page for more information: https://aws.amazon.com/ivs/pricing/#Real-Time_Streaming