Syncing Replayed Chat to a VOD Timeline: Why I Threw Away Binary Search

I built a VOD player for Twitch and Kick streams that replays chat in sync with the video. To handle seeking, I discarded binary search and instead used a simple session counter to invalidate any in-flight requests. This approach avoids issues with accumulated drift and makes the player robust. To implement this, I used a function to calculate the offset of a message in the VOD timeline based on its creation timestamp and the VOD's start time. When seeking, I reset the chat session counter and clear the chat messages to ensure a smooth experience.

Source →
FeedLens — Signal over noise Last 7 days