Repository navigation
[video_player] Add Windows support #37673
Copy link
Copy link
Open
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: desktopRunning on desktopRunning on desktopc: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Fluttercustomer: crowdAffects or could affect many people, though not necessarily a specific customer.Affects or could affect many people, though not necessarily a specific customer.has partial patchThere is a PR awaiting someone to take it across the finish lineThere is a PR awaiting someone to take it across the finish linep: video_playerThe Video Player pluginThe Video Player pluginpackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.platform-windowsBuilding on or for Windows specificallyBuilding on or for Windows specificallyteam-windowsOwned by the Windows platform teamOwned by the Windows platform teamtriaged-windowsTriaged by the Windows platform teamTriaged by the Windows platform team
Description
When does the video player plugin support the Windows platform? Is there any plan support?
Current status (as of October 2024)
There is an in-progress PR (flutter/packages#5884), but it needs more work to be landable, and is not currently under active development. Anyone interested in moving the PR forward is welcome to contribute.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: desktopRunning on desktopRunning on desktopc: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Fluttercustomer: crowdAffects or could affect many people, though not necessarily a specific customer.Affects or could affect many people, though not necessarily a specific customer.has partial patchThere is a PR awaiting someone to take it across the finish lineThere is a PR awaiting someone to take it across the finish linep: video_playerThe Video Player pluginThe Video Player pluginpackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.platform-windowsBuilding on or for Windows specificallyBuilding on or for Windows specificallyteam-windowsOwned by the Windows platform teamOwned by the Windows platform teamtriaged-windowsTriaged by the Windows platform teamTriaged by the Windows platform team
Activity
Tumbler0809 commentedon Aug 6, 2019
Can video playback support full-screen playback?
stuartmorgan-g commentedon Aug 6, 2019
Currently blocked on:
NubilaPardus commentedon Aug 16, 2019
NubilaPardus commentedon Aug 16, 2019
reyesmfabian commentedon Jun 1, 2020
NubilaPardus commentedon Jun 1, 2020
71 remaining items
azchohfi commentedon Nov 29, 2023
Ok, I did some work on this and managed to create a hardware accelerated version using GpuSurfaceTexture.

It is now actually rendering the video \o/ Still, it doesn't update the size or position properly when the flutter video player moves. It is rendering to the same graphics device/adapter that the main flutter hwnd is rendering, but it is not in sync with its position or size.
This has a manual 100,100 position, and size is default.
I'm not that proficient in MF to understand how to keep these in sync.
Here is the code: https://github.com/azchohfi/packages/tree/video_player_windows
azchohfi commentedon Jan 10, 2024
I've done a little bit more investigation, and it seems like flutter still doesn't support Direct Composition. I thought it did. What it does support is to render a ID3D11Texture2D, which we can get from Media Foundation, but it is not optimal, because it has to be frame by frame.
To have this as efficient as possible, without copying ID3D11Texture2D, we would need #76789, or some other mechanism to pass down the actual swap chain from the IMFMediaEngine.
I will try to investigate this further, but I did get this working:

It might seem like it is working, and it kind of is, but the refresh(rate) of the image is happening only at random events that I could call my Update method.
We could add a 60fps times to get the latest, but I don't think that is a good idea.
At least we can render content on top of it ¯\_(ツ)_/¯
azchohfi commentedon Jan 11, 2024
Actually... I kind of mostly got it working, and with decent perf \o/
The way to go is to have a background thread pumping the textures from Media Engine to the ID3D11Texture2D. It is mostly happening on the GPU, so the only thing we need that thread for is to ask for the transfer, and properly keep it in v-sync (which I haven't done yet). I've fixed some memory issues and it is now looking quite nice! I'm almost ready to open a PR. I'm checking with some colleagues on the right Media Foundation pattern for this, to make sure I'm not doing anything that I shouldn't, but it is looking good.
flutter-triage-bot commentedon Jun 7, 2024
The
triaged-desktoplabel is irrelevant if there is noteam-desktoplabel orfyi-desktoplabel.gtgalone commentedon Oct 8, 2024
https://pub.dev/packages/video_player_win
this package solved windows support
syleishere commentedon Oct 8, 2024
gtgalone commentedon Oct 9, 2024
cjng96 commentedon Oct 10, 2024
iampopal commentedon Jun 8, 2026
When this feature is expacted to add to windows?