iOS11 getUserMedia with apple web-app not working - ios11

Edit: Duplicate of How to access camera on iOS11 home screen web app?
I'm running into a problem with using a apple web-app together with camera access through the getUserMedia API.
I have some application that is working fine when accessed through safari, it asks for persmission to use the camera and upon approval I can see the camera feed. But if I save this same page to the home screen as an web-app this does not work anymore. There is no prompt for camera access, which seems to be the problem as it is not enabled by default.
The line that gives the problems is a meta tag which enables full screen for a web application on iOS.
<meta name="apple-mobile-web-app-capable" content="yes">
Anyone know what is going on here and why this fails? Do I need to set camera permission somehow through a meta tag also?
Thanks in advance!

Apple has removed the ability to use getUserMedia inside a UIWebView, WKWebView, SFSafariViewController, or a webpage that has been "added to the home screen".
The reasoning is not clear, however I do not believe this to be a bug.
An Apple staff member wrote this about WebRTC in iOS 11:
...right now, WebRTC is only supported in Safari. No WKWebView, not even SFSafariViewController.
And I can confirm that this includes the UIWebView as well (through personal tesing).

The navigator.mediaDevices.getUserMedia function is back in iOS 14.3 which got out yesterday. (Make sure you are not using the navigator.getUserMedia which is deprecated).
We'll be using it in Cordova, I'll update this post if we find some instabilities.
Don't forget to use the playinline attribute in your <video> element if you don't want the video to start in fullscreen.

Related

[JsQR]Cannot access the camera on a mobile from chrome

I am on iPhone and it cannot access the camera from chrome. Is there any solution?
Error Message: "Unable to access video stream (Please make sure you have a webcam enable)"
source code "https://github.com/cozmo/jsQR"
Demo (I copied the same code from Author's demo)
This problem solved itself in an update of chrome. FINALLY! Safari is still better because It allows the user to save the setting and it never asks about the camera again for that particular url. Using QR codes in the browsers has allowed me to write "apps" in a browser and avoid the red tape of the big tech app stores.

Migrate link from mobile web browser to mobile app

I want that my online website link that is opened in my mobile browser checks whether my mobile app is installed or not and then opens it in my mobile app.
I want my functionality as I have shown in this
image
I am using AngularJS,Express,NodeJS in my application.I tried node deeplink
but it does not work for me.Please provide me with the appropriate solution.
This functionality is known as Mobile Deep Linking. The easiest way to get started is with a deep linking service like Branch.io (full disclosure: I'm on the Branch team), Yozio, or Firebase Dynamic Links. They all do exactly what you're describing.
this could Help you perhaps:
Check this

Google amp html validator doesn't see mobile page

I am working on a news website, trying to implement amp. We are using Mobile_Detect.php to serve desktop pages to desktop and tablets, and mobile version to mobile phones and that works OK, our pages are mobile friendly according to Google for some time now, no problem.
Now, I started to enter the code for amp pages and encountered a situation I can' resolve. URL for the amp version have .amp at the end. Depending on the user's device, we are generating the page from the database and serving different pages to different devices.
Now, PageSpeed Insights and Mobile-Friendly Test shows that the page is mobile friendly but amp validator is pulling the desktop page, I can see by the source code it prints out, instead of a mobile page. I'm on the desktop, Chrome, but I'd expect it to work with mobile pages.
You can see that here: https://validator.ampproject.org/#url=http%3A%2F%2Fwww.poandpo.com%2Fbusineasdfasdfas-usual%2Fpublic-housadfadf-kong-972016223.amp
I installed Chrome amp extension and it says "AMP available" but when I click on it it also pulls the desktop version of the page and it's blank. I would expect the extension to load the mobile page but it doesn't.
We do have links canonical and amphtml, that's why the extension says there is an amp page.
So, how to tell validator to pull the mobile version of the page? The amp implementation is not done yet and I know there are some things missing, but without a validator is a bit hard to program.
Another interesting things is that when I open "Inspect" in Chrome and toggle to responsive design, it shows the mobile version of the webpage correctly. It also says "Powered by amp" and shows no errors although there are errors because we didn't even implemented all tags.
If anybody has any suggestion how to make amp validator to show the mobile page I'd appreciate that. Thank you.
I had a quick look at your pages but it appears that the amphtml reference but there appears to be a problem in the URL you are generating in the href= field. If you take a close look, the AMP URL is missing a '/'.
Broken: http://www.poandpo.com/business-as-usualmexicans-work-longest-hours-germans-the-least-97201645.amp
Works: http://www.poandpo.com/business-as-usual/mexicans-work-longest-hours-germans-the-least-97201645.amp

Force stripe checkout modal on mobile?

I'm building a web app with Stripe checkout. On desktop it loads a nice modal when you go to pay, but on mobile it brings the users off to a Stripe page, and then back. I want it to look like the user is never leaving our site.
Is there a way to force the modal to be loaded on mobile? I'm building the web app in ionic at the same time, so if I want to turn it in to an app I can. Ionic uses a WebView on the phone and that loads the modal fine, so there must be some setting that is allowing it?
Anyone have any ideas? Thanks.
edit If I 'request desktop site' on my mobile it loads the modal fine
As Stripe makes these determinations based on the User-Agent you could try changing the User-Agent of your webview to match that of a desktop browser, (I did a similar thing except I needed to force mobile behavior in the desktop).
It should be stated, that this is definitely not recommended by Stripe nor supported and could break at any time. They'd recommend you just build a custom form using Stripe.js
How i can set User Agent in Cordova App has how to set the User-Agent in iOS and Android.

AngularJS: Embedding Youtube videos in iframe does not work on Android Chrome

I'm developing a web application with AngularJS and I'm using a directive for embedding responsive Youtube videos called youtubeResponsive which allows to embed videos in an iframe with a video id as source parameter.
It all works perfectly on desktop browsers, in fact I also managed to embed a playlist and play it in a loop.
The problem I'm having is now on Chrome Android, on a Nexus 5 device (running Lollipop latest update) the video embedded is not showing and instead I can see a notification of a download going on. Every time I refresh I see the download process restarting but no video is showing. If I click on the download notification to see the file nothing happens.
Of course my aim is to display the video also on mobile with autoplay and loop active.
The output which I can see inspecting the page on mobile using USB debugging (chrome://inspect/#devices)
<iframe id="ytplayer" type="text/html" width="100%" height="202.5" ng-src="http://www.youtube.com/v/ZhfUv0spHCY?version=3&autoplay=1&loop=1&controls=0&showinfo=0&rel=0&wmode=opaque" frameborder="0" allowfullscreen="" video-slug="ZhfUv0spHCY" class="ng-isolate-scope" src="http://www.youtube.com/v/ZhfUv0spHCY?version=3&autoplay=1&loop=1&controls=0&showinfo=0&rel=0&wmode=opaque"></iframe>
I don't see any error on mobile except the same warning I can see on desktop which apparently is not blocking the video from playing at least there.
Resource interpreted as Document but transferred with MIME type application/x-shockwave-flash:
"https://www.youtube.com/v/ZhfUv0spHCY?version=3&autoplay=1&loop=1&controls=0&showinfo=0&rel=0&wmode=opaque".
Anyone experienced the same issue on Android Chrome or on other mobile devices and OS ?
I haven't started testing on AOSP or iOS yet but already on Chrome the issue is quite concerning. Let me know if anyone managed to fix it.
You're specifically requesting the old Flash player widget and not allowing it to upgrade to HTML5, which is required now for mobile support of any kind. You should switch to the YouTube Player API, which requires a few extra lines of code to implement but will work almost anywhere and give you a lot of event data back about videos playing, etc.
https://developers.google.com/youtube/iframe_api_reference
You can still use an IFRAME with this technique, although consider this directive which appears to support the current API:
https://github.com/brandly/angular-youtube-embed

Resources