I am working on a simple project using WinUI3 in C++, and I want to set MediaPlayerElement source in code. Microsoft provide the answers, but it is in c# as following code shows.
MediaPlayerElement mediaPlayerElement1 = new MediaPlayerElement();
mediaPlayerElement1.Source = MediaSource.CreateFromUri(new Uri("ms-appx:///Media/video1.mp4"));
mediaPlayerElement1.AutoPlay = true;
So how to set the media source in code in C++? (the source is like this: "rtsp://198.145.2.56")
According to Set the media source,
There is a UWP 360VideoPlayback(cpp) sample, which you can refer to.