Skip to content

[video_player] Add Windows support #37673

Open

Description

@Tumbler0809

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.

Activity

  1. Tumbler0809 commented on Aug 6, 2019

    @Tumbler0809
    Author

    Can video playback support full-screen playback?

  2. stuartmorgan-g commented on Aug 6, 2019

    @stuartmorgan-g
    Contributor

    Currently blocked on:

  3. added this to the milestone on Aug 13, 2019
  4. NubilaPardus commented on Aug 16, 2019

    @NubilaPardus
  5. NubilaPardus commented on Aug 16, 2019

    @NubilaPardus
  6. modified the milestones: , on Jan 7, 2020
  7. added
    P3Issues that are less important to the Flutter project
    on May 29, 2020
  8. reyesmfabian commented on Jun 1, 2020

    @reyesmfabian
  9. NubilaPardus commented on Jun 1, 2020

    @NubilaPardus
  10. 71 remaining items

  11. azchohfi commented on Nov 29, 2023

    @azchohfi

    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.
    image
    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

  12. azchohfi commented on Jan 10, 2024

    @azchohfi

    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:
    image
    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 ¯\_(ツ)_/¯

  13. azchohfi commented on Jan 11, 2024

    @azchohfi

    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.

  14. added
    team-windowsOwned by the Windows platform team
    and removed on Jun 6, 2024
  15. flutter-triage-bot commented on Jun 7, 2024

    @flutter-triage-bot

    The triaged-desktop label is irrelevant if there is no team-desktop label or fyi-desktop label.

  16. gtgalone commented on Oct 8, 2024

    @gtgalone
    Contributor

    https://pub.dev/packages/video_player_win

    this package solved windows support

  17. syleishere commented on Oct 8, 2024

    @syleishere
  18. gtgalone commented on Oct 9, 2024

    @gtgalone
  19. cjng96 commented on Oct 10, 2024

    @cjng96
  20. iampopal commented on Jun 8, 2026

    @iampopal

    When this feature is expacted to add to windows?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: desktopRunning on desktopc: new featureNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to Fluttercustomer: crowdAffects 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 linep: video_playerThe Video Player pluginpackageflutter/packages repository. See also p: labels.platform-windowsBuilding on or for Windows specificallyteam-windowsOwned by the Windows platform teamtriaged-windowsTriaged by the Windows platform team

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions