0

I am trying to redirect to a different URL when html5 video's not supporting. Actually HTML5 video are not playing in safari browser. So I want to redirect my page to home.html instead of index.html. Any help or direction My browser giving message Your browser does not support HTML5 video. Here is my code, any help will be appreciated.

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>
RAUSHAN KUMAR
  • 5,846
  • 4
  • 34
  • 70
Ans
  • 49
  • 6

1 Answers1

1

You can check if the video element is supported in JavaScript, and then redirect if it isn't supported:

if (!document.createElement('video').canPlayType) {
  window.location.replace('home.html');
}
Jayne Mast
  • 1,427
  • 1
  • 16
  • 32