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

Refactor Player.load using async/await #1336

Closed
joeyparrish opened this issue Mar 5, 2018 · 0 comments
Closed

Refactor Player.load using async/await #1336

joeyparrish opened this issue Mar 5, 2018 · 0 comments
Assignees
Labels
status: archived Archived and locked; will not be updated type: code health A code health issue type: enhancement New feature or request
Milestone

Comments

@joeyparrish
Copy link
Member

Player.load() is large, and we've been given feedback that it is also hard to read. These issues will all benefit from a break-up of Player.load into several pieces:

In addition to breaking up load() into smaller pieces, we should start using the async and await keywords enabled by our migration to ES6 (#1157). This will enhance readability of the many, many async steps in the load() process.

@joeyparrish joeyparrish added type: enhancement New feature or request type: code health A code health issue labels Mar 5, 2018
@joeyparrish joeyparrish added this to the v2.5 milestone Mar 5, 2018
@theodab theodab self-assigned this Mar 5, 2018
shaka-bot pushed a commit that referenced this issue Mar 6, 2018
This adds attach/detach methods to replace the media element in the
Player constructor.  Now applications can take back control of the
media element or provide a reference later in the Player's life cycle.

This also allows applications to decide whether or not to set up
MediaSource in advance, through an optional argument on attach and
unload.  The default will be to set up MediaSource in advance, which
maintains current behavior.  This advanced setup of MediaSource can
improve load latency later.

This change also introduces async/await for the first time in the
project, which required changes to eslint config, Closure build
arguments, Babel & Babel-polyfill setup, and the esprima parser used
by our extern generator.

The use of async/await will improve readability in many places, and
these infrastructure changes to enable async/await should also unblock
issues #1336 and #1337.

Closes #1087

Change-Id: I0d6b4e0e2af27a6520a3d070fa92b7139b2cb8b0
@joeyparrish joeyparrish modified the milestones: v2.5, v2.4 Mar 14, 2018
@shaka-project shaka-project locked and limited conversation to collaborators May 12, 2018
@shaka-bot shaka-bot added the status: archived Archived and locked; will not be updated label Apr 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: archived Archived and locked; will not be updated type: code health A code health issue type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants