仅向桌面提供脚本,而不向智能手机提供脚本?

发布于 2024-11-05 17:06:05 字数 131 浏览 4 评论 0原文

我的网站中有 YouTube 视频,在模式窗口 (ColorBox) 中打开。当我在 iPhone 上尝试时,窗口会启动,但视频无法播放。

如何防止将模态窗口脚本提供给智能手机,以便视频在这些设备上正常启动?

谢谢!

I have YouTube videos in my site opening in a modal window (ColorBox). When I try it on my iPhone, the window launches but the video doesn't play.

How can I prevent the modal window script from being served to smartphones, so that videos launch normally on those devices?

Thanks!

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

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

发布评论

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

评论(1

琉璃梦幻 2024-11-12 17:06:05

您可以使用一些 javascript 甚至服务器端代码来嗅探 用户代理,但请确保为您的用户提供一种在两者之间手动切换的方法。

没有什么比因为您使用的是 konqueror 这样的未知浏览器而在计算机上获取手机版本或者因为您使用的是 Windows 7 手机而在手机上获取计算机版本更糟糕的了。

You could sniff the user agent with some javascript or even server side code, but make sure to give your users a way to switch manually between the two.

Nothing sucks more than getting the phone version on a computer because you're using an unknown browser like konqueror or getting the computer version on a phone because you're using a windows 7 phone.

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