Discussion Forums  >  Audio, Video, Playing, Recording

Replies: 16    Views: 128

Mr stuck
Android Fan
Profile
Posts: 974
Reg: Apr 09, 2012
Fife, Scotland
15,740
11/07/12 02:47 PM (13 years ago)

background audio in custom html screen

i have set up a background audio for my custom html screen and used a dropbox public link to an mp3 file but no audio plays thanks in advance for any help
 
Mr stuck
Android Fan
Profile
Posts: 974
Reg: Apr 09, 2012
Fife, Scotland
15,740
like
11/07/12 04:01 PM (13 years ago)
just to confirm its 2.0 app on android
 
LeonG
Apple Fan
Profile
Posts: 694
Reg: Nov 08, 2011
Hamburg
17,740
like
11/08/12 04:27 AM (13 years ago)
Does it play if you add it in your app directly and what about testing a different URL? Just to check if the dropbox link is the problem.
 
Mr stuck
Android Fan
Profile
Posts: 974
Reg: Apr 09, 2012
Fife, Scotland
15,740
like
11/08/12 04:48 AM (13 years ago)
Hi. The dropbox link us working when opened in native browser so is ok. Read other posts that confirm its something that does not work on android. Seems i need to do all sorts of stuff to get it to work like add scripts and the like which i am not able at the moment. Have you ever got this working yourself! Thanks for response and open to any ideas to get this to work
 
LeonG
Apple Fan
Profile
Posts: 694
Reg: Nov 08, 2011
Hamburg
17,740
like
11/08/12 04:52 AM (13 years ago)
I understand, but what about putting the audio file directly in your project? Does it play?
 
Mr stuck
Android Fan
Profile
Posts: 974
Reg: Apr 09, 2012
Fife, Scotland
15,740
like
11/08/12 04:59 AM (13 years ago)
Never tried running it directly. Will have a go when i get home from work. The app i wanted to use it in i have only just started to lay out the screens. I have a dummy test app installed on my phone and just added to it to try it out. Never used audio in an app before. Do you think it will work directly?
 
LeonG
Apple Fan
Profile
Posts: 694
Reg: Nov 08, 2011
Hamburg
17,740
like
11/08/12 06:14 AM (13 years ago)
It will work directly yes. Will work from URL too, but just need to know if there is a problem with the URL, the file or your project settings. Keep us informed.
 
Mr stuck
Android Fan
Profile
Posts: 974
Reg: Apr 09, 2012
Fife, Scotland
15,740
like
11/08/12 12:09 PM (13 years ago)
Hi. Not tried to add directly yet but i think i have found the problem. It appears to be my phone. I have a band hire app and i remembered that one of the bands websites that i was drawing in from a custom url screen played an intro tune so i checked it and nothing plays. I checked same site via my native browser, still nothing. I tried it on old HTC desire via native browser and it played tune. So all things point to a problem with phone. Its an s2 but i recently flashed it with checkrom v7 and its never been quite right since. Might flash back to v6
 
Mr stuck
Android Fan
Profile
Posts: 974
Reg: Apr 09, 2012
Fife, Scotland
15,740
like
11/08/12 03:13 PM (13 years ago)
Hi. Not tried to add directly yet but i think i have found the problem. It appears to be my phone. I have a band hire app and i remembered that one of the bands websites that i was drawing in from a custom url screen played an intro tune so i checked it and nothing plays. I checked same site via my native browser, still nothing. I tried it on old HTC desire via native browser and it played tune. So all things point to a problem with phone. Its an s2 but i recently flashed it with checkrom v7 and its never been quite right since. Might flash back to v6
 
Mr stuck
Android Fan
Profile
Posts: 974
Reg: Apr 09, 2012
Fife, Scotland
15,740
like
11/09/12 05:23 AM (13 years ago)
Ok. Established its not the phone. Will try adding directly once i can get my son off the Wii lol. Take it i just add the mp3 file name to advanced settings for background music in custom html screen then drop the file into audio folder in eclipse?
 
Mr stuck
Android Fan
Profile
Posts: 974
Reg: Apr 09, 2012
Fife, Scotland
15,740
like
11/09/12 07:21 AM (13 years ago)
Ok added file name to background audio in advanced options and added the mp3 to audio folder in eclipse but still nothing. Any ideas thanks
 
appsolutely
Aspiring developer
Profile
Posts: 72
Reg: Jan 05, 2011
UK
10,070
like
07/12/13 07:14 PM (12 years ago)
Did you ever resolve this Mr stuck? I'm having similar issues.
 
Mr stuck
Android Fan
Profile
Posts: 974
Reg: Apr 09, 2012
Fife, Scotland
15,740
like
07/13/13 01:38 AM (12 years ago)
Hi. I found out that the website was a flash video which is no longer available for newer android phones unless you side load it. I did manage to get audio running by using a HTML 5 player though if you want to use that method. You can hide the controls and set it to autoplay when screen is accessed. There is a small piece of code you need to add to the java file to kill the audio when the user leaves the screen though otherwise it keeps playing. Is this what you are trying to acheive? Let me know and I will help you with the code part. Thanks
 
appsolutely
Aspiring developer
Profile
Posts: 72
Reg: Jan 05, 2011
UK
10,070
like
07/13/13 11:43 AM (12 years ago)
Hi Mr Stuck, Yes I'm looking to play an embedded audio file in the background of a page (on loop) until the user navigates away from the page (simple I thought). Please do let me know how you achieved it as I've tried using this: <audio autoplay="autoplay" controls="controls" loop="loop" preload="auto" tabindex="0"> <source src="your_audio_file.mp3" type="audio/mpeg"> Your browser does not support the audio element. </source></audio> Taken from another post, with the audio files in the BT_Docs and BT_Audio folders, I even created a BT_Sound folder with no luck at all. The app either crashes out or throws up an error message stating it doesn't understand what to load. There does seem to be a general issue with background audio. I have created simple menu pages with no menu items and just a background audio file. With the audio files in the BT_Docs and/or BT_Audio folders, but I get nothing in either the simulator or on a device (test device is HTC with android 2.2.2). I don't think it is the device as I have other apps with html 5 pages (no background audio set) that load fine and it doesn't work in the simulator either. I have even tried an html page with no content and setting the background audio on the buzztouch control panel for that page again with the audio files in the BT_Docs and BT_Audio folders. This particular issue is with an android app, although I am looking to build an app that will work with both andoid and ios so hopefully your html solution with provide that. Thanks I appreciate any help you can give.
 
Mr stuck
Android Fan
Profile
Posts: 974
Reg: Apr 09, 2012
Fife, Scotland
15,740
like
07/14/13 02:02 PM (12 years ago)
hi, sorry for late reply. I have this running in this app all done using dropbox to stream but sure you can adjust adjust the code to use a file in the project to suit your needs. https://play.google.com/store/apps/details?id=com.scottishbagpipesfreeversion the code i use is this <!DOCTYPE html> <body> <audio controls="controls" autoplay="autoplay" loop="100" > <!-- simply replace the link, the autoplay feature has not worked as expected on later versions of android, test it --> <source src="http://dl.dropbox.com/u/79738376/flower%20of%20scotland.mp3" type="audio/mpeg"> </body> </html> to kill the audio on screen exit see this post http://www.buzztouch.com/forum/thread.php?tid=F560C8D4CA4A25A965FEA4A&currentPage=1 and ios kill audio can be found here http://www.buzztouch.com/forum/thread.php?tid=6AD93D337BA13194E39FF28&currentPage=5 hope this helps you out let me any further info you may find out, thanks
 
Mr stuck
Android Fan
Profile
Posts: 974
Reg: Apr 09, 2012
Fife, Scotland
15,740
like
07/14/13 02:31 PM (12 years ago)
Just to add. It appears the loop has to have a number to make it work but I suppose it could be set to a million to make sure it won't stop and the autoplay does not seem to work on my android 4.2 but it did on earlier versions.
 
appsolutely
Aspiring developer
Profile
Posts: 72
Reg: Jan 05, 2011
UK
10,070
like
07/14/13 03:17 PM (12 years ago)
Thanks I'll go through all that and see what the outcome is. Will update you when I get to the end of it. Thanks again
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.