Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Youtube videos not playing on standalone Safari browser iOS 8

I have a very strange problem with an embedded youtube player on a web app, I am working on. The web app is "mobile capable" so when saved on a user homescreen, it opens up in a chromeless safari browser.



So here is my issue:



The YouTube player is embedded on one of the pages in the web app using an iframe, and when the "play" button is clicked and the app is open in the chromeless safari window, the video loads forever and never plays....however when this scenario is replicated in the regular safari browser everything works fine.



This started happening only after the iOS 8 update. This is happening on an iPhone 5 running iOS 8, and it previously worked fine on the same iPhone 5 under iOS 7. Additionally, I tested the app on an iPhone 5c running iOS 7, and an iPad Air running iOS 7 and everything works fine.



Side Note: I even changed the implementation to embed using an object instead of an iframe, and the same problem occurs with either one.

iPhone 5, iOS 8

Posted on Sep 24, 2014 11:24 AM

Reply
51 replies

Apr 30, 2015 6:11 AM in response to modern artist

Ok, so I guess I had the perfect storm of issues over here. Major credit to my coworker Spell (https://github.com/michaelspellacy) for digging this one up.
There appears to be a bug within iOS WebKit (and Blink) rendering engines. Under certain conditions, YouTube videos embedded within iframes cannot be viewed when a user clicks on the video, even with the "youtube-nocookie" addition.

The Bug

Applying the

:active
pseudo-class to a universal selector (*) and including a property of
-webkit-tap-highlight-color
seemes to be the culprit.


*:active { -webkit-tap-highlight-color: tomato; }


Now, here is the odd part. The bug is only triggered when the above CSS block is present and there is an

input
element present on the page with a type attribute value of "search".


<input type="search" placeholder="Search"/>

The Solution

Either rename the input type to text, or (likely preferred) remove the -webkit-tap-highlight-color css attribute.

Youtube videos not playing on standalone Safari browser iOS 8

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.