question

Raashid Mohammed avatar image
0 Likes"
Raashid Mohammed asked Jacob Gillespie commented

How can I put video .mp4 or avi format in the model

Is there a way in flexsim we can link a video file so that it opens it when certain change in variable ? if so what is the code

and/ or

can we embedded video in the dashboard itself so that it plays videos inside the dashboard when triggered? or GUI

Thanks

Raashid

FlexSim 17.0.0
video
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

Phil BoBo avatar image
1 Like"
Phil BoBo answered Jacob Gillespie commented

Using html video tags, you can add video to your dashboard.

Attached is an example model that demonstrates this.

Below is a screenshot that shows the steps for how that model was set up.

The html snippet came from an example at w3.org.

If you want to point at a local file on the file system, you can do that as well:

<video controls="">
 <source src="file:///D:/Documents/FlexSim 2017 Projects/trailer.mp4" type="video/mp4; codecs="avc1, mp4a"">
</video>

To reference a file relative to the model's directory, you can use the keyword flexsimmodel in the src:

<video controls="">
 <source src="flexsimmodel/trailer.mp4" type="video/mp4; codecs="avc1, mp4a"">
</video>

dashboard-video.png (257.2 KiB)
dashboard-video.fsm (12.9 KiB)
· 6
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Raashid Mohammed avatar image Raashid Mohammed commented ·

Thank you

One last thing what is the code I have to write in flexscript or process flow to trigger it to play automatically

For example

I have a userevent command which triggers when variable is changed and the video pops up and plays automatically and closes when done

Thanks again

Raashid

0 Likes 0 ·
Jacob Gillespie avatar image Jacob Gillespie ♦ Raashid Mohammed commented ·

@Raashid Mohammed

You could use the autoplay attribute.

https://www.w3schools.com/tags/att_video_autoplay.asp

Or you could use the play() method using javascript.

https://www.w3schools.com/tags/av_met_play.asp

You can call JavaScript from FlexScript with callwebscriptmethod().

1 Like 1 ·
Raashid Mohammed avatar image Raashid Mohammed Jacob Gillespie ♦ commented ·

Thanks @Jacob Gillespie

Can you tell me what is the flexscript code to open and Close GUI

I would like it to trigger in one of the user events command

Raashid

0 Likes 0 ·
Show more comments