Skip to content

feat(android): initial bitrate #4480

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

Merged

Conversation

moskalakamil
Copy link
Collaborator

@moskalakamil moskalakamil commented Mar 20, 2025

Summary

Added prop to set initial bitrate

Motivation

#3074

Changes

  • new prop source.bufferConfig.initialBitrate
  • setInitialBitrate in ExoplayerConfig
  • new Docs section

Test plan

Run test android app with

<Video
        // ...
        source={{
          // ...
          bufferConfig: {
            // ...
            initialBitrate: {number}
          }
        }}
        reportBandwidth={true}
        onBandwidthUpdate={e => console.log(e.bitrate)}
/>

Copy link
Collaborator

@freeboub freeboub left a comment

Choose a reason for hiding this comment

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

Initial bitrate should be a sub property of source (or even better source.bufferConfig).
The issue here under is when you mount the

@KrzysztofMoch
Copy link
Collaborator

Yeah I agree - It would be better to move it into source.bufferConfig or ssource

@moskalakamil moskalakamil requested a review from freeboub March 26, 2025 16:01
@moskalakamil
Copy link
Collaborator Author

@freeboub Done

Copy link
Collaborator

@freeboub freeboub left a comment

Choose a reason for hiding this comment

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

Long time to approve but it looks good to me.

Just a note for you @moskalakamil.
If I remember well this initial bitrate will be apply on player initialization (I implemented similar feature in my past fork).
During your app life cycle, if you just change <Video/> source we don't release and recreate the whole player, then this parameter may not be used. It make sense as if exoplayer already know its expected bandwidth, no need to apply initial bandwidth.

Thank you!

@KrzysztofMoch KrzysztofMoch merged commit 41ddc5c into TheWidlarzGroup:master Apr 6, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

3 participants