iphone/ipod mobile safari 导致视频元素在旋转时消失
我正在编写一个非常简单的显示视频的网站。我有针对设备不同旋转状态的单独样式表,如下所示:
<link rel="stylesheet" media="all and (orientation:portrait)" href="portrait-style.css"/>
<link rel="stylesheet" media="all and (orientation:landscape)" href="landscape-style.css"/>
当用户首次以相应方向导航到站点时,工作表会正确加载并显示内容。但是,当用户更改方向时,以下代码中的视频元素会消失,而该方向的所有其他样式都会正确应用。
<video id="mainvideo" width="640" height="480" controls preload="auto">
<source src="output.ogv" type="video/ogg" />
<source src="output.mp4" type="video/mp4" />
<object width="640" height="480" data="flowplayer-3.2.5.swf" type="application/x-shockwave-flash">
<param name="movie" value="flowplayer-3.2.5.swf" />
<param name="allowfullscreen" value="true"/>
<param name="allowscriptaccess" value="always"/>
<param name="flashvars" value="config={'clip':{'url':'output.flv', 'autoPlay':false, 'autoBuffering':true}}" />
</object>
<div id="trollface">
<p>You do not have Adobe flash player installed on your browser. You may download it <a href="http://get.adobe.com/flashplayer/">here</a>.</p>
</br>
<p>Alternatively, you may also use a modern, standards-compliant browser (such as <a href="http://www.mozilla.com/en-US/firefox/">firefox</a>, <a href="http://www.google.com/chrome/intl/en/landing_chrome_mac.html?hl=en">chrome</a>, <a href="http://www.opera.com/">opera</a>, or <a href="http://www.apple.com/safari/">safari</a>), or download the video by clicking the download link below.</p>
</div>
</video>
有人可以给我们一些指导吗?
预先感谢您的所有帮助。
I am writing a very simple website that displays a video. I have separate stylesheets for the different rotation states of the device, like so:
<link rel="stylesheet" media="all and (orientation:portrait)" href="portrait-style.css"/>
<link rel="stylesheet" media="all and (orientation:landscape)" href="landscape-style.css"/>
The sheets load and display the content properly when the user first navigates to the site in the respective orientation. However, when the user changes orientation, the video element in the following code disappears, while all other styling for the orientation is correctly applied.
<video id="mainvideo" width="640" height="480" controls preload="auto">
<source src="output.ogv" type="video/ogg" />
<source src="output.mp4" type="video/mp4" />
<object width="640" height="480" data="flowplayer-3.2.5.swf" type="application/x-shockwave-flash">
<param name="movie" value="flowplayer-3.2.5.swf" />
<param name="allowfullscreen" value="true"/>
<param name="allowscriptaccess" value="always"/>
<param name="flashvars" value="config={'clip':{'url':'output.flv', 'autoPlay':false, 'autoBuffering':true}}" />
</object>
<div id="trollface">
<p>You do not have Adobe flash player installed on your browser. You may download it <a href="http://get.adobe.com/flashplayer/">here</a>.</p>
</br>
<p>Alternatively, you may also use a modern, standards-compliant browser (such as <a href="http://www.mozilla.com/en-US/firefox/">firefox</a>, <a href="http://www.google.com/chrome/intl/en/landing_chrome_mac.html?hl=en">chrome</a>, <a href="http://www.opera.com/">opera</a>, or <a href="http://www.apple.com/safari/">safari</a>), or download the video by clicking the download link below.</p>
</div>
</video>
Can anyone lend we some direction with this?
Thanks in advance for all your help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在样式表内部,您还可以针对不同的方向做出不同的设置,
这允许您对同一类(或ID或标签)有两个定义,并且当您将设备转向另一个方向时,它应该动态更新您的页面
Inside the stylesheet you can make a difference as well for different orientations
This allows you to have two definitions for the same class (or ID, or tag) and it should be updating your page dynamically when you turn the device to another orientation