Skip to content
This repository has been archived by the owner on Oct 10, 2022. It is now read-only.

[RFC] forwardRef as to expose the underlying <video> for custom behaviors #2

Open
tomsseisums opened this issue Dec 7, 2018 · 3 comments

Comments

@tomsseisums
Copy link
Contributor

What you think of exposing the underlying <video> with a forwardRef?

One could then hook into various API's to set up custom systems, including custom controls.

@tomsseisums
Copy link
Contributor Author

Hmm, if I understood correctly, it's possible to get a ref to SanityMuxPlayer and then call getVideoElement to get the actual video reference.

I wonder, should forwardRef still be implemented or the current way is sufficient?

@skogsmaskin
Copy link
Member

Yes, you can access the video element with .getVideoElement.

Using forwardRef could be nice as well!

@dictions
Copy link

dictions commented May 7, 2021

@tomsseisums @skogsmaskin how can you call a class method on a rendered React Element?

The only work around I've found is to create a ref wrapping the video player, and then do ref.current.querySelector('video').

Not elegant but it works!

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

No branches or pull requests

3 participants