Open IlaRistola opened 6 years ago
I agree with adding a control that restarts the gif. To solve this, what I did though was remove and readd the material. I use this specifically in the marker lost event but you can add this to buttons.
document.querySelector('#MainGIF').removeAttribute('material'); document.querySelector('#MainGIF').setAttribute('material', { shader: "gif", src: "#my-gif" });
It seems that I cannot control gif from begin. Photoshop created gif loop forever, even if it set to loop only once(tested 2 loop too) in PS. Play/pause/tooglePlayback not have effect on begin of the script, but when i use controls after click event, or mouse enter etc. controls work. But anyway problem is that looping is un-controlled before first click on look event. I also tried make own function for controlling, but no lucky. Of course there is way to trick it, with change src when click or look event happen, so i can control it from first frame. But of course it is much easier to control it from start. Some entity.reset() can also help there probably.. I feel gif's is so tricky :D Any thoughts?