You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey @badrddinb, I'm pretty sure that's intended, the PlayerStateChanged event is private. We make some events private by design. While we can't stop you from using them, we offer no support or guarantees that we won't break that API in future versions. The only public events are those included in the type definition file and the docs.
That being said, what's your use case for having this event?
I work with @badrddinb, we use the event in react to detect when the player is buffering to signal it to the user in UI.
useEffect(()=>{if(!player)returnconststateChangedListener=(state: unknown)=>{setIsPlayerBuffering(state===PlayerState.BUFFERING)}// The IVS Player TS SDK includes the PlayerStateChanged event in its runtime,// but it has not been included in the TypeScript type declarations.// Reported: https://github.com/aws-samples/amazon-ivs-player-web-sample/issues/80constPlayerStateChanged='PlayerStateChanged'asPlayerEventTypeplayer.addEventListener(PlayerStateChanged,stateChangedListener)return()=>{player.removeEventListener(PlayerStateChanged,stateChangedListener)}},[player])
The IVS Player TS SDK includes the
PlayerStateChanged
event in its runtime, but it has not been included in the TypeScript type declarations.The text was updated successfully, but these errors were encountered: