-
Notifications
You must be signed in to change notification settings - Fork 757
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: MediaPlayerElement does not play a local source
- Loading branch information
1 parent
36c4145
commit 25e3d33
Showing
14 changed files
with
229 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+299 KB
...ITests.Shared/Assets/Thumbnails/Getting_Started_with_Uno_Platform_for_Figma.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+3.71 MB
src/SamplesApp/UITests.Shared/Assets/Videos/Getting_Started_with_Uno_Platform_for_Figma.mp4
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
...dows_UI_Xaml_Controls/MediaPlayerElement/MediaPlayerElement_Original_MsAppdataSource.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<UserControl x:Class="UITests.Shared.Windows_UI_Xaml_Controls.MediaPlayerElement.MediaPlayerElement_Original_MsAppdataSource" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"> | ||
|
||
<Grid> | ||
<Grid.RowDefinitions> | ||
<RowDefinition Height="Auto" /> | ||
<RowDefinition Height="*" /> | ||
</Grid.RowDefinitions> | ||
|
||
<Button x:Name="SelectVideoButton" | ||
Click="SelectVideoButton_Click" | ||
Content="Pick another video file" | ||
Margin="0,0,0,10" /> | ||
|
||
<MediaPlayerElement x:Name="SelectedVideo" | ||
Grid.Row="1" | ||
AreTransportControlsEnabled="True" | ||
AutoPlay="True" | ||
Visibility="Collapsed" /> | ||
</Grid> | ||
</UserControl> |
45 changes: 45 additions & 0 deletions
45
...s_UI_Xaml_Controls/MediaPlayerElement/MediaPlayerElement_Original_MsAppdataSource.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Runtime.InteropServices.WindowsRuntime; | ||
using Microsoft.Graph; | ||
using Uno.UI.Samples.Controls; | ||
using Windows.Foundation; | ||
using Windows.Foundation.Collections; | ||
using Windows.Media.Core; | ||
using Windows.Media.Playback; | ||
using Windows.Storage; | ||
using Windows.Storage.Pickers; | ||
using Windows.UI.Xaml; | ||
using Windows.UI.Xaml.Controls; | ||
using Windows.UI.Xaml.Controls.Primitives; | ||
using Windows.UI.Xaml.Data; | ||
using Windows.UI.Xaml.Input; | ||
using Windows.UI.Xaml.Media; | ||
using Windows.UI.Xaml.Navigation; | ||
|
||
namespace UITests.Shared.Windows_UI_Xaml_Controls.MediaPlayerElement | ||
{ | ||
[SampleControlInfo("MediaPlayerElement", "Original using a local ms-appdata source", ignoreInSnapshotTests: true, description: "Video using a local ms-appdata source for video and poster. At the moment media element cannot read content from the in-browser file system, so keep this test aside for WASM.", IsManualTest = true)] | ||
public sealed partial class MediaPlayerElement_Original_MsAppdataSource : UserControl | ||
{ | ||
public MediaPlayerElement_Original_MsAppdataSource() | ||
{ | ||
this.InitializeComponent(); | ||
} | ||
|
||
private async void SelectVideoButton_Click(object sender, RoutedEventArgs e) | ||
{ | ||
var picker = new FileOpenPicker(); | ||
picker.FileTypeFilter.Add("*"); | ||
StorageFile file = await picker.PickSingleFileAsync(); | ||
var extension = Path.GetExtension(file.Name); | ||
var fileName = Guid.NewGuid() + extension; | ||
await file.CopyAsync(ApplicationData.Current.LocalFolder, fileName); | ||
var uri = new Uri($"ms-appdata:///Local/{fileName}"); | ||
SelectedVideo.Source = MediaSource.CreateFromUri(uri); | ||
SelectedVideo.Visibility = Visibility.Visible; | ||
} | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
...Windows_UI_Xaml_Controls/MediaPlayerElement/MediaPlayerElement_Original_MsAppxSource.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<UserControl x:Class="UITests.Shared.Windows_UI_Xaml_Controls.MediaPlayerElement.MediaPlayerElement_Original_MsAppxSource" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"> | ||
|
||
<MediaPlayerElement Source="ms-appx:///Assets/Videos/Getting_Started_with_Uno_Platform_for_Figma.mp4" | ||
PosterSource="ms-appx:///Assets/Thumbnails/Getting_Started_with_Uno_Platform_for_Figma.png" | ||
AreTransportControlsEnabled="True" | ||
AutoPlay="True" /> | ||
</UserControl> |
27 changes: 27 additions & 0 deletions
27
...dows_UI_Xaml_Controls/MediaPlayerElement/MediaPlayerElement_Original_MsAppxSource.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Runtime.InteropServices.WindowsRuntime; | ||
using Uno.UI.Samples.Controls; | ||
using Windows.Foundation; | ||
using Windows.Foundation.Collections; | ||
using Windows.UI.Xaml; | ||
using Windows.UI.Xaml.Controls; | ||
using Windows.UI.Xaml.Controls.Primitives; | ||
using Windows.UI.Xaml.Data; | ||
using Windows.UI.Xaml.Input; | ||
using Windows.UI.Xaml.Media; | ||
using Windows.UI.Xaml.Navigation; | ||
|
||
namespace UITests.Shared.Windows_UI_Xaml_Controls.MediaPlayerElement | ||
{ | ||
[SampleControlInfo("MediaPlayerElement", "Original using a local ms-appx source", ignoreInSnapshotTests: true, description: "Video using a local ms-appx source for video and poster")] | ||
public sealed partial class MediaPlayerElement_Original_MsAppxSource : UserControl | ||
{ | ||
public MediaPlayerElement_Original_MsAppxSource() | ||
{ | ||
this.InitializeComponent(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters