I want to make a streaming with HTML5, in desktop works fine, but in android dont work, only work with local files on my server ".mp3", but with the code attached only works on my desktop, but not in android, any ideas? Thanks
<audio controls="controls">
<source src="http://radio3.oceanofm.com:8010/;" type="audio/ogg">
<source src="http://radio3.oceanofm.com:8010/;" type="audio/mpeg">
<source src="http://radio3.oceanofm.com:8010/;" type="audio/wav">
<source src="http://radio3.oceanofm.com:8010/;" type="audio/mp3">
I'm sorry; your browser doesn't support HTML5.
</audio>
According to this post: HTML5 audio tag is not working in Android , it seems that there can be many causes for your problem. Have you already checked those?
Related
I am trying to use HTML5 audio across devices and have managed to get it to work on desktop machines by using the following code:
<audio id="audio-1" preload="auto" >
<source src="~/Assets/audio/file1.m4a" type="audio/mpeg">
<source src="~/Assets/audio/file1.ogg" type="audio/ogg">
</audio>
<audio id="audio-2" preload="auto">
<source src="~/Assets/audio/file2.m4a" type="audio/mpeg">
<source src="~/Assets/audio/file2.ogg" type="audio/ogg">
</audio>
<audio id="audio-3" preload="auto">
<source src="~/Assets/audio/file3.m4a" type="audio/mpeg">
<source src="~/Assets/audio/file3.ogg" type="audio/ogg">
</audio>
However on devices (both Android 5.1.1 and iOS 9) the sounds don't play.
When debugging the iPad I noticed that GET requests were sent for all the audio files but no status code was returned.
I have read an article from IBM about a combination of AAC and OGG are the best source of cross browser compatibility: http://www.ibm.com/developerworks/library/wa-ioshtml5/#resources so I'm hopeful that it isn't the file types causing the issue.
I've also read that there are possible issues with files being served up over HTTPS on devices.
What I don't know is if there is a work around to get these files to play on devices? (They are triggered on events using native HTML5 audio methods in JS)
I have since found out that you cannot autoplay sounds on mobile devices. You have to have a user interaction such as a button press to instigate the action.
http://codetheory.in/fixing-html5-audio-problems-in-ios-and-android-mobile-browsers-to-overcome-the-limitations/
I've been trying to make a html5 video to work in IOS and Android with
Autoplay
Loop
No controls
I found a lot of codes out there and tried them all but I can't get it working
This is the best I've got:
<video autoplay="autoplay" controls="" id="video" loop="true" style="display: inline-block;margin:0;padding:0;">
<source src="timelapse_panoramic_fin_5.webm" type="video/webm" />
<source src="timelapse_panoramic_fin_5.ogv" type="video/ogg" />
<source src="timelapse-panoramic-fin_5.mp4" type="video/mp4" />
</video>
I think that it will be very hard to get this working properly. What other option do I have to HTML 5 video?
Use webview.
WebView webView=(WebView)findViewById(R.id.webview);
String html="you html code for video";
webView.loadData(html);
As you already experienced, video playout across different platforms and browsers can be hard. I would definitely recommend to use a player framework, like Video.js, or in context of adaptive streaming, Bitmovin player, etc. They can make your life much more easy.
I have used this plugin cordova video plugin
it is working fine on android phone but not working ios.
so I have used Html5 video player
<video width="320" height="240" autoplay>
<source src="movie.mp4" type="video/mp4">
<source src="movie.ogg" type="video/ogg">
Your browser does not support the video tag.
</video>
this code is not working on android phone. Is it working on ios? pls can you tell me? which video player support on android and ios phone?
As I understand Ionic has issues with embedding local videos using the HTML5 video tag, however you can open the video using fileOpener2 with ngCordova. It's easy to do this and you only have to know the file mime type to open whatever you need.
I have a Flash animation with sound that I converted to HTML5.
When I play it in a WebView or open it with the device browser, there is no sound.
I've tried several sound formats with no success.
I used www.html5test.com to see the browser compatibility and it supposed to support mp3.
Is is possible?
Any ideas how?
I am using Android 4.0.4
I found the solution here Embed Background Audio in Android >= 2.3 Browser
<audio id="audio1" controls="controls" loop="loop" autoplay="autoplay" >
<source src="scene1.mp3" type="audio/mpeg" />
<source src="scene1.ogg" type="audio/ogg" />
</audio>
it's work for me :)
I want to play audio in the Android browser, using the html5 <audio> tag. It works fine in the iPhone browser, but not in Android. I'm using Android Virtual Device 4.0.3.
Does anyone know why?
The Android source:
webView.loadUrl("file:///android_asset/www/test.html");
The HTML file:
<audio controls="controls" format="mp3">
<source src="achievement.mp3" />
</audio>
(i couldn't hear the audio with <embed> and <object> tags either)
I found the solution here
Embed Background Audio in Android >= 2.3 Browser
<audio id="audio1" controls="controls" loop="loop" autoplay="autoplay" >
<source src="scene1.mp3" type="audio/mpeg" />
<source src="scene1.ogg" type="audio/ogg" />
</audio>
it's work for me :)
I did a quick search and found this issue report on google code. It seems the tag is unsupported. However, the tag is and can play mp3 files. The down side is (if I read it correctly) that the controls are not available. Give it a read and let us know how you make out.
I found another question that has lots of different possible solutions: Check it out