i have added checks to ensure the api method is available prior to proceeding after detecting change as playing. Yet the function to update timers still fails. It does work on refresh. The flow waits for yt api to be ready to run yt init, in the on ready there are flags setup to wait for custom control setup, check for api methods to be fully ready to handle calls. The check for api methods is referenced in a global state flag by the onplayerstate change before it proceeds to handling playing state, playing state proceeds to update timers-that’s where the issue starts and I cannot figure out why it is showing what’s in the logs I’ll provide. I can see that the duration of the video is properly populated on the page but below you’ll see the duration call returning false.
[Player State Change] Detected state change. State: PLAYING, Container ID: player-0-1, Video ID: aFvw_yu0N3A, Ready: true, Custom Setup Complete: true, API Fully Ready: true[Player State Change] Handling state change. State: PLAYING, Container ID: player-0-1, Video ID: aFvw_yu0N3A, API Fully Ready: true[Player State Change] Video with ID: aFvw_yu0N3A is now playing, Container ID: player-0-1.[startOrUpdateVideoTimeUpdate] Initiating for Video ID: aFvw_yu0N3A, Player Container ID: player-0-1.[Video Time Update] Player State for Video ID: aFvw_yu0N3A, Player Container ID: player-0-1: Player state method not available[Video Time Update] Checking API method availability for Video ID: aFvw_yu0N3A, Player Container ID: player-0-1. getCurrentTime: false, getDuration: false[Video Time Update] Attempt 1: Player API methods not available for Video ID: aFvw_yu0N3A, Player Container ID: player-0-1. Retrying...