Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

html5 video interactive objects

Tags:

html

video

Does anyone know if html5 video allows objects like buttons, menu, etc connected to the timeline?

Youtube flash player do this: in specific moment, show an object (banner, links, comments) over the video for defined seconds.

thanks

like image 581
Mike Avatar asked Jan 25 '12 10:01

Mike


People also ask

What is interactive HTML5?

Interactive HTML5 content changes to respond to user actions. For example, when you click a button, a webpage opens in your default browser. Saola Animate uses events and actions to help you add interactivity to HTML5 animation. Events are occurrences that determine when to trigger an action.

How do I make video imbed in HTML?

To embed a video in an HTML page, use the <iframe> element. The source attribute included the video URL. For the dimensions of the video player, set the width and height of the video appropriately. The Video URL is the video embed link.

When implementing the HTML5 video element How do you ensure that?

In order to ensure that a video is accessible by all of the target browsers, you'll need to provide, at minimum, two different source elements for your video element. Example 1-5 shows an HTML5 web page with a video element containing two different video sources: one in H.

Which of the following is true about video in HTML5?

Q 4 - Which of the following is true about 'video' tag in HTML5? A - HTML5 supports <video> tag which is used to embed a video file in an HTML or XHTML document.


2 Answers

Yes and no, It's possible to create very interactive video-based presentations using html5 video objects however it requires a lot more than just the video object itself. You can nest video into a canvas object then mess with the actual video image frames, you can overlay any visual html element on top of the video object itself then animate these, you can control the video playback with buttons, click events etc. You can even have the video object control the rest of the page with time-based listeners.

Popcorn.js is really really good and easy to learn, allowing you to do all of what you mentioned. http://popcornjs.org

http://popcornjs.org/demos

like image 134
Alex Avatar answered Sep 22 '22 10:09

Alex


It's not part of the HTML5 video standard, but it's easy to implement manually by wiring up some scripting to the progress event. By looking at the currentTime property of the video object you can decide when to show/hide additional elements.

eg showing an element on top of a video between 1 and 2 seconds into a video:

<video id="v">...</div>
<div id="overlay" style="position: relative; top: -80px;">HELLO</div>

<script type="text/javascript">
    var overlay= document.getElementById('overlay');
    var video= document.getElementById('v');
    video.addEventListener('progress', function() {
        var show= video.currentTime>=1 && video.currentTime<2;
        overlay.style.visibility= show? 'visible' : 'hidden';
    }, false);
</script>
like image 25
bobince Avatar answered Sep 18 '22 10:09

bobince