Thank you, I want to hide the tag before I press the shutter button. My shutter button purpose is to randomize the displayed image.
Currently, when I not yet press the shutter button, my img frame is displayed in black frame(i want to hidden this frame).
and how can I load the Dance mp4 video right after I scan the bar code? My code is below:
<html>
<body style='margin: 0; overflow: hidden;'>
<a-scene embedded arjs='sourceType: webcam; debugUIEnabled: false;'>
<a-assets>
<video src="Dance.mp4"></video>
<img id="my-image">
</a-assets>
<a-image src="#my-image"
position="0 2 -5"
width="2.5"
height="1.5"
scale="1 1 1">
</a-image>
</a-scene>
<div class="ui">
<a id="take-phot" title="Take Phot"><i class="material-icons">photo_camera</i></a>
</div>
</body>
<script>
var myPix = new Array("ass/1.png", "ass/2.jpg", "ass/3.png");
function choosePic() {
var randomNum = Math.floor(Math.random() * myPix.length);
document.getElementById("my-image").src = myPix[randomNum];
}
var take_photo_btn = document.querySelector('#take-phot');
take_photo_btn.addEventListener("click", function (e) {
choosePic();
});
</script>
</html>
question from:
https://stackoverflow.com/questions/65915351/web-ar-aframe-ar-js 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…