Skip to content

flet-video subtitles are not displayed #10

@Katsiuk

Description

@Katsiuk

Duplicate Check

Describe the bug

Hello!

I tried to add subtitles to my video, but they don't work.
As far as I can see, they worked previously.
Can you please take a look?

Code sample

Code
import flet as ft
import flet_video as ftv


def main(page: ft.Page):
    page.theme_mode = ft.ThemeMode.LIGHT
    page.window.always_on_top = True

    page.add(
        ftv.Video(
            playlist=[
                ft.VideoMedia(resource="https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/Sintel.mp4"),
            ],
            fill_color=ft.Colors.BLACK,
            expand=True,
            autoplay=True,
            volume=60,
            subtitle_configuration=ft.VideoSubtitleConfiguration(
                src="subtitles-1.srt", # path or link to a subtitle file
                title="A title",
                language="en",
                text_style=ft.TextStyle(
                    size=45,
                    color=ft.Colors.RED,
                    weight=ft.FontWeight.BOLD,
                    bgcolor=ft.Colors.WHITE,
                )
            )

        ),
    )


ft.app(main, assets_dir="assets")

To reproduce

Extract provided zip file and run main.py

Expected behavior

No response

Screenshots / Videos

Captures

[Upload media here]

Operating System

Windows

Operating system details

Windows 10

Flet version

0.28.2

Regression

No, it isn't

Suggestions

No response

Logs

Logs
[Paste your logs here]

Additional details

Here is the full project.

flet-video.zip

I noticed one thing: subtitles work through the Flet module, but not through flet-video.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions