HTML5: How to play sound on every mobile device
- iPhone/i开发者_如何学PythonPad
- Android
- Windows Phone 7
- Windows Phone <= 6.5
- Symbian
- Blackberry
- Bada
This should work as a Webapp (HTML).
This is how you implement HTML5 audio into your page for every device:
<audio controls preload>
<source src="path/to/file.ogg" type="audio/ogg" />
<source src="path/to/file.mp3" type="audio/mpeg" />
<!--
Here comes the Flash (in case you want any) fallback,
or you can write something here like this
-->
<p class="error-message">Try another browser...</p>
</audio>
If you are trying to use it via SSL, it's not gonna work, read this: https://stackoverflow.com/a/10089632/819194 This is what we have figured and how we have solved our stuff.
Regards!
Not sure about Bada, but avoiding Flash and instead using JavaScript or server-side browser/device detection to serve either .mp3 or .ogg files should cover most bases.
精彩评论