Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/initial bandwidth estimate override #509

Merged
merged 4 commits into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## [Unreleased]

### Added

- Android: `AdaptationConfig.initialBandwidthEstimateOverride` to override the selection of the optimal media tracks before actual bandwidth data is available

## [0.28.0] - 2024-08-07

### Added
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ private fun String.toTimelineReferencePoint(): TimelineReferencePoint? = when (t
*/
private fun ReadableMap.toAdaptationConfig(): AdaptationConfig = AdaptationConfig().apply {
withInt("maxSelectableBitrate") { maxSelectableVideoBitrate = it }
withInt("initialBandwidthEstimateOverride") { initialBandwidthEstimateOverride = it.toLong(); }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JS number is a double. Not sure why this is an Int 🤔 Should both be changes to withDouble?

Copy link
Contributor Author

@saravanans-github saravanans-github Aug 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point; thank you.

OK if I'll leave it as-is for now please as this seems inline with the withInt implementation of both bandwidthEstimateWeightLimit and maxSelectableBitrate

}

/**
Expand Down
8 changes: 8 additions & 0 deletions src/adaptationConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,12 @@ export interface AdaptationConfig {
* Can be set to `undefined` for no limitation.
*/
maxSelectableBitrate?: number;

/**
* The initial bandwidth estimate in bits per second the player uses to select the optimal media tracks before actual bandwidth data is available. Overriding this value should only be done in specific cases and will most of the time not result in better selection logic.
*
* @platform Android
* @see https://cdn.bitmovin.com/player/android/3/docs/player-core/com.bitmovin.player.api.media/-adaptation-config/initial-bandwidth-estimate-override.html?query=var%20initialBandwidthEstimateOverride:%20Long?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @see https://cdn.bitmovin.com/player/android/3/docs/player-core/com.bitmovin.player.api.media/-adaptation-config/initial-bandwidth-estimate-override.html?query=var%20initialBandwidthEstimateOverride:%20Long?
* @see https://cdn.bitmovin.com/player/android/3/docs/player-core/com.bitmovin.player.api.media/-adaptation-config/initial-bandwidth-estimate-override.html

Actually not sure if this is very helpful. The documentation here is the same as the linked one. I would suggest to not include the link, also as it could get outdated.

saravanans-github marked this conversation as resolved.
Show resolved Hide resolved
*/
initialBandwidthEstimateOverride?: number;
}
Loading