iPhone WebApp Autoplaying Embeded Youtube - iphone

This is a problem I've been noticing since the youtube embed design change, at least from what I've noticed.
So what's happening is any web pages that have been added to homescreen that have a youtube video embedded will autoplay the first youtube video on screen in the youtube app. This doesn't happen when you open the same web page is opened in safari.
Basically any web pages that have a youtube video embedded are inaccessible due to it automatically redirecting you to the youtube app.
How can I stop this? Or is it something they've added that can't be fixed?

Update: found similar question with the proper workaround Embedded YouTube videos in HTML5 standalone app iOS 8.3 opening YouTube app
Unfortunately, the only workaround I've found so far is to disallow web application to runs in full-screen mode by removing:
<meta name="apple-mobile-web-app-capable" content="yes" />
Neither postponed iframe injection to dom, nor even putting iframe in iframe helps.
I really hope that it is not the intended behaviour and it will be resolved soon via iOS update; though until then I have to use server-side to detect OS 8_3 in useragent and deliver them modified version of webapp.

Related

Strange PWA/Manifest Behavior on iOS

I am just beginning to dip my toes into the PWA waters and have started by playing with the manifest.json on a site I am building. My goal is to get it to open up in fullscreen.
I am getting some very strange behavior on iOS.
I add the PWA to the home screen fine and it correctly uses the short name as specified by the manifest. But when I try to open it things go off the rails. The app seems to attempt to load in fullscreen per the manifest but then stops and the website instead opens in a new Safari tab, twice. I have two new tabs both pointing to the URL of the PWA.
Does anyone have any idea what is causing this strange behavior?
Hopefully this is not too late for you.
I had the same problem and I realize it is course by manifest link tag in the header:
<link id="manifest_link" rel="manifest" href="/manifest.json">
The moment you have this, any link or redirect from your PWA will launch Safari regardless of internal or external link.
One solution is to have the link remove from header with javascript after you load the file:
var manifestlink = document.getElementById("manifest_link");
document.head.removeChild(manifestlink);
However that might course some issues for android. You have to test your scenario with on both thoroughly.

Jquerymobile HTML5 Iphone App Add to Home screen

I'm creating a Mobile App with JQM and JSP I'm using Bookmark bubble to do this, but I just want to ensure I understand what is happening behind the scenes here.
Is the static HTML generated by my JSP saved locally on the iPhone?
Does clicking on the APP always get fresh info from my online server or does it cache?
I'm assuming it still uses Safari to render? And just hides the toolbar etc?
If instead of hosting this online, I packaged it as an Apple App and it went on App store,
would the device still use safari to render it?
Thanks!
Documentation is at: https://developer.apple.com/library/content/documentation/iPhone/Conceptual/SafariJSDatabaseGuide/OfflineApplicationCache/OfflineApplicationCache.html
It's possible to cache the page(s) locally.

Problem with youtube embed in UIWebView

I inserted a youtube embed code (the iframe code) in a UIWebView on iPhone and since i upgraded to iOS 4.3.4 it will not play those videos anymore.
It shows fine in the uiwebview but when tapping the play button it goes blank.
Has anyone had a similar problem?
(I could use the old youtube embed code but it really stirs my display when it is returning)
best regards,
broch
Edit (July 30th 2011): It is working again! Really great. Thanks to the guys at YouTube
Check out this link, it looks like its a youtube issue and not us! Engineers are working on it.
http://groups.google.com/group/youtube-api-gdata/browse_thread/thread/394c41dda8b4745a
Greg
I can confirm this issue exists in iOS 4.3.5 as well (tested on an iPhone 4 and iPad 2). We've found that YouTube's embed method no longer works in a UIWebView. The video will usually play but you will only hear the audio.
Falling back to YouTube's old Flash embed code will solve the problem, however it is indeed slower this way. But at least it works.
In the app I'm working on, we retrieve JSON encoded data from a web server. We've simply made it so this data includes the YouTube embed code, which we can change back to the iframe at any time. That way we don't have to keep updating our app every time Apple breaks some functionality, instead we just update our JSON script which only takes a second. Hopefully you can implement some workaround similar to this, or perhaps just go with the old embed code for now until Apple or YouTube addresses the bug.

Prevent Downloading of Mobile Safari Video

Via HTTP Live Streaming or any other method, is it possible to embed videos in a web page that:
Are viewable in Mobile Safari?
and
Cannot be directly downloaded? (when the user navigates to the media URL in a browser, they should not by default get a downloadable file.)
Flash and Silverlight can serve media that meet these criteria on desktop browsers. I'm wondering if there's some way to meet this criteria that is compatible with Mobile Safari, which does not support Flash or Silverlight. The media need not be impossible to rip, just difficult to download with a browser alone.
For example, on the below site, demonstrating HTTP Live Streaming, I can just open up the video URLs and do File > Save. This is what I (actually the client's legal team) would like to avoid.
http://iphone.akamai.com/
Edit: Tried to clarify my question based on responses so far.
its known fact that anything accessible to a browser is downloadable, otherwise the browser couldn't get it. most users are to busy watching the video to think about downloading it, but if they want it there get it...
#dleavitt:
As per Apple's HIG, It is a fact that an app cannot have control of the things outside its sandbox.
So as the Mobile Safari Browser is not in the sandbox of any of the iPhone/iPad apps, it cannot be controlled. You cannot modify or make any changes into its default behaviour.
So keeping it in simple words, You cannot stop downloading videos via Mobile Safari Browser as you dont have control over it.
Hope this helps you.

video content on iPhone Safari/UIWebView

In my application I have a UIWebView that is able to play Youtube videos normally, but I'd like to play some videos from a website other than Youtube.
If i try to play those videos in the iPhone Safari browser it opens in the same way that YouTube videos (fullscreen mode, showing the player), but that doesn't happen in the UIWebView inside my application.
As an example, consider the following URL: http://m.video.globo.com/#video.php?id=1174097 (don't forget to open it in the simulator)
I didn't have to download any plugin or application to play it.
Both JavaScript and Plug-Ins options in the iPhone Settings are turned on.
Is there something wrong with my UIWebView? All I'm doing is loading the webpage using the "loadRequest" method from UIWebView class.
Thanks in advance.
The iPhone has support for youtube videos, (hence the built in youtube player), other than that it supports only quicktime. There is no support for other formats: most sites use flash for video these days (inc youtube), but flash is not supported on the iPhone. I site embedding a youtube video will work, but one embedding a video hosted elsewhere will not (unless its quicktime)