async void PickFile(object sender, RoutedEventArgs e)
        {
            var currentState = Windows.UI.ViewManagement.ApplicationView.Value;

            if (currentState == Windows.UI.ViewManagement.ApplicationViewState.Snapped && !Windows.UI.ViewManagement.ApplicationView.TryUnsnap())
            {
                TranscodeError("Cannot pick files while application is in snapped view");
            }
            else
            {
                Windows.Storage.Pickers.FileOpenPicker picker = new Windows.Storage.Pickers.FileOpenPicker();
                picker.SuggestedStartLocation = Windows.Storage.Pickers.PickerLocationId.VideosLibrary;
                picker.FileTypeFilter.Add(".wmv");
                picker.FileTypeFilter.Add(".mp4");

                Windows.Storage.StorageFile file = await picker.PickSingleFileAsync();

                if (file != null)
                {
                    Windows.Storage.Streams.IRandomAccessStream stream = await file.OpenAsync(Windows.Storage.FileAccessMode.Read);

                    _InputFile = file;
                    InputVideo.SetSource(stream, file.ContentType);
                    InputVideo.Play();

                    // Enable buttons
                    EnableButtons();
                }
            }
        }
Example #2
0
        async void PickFile(object sender, RoutedEventArgs e)
        {
            Windows.Storage.Pickers.FileOpenPicker picker = new Windows.Storage.Pickers.FileOpenPicker();
            picker.SuggestedStartLocation = Windows.Storage.Pickers.PickerLocationId.VideosLibrary;
            picker.FileTypeFilter.Add(".wmv");
            picker.FileTypeFilter.Add(".mp4");

            Windows.Storage.StorageFile file = await picker.PickSingleFileAsync();

            if (file != null)
            {
                Windows.Storage.Streams.IRandomAccessStream stream = await file.OpenAsync(Windows.Storage.FileAccessMode.Read);

                _InputFile = file;
                InputVideo.SetSource(stream, file.ContentType);
                InputVideo.Play();

                // Enable buttons
                EnableButtons();
            }
        }