Embedding multimedia

Media element can cooperate and be combined with other elements. Various CSS properties can be applied to the elements and there are options to combine video with SVG. We can embed video in canvas element and apply processing on the rendered images.

In this recipe we will create a simple case where we embed a video inside canvas.

Getting ready

In this recipe we will need a video for our video element and an additional requirement is that the video has Cross-Origin Resource Sharing support or is located on our local server. The simplest way to make sure of this is to have a video with our locally running server.

Note

There are many videos with different formats available from NASA and ESA at http://www.spacetelescope.org/videos/astro_bw/ ...

Get HTML5 Data and Services Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.