a. Playing Background Video

<< Click to Display Table of Contents >>

Navigation:  Tutorials > Tutorial 12 - Video Primitives >

a. Playing Background Video

This section shows how to play the video in the background using the SetBackgroundVideo() command.

 

 

Command Prototype

 

int16_t SetBackgroundVideo(const char* FileName, int16_t Framerate)

 

Parameters

Description

Filename

video file path

Framerate

Value between 0 - 100

 

 

Code

 

 

#define SCREEN_WIDTH          800

#define SCREEN_HEIGHT         480

#define CENTRE_X                   (0.5 * SCREEN_WIDTH)

#define CENTRE_Y                  (0.5 * SCREEN_HEIGHT)

 

void setup() {

/* Initialize CleO - needs to be done only once */

 CleO.begin();

 

 /* Set background video */

 CleO.SetBackgroundVideo("@Videos/thun100.avi", 0);

}

 

void loop() {

 /* Start building screen frame */

 CleO.Start();

 

 CleO.StringExt(FONT_SANS_4, CENTRE_X, CENTRE_Y, BLACK, MM, 0, 0, "Background Video");

 

 /* Show screen frame */

 CleO.Show();

}

 

 

Description

 

The above setup routine sets "thun100.avi" video file to play in background.

The loop() routine displays the "Background Video" string in the center of the screen.

 

 

Output

 

Here is the output displayed upon executing the above code snippet -

 

Playing Background Video