Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Script to Autoplay a Video then Redirect to Another Page</p> <p>This script is tested on Safari, Firefox, Chrome, Opera, and Internet Explorer. It also works (and autoloads) on iPhone.</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html lang="en"&gt; &lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /&gt; &lt;title&gt;&lt;/title&gt; &lt;script type="text/javascript" src="http://brigadapictures.com/images/flowplayer-3.2.6.min.js"&gt; &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;video width="488" height="488" autoplay id="myVideo"&gt; &lt;source src='http://brigadapictures.com/images/image2.mp4' type='video/mp4' /&gt; &lt;source src='http://brigadapictures.com/images/image1.mp4' type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"' /&gt; &lt;source src='http://brigadapictures.com/images/image1.ogg' type='video/ogg; codecs="theora, vorbis"' /&gt; &lt;source src='http://brigadapictures.com/images/image1.webm' type='video/webm; codecs="vp8, vorbis"' /&gt; &lt;!-- Flowplayer as fallback for html5 video tag into the following container --&gt; &lt;div id="flashfallback" style="width:488px;height:488px;display:block"&gt;&lt;/div&gt; &lt;/video&gt; &lt;script type="text/javascript"&gt; //&lt;![CDATA[ var videotag = document.getElementById("myVideo"), videosupport = !!videotag.canPlayType; function myHandler(e) { if(!e) { e = window.event; } top.location.replace("http://www.brigadapictures.com/Home.html"); } if (videotag.addEventListener) { videotag.addEventListener('ended', myHandler, false); } if (videosupport) { videotag.load(); videotag.play(); } else { $f("flashfallback", "http://brigadapictures.com/images/flowplayer-3.2.6.swf", { clip: { url: "http://brigadapictures.com/images/image4.m4v", onStart: function () { this.setVolume(100); }, onFinish: function () { top.location.replace("http://www.brigadapictures.com/Home.html"); } }, canvas: {backgroundGradient: "none"}, play: null, plugins: {controls: null} }); } //]]&gt; &lt;/script&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload