-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/bbc/bigscreen-player into…
… plugin-playback-rate
- Loading branch information
Showing
85 changed files
with
8,122 additions
and
6,930 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# 004 Removing `windowType`; changing time representation | ||
|
||
Originally added: 2025-02-03 | ||
|
||
## Status | ||
|
||
| Discussing | Approved | Superceded | | ||
| ---------- | -------- | ---------- | | ||
| | x | | | ||
|
||
## Context | ||
|
||
BigscreenPlayer supports DASH and HLS streaming. Each transfer format (aka streaming protocol) represents time in a stream in a different way. BigscreenPlayer normalised these times in versions prior to v9.0.0. This normalisation made multiple assumptions: | ||
|
||
- The timestamp in the media samples are encoded as UTC times (in seconds) for "sliding window" content i.e. streams with time shift. | ||
- Streams with time shift never use a presentation time offset. | ||
|
||
What is more, metadata (i.e. the `windowType`) determined BigscreenPlayer's manifest parsing strategy from v7.1.0 and codified these assumptions. | ||
|
||
- How might we overhaul our time representation to support streams that don't comply with these assumptions? | ||
|
||
### Considered Options | ||
|
||
1. Expose time reported by the `MediaElement` directly. Provide functions to convert the time from the `MediaElement` into availability and media sample time. | ||
2. Do not apply time correction based on `timeShiftBufferDepth` if `windowType === WindowTypes.GROWING` | ||
3. Do not apply time correction based on `timeShiftBufferDepth` if SegmentTemplates in the MPD have `presentationTimeOffset` | ||
|
||
## Decision | ||
|
||
Chosen option: 1 | ||
|
||
This approach provides a lot of flexibility to consumers of BigscreenPlayer. It also simplifies time-related calculations such as failover, start time, and subtitle synchronisation. | ||
|
||
## Consequences | ||
|
||
A major version (v9.0.0) to remove window type and overhaul BigscreenPlayer's internals. |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# 005 Remove fake seeking from restartable strategy | ||
|
||
Originally added: 2025-02-04 | ||
|
||
## Status | ||
|
||
| Discussing | Approved | Superceded | | ||
| ---------- | -------- | ---------- | | ||
| | x | | | ||
|
||
## Context | ||
|
||
Native media players with the capability to start playback in a livestream from any (available) point in the stream are called "restartable" in BigscreenPlayer's jargon. Unlike "seekable" devices, "restartable" devices don't support in-stream navigation. In other words, seeking is not supported. | ||
|
||
BigscreenPlayer exploited this restart capability to implement "fake seeking" prior to v9.0.0. The restartable player effectively polyfilled the native media player's implementation of `MediaElement#currentTime` and `MediaElement#seekable`. This polyfill relied on the `windowType` metadata to make assumptions about the shape of the stream's seekable range. v9.0.0 deprecates `windowType`. | ||
|
||
- Should we continue to support fake seeking for native playback? | ||
- How might we continue to support fake seeking? | ||
|
||
### Considered Options | ||
|
||
1. Remove fake seeking from restartable strategy | ||
2. Poll the HLS manifest for time shift | ||
3. Provide a "magic" time shift buffer depth for HLS streams | ||
|
||
## Decision | ||
|
||
Chosen option: 1 | ||
|
||
The effort to contine support for fake seeking on restartable devices is not justified by the small number of people that benefit from the continued support. | ||
|
||
## Consequences | ||
|
||
Viewers that use devices on the restartable strategy will no longer be able to pause or seek in-stream. |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# 006 Detect timeshift to enable auto-resume | ||
|
||
Originally added: 2025-02-04 | ||
|
||
## Status | ||
|
||
| Discussing | Approved | Superceded | | ||
| ---------- | -------- | ---------- | | ||
| | x | | | ||
|
||
## Context | ||
|
||
BigscreenPlayer's auto-resume feature prevents undefined behaviour when native players resume playback outside the seekable range. Auto-resume consists of two mechanisms: | ||
|
||
1. Playback is resumed before current time can drift outside of the seekable range | ||
2. Pausing isn't possible when current time is close to the start of the seekable range | ||
|
||
Auto-resume is only relevant for streams with time shift. The presence of time shift was signalled through the `windowType === WindowTypes.SLIDING` parameter prior to v9.0.0. v9.0.0 deprecates `windowType`. | ||
|
||
DASH manifests explicitly encode the time shift of the stream through the `timeShiftBufferDepth`. On the other hand, time shift in HLS manifests is only detectable by refreshing the manifest. | ||
|
||
- How might we detect timeshift and enable the auto-resume feature for DASH and HLS streams? | ||
|
||
### Considered Options | ||
|
||
1. Poll the HLS manifest to check if the first segment changes | ||
2. Poll the seekable range for changes to the start of the seekable range | ||
3. Provide a "magic" time shift buffer depth for HLS streams | ||
|
||
## Decision | ||
|
||
Chosen option: 2 | ||
|
||
## Consequences | ||
|
||
The time it takes the `timeshiftdetector` to detect and signal timeshift depends on it's polling rate. Hence, there is a risk the user navigates outside of the seekable range in the span of time before the `timeshiftdetector` detects a sliding seekable range. |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# 007 Estimate HLS Availability Start Time | ||
|
||
Originally added: 2025-02-04 | ||
|
||
## Status | ||
|
||
| Discussing | Approved | Superceded | | ||
| ---------- | -------- | ---------- | | ||
| | x | | | ||
|
||
## Context | ||
|
||
BigscreenPlayer adds functions to convert between three timelines: | ||
|
||
1. Presentation time: Output by the MediaElement | ||
2. Media sample time: Timestamps encoded in the current media | ||
3. Availablity time: UTC times that denote time available. Only relevant for dynamic streams. | ||
|
||
BigscreenPlayer relies on metadata in the manifest to calculate each conversion. | ||
|
||
For DASH: | ||
|
||
- Presentation time <-> Media sample time relies on `presentationTimeOffset` | ||
- Presentation time <-> Availability time relies on `availabilityStartTime` | ||
|
||
For HLS: | ||
|
||
- Presentation time <-> Media sample time relies on `programDateTime` | ||
- Presentation time <-> Availability time relies on ??? | ||
|
||
HLS signals availability through the segment list. An HLS media player must refresh the segment list to track availability. Availability start time can be estimated as the difference between the current wallclock time and the duration of the stream so far. This estimate should also correct for any difference between the client and server's UTC wallclock time. | ||
|
||
### Considered Options | ||
|
||
1. Accept the conversion between availability and presentation time is broken for HLS streams. | ||
2. Estimate availability start time for HLS streams. This requires clients provide the offset between the client and server's UTC wallclock time in order to synchronise the calculation. | ||
|
||
## Decision | ||
|
||
Chosen option: 1 | ||
|
||
## Consequences | ||
|
||
The conversion between presentation time and availability start time is erroneous for HLS. |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# 000 Title | ||
|
||
Originally added: | ||
|
||
## Status | ||
|
||
| Discussing | Approved | Superceded | | ||
| ---------- | -------- | ---------- | | ||
| | x | | | ||
|
||
## Context | ||
|
||
### [Considered Options] | ||
|
||
Optional | ||
|
||
## Decision | ||
|
||
## Consequences |
This file contains 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
Oops, something went wrong.