navigator.getUserMedia alternative API for iOS safari mobile browser? - html

I know with below code will capture a image from ios 6+ safari mobile browser
<input type="file" capture="camera" accept="image/*" id="cameraInput" name="cameraInput">
Is there any other way of capturing a image from safari mobile browser using html5/JS?
Is there any alternative for WebRTC MediaStream API in iOS safari mobile browser?

Safari does not support WebRTC yet.
http://iswebrtcreadyyet.com/
To start with WebRTC on iOS, you may explore this demo https://github.com/ISBX/apprtc-ios. It't not exactly the same as you're looking for. The demo app achieves video chat. But it should be trivial to get image

Related

iOS Safari WebRTC > Chrome > Other Browser Black Screen

I currently have an iPhone that is connecting to a browser via WebRTC and from that browser I have other additional browser windows connected via webRTC that preview the same video stream.
iPhone > Safari Desktop (video works) > Chrome/Firefox/Safari Desktop works great
iPhone > Firefox (video works) > Chrome/Firefox/Safari Desktop works as well
iPhone > Chrome (video works) > Chrome/Firefox/Safari display a black video
My issue is a little hard to explain so I've created an image to help illustrate the issue:
The crazy thing is it works when the source is an Android device or another browser. Is it possible that iOS Safari is limiting the WebRTC stream to the first browser? Is there a way to debug why Chrome is displaying black instead of the video?
It looks like this is a known issue with Chrome and H264:
https://bugs.chromium.org/p/chromium/issues/detail?id=1073828&q=black%20h264&can=2
When I disable H264 it works so I will run with that for now. Unfortunately that means we miss out on the benefits of H264 hardware encoding/decoding.

How to support autoplay in IOS for chrome and safari using HTML5 audio tag?

I am using HTML5 audio along with angular2. It works for desktop very smoothly. But when it comes to media device it seems not working.
I have tested on iOS chrome and safari.
Any help would be highly appreciated?

html5 capture image from ipad camera

Use input file tag for capture image from ipad camera.
<input type="file" accept="image/*;capture=camera">
On Safari - back screen, on Chrome - work.
What problem with safari?
Hello you should know that the camera API is new and not available for all browsers. Here you can see, if it's available for the specific browsers. You also will see that Safari doesn't support it. Only a few supports it like : GC, FF, Opera, GC for Android and Android Browser.
Supporting Camera

Video Streaming Solution for Apple/Android/Desktop

I need to stream a video to a variety of browsers and devices, all main browsers, IE 8+, FF, Chrome, Safari and to Android and Apple mobile devices. My videos will be stored on S3/Cloudfront.
I've looked into the options and have come up with HLS streaming, which will work on apple and android devices, and safari desktop.
For other browsers I will use a flash fallback implementation. I know JW player can read a HLS stream in a flash implementation. Does anyone know of alternative free software?
My question is, is there a better approach, what is your solution?

Using getUserMedia/Stream API with iOS 6

I am trying to build a web app that will allow users to use the built in camera on an iPad to take a picture or video of themselves and then post it to Facebook. So far I have had no luck when testing getUserMedia() in Safari for iOS 6 or the Chrome app.
This info graphic shows that it is not supported by Safari with iOS 6 but it should work with Chrome, no?
http://caniuse.com/stream
Any help would be much appreciated.
Currently the only way for mobile Safari to get an image from the camera (or photo roll) is with an input element. It is quite simple:
<input id="image-picker" type="file" accept="image/*" />
Then in js:
$("#image-picker").change( function (event) {
var files = event.target.files;
if (files.length>0) {
// Do something with files[0]
}
});
Chrome for iOS uses identical methods/views for displaying and interpreting HTML, with the exception of a few Safari-specific optimizations. If Safari does not support getUserMedia(), then Chrome cannot support it either unless they build their own port of WebKit for iOS, and even then, it might be a stretch. The functionality you are after may be available through some other means, but not using getUserMedia().
Now Safari supports it starting from IOS 11 & Safari 11.
The namespaces have changed a little as its now mediaDevices prefixed.
Check https://caniuse.com/?search=mediaDevices