Video can also be used for animated objects instead of images. This example shows a single video which is played across all the pages on two different objects. The CardBounceClockwise object shows the video continuously on the global page while the CardTumbleIn object shows the same video using a repeated animation on each regular page.
The video option is used instead of the image option for the object commands in this example. Video names are required for this option, but these are not the complete file names. The file names must be defined by separate video commands which could either be on the same page where the video is used, or it can be on a preceding global command page, as shown here. The global page method must be used here because the video is shown across multiple pages.
The video command requires the complete video file name with an extension. The extension defines the codec type of the video file used. Lightwing supports several specific codec formats which are optimized for digital signage and contain no audio. The most common video file formats can be easily converted to these formats using WinFF as detailed in the section titled Converting Videos in the online Content Development guide. The video files must be named with extensions that correspond to the video codec type that the file contains.
Since video is not implemented in the Windows version of Lightwing, a representative substitute image is used for the video instead. The Windows version of Lightwing will automatically display the substitute image in place of the video. The substitute images must have the same names, except that their extensions must be .pvr and they must be located in the images folder.
The loop option sets the video to automatically loop to the start and repeat when the end of the video file is reached. Otherwise, this option would default to off.
Lightwing supports two simultaneous video streams. The optional stream option defines which stream the video will be played on. It is not required for this example since only a single video is used for both objects.
Notice that the scale option is used on each object command to scale the aspect ratio of the objects to match the 16:9 ratio of the video. Otherwise, the video would have been stretched to fit the 1:1 aspect ratio of the objects. Also refer to the online Scripting Guide for more details about these commands.
// Scripting Tutorial - Video Objects version: 1.0 global: Global video: BigBuckBunny.lv2 loop: on object: CardBounceClockwise fade: 1 0 scale: 1.33 0.75 loop: on rate: 20 video: BigBuckBunny page: Mercury time: 1, 3 transition: Fade image: PlanetMercuryBackground.pvr object: CardTumbleIn fade: 1 0 scale: 1.33 0.75 video: BigBuckBunny page: Venus time: 1, 3 transition: ZoomIn image: PlanetVenusBackground.pvr object: CardTumbleIn fade: 1 0 scale: 1.33 0.75 video: BigBuckBunny page: Earth time: 1, 3 transition: ZoomOut image: PlanetEarthBackground.pvr object: CardTumbleIn fade: 1 0 scale: 1.33 0.75 video: BigBuckBunny page: Mars time: 1, 3 transition: Implode image: PlanetMarsBackground.pvr object: CardTumbleIn fade: 1 0 scale: 1.33 0.75 video: BigBuckBunny page: Jupiter time: 1, 3 transition: Explode image: PlanetJupiterBackground.pvr object: CardTumbleIn fade: 1 0 scale: 1.33 0.75 video: BigBuckBunny page: Saturn time: 1, 3 transition: SpinIn image: PlanetSaturnBackground.pvr object: CardTumbleIn fade: 1 0 scale: 1.33 0.75 video: BigBuckBunny page: Uranus time: 1, 3 transition: Slide direction: Top image: PlanetUranusBackground.pvr object: CardTumbleIn fade: 1 0 scale: 1.33 0.75 video: BigBuckBunny page: Neptune time: 1, 3 transition: Twist direction: Right image: PlanetNeptuneBackground.pvr object: CardTumbleIn fade: 1 0 scale: 1.33 0.75 video: BigBuckBunny page: Pluto time: 1, 3 transition: Radar direction: Left image: PlanetPlutoCharonBackground.pvr object: CardTumbleIn fade: 1 0 scale: 1.33 0.75 video: BigBuckBunny jump: Mercury