-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Support for maximum bit rate adaptive streaming #1310
Support for maximum bit rate adaptive streaming #1310
Conversation
Hi @ashnfb, great feature. I went ahead and made some updates to the documentation and code. I've renamed it to maxBitRate to keep it in the style of bufferConfig. In the docs, I made a couple of changes:
Looking at the iOS code, if you set the maxBitRate after the video is loaded, nothing will happen because there is nothing in applyModifiers to apply it. This is a pretty common use case if you want to emulate YouTube and change the bitrate mid-playback. Please update the PR to handle it. Otherwise looking very good. I am going to wait for the change and will test then. Do you by any chance have a sample stream I can use to test? |
468491d
to
12a482a
Compare
Hi @cobarx, support for applyModifiers and maxBitRate. |
it is possible to make video player to automatically switch between different bitrates/resolutions according to current internet connection speed/quality at real time ? |
@c1ngular, the code permits chaining the maximum bitrates; however two caveats:
|
@ashnfb thanks ! |
@c1ngular The underlying player will automatically change bitrates to what it feels is the appropriate stream/resolution. I believe there is a PR in the works to support choosing a specific resolution similar to what YouTube offers. |
@ashnfb Tested this on iOS tonight and it's looking good. I'll get to ExoPlayer tomorrow and merge it! Thanks for making the changes. |
@ashnfb It just occurred to me that we should document how to clear the value by setting it to zero. If you get to it before I review tomorrow, can you add a note about that. Also, looking at the Android code you are setting max rate to 0 when initializing the video. That's not what we want since it wants MaxInfinity to indicate auto-selection, I'd imagine it will cause it to select the minimum bitrate stream. I would instead use a conditional like this:
|
@cobarx thanks for making the changes |
@ashnfb No problem, I didn't see your message till just now. Have a little time this morning to do open source work, so I hopped right into it. |
@cobarx i getting build error in android ... |
…daptive-streaming Support for maximum bit rate adaptive streaming (rebased from commit 62f7221)
Was this feature worked on, if yes, how can i activate/implement |
iOS and Android support maximum bit rates for HLS streams; and this can be helpful when a user wants to limit bandwidth consumption (example may include limiting content on cellular devices).
This PR implements this prop for both platforms
Example to test:
specify adaptive streaming without maximum bitrate limit (this is default when prop not specified)
maximumBitRate={0}
specify adaptive streaming with maximum bitrate limit
maximumBitRate={2500000}
[2500000 is an example medium-quality encoded 720P h264 video, but it will vary by the encoder and source]