目前我流動的教程,可以顯示和播放視頻使用窗口通用應用程序,我幾乎理解的過程,但我被卡在視頻顯示在另一個窗口(窗口2),上傳從第一個窗口(窗口1)如下圖所示:如何從窗口1在窗口2中顯示視頻?
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();
}
窗口1
//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();
}
謝謝,它的工作原理。我使用Windows 10 IOT作爲操作系統的Raspberry Pi 3進行了測試,視頻選擇上存在錯誤,是否有其他協議可以使用樹莓上傳視頻。 –