Re: [css-houdini-drafts] [css-animationworklet] Sending data to animators in worklet from main thread (#869)

I have a case where i have a `<video>` element but sometimes it dose not contain any video tracks (only audio tracks).
in those cases i would like to show a visualizer. I do not wish to replace the src using something new like `video.srcObject = canvas.captureStream()` i already have a media playing. and it would not work to seek, pause and play, etc

I would have wished for something like `video.videoTracks.addTrack` to exist but that is not the case, it's only possible to do so with text tracks 😞 

So my 2nd effort will be to show a canvas behind the video element but that is not as much appealing as just adding a background to the video element instead. Therefore i need to 1) create a audio context `context.createMediaElementSource(video)` 2) analyze the audio and paint a visualizer to a canvas context.
it would feel unnecessary to have to send a postMessage for every frame, if something could be transferable that would be more awesome.

Maybe someone have some tricks and tips for me of how i can solve this today?

---

it would have been better to be able to add a video track cuz than i can show the video with picture in picture. currently the feature is disabled if there is no video tracks - hmm, don't know how to best solve it... i would wish for it to be possible to have some media buttons in the pip view - i know some work is being done to allow [arbitrary content](https://chromestatus.com/feature/4844605453369344) in pip so that you can have any html content you want inside of it. but not possible today

-- 
GitHub Notification of comment by jimmywarting
Please view or discuss this issue at https://github.com/w3c/css-houdini-drafts/issues/869#issuecomment-782916810 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Sunday, 21 February 2021 20:02:33 UTC