This demo pairs a video stream with a real-time chat. The video comes from Livepeer, the video provider the demo integrates with. Everything around the video, the chat, the user profiles, and the reports, runs on PubNub. The web app is built with Next.js and the PubNub Chat SDK.
The page you start on is the host view. When you create a livestream, the app gets a playback ID from Livepeer and uses it as the ID of a public chat channel. Viewers who open the viewer link sign in with a username, which is saved as their App Context profile, and join the same channel. Mute, ban, and message deletion need your secret key, so the app sends them to a separate server; the README includes sample code for it. The source code is open on GitHub.