Rythm.js icon indicating copy to clipboard operation
Rythm.js copied to clipboard

Does not work in iOS Safari

Open mgreci opened this issue 7 years ago • 5 comments

I’m not sure if you have considered mobile or even Safari but starting the demo initially rotates the Github and Release Notes buttons but no music plays nor does everything dance like it does on a desktop (Chrome).

mgreci avatar Nov 13 '18 22:11 mgreci

Safari is a known bug for me, but i have nothing to debug this out :/ Any help to find the issue would be appreciated.

Okazari avatar Nov 13 '18 23:11 Okazari

Would love to see this working on mobile with mic support.

brianyuen avatar Apr 17 '20 21:04 brianyuen

I still need help on this as i don't have neither a mac or an iphone.

Okazari avatar Apr 18 '20 07:04 Okazari

The demo plays fine on desktop Safari. Except for a console log Promise rejection error of navigator.getUserMedia upon click on 'Use Microphone'. I'll investigate, possibly send PR.

I can try to debug iOS Safari next.

mgreci avatar Apr 19 '20 03:04 mgreci

Using combination of Howler and Rythm.js resolve this problem.

Example:

import Rythm from 'rythm.js'
import { Howl } from 'howler'
import kineticMusicMP3 from '@/assets/musics/kinetic.mp3'

const howlKinetic = new Howl({ src: kineticMusicMP3, html5: true, preload: false })

const rythm = new Rythm()
rythm.addRythm('rythm-pulse', 'pulse', 0, 10)
rythm.addRythm('rythm-shake', 'shake', 0, 10)
rythm.addRythm('rythm-twist', 'twist', 0, 10)

// when need to load music and start dance page
howlKinetic.load();
howlKinetic.play();
rythm.connectExternalAudioElement(howlKinetic._sounds[0]._node);
rythm.setGain(0.1);
rythm.player.currentInputType = rythm.player.inputTypeList['TRACK'];
rythm.start();

// when need to stop dancing
howlKinetic.stop();
rythm.stop();

oleegarch avatar Aug 14 '23 19:08 oleegarch