Home > Questions and Answers > General Questions

using audio when user opens mobile lander? (10)


09-03-2014 06:29 AM #1 dvir0776 (Member)
using audio when user opens mobile lander?

Hi,

Is it possible to play audio when the user lands on my lander for mobile?
If so, can you point me or give an example code of how to do that?

Thanks!
Dvir


09-03-2014 08:04 AM #2 constantin (Member)

be sure to host your audiofiles on CDN

then:

<audio autoplay="autoplay" preload>
<source src="YOUR CDN LINK HERE/SOUND.mp3" type="audio/mpeg" />
</audio>


09-03-2014 11:43 AM #3 dvir0776 (Member)

holy sh1t it's that simple?! I had no idea.
Thank you constantin!
Now just need to be creative about what to play, mmm


09-03-2014 06:14 PM #4 bbrock32 (Administrator)

That code above will work but only on certain phones.

Some models have auto playing audio disabled on the browser so nothing can be done there.


09-05-2014 06:56 AM #5 dlegia (Member)

also think about loading speed of your page. If browser waits to open .mp3 file and then render page it will terrifically slow page loading speed

you have to test you LP with limited bandwidth before going to production mode.


08-09-2015 07:17 PM #6 Gabreeze (Member)

Bump. Is there any alternative to this method? So it would be possible to play audio on Androids? Thanks


05-05-2016 07:00 PM #7 pablo (Member)

Found an alternative:

http://goldfirestudios.com/blog/104/...script-Library

Works perfect in Android and desktop. Didn´t test it in iphone, but it should work.

Regards,
Pablo.


08-02-2016 12:06 AM #8 massiv biz (Member)

Quote Originally Posted by pablo View Post
Found an alternative:

http://goldfirestudios.com/blog/104/...script-Library

Works perfect in Android and desktop. Didn´t test it in iphone, but it should work.

Regards,
Pablo.
Thanks for this, it seems great... I can't get it to work tho. Could you please help me with setting it up - I don't know what should I write in my index.html to make it loop my sound. (or even play it). Thanks man!


08-02-2016 12:47 PM #9 pablo (Member)

Sure, copy and paste that just before the </body>, and ensure you have at least an audio file of the type mp3 or ogg in the folder. Once it works and an "loop: true," and it should loop.

Hope that helps!


08-02-2016 06:30 PM #10 massiv biz (Member)

Quote Originally Posted by pablo View Post
Sure, copy and paste that just before the </body>, and ensure you have at least an audio file of the type mp3 or ogg in the folder. Once it works and an "loop: true," and it should loop.

Hope that helps!
aa thanks man it works!!!


Home > Questions and Answers > General Questions