private void btnVideoBrowse_Click(object sender, RoutedEventArgs e) { // Create OpenFileDialog Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog(); // Set filter for file extension and default file extension dlg.DefaultExt = ".mp4"; //dlg.Filter = "JPEG Files (*.jpeg)|*.jpeg|PNG Files (*.png)|*.png|JPG Files (*.jpg)|*.jpg|GIF Files (*.gif)|*.gif"; // Display OpenFileDialog by calling ShowDialog method Nullable <bool> result = dlg.ShowDialog(); // Get the selected file name and display in a TextBox if (result == true) { try { // Open document string filename = dlg.FileName; txtVideoPath.Text = filename; Vid.Stop(); Vid.Source = new Uri(filename); RestartVideo(Vid); } catch { } } }
private void SetMainAndScanningVideos() { try { // Open document string filename = txtVideoFolderPath.Text + @"\Pergola Main.mp4"; Vid.Stop(); Vid.Source = new Uri(filename); RestartVideo(Vid); // Open document filename = txtVideoFolderPath.Text + @"\Pergola Scanning.mp4"; ScanningVid.Stop(); ScanningVid.Source = new Uri(filename); RestartVideo(ScanningVid); //start sound SoundComplete(true); } catch { } }