I was wondering how to play sound on every mobile device.
iPhone/iPad
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.
Related
I'm working on an Electronjs app that needs to play very large videos stored in the user's machine. I've tried both with the vanilla html5 video tag and with other players. Small videos load and play fine, but large ones (1GB and up) only play sound, not images.
<video controls width="1280" height="720">
<source src="F:\sample.MP4" type="video/mp4" />
Sorry, your browser doesn't support embedded videos.
</video>
This happens both within the Electron app (Chromium based) and Chrome itself. Edge, on the other hand, plays large videos correctly.
I could not find any documentation on why this could happen, or if Chrome is behind in some video compatibilies...
Where could I look for a solution?
Thanks
Edit: The problem was not the size of the videos, but their codec, h264 played well, hevc (h265) didn't
#snwflk found the answer in the comments. It's because the hevc codec is not supported in Chrome: https://caniuse.com/#feat=hevc
Edge apparently supports it by offloading the video decoding to the hardware: H.265/HEVC web browser support
Maybe Electron can be compiled in a way that Chromium supports it? https://stackoverflow.com/a/39319614/3362074
I am new to video player world. I want to develop a mobile browser based video player. I know HTML5 and its flash fall back but this is a different requirement .
The requirement is, using Object tag I should embed my video so that it Plays in all the mobile devices(Browser). Code help will be highly useful . It mandatory to use Object tag . If any swf or anything like that which is compatible to all mobile browsers..
Thanks in advance .
Using the <object>-tag is a bad way. Why is it mandatory for your use? Why not go with the <video>-tag instead? Also, <object> is deprecated as of January 27, 2015.
If the file you want to embed is playable by most phones (such as a .MP4 file), you can use the <video>-tag instead.
<video width="500" controls>
<source src="video.mp4" type="video/mp4">
Your browser does not support HTML5 video.
</video>
If you're embedding an .swf file, you cannot play it on devices with no flash support. I am unable to play .swf files natively in Chrome on my Android phone, and don't even think about iOS devices.
If you really, REALLY want to use the <object>-tag as well, you can wrap that inside a <video>-tag, like this:
<video src="video.mp4" controls>
<object data="flvplayer.swf" type="application/x-shockwave-flash">
<param value="flvplayer.swf" name="movie"/>
</object>
</video>
I want to play a mp3 audio file in HTML. I don't want to display the whole player with controls like Volume etc.
I just need a play/pause button, Designed by me, not the core design of some player, like yahoo player, or google one.
For example the audio will be autoplay. When a button (probably an image) is clicked it will pause, and when that image is clicked again, the audio will play again.
There are quite few examples here : http://www.w3schools.com/html/html_sounds.asp
Can I control any of them to play/stop from JS code ?
You can use the html5 audio tag. You can specify your own controls for playback.
<audio preload="auto" autobuffer>
<source src="elvis.mp3" />
<source src="elvis.wav" /> <!-- fallback if no mp3 support in browser -->
</audio>
This is a jQuery solution.
http://jsfiddle.net/QPW27/109/
This is what your non-jQuery solution would look like.
var foo = document.getElementById('player');
foo.pause(); //just bind play/pause to some onclick events on your page
foo.play();
Different browsers support different audio formats. You can specify fallback audio versions though. This website has a nice chart of browser support as of July 2011.
Hopefully, in a few years, the HTML5 audio API will be supported accross more browsers, but currently, playing sounds requires either a lot of browser-specific hacks to get things working, or reliance on a browser plugin like flash.
In the meantime, I reccomend using SoundManager2. It's fairly easy to work with and will involve much less headache than doing it yourself.
Audio.js looks like it has the player styling features you're looking for, with a graceful degradation to Flash if the browser doesn't support the new audio API.
You can play audio by using embed tag
<!DOCTYPE html>
<html>
<body>
<p>Play mp3</p>
<p>Play wav</p>
<script src="http://mediaplayer.yahoo.com/js"></script>
</body>
</html>
I had done the HTML5 native video playing with Android (Samsung Galaxy pop gts5570) mobile steps I have done and its get work perfectly with Opera Mobile 11.10
Upload the video through YouTube
downloaded through keepvid.com in 3gp format
done through the following code
<video width="320" id="video" height="240" onclick="this.play()" autoplay="autoplay" controls="controls" style="border:4px solid #00C;background:#636465;">
<source src="video/1.3gp"/>
</video>
but I have encoded the files using some converter to 3gp format but that not working,which convert will convert it correctly? thanks in advance.
I have found the solution by my self, I feel this may help to some one .... handbreak is the convert which has the facility to make the video playable in mobile web browser
1) choose the iphone & ipod in preset setting
2) Enable the web optimized then convert it ... it will work in mobile web
UPDATE
another HTML5 converter is available now in easy html5 video
How to play video file in webrowser without installing any player software in the remote computer? I think this is on fly video playing concept and lots of sites using this
I'm using VLC media player to play video on the browser. Is there any way so that I can play video on the remote browser without installing any software.
Maybe I can tell them to install plugins for that?
there is any way so i can play video on the remote browser without installing any software
Nope, there isn't. You will always need video playing capability on the client side. (Well, short of turning the videos into Animated GIFs, but that is madness.)
The best supported Video embedding methods are Flash Video and HTML 5 Video. See this SO question for detailed information on the two.
use this code in any control to play video
<video controls="controls" id="id1" width="200" height="200">
<source src="movie/show.mp4" />
</video>