根据iPad的方向更改html5视频标签的src
编码 HTML5 页面,以便在 iPad Mobile Safari 中使用,该页面具有用于嵌入视频文件的标签。使用 CSS3 媒体查询来确定 iPad 的方向,效果很好。
现在需要根据方向更改视频标签的 src。换句话说,有两个视频,一个尺寸适合横向视图,另一个适合纵向视图。
关于如何解决这个问题有什么建议吗?我确信这很简单,但我似乎无法让它发挥作用。
Coding HTML5 page for use in iPad Mobile Safari that has tag for embedding video file. Using CSS3 media queries to determine orientation of iPad, which works fine.
Now need to change the src of the video tag depending on orientation. In other words, there are two videos, one sized to work in landscape view and one to work in portrait view.
Any advice on how to approach this problem? I'm sure it's something pretty simple, but I can't seem to get it to work.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在查看文档宽度并确定方向后,我只需使用 JavaScript 插入视频标签。
I'd just insert the video tag using javascript, after it's looked at the document width and figured out the orientation.