针对网站特定部分的移动检测 [英] Mobile detection for specific parts of websites

查看:97
本文介绍了针对网站特定部分的移动检测的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是网络开发的初学者,我无法解决这个问题。

I am beginner in web development and I'm having trouble wrapping my head around this problem.

我拍摄了一段视频并将其编码为mp4文件一个ism文件。我有两个不同的视频标签 - 一个将播放每个文件。对于我正在处理的网站,如果在移动设备上查看网站,我希望使用其中一个视频标签,如果不是,则使用另一个。现在网站是HTML5。感谢您提供任何帮助!

I have taken a video and encoded it into an mp4 file and an ism file. I have two different video tags- one that will play each file. For the website I'm working on I would like it to use one of the video tags if the website is being viewed on a mobile device, and the other if it is not. Right now the website is in HTML5. Thank you for any help you can give!

推荐答案

您可以使用基于UserAgent的检测来决定要显示的内容(不建议用作您必须使用您使用的编解码器来维护它)或 canPlayType()以查看浏览器是否支持它(更好的选项)

you could either use UserAgent based detection to decide what to show (not recommended as you have to maintain it) or canPlayType() with the codec you are using to see if the browser supports it (better option)

这篇关于针对网站特定部分的移动检测的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆