28

YouTube iOS8 Media Load Issue - Media plays successfully while in Safari, but when the app is loaded from a Home Screen web clip, playing the video fails.

Moreover, tapping a link to navigate away from the page while the media is failing to load results in a complete crash of the app to the Home Screen.

Here is a link that demonstrates this (obviously run on your iDevice). You can run it initially in Safari browser, it'll work fine. Install it as a home screen icon, playing video will fail, and clicking the bottom link will crash the app.

http://nterspace.com/youtubeissue.html

The code that works when the app is loaded up in the Safari browser is:

<iframe width="100%" maxwidth="432" height="270" src="//www.youtube.com/embed/_j4KrMAygJI" frameborder="0" allowfullscreen></iframe>

Anyone have any thoughts? Is this bad embed code?

sneuf
  • 708
  • 2
  • 7
  • 13
  • it is a problem with iOS8: [html5 video doesn't play in ios 8 homescreen webapp][1] [1]: http://stackoverflow.com/questions/25972362/why-html5-video-doesnt-play-in-ios-8-webappwebview –  Sep 23 '14 at 16:03
  • I've noticed that the "canplay" event is not fired which is required by the Video API in Mobile Safari in order to play. For now I'm having to rely on some javascript to play a video when "loadedmetadata" is fired. Awful bug. – Cue Sep 26 '14 at 15:28
  • 4
    @Cue can you expand on what you did with canplay and loadedmetadata? – matb33 Sep 26 '14 at 20:24
  • Still not resolved in iOS 8.1. Logged as a bug in Apple Bug Reporter, the response back is that it is a duplicate of another bug... So they are aware of it, at least. – sneuf Nov 14 '14 at 14:30
  • I've spent the last two days trying to get an embedded YouTube video to work on my site. Are we saying that this is completely broken still? I cannot get the video to even appear on the page let alone play. – Jammer Nov 14 '14 at 16:05

5 Answers5

9

Today, April 09, 2015. Finally , this issue is partially resolved. After updating to version 8.3 my webapps returned to work again for the dailymotion and vimeo videos. Youtube videos are now redirecting to the native application, which is very annoying.

EDIT:

As the youtube videos was redirecting to the native application , I had to use the youtube url as follows:

<iframe width="100%" height="300" src="https://www.youtube-nocookie.com/embed/hdjL8WXjlGI?rel=0&amp;controls=0&amp;showinfo=0" frameborder="0" allowfullscreen></iframe>

So my users can watch the video without having to leave the webapp.

For some reason the nocookie option does not redirect. Let's hope that this will be completely fixed in the next iOS version.

Daniel Lima
  • 798
  • 8
  • 13
  • I definitely don't consider this resolved... The replacement functionality of launching the native YouTube functionality as opposed to playing the video inline on the iPad or within the web app on the iPhone is not a fix, and is detrimental in a big way to the design of our solutions. – sneuf Apr 13 '15 at 14:00
  • It seems to me that the redirect is forced by youtube. I managed to use youtube videos in webapps with the link as follows: https://www.youtube-nocookie.com/embed/videoIdAndOptions. For some reason the nocookie option does not redirect. – Daniel Lima Apr 17 '15 at 15:04
  • Thanks for posting the solution. Will test this with our apps. – sneuf Apr 18 '15 at 17:32
  • Thanks for posting this fix. I have a youtube video on my landing page and the web app was redirecting you the youtube native app as soon as it opened. – Jay Kyburz Sep 11 '15 at 22:49
2

I am having the same issues!

This is an issue particular to IOS8. Please see: https://discussions.apple.com/thread/6558443 Hopefully Apple will fix this issue soon. Another issue arising is unable to use Play button: The Play button on a youtube embed does not work on android-chrome

UPDATE: They have fixed the PLAY button ISSUE!

Community
  • 1
  • 1
Rdg
  • 53
  • 1
  • 10
2

It was still broken on 8.3 for me, but it turned out it was because there was an <input type="search"> element on the page (bizarre). Made a video: https://www.youtube.com/watch?v=rrKxAIXnydE

Chris Coyier
  • 1,238
  • 2
  • 11
  • 13
  • Just wanted to add that this fix is also discussed here: [Embedded YouTube videos don't play on iPad (iOS 7) while HTML5 search input is visible](http://stackoverflow.com/questions/19507930/embedded-youtube-videos-dont-play-on-ipad-ios-7-while-html5-search-input-is-v) – Markus Aug 13 '15 at 13:14
1

iOS 8.3 fixes the bug. Videos are now playable from homescreen webapp, including from appcache.

source:

Community
  • 1
  • 1
Vivo
  • 768
  • 1
  • 8
  • 20
0

Just tested this on iPad with IOS 8.1.3 - still broken.

sneuf's iframe works for safari pages but not when loaded from home screen (web clip).

El Bno
  • 31
  • 2