E-Kuerschner / useAudioPlayer

React hooks for controlling audio on the web
MIT License
330 stars 36 forks source link

WAV files do not load on iPad iOS 15.2 #81

Closed objectiveSee closed 1 year ago

objectiveSee commented 2 years ago

Describe the bug My react code is able to play MP3s and Wavs on a desktop, but not on Mobile safari on iOS 15.2 (iPad Air 4th Gen). The WAV files do not play. Adding html5:true to the howler config will fix things, however that seems like a patch and not a solution.

To Reproduce Code Example:

case 'playSound': {
          const logSoundName = payload.data.url.split('/')
          console.log(`🍎 attempting to play sound: ${logSoundName[logSoundName.length-1]} 🍎`);
          const sound = new Howl({
            src: [payload.data.url],
            volume: 0.2,
            onload: (soundId: number) => {
              console.log(`🍎 onLoad - attempting to play sound# ${soundId} 🍎`);
              sound.play();
            },
            onplay:(soundId: number) => {
              console.log(`🍎 onPlay sound# ${soundId} 🍎`);
            },
          });

          sound.once('loaderror', (e) => console.log(`load error: ${e}`))
          sound.once('playerror', (e) => console.log(`playerror: ${e}`))

          break;
        }

Expected behavior

Environment (please complete the following information):