CAPL Script

SetMediaFile

This reference collection includes Vector documentation reproduced with permission. Snippets may require configuration-specific symbols and are not all standalone programs. Sources and validation limits.

Syntax

SetMediaFile(panel, control, mediafile);

Function

Replaces the media file of thePanel DesignerMedia Playercontrol during runtime. The panel is accessed by its individual panel name that is entered in thePanel Designer.

Parameters

panel Panel name, restricted to 128 characters."" – references allloaded panelsIf you open a panel the first time, the panel is loaded.
If you close the panel, it remains loaded.

control

Name of the control, restricted to 128 characters."" – references all controls on the panel.

mediafile

Path and name of the media file.

Return Values

—

Setting media file usingabsolutepath. on key 'x'{SetMediaFile("Movie", "Media Player", "D:\\Example\\MediaPlayerProject\\Videos\\song.mpg");} Setting media file usingrelativepath. The media file is in theVideosfolder and this folder is parallel to the panel folder. on key 'y'{SetMediaFile("Movie", "Media Player", "..\\Videos\\song.mpg");}

putValue | SetPictureBoxImage