Name
OpenVideo -- open a video file (V5.0)
Synopsis
[id] = OpenVideo(id, filename$[, table])
Function
This function opens the video file specified by filename$ and assigns the specified id to it. If you pass Nil in id, OpenVideo() will automatically choose an identifier and return it. The video file specified in filename$ will be opened and prepared for playback. Video playback is always done directly from disk which means that OpenVideo() will not prebuffer any data at all. It will just initialize all parameters necessary for video playback.

Video formats that are supported on all platforms are CDXL and formats you have a plugin for. Depending on the platform Hollywood is running on, more video formats might be supported. On Windows Hollywood is able to open all video formats for which you have a Media Foundation or DirectShow codec installed. On macOS Hollywood can open all video formats that are supported by AV Foundation (or QuickTime on older Macs).

Starting with Hollywood 6.0 this command accepts an optional table argument which recognizes the following options:

Loader:
This tag allows you to specify one or more format loaders that should be asked to load this video. This must be set to a string containing the name(s) of one or more loader(s). Defaults to the loader set using SetDefaultLoader(). The default loader lets Hollywood first ask all plugins whether they would like to handle the video file, then it will check its inbuilt loaders (currently only CDXL), and finally it will ask the video interface of the host OS to play this video. If you want to customize this order, use this tag. See Loaders and adapters for details. (V6.0)

Adapter:
This tag allows you to specify one or more file adapters that should be asked to open the specified file. This must be set to a string containing the name(s) of one or more adapter(s). Defaults to the adapter set using SetDefaultAdapter(). See Loaders and adapters for details. (V6.0)

UserTags:
This tag can be used to specify additional data that should be passed to loaders and adapters. If you use this tag, you must set it to a table of key-value pairs that contain the additional data that should be passed to plugins. See User tags for details. (V10.0)

This command is also available from the preprocessor: Use @VIDEO to preload video files!

Inputs
id
identifier for the video or Nil for auto id selection
filename$
file to load
table
optional: table that contains further parameters (V6.0)
Results
id
optional: identifier of the video; will only be returned when you pass Nil as argument 1 (see above)
Example
OpenVideo(1, "intro.avi")
PlayVideo(1)
The code above loads & plays "intro.avi".

Show TOC