Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想为高带宽的用户显示视频,为低带宽的用户显示静态图像。我可以向所有移动网络用户展示图像。
我找到了一个移动检测类PHP Mobile Detect。
解决此问题的最佳方法是什么?
这对于 HTML/CSS/JS 来说是不可能的。您可以使用 Javascript 下载测试文件并测量时间,但这在我看来是浪费带宽。唯一能想到的简单机制是 Flash,它有一个内置功能(虽然我不知道它实际上是如何工作的)。
作为提示,我建议首先使用一个简洁的小按钮向所有用户显示静态图像,您可以在其中切换到视频(我自己 - 以及许多其他人 - 更喜欢这个,即使我有很好的连接)。