Audio plays briefly in Safari when removed
Description When removing an audio in Safari it briefly plays for a split seconds before being removed.
To Reproduce Steps to reproduce the behavior:
- Enter a Hubs room
- Spawn an audio element
- Remove it from the scene
- The audio plays from the beginning briefly before disappearing.
Expected behavior The audio element should stop playing and disappear.
Hardware
- Device: Desktop
- OS: MacOS
- Browser: Safari
Additional context Seems that this workaround is causing the issue. It would be good to check if this is still necessary and either remove or keep it and fix the issue: https://github.com/mozilla/hubs/blob/79c6b268c5deecd417c45cb2108d8d13c7d1c24a/src/components/media-video.js#L659-L681
┆Issue is synchronized with this Jira Task
We tested this on Safari 15.2 on both Mac and iOS and couldn't reproduce this issue on hubs.mozilla.com/. When removing an audio element from the scene, the element disappears and no sound is being played.