[英]How can I redirect to a URL when browser dose not support HTML5 videos?
I am trying to redirect to a different URL when html5 video's not supporting. html5视频不支持时,我试图重定向到其他URL。 Actually HTML5 video are not playing in safari browser.
实际上,HTML5视频无法在野生动物园浏览器中播放。 So I want to redirect my page to home.html instead of index.html.
所以我想将页面重定向到home.html而不是index.html。 Any help or direction My browser giving message
Your browser does not support HTML5 video
. 任何帮助或指示我的浏览器给
Your browser does not support HTML5 video
消息Your browser does not support HTML5 video
。 Here is my code, any help will be appreciated. 这是我的代码,任何帮助将不胜感激。
index.html 的index.html
<video id="myVideo" autoplay preload controls >
<source src="final.mp4" type="video/mp4">
<source src="final.ogv" type="video/ogg; codecs=theora, vorbis">
<source src="final.webm" type="video/webm; codecs=vp8, vorbis">
Your browser does not support HTML5 video.
</video>
You can check if the video element is supported in JavaScript, and then redirect if it isn't supported: 您可以检查video元素是否受JavaScript支持,然后重定向(如果不支持):
if (!document.createElement('video').canPlayType) {
window.location.replace('home.html');
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.