spacer graphic
spacer graphic
Montage of games AGS Logo
spacer graphic

 

spacer graphic
Menu
spacer graphic Home
About
News
Features
Download AGS
spacer graphic Games 
Games main page
Award Winners
Picks of the month
Short games
Medium length games
Full length games
In Production
Hints & Tips
Community
Forums
AGSers World Map
Member websites
Chat
Resources
Tutorials
FAQ
Knowledge Base
Downloads
Links
AGS-related links
* AGS Manual
  * Scripting
    * Multimedia functions

PlayVideo

PlayVideo (string filename, VideoSkipStyle, int flags)
Plays an AVI, MPG or OGG Theora file, or any other file type supported by Media Player. The game is paused while the video plays.

VideoSkipStyle defines how the player can skip the video:

eVideoSkipNotAllowed     player can't skip video
eVideoSkipEscKey         player can press ESC to skip video
eVideoSkipAnyKey         player can press any key to skip video
eVideoSkipAnyKeyOrMouse  player can press any key or click mouse to skip

FLAGS can be one of the following:

0: the video will be played at original size, with AVI audio
1: the video will be stretched to full screen, with appropriate
   black borders to maintain its aspect ratio and AVI audio.
10: original size, with game audio continuing (AVI audio muted)
11: stretched to full screen, with game audio continuing (AVI audio muted)

There are two distinct type of videos that the PlayVideo function can play.

The first is OGG Theora, which is a recently introduced video file format. AGS has built-in support for playing these videos, so everyone who plays your game will be able to see the video. OGG Theora videos are also built into the game EXE file when you compile the game (just make sure the file has a .OGV extension and is placed in your main game folder).

The second type of files that AGS can play is anything supported by Windows Media Player. This includes AVI, MPG and more. However, in order for these to work on the player's system, they will need to have the correct codecs installed. For example, if you create your video with the XVid codec, the player will need to have XVid installed to be able to view it. These types of video cannot be included into the game EXE, so you will have to place them separately in the Compiled folder for them to work.

NOTE: In 256-colour games, PlayVideo is not supported. Please use a FLC/FLI video with the PlayFlic command instead.

Cross-Platform Support

Windows: Yes
MS-DOS: No
Linux: No
MacOS: Yes

Example:

PlayVideo("intro.mpg", eVideoSkipEscKey, 1);
will play the video Intro.mpg, allowing the player to skip with ESC if they've seen it before.

Compatibility: OGG Theora supported by AGS 3.1.1 and later versions.

See Also: PlayFlic


User comments and notes
There are currently no user comments on this page.
The user comment facility is currently disabled.