aws / amazon-chime-sdk-js

A JavaScript client library for integrating multi-party communications powered by the Amazon Chime service.
Apache License 2.0
709 stars 477 forks source link

Synchronized Pausing Between Two Peers #2785

Open JDSeiler opened 11 months ago

JDSeiler commented 11 months ago

Hello, I'm trying to do something quite unusual and I wanted to ask if there's an idiomatic way to do this with the existing Chime JavaScript API before I explore other options.

What I'm Trying to Do In my situation, there are two attendees in a single meeting. One attendee (which I'll call the broadcaster) streams video and has a local preview of their stream, while the other attendee is a spectator. I'd like the spectator to be able to "pause" the stream such that both the spectator's view and and broadcaster's preview are showing the same image.

I know that I can use the pauseVideoTile to stop the pause on the spectator side, but the difficulty is getting the broadcaster preview and spectator view synchronized, since the spectator is "in the past" relative to the broadcaster. If I simply call stopVideoInput on the broadcaster side, it causes the video stream on the spectator side to go blank (as you'd expect).

Is there a way I can stop streaming on the broadcaster side, such that the spectator will continue consuming whatever video was already on the wire, and then freeze on the last frame of video sent by the broadcaster?