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

[2.0] Some API methods don't work before play #973

Closed
LloydW93 opened this issue Jan 4, 2016 · 6 comments
Closed

[2.0] Some API methods don't work before play #973

LloydW93 opened this issue Jan 4, 2016 · 6 comments
Assignees
Labels
Milestone

Comments

@LloydW93
Copy link
Member

LloydW93 commented Jan 4, 2016

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:

var dashPlayer = MediaPlayer().create();
dashPlayer.initialize();
// various settings such as setScheduleWhilePaused, setAutoSwitchQuality
dashPlayer.attachView(video);
dashPlayer.attachSource(connection);

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.

@wilaw
Copy link
Member

wilaw commented Jan 4, 2016

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
PS. Dan is out on vacation rest of this week reducing the Hawaiian MaiTai supply, so he won't be able to comment until next Monday.

@LloydW93
Copy link
Member Author

LloydW93 commented Jan 5, 2016

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?

@LloydW93
Copy link
Member Author

LloydW93 commented Jan 6, 2016

setup doesn't work in the case where a stream finishes and you attempt to play another - some controllers are immediately torn down.

@dsparacio
Copy link
Contributor

@LloydW93 @wilaw I'll take a look soon. Never liked the create call in play was there for your last comment problem. Many todos around dash handler/parser create stuff. Ill take a look to come up with a better object creation process.

Dan

@dsparacio dsparacio added the Bug label Jan 12, 2016
@dsparacio dsparacio added this to the 2.0.0 milestone Jan 12, 2016
@dsparacio dsparacio self-assigned this Jan 12, 2016
@dsparacio
Copy link
Contributor

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.

dsparacio pushed a commit that referenced this issue Jan 21, 2016
Fix for [2.0] Some API methods don't work before play #973
@dsparacio
Copy link
Contributor

Fixed with PR #1041

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants