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

Autoplay not working on mobile safari [restriction] #78

Open
talipbyk opened this issue Oct 4, 2016 · 10 comments
Open

Autoplay not working on mobile safari [restriction] #78

talipbyk opened this issue Oct 4, 2016 · 10 comments
Assignees
Labels

Comments

@talipbyk
Copy link

talipbyk commented Oct 4, 2016

I create one button for sound and when I click the button it works. But I want that it works as autoplay.I mean when the user enter the website, the sound should start automatically. By the way i am workıng on Safarı browser and this problem is occuring for mobile.(Not for PC). It is working on dekstop well. But i dont know why it doesnt work on mobile device.

When i click the button first, the sound is working then when i refresh the page, also autoplay works. but when i close to browser and open the browser again, autoplay doesnt work again. i have to click to button again to get the sound.

I would like to get help about how can i make it autoplay sound..

@IonDen
Copy link
Owner

IonDen commented Oct 4, 2016

Hello, you can't do it on Mobile devices. It's a build in restriction. Check this Apple article about it. Section "User Control of Downloads Over Cellular Networks".

This means, that user action is a requirement to download and play a media on mobile device. Autoplaying sounds and video could bring a negative experience to users, because they have to pay a lot of money for mobile connection to 3G/4G/LTE.

@IonDen IonDen self-assigned this Oct 4, 2016
@IonDen IonDen added the Question label Oct 4, 2016
@IonDen IonDen changed the title Hi, I have tried ion.sound's last version but autoplay not working on mobile safari Autoplay not working on mobile safari Oct 4, 2016
@IonDen IonDen changed the title Autoplay not working on mobile safari Autoplay not working on mobile safari [restriction] Oct 4, 2016
@talipbyk
Copy link
Author

talipbyk commented Oct 4, 2016

I think you misunderstand my problem. I upload the sound to my soruce codes. The user does not have to download the sound. The sound should play from soruce code.
This sound is working on Android systems but it does not work on IOS.
this sound is short example bip

@IonDen
Copy link
Owner

IonDen commented Oct 4, 2016

I understand. Safari does not care about it, the whole audio system in safari is disabled until any user action.

@talipbyk
Copy link
Author

talipbyk commented Oct 4, 2016

All right.
Thank you for your interest.
I have last question.
How about if i use google chrome on IOS ?
do you think it will work ?

@IonDen
Copy link
Owner

IonDen commented Oct 4, 2016

Nope, Google Crome on iOS is using the same webkit as Safari. Apple restriction.

@a4jp-com
Copy link

Can you post a working example of code here if it's okay? I have read through all the examples but still can't get the code to work properly and don't understand why everything has to be so difficult on iOS. You code works normally on Android devices and PCs easily.

@pmoitech
Copy link

Hi guys, I also faced this problem some months ago, and this is not for the ion script but an IOS restriction.
My solution was to set a button, audio button, to "enable" the audio in the app, and set to play some audio when the user press it. Since the moment the user click the button, sounds will play and will sound for the rest of the time users can spend in the app, even in background as my app work right now.
Hope this can help.
Regards,

@X-Tender
Copy link

I currently faced a additional "unwanted" behavior.
I have a Sound which I start on webpage load, on iOS and Android the SOund is not played (which is completly ok). But then when I click a Button to play an another Sound I head the sound which i autostarted too (its looping). On Android is only playing the sound which I start on Button Press. The Behavior on Android is the one I expected.
So who's wrong, iOS or ANdroid, and is it fiixable :)

@IonDen
Copy link
Owner

IonDen commented Feb 1, 2017

@X-Tender i will check this soon.

@a4jp-com
Copy link

a4jp-com commented Feb 1, 2017

Thank you

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

No branches or pull requests

5 participants