-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Add official method for accessing HTML media element #723
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
I signed it! |
CLAs look good, thanks! |
@silverbucket thanks for the PR. Could you provide some examples of the use cases for this change? |
Hi @ismena for what I'm working on at the moment, the code does not initialize the video itself, that's done by the end-user. So, when we access shaka player instance, we can make no assumptions made about what's on the HTML page, and which video element might have been assigned to the shaka player instance. We do, however, want to get video position information so that we have a better understand of the state of the video playback, using the standard HTML Media Element API. Does that make sense? |
Thanks for the explanation! Let me see if i got you right: your code doesn't have access to the Player's internals (or wants to access the Media Element from outside the class), correct? |
Testing in progress... |
All tests passed! |
The tests passed, so I'm ready to merge if you're still interested :) |
Sounds great! And in response to your question, I need to be able to access the HTML Media Element API in certain cases related to buffering, seeking etc. |
@silverbucket There you go! |
@ismena thank you! any idea when the next patch release will be made so I can update the dependencies? |
Let me summon the Big Shaka Boss for that question :) |
Either next week or the following. |
Thanks everyone! |
This was just released in v2.0.7. |
In some cases it may be necessary to get access to the HTML Media Element (the one that is passed in during initialization of a player) from a player instance when you no longer have a reference to what it was initialized with. In this case it would be helpful to have a method to do so (and not have to access player.video_ directly, which could change at any point not reflected by semver as it's not an official API).