- Newest
- Most votes
- Most comments
The IVS Player SDK does not support this functionality out of the box. To implement a functionality like this, a custom solution will need to be created. See below a recommendation on one avenue for potentially implementing this functionality.
- Show a static preview image on the page until the live broadcast starts.
The HTML video tag can handle this via the "poster" attribute. If the IVS stream has started, the player state is set to play and the player loads the playback url, this static image will transition to the live stream. When the player state has stopped after the livestream ends, the static image will resume.
- When the live broadcast starts, automatically replace the preview image with the live video feed.
It is possible to be able to find out when a stream goes live by setting up watchable events in Amazon EventBridge for IVS (https://docs.aws.amazon.com/ivs/latest/userguide/eventbridge.html). These events can be received by various processes that could be responsible with providing the UI the information it needs to cause the player to load the url.
- When the live broadcast ends, automatically display the same preview image as before.
Following the logic described in point 2, this custom process should also be configured to notify the UI when the stream has ended and potentially use the player.delete() method. This method will return the poster state on the HTML video tag. It is important to note that on player.delete() the playback is stopped and it will not longer emit events or respond to API calls. So if this method is utilized, another player instance will need to be initiated to continue playback.
Relevant content
- asked 4 months ago
- Accepted Answerasked 8 months ago
- asked 2 years ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated 7 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 7 months ago