I use modernizr to support some html5 features (like placeholder or different input types such as date, number) for my website. However, the current browsers in my mac (chrome and safari) support html5 and I don't have any chance to test my website in a browser that doesn't have html5 support.
What's the best approach to test a website under the non-html5 conditions? Downloading an html5 incompatible browser (if so example please) or a tool ?
Since you're on Mac (so am I), the images provided through modern.ie might be more helpful. They have vm images for VirtualBox and VMWare, in addition to VirtualPC.
Microsoft offers virtual machines for testing Internet Explorer versions: http://www.microsoft.com/en-us/download/details.aspx?id=11575
Maybe Browsershots could be of help to you.
Related
We are building a mobile barcode-scanner using QuaggaJS that reads barcodes directly from the device's camera stream. Works fine on desktop/Android, but doesn't work at all on iOS.
From initial research, I've found that iOS simply does not support WebRTC/getUserMedia through Safari or iOS Chrome (related links below), which is what QuaggaJS uses to read the camera stream.
I've also seen this question about capturing a still image on iOS, but the answer provided is only for capturing a still image, not for reading the stream real-time.
My question - is there any other way to grab the stream from an iOS camera? Perhaps an alternate library other than QuaggaJS that does not use getUserMedia? I am not well-versed in Javascript, so I am not sure if there even is a possible way to access the camera stream other than getUserMedia.
A "no" is an acceptable answer here; I'm simply looking for someone more experienced to provide guidance.
Appendix/related links:
navigator.getUserMedia alternative API for iOS safari mobile browser?
https://www.quora.com/Why-is-navigator-getUserMedia-not-supported-in-Safari
https://bloggeek.me/webrtc-apple-or-microsoft/
HTML5: getUserMedia iOS issue?
2017 update: Apple just announced that getUserMedia will finally be supported in iOS11.
Aug 2019 update: ONLY works in Safari, not in a WebView of any kind. Thanks #Klathmon for the comment.
The quaggaJS page has a feature compatibility matrix which answers your question:
getusermedia is not supported on iOS safari.
As per the quaggaJS documentation (https://github.com/serratus/quaggaJS#browser-support)
Quagga makes use of many modern Web-APIs which are not implemented by all browsers yet. There are two modes in which Quagga operates:
analyzing static images and
using a camera to decode the images from a live-stream. The latter requires the presence of the MediaDevices API. You can track the compatibility of the used Web-APIs for each mode:
Static Images
Live Stream
I would suggest that you use static image mode on iOS as live stream mode is not supported.
So for those who worked on iOS web applications probably know that due to Apple's policy, Chrome and other mobile browsers on iOS use a very ancient javascript engine. This is why we need to disable some of the rendering for Chrome and other none-safari browsers for iOS.
I had been reading this question and there is no useful answer there. Here are some of my approaches (failed):
Use is_iOS = navigator.userAgent.match(/(iPad|iPhone|iPod)/g) to detect if the browser is on iOS. And then use:
is_FF = navigator.userAgent.match(/(firefox)/g) and is_Chrome = navigator.userAgent.match(/(chrome)/g)
to kill off those firefox and chrome browsers.
I then realized all the browsers share identical user agent string with iOS safari. So I imagine the method should be running a javascript function that only Safari can run and then determine if the browser is Safari.
So, there's two schools of thought when choosing which native functionality you should use while working in browsers. One school of thought is checking the userAgent as you are doing here and using/removing features based on the userAgent.
The problem with checking userAgent is that it gets complicated really fast. You have already run into an interesting problem, but what will happen when you find that ie8 does not have the feature you are looking for?
A better solution may be to check if the feature exists in its current context without worrying about userAgent. A great example would be the new HTML5 audio element. Based on browser support, we can tell that it does not exist in ie8 nor Safari < 4.0. Instead of checking if the browser matches the ones mentioned here you can just check if the feature exists. As we know that the audio element is an instance of the Audio class. We can simply check:
if (window.Audio) {
//load and play the HTML5 audio element here
}
That is much simpler than checking the userAgent.
I want to stream some video file and i've found interesting the DASH adaptive streaming capabilities, but i'cant find anything else but "dash.js" (which seems to work only for Chrome browsers) to implement client-side playback (integrated with html5 "video" tag). I know that dash.js works with chrome's mediasource APIs, but -if i'm not wrong- they should be standardized by W3C. Firefox says that MSE APIs are already avaliable on the recent versions, but dashif.org example video doesn't work, while an alert says that i should retry with chrome. So, what can a poor student at first experience with web development do to adaptive-stream video with html5???
Indeed, Firefox supports the standardized Media Source Extensions, but you also need to confirm that the content you are trying to play is supported in terms of video and audio codecs.
You can find the supported codecs for Firefox here. So, the key for cross-browser compatibility is to use the audio and video codecs supported by all browsers.
Also, there is a much newer version of the DASH.js player currently available, perhaps you want to give it a try: DASH.js 1.1.2
You can test the MSE implementation of Firefox already with the developer version of Firefox 36/37. Please not that you have to enable it via about:config. Currently it is planned to release it in version 37, to the best of my knowledge. Also the nightly build allows MSE testing.
According to your player request, I can recommend the player from www.dash-player.com. I tested it already on IE 11 (Win 8), Safari 8, Firefox 36 and Chrome (Windows, Linux, Android) of course. They have also an automatic fallback solution using Flash. And, perfectly for students - it's free.
Can't every mobile browsers support JavaScript? Which language/technology are used in mobile browsers pages? I mean the mobile websites...
I know XHTML is used much, What are the rest?
iPhone and default Android and BlackBerry all use WebKit. Opera and FireFox offer mobile browsers as options.
Windows Phone uses a version of IE9.
All of above support JavaScript. You can see phones from 2+ years ago that have browsers w/o JS, but they're not common anymore.
Most modern smartphones' browsers are based on Webkit - the same engine that powers Chrome and Safari. IE on Windows Phone 7 and Firefox are supposed to be standards-compliant too. Opera does have some support but don't count on it too much.
So, yes, they do support Javascript, and the technology stack is the same as for desktop ones (HTML, CSS, javascript). You even get broader support for HTML5/CSS3 in them.
Older phones, however, are a completely different story, and believe me, you don't want to go there :)
Does the Android WebKit supports the XPCOM framework or NPRuntime API`s as like Firefox? How to implement JavaScript in the Android WebKit plug-in?
Update:
I am writing a media player plug-in for the Android WebKit browser and my plug-in needs to get the command from the web page through JavaScript (some actions like play/pause/stop/resize are issued as JavaScript commands from the browser). My plug-in is written in native C code. Are there any examples or sample plug-in available for JavaScript communication?
WebKit doesn't support XPCOM, as WebKit is entirely separate from the Mozilla stack.
When you say you want to "implement Javascript", what do you mean?
The built-in Android browser already supports the execution of Javascript.
The android browser supported NPAPI all the time, the mechanism changed in 2.1 though, now it looks for APKs with the intent filter "android.webkit.PLUGIN", so a plugin needs to be packaged separately.
Previously setting the plugin path on the WebView and compiling the plugin using the NDK did the trick.
Hope this helps, you will find a lot of info when googling for NPAPI and WebView or NPAPI and android.
Android's WebKit doesn't support XPCOM, nor does it support NPAPI and npruntime. Not sure how you're planning to write a browser plugin, but it's not going to be possible with the Android SDK.