iOS 8 Embedded YouTube in HTML web app fails

2019-01-16 16:14发布

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?

5条回答
孤傲高冷的网名
2楼-- · 2019-01-16 16:52

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

查看更多
对你真心纯属浪费
3楼-- · 2019-01-16 17:08

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

source:

查看更多
爷、活的狠高调
4楼-- · 2019-01-16 17:09

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!

查看更多
劳资没心,怎么记你
5楼-- · 2019-01-16 17:10

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).

查看更多
狗以群分
6楼-- · 2019-01-16 17:18

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.

查看更多
登录 后发表回答