Currently I flow a tutorial that can display and play a video using window universal application and I almost understand the process but I am stuck on the video display in another window (window2),Upload from the first window (window 1) as in the figure below:
public async void GetMedia()
{
var openPicker = new FileOpenPicker();
openPicker.SuggestedStartLocation = PickerLocationId.VideosLibrary;
openPicker.FileTypeFilter.Add(".wmv");
openPicker.FileTypeFilter.Add(".mp4");
var file = await openPicker.PickSingleFileAsync();
var stream = await file.OpenAsync(FileAccessMode.Read);
media.SetSource(stream, file.ContentType);
media.Play();
}
Window1
//Click boutton for upload video
private void b_Click_1(object sender, RoutedEventArgs e)
{
Screen s=new Screen(); // window 2
//display and play video to window 2
s.GetMedia();
}
Based on your snapshot, you look like finding a solution like this:
A music player app that lets users see what's playing while browsing through a list of other available music.
If my understanding is correct, you can utilize
CoreApplication.CreateNewView()
.And here is a sample code:
In MainPage.xaml
In MainPage.xaml.cs
In NewWindowPage.xaml
In NewWindowPage.xaml.cs
MediaData class: