-
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
bitECS: Support media with link component #6272
Conversation
As commented inline this solution is very hacky for sure. Give me some time to think whether there is clearer solution... I haven't deeply thought yet but making a new component (that holds link url) for this special case rather than adding link url to MediaLoader component would be simpler? Anyways give me more time... |
Let me share my thoughts. With the new loader enabled, we prevent a glTF node that has multiple Hubs components that generates Three.js object. We preprocess such nodes to make multiple Hubs Component glTF nodes under the node. Under this policy, Link + Media is not doable as is. Probably we don't spend long time for this problem. So probably preprocessing Link + Media glTF Hubs Components and reusing the existing code as much as possible would be good. Also, adding a special path after loading a media as this PR does would be reasonable. But I don't prefer adding This code in the media loading system const linkSrc = APP.getString(MediaLoader.linkSrc[eid]);
if (linkSrc) {
...
} would be replaced with like if (hasComponent(world, MediaLink, eid)) {
const linkSrc = APP.getString(MediaLink.src[eid]);
...
} |
aa39222
to
c619017
Compare
Yes, that makes sense and I like that is much more clear, updated. |
c619017
to
91ec811
Compare
Fixes #6263
In the AFrame loader when an object had a
link
and aimage
components (also works withvideo
andloader
) the media would override the link mediaIn the new loader we don't support a media loader loading multiple media. The second media would override the first one's parameters.
Using image/video/model with the link component seems to be a pretty common use case. This PRs adds a hack to support that specific use case.
Another alternative would be to add support for multiple loads to the media loader but I'm no sure if that's something that we want...