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 support for Image and Video #13

Open
vincentfretin opened this issue Mar 12, 2024 · 4 comments
Open

Add support for Image and Video #13

vincentfretin opened this issue Mar 12, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@vincentfretin
Copy link
Member

vincentfretin commented Mar 12, 2024

Something really simple, spawning a plane, scale to respect the aspect ratio.
For video, a play/pause button.

Image and videos are generally in a hubs room so in the objects.gltf file, not in hubs glb scene.
The objects.gltf file can be downloaded for any hubs rooms at https://hubs.mozilla.com/xxxxxxx/objects.gltf
The objects.gltf file is the non binary format but that's the same than the scene glb with hubs extensions. Mainly pinnable and media extensions (glb, sketchfab glb, png, mp4).

For images, we can do a simplified version of https://github.com/mozilla/hubs/blob/master/src/components/media-image.js just supporting jpg, webp, png by creating a a-plane entity, and scaling the entity based on image dimensions.

For videos, it's https://github.com/mozilla/hubs/blob/master/src/components/media-video.js there is lots of code in there, but at first we can just do like images and use a VideoTexture, similar to networked-video-source, and adding a simple pause/play button on it. Syncing video time between participants is another subject.

Hubs uses https://github.com/mozilla/hubs/blob/master/src/components/media-loader.js to guess the mime type of the media and use the correct component, but this code is so complex! We can do a simpler one.

@vincentfretin vincentfretin added the enhancement New feature or request label Mar 13, 2024
@jywarren
Copy link

I would sponsor part of this! What is your goal?

@vincentfretin
Copy link
Member Author

That would be great, thank you! See my answer about sponsorship in #5 (comment)

@jywarren
Copy link

TY! Sponsored for $100. Much appreciated.

@vincentfretin
Copy link
Member Author

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Planned
Development

No branches or pull requests

2 participants