Go Back   Android Forums > Android Development > Application Development
Application Development Dev lounge for our application developers.

New Forums: Nexus Player | Nexus 9
test: Reply
LinkBack Thread Tools
Old August 1st, 2012, 02:37 AM   #1 (permalink)
New Member
Thread Author (OP)
Join Date: Aug 2012
Posts: 1
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default Android 4.0.3 Browser - audio.canPlayType() not working ?

I am using Samsung Galaxy S2, Andriod 4.0.3 and below is HTML5 audio elements JavaScript to detect if Android default Browser support certain audio types of MP3, OGG and WAV.

function OnAudioSupportGet (audio)
var ext = "";
if( audio.canPlayType("audio/ogg") =="probably" ||
audio.canPlayType("audio/ogg") == "maybe")
ext = "ogg";
if( audio.canPlayType("audio/wav") =="probably" ||
audio.canPlayType("audio/wav") == "maybe")
ext = "wav";
if( audio.canPlayType("audio/mp3") == "probably" ||
audio.canPlayType("audio/mp3") == "maybe")
ext = "mp3";

return ext;

Via html5test.com, it seems default Android Browser able to play MP3 but
yet, it failed to be recognized at instructions above.

Any help, link, hint or guideline will be appreciated )

rickygai is offline  
Reply With Quote
sponsored links
android, audio, browser, canplaytype, default, html5, javascript, mp3

Go Back   Android Forums > Android Development > Application Development
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

All times are GMT -5. The time now is 07:28 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.