Video::CPL Tutorial
Video::CPL is a Perl package which provides a convenient way to author CPL scripts dynamically.
Overview
CPL is the Coincident Programming Language, an XML dialect which describes interactive complex video.
To view CPL in a web page, several pieces are needed.
- One or more video sources, URLs which point to video content. Users with a webcam enabled laptop can create and upload a short video to Youtube in a few minutes which can be used for testing.
- Optionally other assets may be used in the CPL experience, JPEG files, SWF images, web links.
- A CPL file. This controls the video experience; displaying annotations, branching to other points in the video or in different videos, executing Javascript on the containing page, etc.
- A CPL player. This program reads the CPL file and makes the experience occur within the browser. Traditionally this has been in Flash, a binary image supported by most browsers. The player can also be a Javascript program within HTML5, for some kinds of video.
- An HTML page. The CPL player works within this page. It can take over the entire page, or be simply another object within the page. The CPL player can change the workings of the page with Javascript, and a Javascript program on the HTML page can change the CPL program and the experience.
With the Flash player, some supporting assets must be on the same server as the Flash player was served from, following the so-called Sandbox rules. The easiest and most robust way to put an experience on foo.com is to serve the player, html pages, images, and videos from the same foo.com server.
CPL experiences can be created using an editor, and placed one by one on a web server. Or they can be created by a Perl program, dynamically. It is easy to create CPL experiences in Perl. If you have a web server running CGI scripts and Perl available, this tutorial will walk you through to creating your first dynamic CPL experience in a few minutes.
Next Steps