fix(BBC): resolve epoch timer on live simulcast episodes#10959
Open
decbr1 wants to merge 3 commits into
Open
Conversation
Contributor
🖼️ Activity asset previewAnother day, another diff. Here's everything shiny I could dig out of this one. BBC (
|
| Preview | Source | URL |
|---|---|---|
![]() |
logo | https://cdn.rcd.gg/PreMiD/websites/B/BBC/assets/logo.png |
| thumbnail | https://cdn.rcd.gg/PreMiD/websites/B/BBC/assets/thumbnail.png |
Beep boop — I refresh this comment on every push, so no need to scroll. 🤖
|
seems good to me 👍 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
Fixes BBC iPlayer live simulcast episodes (e.g. World Cup matches) showing a nonsense epoch-based elapsed timer (
495288:08:16+) instead of a Live badge.Root causes:
__IPLAYER_REDUX_STATE__) was fetched once via??=and never refreshed on SPA navigation, so live detection always ran against stale/empty state.video.currentTime/durationanchored to Unix epoch seconds which slip past the live check into the VOD timestamp branch.episode.Livewas checked with the wrong casing (BBC's actual field is lowercaseepisode.live) so that flag never worked regardless of staleness.channel/headerno longer exist in BBC's current redux shape for simulcast content; live detection now usesepisode.liveandversions[].kind === 'simulcast'instead. This also exposes real scheduledstartTime/endTimefor a correct elapsed/remaining timer./iplayer/livechannel branch setstartTimestampin milliseconds instead of seconds.getPageVariable('__IPLAYER_REDUX_STATE__')also crashed the Firefox extension (DOMException: Function object could not be cloned). Switched to scoped dot-notation fetches for just the fields used.Screenshots
Proof showing the creation/modification is working as expected
Before:
After:
With 'iPlayer Title as Presence'
Without 'iPlayer Title as Presence'