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.
Related
I come today with a 'fairly easy' question around using video.
I have used this before and it seems to be working on Android devices. However, I just recently realised that the same video won't work on any Apple device.
My initial thought was around the video format (which is currently MP4), so I added a 'webm' back-up. MP4 should be enough, but I just wanted to give it a try (unsuccessfully)
Am I missing something? Do I need an specific format to be able to display a video on Apple devices?
<video class="intro-header-mobile" playsinline autoplay loop muted preload="auto" width="100%" height="100%">
<source src="/medias/custom-content/projects/2021/Own-brand-hub/e0821_Ownbrand_mob_v2.mp4" type="video/mp4">
<source src="/medias/custom-content/projects/2021/Own-brand-hub/e0821_Ownbrand_mob_v2.webm" type="video/webm">
</video>
Thank you everyone!
Diana
I am using xamarin.forms webview and have implemented video tag in my html5 code to play video.
I test it on IOS and Android. None of both play the video. What I am doing wrong?, I read on some SO set hardware acceleration. Someone please help me how this thing work.
Testing code for playing video
<p>testing from 3:49</p> <video width='320' height='240' controls> <source src='https://www.w3schools.com/html/mov_bbb.mp4' type='video/mp4'> Your browser does not support the video tag. </video>
<p>testing from 3:49</p> <video width='320' height='240' controls> <source src='https://interactive-examples.mdn.mozilla.net/media/examples/flower.webm' type='video/mp4'> Your browser does not support the video tag. </video>
What is wrong in my case is I have isEnable property false in WebView. After set it True, it's working fine.
If you still have some issue, try to enable HardwareAccelerate in Mainfest of Android app.
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?
I want to write an HTML page, that can play some audio files. I use this code:
<audio width="100%" controls >
<source src="sprachMemo.mp3" type="audio/mpeg" />
<source src="sprachMemo.m4a" type="audio/x-aac" />
<source src="sprachMemo.ogg" type="audio/ogg" />
<source src="sprachMemo.wav" type="audio/wav" />
Problem!
</audio>
When I open the page with Chrome and a PC it work. But on the mobile, it shows the audio file, but you can not play it. So it just shows, that there is a file used.
I have also been looking for other solutions , but want to have a simple variant. And as I could see, the system worked on other sites.
How can I make it work on Android, too?
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