Redirect html5 video after play

<script type=”text/javascript”> // Do not name the function “play()” function playVideo(){ var video = document.getElementById(‘video’); video.play(); video.addEventListener(‘ended’,function(){ window.location = ‘http://www.google.com’; }); } </script> <video controls id=”video” width=”770″ height=”882″ onclick=”playVideo()”> <source src=”video/Motion.mp4″ type=”video/mp4″ /> </video> Here is a list of media events to which you can bind: http://dev.w3.org/html5/spec/Overview.html#mediaevents

html5 video issue with chrome

This is a solution I found That worked for my case, First, embed the video in your html: <video id=”videoId” width=”100%” autoplay loop> <source src=”https://stackoverflow.com/questions/16773986/main.webm” type=”video/webm”> <source src=”main.mp4″ type=”video/mp4″> Your browser does not support the video tag. </video> Then detect if the Browser is chrome: var isChrome = !!window.chrome; var isIE = /*@cc_on!@*/false; If its … Read more

Autostart html5 video using android 4 browser

It seems that Android 4+ changed the requirements for the play() method to require user interaction. If you trigger play() from within a user event handler (eg. touchstart or mousedown), then you can play the video as long as you run it inside the same event loop. This means that you shouldn’t use async triggers … Read more

Play HTML5 Video when scrolled to

In brief Let’s say our browser window W currently scrolled to y-position scrollTop and scrollBottom Our video will NOT be played when its position is at V1 or V2 as below snapshot. Code details $(document).ready(function() { // Get media – with autoplay disabled (audio or video) var media = $(‘video’).not(“[autoplay=’autoplay’]”); var tolerancePixel = 40; function … Read more

How can I play a local video in my IPython notebook?

(updated 2019, removed unnecessarily costly method) Just do: from IPython.display import Video Video.from_file(“test.mp4”) If you get an error No video with supported format or MIME type found, just pass embed=True to the function: Video(“test.mp4”, embed=True). Or if you want to use the HTML element: from IPython.display import HTML HTML(“”” <video alt=”test” controls> <source src=”test.mp4″ type=”video/mp4″> … Read more