How to play a video file on the form?

Ask questions about creating Graphical User Interfaces (GUI) in PowerShell and using WinForms controls.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 5 years and 2 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
MosheBA
Posts: 1
Last visit: Fri Aug 11, 2023 11:01 am

How to play a video file on the form?

Post by MosheBA »

Hi All,

I am curious about creating a video player GUI tool and I would like to know if I can reach my goal with PowerShell Studio.
I need to create 3-5-10 buttons, and each button must play it's corresponding video file.
For example, a form with 3 buttons: Introduction, Dinning Room, Playground.
I will create 3 mp4 files and I would like to use something like $VideoPlayer1.Open("C:\Video\Video1.mp4")
Basically, I would like to have a component like PictureBox but for video.
Any suggestions?

PS: SPS ver 2018
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: How to play a video file on the form?

Post by davidc »

[TOPIC MOVED TO POWERSHELL GUIS FORUM BY MODERATOR]

I'm not familiar with a built in .NET control that does video, but I'm sure you could use a third party library for this.
There is also a COM object for Windows Media player:

https://docs.microsoft.com/en-us/window ... k-solution
David
SAPIEN Technologies, Inc.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: How to play a video file on the form?

Post by jvierra »

one way is to host the media control in the WebBrowser control. https://www.mediacollege.com/video/form ... embed.html

The Visual Studio methods in the article require a generated interop that VS does for you.
This topic is 5 years and 2 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked