Assets Tag
Working with the assets tag <a-asset>
To use images or videos several times, it is possible to place them in the <a-asset>
tag. All details are in the documentation. The tag supports the four following items:
<a-asset-item>
– Miscellaneous assets such as 3D models and materials<audio>
– Sound files<img>
– Image textures<video>
– Video textures
<a-assets> <video id="videoWatch" src="videos/video_pruefung.mp4" loop="false" autoplay="true" ></video> <img id="imagePoki" src="images/bulbasaur.gif" > </a-assets> <a-box id="box_square" position="-1 0.5 -3" rotation="0 45 0" width="1.82" color="#FFF" src="#videoWatch" ></a-box> <a-image id="box_rect" position="0 1.25 -5" height="1" width="6" rotation="0 45 0" color="#FFF" src="#imagePoki" repeat="6 1" ></a-image>
Please note that – as in HTML – <video>
and <audio>
tags need an end tag, but not <img>
.
Audio and video assets will block the scene if we set preload="auto"
or preload="true"
Example
Please use the example to test.
Previous TopicNext Topic