New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WinUI MediaPlayerElement #5172
Comments
MediaPlayerElement isn't currently supported in Winui3, @MikeHillberg @codendone or @Austin-Lamb to weigh in on the plan for it. |
See the WinUI 3.0 Feature Roadmap for the latest status on plans, including Media Controls. We currently do not have a specific release timeline for MediaPlayerElement. |
I wonder if it will include MediaElement or will it be removed as previously deprecated control. |
It would be pretty helpful for us to have the MediaPlayerElement available to WinUI applications. We use video content in our educational app to help users learn and complete their school activities, so Media Player support would be very helpful. Rather than sending students out of the app to a browser to view the video content, we’d like to have them view their content inside the app while doing their programming work. We also believe the MediaPlayerElement would allow us to swap out our large library of sounds (which are mono, low bit-rate .wav files), for higher fidelity stereo .mp3 files. This would help us reduce our app install size as well. The Sound Player we are currently using doesn't have a way for us to detect when a sound is done playing, the MediaPlayerElement does. Overall, better video playback would ensure that our Windows app is competitive with the other versions of our app on iOS, macOS, Android, and ChromeOS, and better ensure the Windows app is a viable solution for our ~200,000 MAU during the school season. |
I wanted to port my WPF app to WinUI 3 which relies heavily on video playback. This is very disappointing. Please add support for this! |
I contribute to an UWP app with background audio streaming (radio). Would be nice to convert the app to WinUI 3, so no media support would be a show stopper. |
I would like to update my Video Detail Player to WinUI 3 in the near future. This kind of blocks me. The |
Same goes for my app Chronotron. |
We urgently need the Control MediaPlayerElement or MediaElement! The roadmap says it will come in a future release, but we need to know when (Q1, Q2?). We would very much like to switch our UWP app to WinUI3 because we urgently need WebView2, but as long as there is no MediaElement, we cannot make the switch. |
For me this issue is also problematic since it is not possible to use XAML Islands in WPF with .NET 5/6 and WinUI3 doesn't support MediaPlayerElement. So other than creating/using a third party media control I think the only solutions are to use either .NET Core 3.1 or UWP? Which both are end-of-life. |
Microsoft, please tell us, will you offer the MediaControls at all? More than half a year is invested in the acrylic features. Who needs that? Would it be possible to know how much longer we have to wait? Unbelievable! |
You can load the video in a WebView2 and use the HTML5 video API via JavaScript interaction. |
That's a possibility if playing videos is a marginal feature. We have a digital signage system where this is one of the core features... |
For me this is probably also not a solution because I create an overlay using a IBasicVideoEffect. |
Yes, audio and video effects are a must have, at least for me. |
Never tried it but maybe you could implement custom effects in JavaScript as well and trigger them from within your .NET app. |
Yeah, or we can try to write the whole app in some other technology than c# and xaml. ToTalLy ViAbLe oPtioN... |
Indeed. Quoting myself from microsoft/WindowsAppSDK#1055 (reply in thread): |
This is exactly where Microsoft finally has to say honestly if and when the important controls (MediaPlayerElement, InkCanvas and Win2D) will be made available. Not making any statements is very disrespectful to the community. |
This is the only remaining showstopper for our primary app that relies on MediaPlayerElement. |
We are in a similar situation to many on this thread. We want to move up to WebView2, but our app also has a video/audio playing component. So - WinUI 2.8 (with WebView2) is not released - and with no clear timeframe on release. And WinUI 3.0 has WebView2, but is missing MediaPlayerElement etc. - and no clear timeframe on release. |
Looking at the number of commits and active contributors draws a dark shadow over my heart. For such a project to succeed, there must be a big team working actively on it. Now, WinUI 3 looks like a hobbist project. MAUI gets more love even in the newsletters, while WinUI 3 is nowhere to be seen. |
I keep saying Microsoft abandoned UWP way too early. Perhaps they underestimated the work to be done to get WinUI 3 to feature-parity, or just decided that the few of us developing UWP apps should be "sacrificed". |
In all fairness, UWP still works just fine as-is. They just decided that adding more features to it (esp support for .NET 5+) would be way too much work, which is hard to evaluate unless you understand these technologies at the deepest level. To get back on topic, I am also really surprised and disappointed that they haven't provided a precise roadmap for the |
Hi @asklar Your sample will crash when attempting to do subtitles. |
I just tested the Media Engine and it seems to work very fine |
@castorix Have you tried this simple MediaPlayerElement? It doesn't have all the features built-in yet, but I think it is the best solution in the long term. |
Yes, I had tried, but it has the known resizing problem of the SwapChainPanel when scale > 100% |
That issue was resolved a couple of weeks ago. Feel free to test it. (Edit: There is still an issue when the window is small, though...) |
Yes, I re-tested and have (a bit of) flickering on resizing with small size (and also some crashes on longer videos (Windows 10 21H1), on seeking for example) |
@castorix , can you please provide a sample how to use this Media Engine from C#? |
Media Engine is essentially the engine behind the UWP MediaPlayer class. It cannot be trivially used in C#. If you put the MediaPlayer class in frame server mode, you obtain the same result. There are examples on how to do that on microsoft docs. |
I did not test all ME interfaces, but I could draw a text on the DXGI surface, just after IMFMediaEngine::TransferVideoFrame |
Basically, yes. |
@PierreHenriKT , is there a way to set the current position of the media from code? |
It is a replica of the UWP MediaPlayerElement, so you can use (most of) the same features. For the position, refer to this documentation. |
Apparently, subtitles seem to be managed with IMFTimedText and associated interfaces |
I just uploaded a sample : WinUI3_MediaEngine |
I also have a semi working approach to subtitles that use the winRT interfaces, but positioning is really difficult to get working correctly with it comes to all the wanky stuff that SSA supports. The testing work alone is going to take months for an uncoordinated open source project. I still very much hope that Microsoft sees the light and releases a proper Mediaplayerelement. |
I'm using LibVLC + WriteableBitmap, as a temp solution |
I had to modify the SwapChain and the method for FullScreen because of update 1.1.0 (with the new black/white background added, apparently for flickering problem...) |
I downloaded LibVLC also as the base for creating a media player inside my application as well. Haven't had much time to finish it though. Seems like a solid solution. When I was reading the docs, it looks like you can pass it an HWND(for Win32) and other native window targets and it'll render the media for you. Awesome IMO. |
@emceelovin, @eshvatskyi |
Apparently, MediaPlayerElement was just added to WinUI 3 (in the Windows App SDK version 1.2 Preview 1). That's a pleasant surprise! Edit: I just tested it. It works well, except for some TransportControls buttons that cause the app to crash. Maybe they aren't yet implemented. |
@PierreHenriKT If you haven't done so, please log a new issue for the crashes you're experiencing with some of the TransportControls. Thanks! Regarding FullWindow and CompactOverlay, these will not be supported in 1.2. Those buttons and APIs have been removed until they are implemented in a future release. |
Thanks for the explanation for FullWindow and CompactOverlay. |
Hello, I am successful in readin a mpeg-dash stream with play ready protection with UWP code (MediaPlayerElement / AdaptiveMediaSource). With the same code using WinUI3 (last experimental version), I get a "SourceNotSupported" exception. Are there any differences between WinUI3 and UWP implementations ? Do I miss something ? Thanks |
It is probably just bugged. |
With the release of the Win App SDK 1.2, I think we can close this issue :) |
Yes you can close this issue, thanks |
@Fernand-Delavy You are the one who opened this issue, so you can close it : There is a button for that next to the "Comment" button.. |
OMG finally :) |
I need MediaPlayer on WinUI or Reunion for Windows
On the page :
https://docs.microsoft.com/en-us/uwp/api/windows.ui.xaml.controls.mediaplayerelement?view=winrt-20348
I read : Equivalent WinUI class: Microsoft.UI.Xaml.Controls.MediaPlayerElement.
if using Microsoft.UI.Xaml.Controls.MediaPlayerElement;
But MediaPlayerElement is not present on :
WinUI UWP, WinUI for Desktop , Project Reunion 0.5.7 and 0.8.0 with .NET 5
What is wrong ? How to use MediaPlayerElelemnt ?
The text was updated successfully, but these errors were encountered: