I experiment the amazon-ivs-web-broadcast libraries with the sample code from
https://github.com/aws-samples/amazon-ivs-real-time-** and from internet react samples.
I try to implement an application that one party creates a IVS stage and joins the stage. Then the first party creates a stage token for a second party and send the token to the second party. The second party uses web app on browser to join the IVS stage with the second party token.
The IVS is a solid service and the experimental application runs well and the application call flow works more than 95% in about one hundred test runs. The call flow includes first party creates/joins the call, the second party joins the call, finally the stage is deleted. First party and second party are running on PC/iPhone/Android browsers. Browsers include Safari/Chrome/Edge.
However, in rare occasion, the video stream from one party is black out.
The js code handles the following 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);
stageRef.current = stage;
await stageRef.current.join();
The handleParticipantJoin and handleMediaAdded are called on the first party side when the second party joins. However, the second party video stream is black on first party's display in a rare occasion without any IVS event received.
Additional information:
function const handleMediaAdded = (participantInfo, streams) => {
the streams parameter is [null, null].
I wonder if I miss capturing IVS events?
Thank you for your comment in advance.
( I think that this is a bug. The issue could be the delivery sequence of two events StageEvents.STAGE_PARTICIPANT_JOINED and StageEvents.STAGE_PARTICIPANT_STREAMS_ADDED. The StageEvents.STAGE_PARTICIPANT_STREAMS_ADDED event was delivered before StageEvents.STAGE_PARTICIPANT_JOINED. )
I'm curious about your mention of "finally the stage is deleted". When does this happen, and how/why are you deleting the stage?