p5.js-sound icon indicating copy to clipboard operation
p5.js-sound copied to clipboard

Downloaded Sketches not Working in Chrome

Open alsumwas opened this issue 5 years ago • 4 comments

Most appropriate sub-area of p5.js?

  • [ ] Accessibility (Web Accessibility)
  • [ ] Color
  • [ ] Core/Environment/Rendering
  • [ ] Data
  • [ ] Dom
  • [ ] Events
  • [ ] Image
  • [ ] IO
  • [ ] Math
  • [ ] Typography
  • [ ] Utilities
  • [ ] WebGL
  • [X] Other (specify if possible)

Details about the bug:

  • p5.js version: Current Web Editor
  • Web browser and version: Chrome Version 85.0.4183.121
  • Operating System: Happens on Mac, iphone and PC

None of the sketches I download from the p5.js web editor work in Chrome. Here is one that I uploaded to a sever: http://do.art.gvsu.edu/interactive21/sound/index.html They do work in safari and firefox.

alsumwas avatar Oct 02 '20 15:10 alsumwas

this looks like an issue with p5.sound. i will transfer your issue to that repository.

lmccart avatar Oct 02 '20 19:10 lmccart

@alsumwas I was facing a similar problem with chrome. I think the problem was due to the Autoplay Policy Changes of 2018. According to that, the "audio context" was not allowed to start until there was a user interaction with the domain. I feel adding a simple DOM element call initiating the sketch should solve the issue you are facing. :)

nakul-shahdadpuri avatar Dec 18 '20 07:12 nakul-shahdadpuri

@nakul-shahdadpuri for that you can use userStartAudio() after some mouse event

Ajaya1000 avatar Apr 12 '21 09:04 Ajaya1000

@alsumwas I'm having the cross-origin issue. Is that the problem with the sketch here?

Ajaya1000 avatar Apr 12 '21 09:04 Ajaya1000