Skip to content

feat: add content property to Video control#6392

Open
bl1nch wants to merge 1 commit intoflet-dev:mainfrom
bl1nch:video-custom-controls
Open

feat: add content property to Video control#6392
bl1nch wants to merge 1 commit intoflet-dev:mainfrom
bl1nch:video-custom-controls

Conversation

@bl1nch
Copy link
Copy Markdown
Contributor

@bl1nch bl1nch commented Apr 8, 2026

Description

This PR adds a content property to the Video control. It allows developers to replace the standard media_kit playback controls with a custom Flet control (e.g., a Container, Stack, or Row with custom buttons/text/other controls).

Test Code

# Test code for the review of this PR
import flet as ft
import flet_video as ftv


async def main(page: ft.Page):
    video = ft.Ref[ftv.Video]()

    async def on_inner_btn_click():
        await video.current.stop()

    async def on_play_btn_click():
        await video.current.play()

    async def on_stop_btn_click():
        await video.current.stop()

    page.add(
        ftv.Video(
            playlist=[ftv.VideoMedia("https://user-images.githubusercontent.com/28951144/229373720-14d69157-1a56-4a78-a2f4-d7a134d7c3e9.mp4")],
            height=500,
            width=700,
            ref=video,
            content=ft.Stack(
                controls=[
                    ft.Button(content="Stop <EXAMPLE>", on_click=on_inner_btn_click),
                ]
            )
        ),
        ft.Button(content="Play", on_click=on_play_btn_click),
        ft.Button(content="Stop", on_click=on_stop_btn_click),
    )


ft.run(main=main)

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist

  • I signed the CLA.
  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • New and existing tests pass locally with my changes
  • I have made corresponding changes to the documentation (if applicable)

Screenshots

Additional details

Summary by Sourcery

Add support for customizing the Video control’s playback UI via a new content property that can replace the default controls.

New Features:

  • Introduce a content property on the Video control to host a custom Flet control as the video’s UI overlay.
  • Wire the Video control’s content property into the Flutter video widget so custom content can be used instead of the built-in media controls when enabled.

Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've reviewed this pull request using the Sourcery rules engine

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant