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

Add official method for accessing HTML media element #723

Merged
merged 1 commit into from
Mar 16, 2017
Merged

Add official method for accessing HTML media element #723

merged 1 commit into from
Mar 16, 2017

Conversation

silverbucket
Copy link
Contributor

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).

@googlebot
Copy link

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!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please let us know the company's name.

@silverbucket
Copy link
Contributor Author

I signed it!

@googlebot
Copy link

CLAs look good, thanks!

@ismena
Copy link
Contributor

ismena commented Mar 15, 2017

@silverbucket thanks for the PR. Could you provide some examples of the use cases for this change?

@silverbucket
Copy link
Contributor Author

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?

@ismena
Copy link
Contributor

ismena commented Mar 15, 2017

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?
I wasn't sure what you meant by 'video position information', so let me note that you're talking about current playback time (video_.currentTime), you can get it from Playhead.getTime().

@shaka-bot
Copy link
Collaborator

Testing in progress...

@shaka-bot
Copy link
Collaborator

All tests passed!

@ismena
Copy link
Contributor

ismena commented Mar 16, 2017

The tests passed, so I'm ready to merge if you're still interested :)

@silverbucket
Copy link
Contributor Author

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.

@joeyparrish joeyparrish requested a review from ismena March 16, 2017 16:22
@joeyparrish joeyparrish added the type: enhancement New feature or request label Mar 16, 2017
@ismena ismena merged commit 8f8c6d4 into shaka-project:master Mar 16, 2017
@ismena
Copy link
Contributor

ismena commented Mar 16, 2017

@silverbucket There you go!

@silverbucket
Copy link
Contributor Author

@ismena thank you! any idea when the next patch release will be made so I can update the dependencies?

@ismena
Copy link
Contributor

ismena commented Mar 16, 2017

Let me summon the Big Shaka Boss for that question :)
@joeyparrish

@joeyparrish
Copy link
Member

Either next week or the following.

@silverbucket
Copy link
Contributor Author

Thanks everyone!

@joeyparrish
Copy link
Member

This was just released in v2.0.7.

@github-actions github-actions bot added the status: archived Archived and locked; will not be updated label Jul 25, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 25, 2023
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: enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants