Page 1 of 1
Playing and Stopping a video by a tag status
Posted: Tue May 26, 2015 5:08 pm
by berkengin
Hello,
I am able to play a video in DEMO Mode which I will upload to a pc as a runtime ultimately. I need to start a video according to a tag status. Is it possible in iX developer?
Thank you very much for your time...
Re: Playing and Stopping a video by a tag status
Posted: Wed Jun 10, 2015 2:55 pm
by Kyle W.
There are a couple of ways I would go about this. Please remember that iX Developer is event driven. So we need something to trigger the video (like a tag change you mentioned above).
The first way I would go about it is to go to the screen with the media player on it and have some kind of a trigger (like an analog numeric input value change) and use this code:
if(Globals.Tags.Tag1.Value == 20)
MediaPlayer.Play();
else
MediaPlayer.Stop();
That would play the video on the screen. If you wanted to do it from a script module, or from the tags scripting area, the best way would be to have a popup window that is the same size as the video player you want, and then when the tag gets to whatever value you want to trigger the video with, you would open the popup like this:
if (Globals.Tags.Tag1.Value == 20)
PopupScreen.Show();
else
PopupScreen.Close();
In the popup screen scripting area, you would put under the "Opened" action:
MediaPlayer.Play();
If you need additional help, I can upload a sample program that does this.