Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure autoplay for mediaelment #565

Merged
merged 1 commit into from
Oct 29, 2015
Merged

Configure autoplay for mediaelment #565

merged 1 commit into from
Oct 29, 2015

Conversation

chinshr
Copy link
Contributor

@chinshr chinshr commented Oct 29, 2015

Enable autoplay for backend "mediaelement". Background is the canplay event on an <audio> element, which is mapped to ready in wavesurfer is not triggered automatically on iOS. The workaround is to set autoplay to true and pause the audio as soon as the ready event is fired.

Note: This could provide a workaround for #429.

wavesurfer.init({autoplay: true});
wavesurfer.on('ready', function() { wavesurfer.pause(); })

@katspaugh
Copy link
Owner

Have you checked if it works on iOS?

@chinshr
Copy link
Contributor Author

chinshr commented Oct 29, 2015

Yes, tested and works for me.

katspaugh added a commit that referenced this pull request Oct 29, 2015
Configure autoplay for mediaelment
@katspaugh katspaugh merged commit 85ff34d into katspaugh:master Oct 29, 2015
@katspaugh
Copy link
Owner

Cool, thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants