How to automatically play a local MP4 file using WebView2 in Windows 10?

john zyd 421 Reputation points
2021-12-16T10:42:36.057+00:00

Hello:
I have a number of MP4 files in my local hard drive. I want to play them automatically in WebView2.
How I can do this?
For example, I have one MP4 file: C:\Video2\1.mp4.
I can launch ME Edge, and press Ctrl-O to open this mp4 file and play it in Edge.
I want to do the same in a WinForm app. I can add one button (Button1), and if I click on Button1, then I want to launch WebView2 and begin to play the MP4 file. I can use both VS 2019 and VS 2022.
Please advise!

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,271 questions
0 comments No comments
{count} votes

0 additional answers

Sort by: Most helpful