Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 10    Views: 795

ianJamesPiano
Code is Art
Profile
Posts: 2661
Reg: Feb 13, 2011
Palm Springs, C...
37,010
04/16/12 03:08 AM (13 years ago)

Android HTML5 audio player fix

Made a simple Html5 audio player but had to add a line of code to the BT_screen_HtmlDoc.java file...around line 307 had to add webView.loadUrl("about:blank") so when hitting the Back button on the device the audio would stop playing. Hope this helps someone :) //onDestroy @Override public void onDestroy() { super.onDestroy(); webView.loadUrl("about:blank"); //BT_debugger.showIt(activityName + ":onDestroy"); } Here is a screenshot of early stages, working well on devices http://dl.dropbox.com/u/39276137/scalestest.png
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
04/16/12 07:45 AM (13 years ago)
Cool, is the audio player available? Fred
 
ianJamesPiano
Code is Art
Profile
Posts: 2661
Reg: Feb 13, 2011
Palm Springs, C...
37,010
like
04/16/12 09:04 AM (13 years ago)
Its just an HTML 5 audio player, easy to do video as well...good solution till official plugins come out
 
ATRAIN53
Code is Art
Profile
Posts: 1755
Reg: Nov 17, 2011
Chicago
26,450
like
04/16/12 10:10 AM (13 years ago)
looks nice. is that jplayer? or a player built around jquery? one thing i realized i like about the idea of using an HTML player vs a plug-in (that doesn't exist yet anyway) is the fact you can add stuff to the screen - like a link to buy the track in iTunes. or something like that scale graphic you have. i'd love to know a bit about the video on your player. i'm toying with jplayer and noticed that jplayer VIDEO seems to use the native iOS Video Player if the file format is supported by the device. this is nice as it keeps them within the APP.
 
nickrick32
Apple Fan
Profile
Posts: 111
Reg: Feb 28, 2011
location unknow...
1,110
like
06/07/12 09:05 AM (13 years ago)
Hi ianjamespiano, I have a question, I hope you can help me with my issue. I just create Android app at BT 1.5 and create custom url to mobile soundcloud.com/mypage but it show just search icon and footer of that page. I try to open with browser on android phone and works fine also works on iPhone but on Android doesn't work. It can be that browser doesn't support HTML5 player from sound cloud? do you have any solution for that problem? thx
 
ianJamesPiano
Code is Art
Profile
Posts: 2661
Reg: Feb 13, 2011
Palm Springs, C...
37,010
like
06/07/12 07:44 PM (13 years ago)
Hi nickrick33, did you try to Launch Native App screen with your audio file? Keep me posted.
 
nickrick32
Apple Fan
Profile
Posts: 111
Reg: Feb 28, 2011
location unknow...
1,110
like
06/08/12 06:28 AM (13 years ago)
Hi ianjamespiano I try to use Native app with url of soundcloud but can't open the page?
 
ianJamesPiano
Code is Art
Profile
Posts: 2661
Reg: Feb 13, 2011
Palm Springs, C...
37,010
like
06/08/12 07:20 AM (13 years ago)
What the url link to the file? Thanks
 
nickrick32
Apple Fan
Profile
Posts: 111
Reg: Feb 28, 2011
location unknow...
1,110
like
06/08/12 07:23 AM (13 years ago)
http://m.soundcloud.com/ and all you can get is a search bar and footer of the page if you add Custom URL (Android)
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
06/08/12 07:54 AM (13 years ago)
I don't know if there's a BTv1.5 Android solution, but do know there's a BTv2.0 solution. Fred
 
buzzbt
Android Fan
Profile
Posts: 233
Reg: Nov 14, 2011
las vegas
6,530
like
01/19/14 07:16 PM (11 years ago)
Thanks lot for sharing. for Back button it solve my problem. i use html5 audio player, If you drop the following into your html in the body section, it should work in ios ad android. <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> http://www.buzztouch.com/forum/thread.php?tid=8DB78038FD780BF39A5A2D4
 

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.