UnityPlugin-AVProVideo icon indicating copy to clipboard operation
UnityPlugin-AVProVideo copied to clipboard

Audio Clipping when OpenMedia by url in WebGL build if SupportPositionalAudio is turned on

Open Dioinecail opened this issue 1 year ago • 0 comments

Issue

The issue is this very loud clipping sound when opening a video in a browser through url while SupportPositionalAudio is set to true, you know like when you plug an electric guitar into a working amp or headphones into a mini jack while wearing them. Note that the clipping sound does not reappear after 2-nd or sometimes 3-rd OpenMedia on any other gameobject or url Also clipping sound can be heard when closing a browser tab while any video is playing

To Reproduce

  1. Create gameobject with MediaPlayer, ApplyToMesh, AudioOutput, MeshRenderer and AudioSource components
  2. Set ApplyToMesh to target your MeshRenderer
  3. Set your MediaPlayer references where needed (ApplyToMesh, AudioOutput etc.)
  4. Set AutoPlay and AutoOpen to false
  5. Set SupportPositionalAudio on AudioOutput to true
  6. Upload the build or localhost it with something like nginx (sorry i'm not familiar with hosting and stuff)
  7. Open your build in a browser, chrome, firefox or safari
  8. Perform OpenMedia(MediaPathType.AbsolutePathOrURL, url, true); where url is your target video, for example we use AWS

Tested on

  • Unity version: 2019.4.30f1, 2021.3.16f1, 2021.3.21f
  • AVPro Video version: 2.9.1
  • Operating system version: built with Windows 10, macOS Sonoma 14.1.2
  • Browser: chrome, firefox, safari (haven't tried other browsers)
  • Video specs: 1280x720, 29.97fps, 403KBps
  • Other: WebGL build with webGL 2 api and brotli compression
  • Video hosted with AWS R2

Video Sample

The issue persists with any video on our servers, but just in case, here is the one i'm testing with https://r2.anasaea.dev/MUggAUQ42m8.mp4

Dioinecail avatar Feb 26 '24 19:02 Dioinecail