-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[2.0] Some API methods don't work before play #973
Comments
I noticed the same thing when trying to use setLiveDelayFragmentCount() - could only be called after initialize() had been called. The issue as you point out is that createControllers() is only called inside play(). This seems rather late in the stack and the controllers being created don;t really have any dependencies besides context. How about adding createControllers() to setup() function? This is the first function called upon instantiation of a new MediaPlayer. I tested this and it worked well with my setLiveDelayFragmentCount() use case. Other samples seem to work too as well as build-up and tear-down of the instance. Does this also work for your setInitialBitrateFor case? -Will |
Yep - putting it in setup works too - I just wasn't sure if there was an active decision not to put it there. We can check with Dan when he's back? |
setup doesn't work in the case where a stream finishes and you attempt to play another - some controllers are immediately torn down. |
Solution will be to use the mediaPlayerModel to store data before controllers are initialized. This was the intent of this object and is already in place. I will fix this. Thanks for catching this. |
Fix for [2.0] Some API methods don't work before play #973
Fixed with PR #1041 |
createControllers is not called until play() is first ran. This could potentially be problematic if you want to use a call such as setInitialBitrateFor.
For example, we do something like:
I'm currently working around this for testing and playing with by adding createControllers() to the initialize function, but am not sure if that's the best place for it.
The text was updated successfully, but these errors were encountered: