goldfire / howler.js

Javascript audio library for the modern web.
https://howlerjs.com
MIT License
23.87k stars 2.23k forks source link

Howler doesnt start on iOS if the interaction is a slide #1679

Open Makio64 opened 1 year ago

Makio64 commented 1 year ago

The Problem

If the user do a simple touch without moving : Howler audio will play But if the user touch the screen, move the finger and then release the touch : Howler audio will not play

Reproducible Example

any howler

Reproduction Steps


const sound = new Howl({
    src: ['/audio/cookiecrack.mp3'],
    autoplay: false,
    loop: false,
})
window.addEventListener('pointermove', (e) => {
    e.preventDefault()
})
document.addEventListener('touchend', () => {
    console.log('oh')
    sound.play()
})

Possible Solution

maybe an ios bug ?

Context

On a website the user arrive on a page where he's ask to slice an object, at the end of the "slice" the sound should play.

Howler.js Version

latest

Affected Browser(s)/Versiuon(s)

iOS Chrome/Safari 16.6