跳至內容

How to detect IVS video stream state?

0

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?

已提問 1 年前檢視次數 350 次
2 個答案
0
已接受的答案

I cannot reproduce the issue after day long testing. This could be my error along the development and testing.

The issue should be closed.

已回答 1 年前
0

Additional information:

function const handleMediaAdded = (participantInfo, streams) => { the streams parameter is [null, null].

已回答 1 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。