Applies To:
  • CitectSCADA 6.xx
  • CitectHMI 6.xx

Summary:
How do I use Microsoft Windows Media Player ActiveX in Citect?
 

Solution:
You will need to set the Media Player ActiveX object property to specify the filename that needs be opened and also call the Play Method via Cicode:

1. Specify the URL obtained from user input (Player.URL)
2. Start the Player (Player.Controls.Play)

The following Cicode function illustrates an example of running a specific media player file with the Windows Media Player. In the example, the ActiveX object has an object name of AN202. This function can be called by clicking on a button on the page where the ActiveX object is located.

FUNCTION
Media()
_ObjectSetProperty(
ObjectByName("AN202"), "URL", "C:\NewStories.wma");
_ObjectCallMethod(
ObjectByName("AN202"), "Controls", "play");
END

Note that the following methods may also be useful:

player.controls.stop
player.controls.pause

More information can be found at the following websites:
1. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmplay10/mmp_sdk/controlsplay.asp
2. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmplay10/mmp_sdk/playerurl.asp

 

Keywords:
 

Attachments