Extension Requirement

Can be that the UVW mapping of the TV does not fit to your movie. Better first try it with a siple box and apply the stream to this box.

We have implemented a dedicated viewer extension to use an HLS video stream as a texture, but itā€™s not yet available in the desktop application, it will be included in the next release.

As a part of the implementation weā€™ve extended the new JavaScript API with a new function: ViewerApi.createStreamTextureFromHtmlVideo(video) that must be used instead of ViewerApi.createTextureFromHtmlVideo(video) to create a texture from a video element if the video element represents a live streamed video. @Nisarg_Mehta, could you use the former function and check if it fixes the black image issue for you? The new function is currently available only after uploading the scene to our hosting, ignore that it fails in the desktop application.

1 Like

Thanks a lot @wojtek. This could possibly be a gamechanger for us. The new function works succesfully as you mentioned. The only small quibble is that the user has to click twice to play the video. The first click only loads the audio. Upon the second click, the video starts playing.

Please find the link below. The video will play when we click on the Rug.
https://3d.xporium.com/example-room-demo/

I think you have to make the video texture playing (material.play() or videoTexture.play()) from the Hls.Events.MANIFEST_PARSED event handler, because only then the video is ready to be played, and calling video.play() makes the video DOM element play, but not the texture.

1 Like

Hi @wojtek,

This topic also interests me. However, Iā€™m not sure what needs to be replaced.
Can you give the complete code?
How many videos can be streamed at the same time without any problems?
Is it possible to activate 2 (or more) videos with one switch (what would the cod look like)?

Thanks for your help!

1 Like

In the next version of Shapespark we will add an extension that enables you to use a live video stream as a texture without custom coding.

For now, I think you can start with the script from the Jumbeā€™s post replacing createTextureFromHtmlVideo with createStreamTextureFromHtmlVideo and using material names from your scene instead of the names from our example-room scene. However, currently it will work only when the scene is hosted on our infrastructure.

3 Likes

I look forward to a new update Shapespark with these features.

I did a demo scene and entered the code according to your instructions, but it takes two clicks to watch the video. I donā€™t know how to solve it.

1 Like

Sorry for the late revert @wojtek. Thanks for your reply. I will try this solution out shortly and get back to you if its working or not.

2 Likes

Hi @wojtek, do you have a date for the new update where this implementation is already coming?

We have this implemented as an extensions, but unfortunately during testing it turned out that Apple devices have a bug with handling of HLS streams that prevents our extensions and the manual solution provided by @wojtek from working on these devices. Apple is working on a fix, but unfortunately we will need to delay the release until the fix is released.

1 Like

Roger that @jan, :smiley: I hope apple corrects soon so you guys can get this update out! Thanks for your prompt reply.:pray:t3::pray:t3::pray:t3:

Is there any update on whether the element Apple need to fix has been done yet @jan

1 Like

A version with the fix is not yet released, but is is already available in iOS 14.6 Beta 2: 218637 ā€“ Textures Fail to Render in WebGL from HLS Stream on iPhone 12 [iOS 14.2]

1 Like