I have an asset grid that gets texts, images, sounds and video from a api.
Some items have an image, other items have sound or video. I have used a converter script to show/hide the different media assets depending on file name like so:
This works well, when there is an image I see the image, when there is a soundfile I see the sound controls.
If I press play the sound starts. But when I navigate back or forward in the grid the sound does not stop. It only stops when I navigate to another layer. Then when moving back to the layer where the sound controls are the sound continues but the controls have reverted into a state as if the audio is not playing - meaning the play button is visible, not the pause button, although the sound is playing. Even after I close the player moving back into composer the sound still playes?!
Why is this?
What I want is for the sound only to play when sound controls are visible - meaning when I can see them on screen/in viewport. As soon as the sound controls are not in viewport I want to pause the sound.
And natually I want the controls to work after I have navigatet within the experience and comes back to the sound clip.
Are there any known issues regarding using the sound asset?