iPad 上的 YouTube 嵌入代码

发布于 2024-11-04 05:50:20 字数 929 浏览 2 评论 0原文

我正在努力通过添加 iPad 支持来改善网站的体验。这包括对视频的支持。我们的客户正在推动一种用于存储和提供视频的 YouTube 模型——这对我们来说太棒了!我最初计划使用 YouTube 新的支持 HTML5 的 代码片段。这将设备检测任务转移到 YouTube,并使嵌入视频变得轻而易举,因为我们无需担心兼容性。事实证明,我们使用的 CMS Sitecore CMS 删除了 来自我们的所见即所得编辑器。经过大量研究后,似乎很难不发生这种情况。

快进到现在...我测试了旧式 代码,发现尽管 iOS 不支持 Flash,这些嵌入似乎在 iPad 上运行良好。一些 Stack Overflow 研究让我看到了这篇文章 这表明它是因为 iPad 上的 YouTube 插件 /System/Library/Internet Plug-Ins/YouTubePlugIn.webplugin 允许播放。

我的问题是,是否有任何文件表明这是确切原因?我想以此来解释为什么我们可以使用常规 代码,但我需要通过 iOS 文档来证明它。这个YT插件是每个iPad默认都有的,还是需要用户手动安装?考虑到我们不幸与 不兼容,这似乎是一个很好的解决方案,但我需要通过确凿的事实来支持 的使用。提前致谢。

I'm working on improving the experience of a site by adding in iPad support. This includes support for videos. Our client is pushing towards a YouTube model for storing and serving videos -- great for us! I originally planned to implement the use of YouTube's new HTML5-supporting <iframe> snippets. This offloads the device detection to YouTube and makes embedding a video a cinch as we don't need to worry about compatibility. It turns out the the CMS we're using, Sitecore CMS, strips out <iframe>'s from our WYSIWYG editor. After a lot of research it looks like its a bit hard to not make this happen.

Fast forward to now... I tested out the old style <embed> code and discovered even though iOS doesn't support Flash, these embeds seem to work fine on iPad. Some Stack Overflow research led me to this post which suggests its because of the YouTube plugin /System/Library/Internet Plug-Ins/YouTubePlugIn.webplugin on iPads that allows for the playback.

My question is, is there any documentation that this is the exact reason? I'd like to go by this as why we can use the regular <embed> code but I need to back it up with proof via a document for iOS. Is this YT plug-in on every iPad by default, or do users need to manually install it? This seems like a great solution considering our unfortunate incompatibility with an <iframe> but I need to support the use of the <embed>'s with hard facts. Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

痞味浪人 2024-11-11 05:50:20

您正在寻找的答案可以在 Apple 的 URL 方案参考中找到。基本上,它是一种在 iDevice 上发挥作用的机制,用于专门检测和处理某些类型的 URL,例如 Google 地图、iTunes 和 YouTube。

这里有一些参考链接。

https://developer.apple.com/library/archive/featuredarticles/iPhoneURLScheme_Reference/Introduction/Introduction.html#//apple_ref/doc/uid/TP40007899

https://developer.apple.com/library/archive/featuredarticles/iPhoneURLScheme_Reference/YouTubeLinks/YouTubeLinks.html#//apple_ref/doc/uid/TP40007895-SW1

为了更好地衡量,您可能会还想查看 Safari 开发人员库,了解有关 HTML5 视频和音频嵌入的最佳实践建议:-)

The answer you are looking for is to be found in Apple's URL Scheme Reference. Basically it's a mechanism that comes into play on the iDevices to detect and handle specifically, certain types of URLs - for instance Google Maps, iTunes and also YouTube.

Here's a few reference links.

https://developer.apple.com/library/archive/featuredarticles/iPhoneURLScheme_Reference/Introduction/Introduction.html#//apple_ref/doc/uid/TP40007899

https://developer.apple.com/library/archive/featuredarticles/iPhoneURLScheme_Reference/YouTubeLinks/YouTubeLinks.html#//apple_ref/doc/uid/TP40007895-SW1

And just for good measure, you might also want to take a look at the Safari Developer Library for the best practice recommendations on HTML5 Video and Audio embedding :-)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文