flet icon indicating copy to clipboard operation
flet copied to clipboard

ft.Video crash when mpd.file

Open lanceqqe opened this issue 3 months ago • 12 comments

Description

Issue: if you add ft.Video with the source argument that uses the mpd file, then re-overwriting ft.Video using a link to the mpd file causes the application to crash without errors, m3u8 does not show similar behavior

Code example to reproduce the issue:

(               self.playlist_video = ft.VideoMedia(video.url,http_headers=http_headers)
                self.my_video = ft.Container(
                    content=ft.Video(playlist=self.playlist_video, playlist_mode=None, filter_quality=ft.FilterQuality.HIGH, expand=True, aspect_ratio=16 / 9,
                                     autoplay=True))
                self.page.add(self.my_video)
                self.page.update())

Describe the results you received: crash without errors.

Describe the results you expected: Just a video player which can switch episodes.

Additional information you deem important (e.g. issue happens only occasionally):

Flet version (pip show flet):

(Name: flet
Version: 0.22.0
Summary: Flet for Python - easily build interactive multi-platform apps in Python
Home-page:
Author: Appveyor Systems Inc.
Author-email: [email protected]
License: Apache-2.0
Location: C:\Users\lance\PycharmProjects\anime-ui\.venv\Lib\site-packages
Requires: cookiecutter, fastapi, flet-runtime, packaging, qrcode, uvicorn, watchdog
Required-by: flet-ivid
)

Give your requirements.txt file (don't pip freeze, instead give direct packages):

(anicli_api==0.6.4,shikimori-api==1.0.1,fastapi==0.110.1
flet==0.22.0
flet-core==0.22.0
flet-runtime==0.22.0,chompjs==1.2.3)

Operating system: Windows 11 (23H2).

lanceqqe avatar Apr 13 '24 12:04 lanceqqe

How to test all this? Can you share the necessary links, code repro, etc ?

ndonkoHenri avatar Apr 13 '24 15:04 ndonkoHenri

Collaborator

def test(page:ft.Page): playlist_video = ft.VideoMedia("https://ruby.yagami-light.com/l3/l38qg9rX6yw/5ed8dec4d0e8b.mpd") my_video = ft.Container( content=ft.Video(playlist=playlist_video, playlist_mode=None, filter_quality=ft.FilterQuality.HIGH, expand=True, aspect_ratio=16 / 9, autoplay=True)) page.add(my_video, my_video) page.update()

ft.app(target=test)

lanceqqe avatar Apr 13 '24 18:04 lanceqqe

link is valid, u can check it by cmd: mpv https://ruby.yagami-light.com/l3/l38qg9rX6yw/5ed8dec4d0e8b.mpd

lanceqqe avatar Apr 13 '24 18:04 lanceqqe

How to test all this? Can you share the necessary links, code repro, etc ?

sorry that it all not in one reply, but if u change url to https://lily.yagami-light.com/l3/l38qg9rX6yw/master_device.m3u8, same file but in m3u8, u able to create 2 video players with same file, but with mpd u wont, and u cant change episode cuz u get crash too

lanceqqe avatar Apr 13 '24 18:04 lanceqqe

Thanks for the repro code. I think I might not be able to understand fully the error you are describing. I tried both URLs and the video player showed up as expected.

Will appreciate if you could help me better understand. Perhaps with a screen record of the issue?

ndonkoHenri avatar Apr 14 '24 00:04 ndonkoHenri

Thanks for the repro code. I think I might not be able to understand fully the error you are describing. I tried both URLs and the video player showed up as expected.

Will appreciate if you could help me better understand. Perhaps with a screen record of the issue?

I use flet for the anime video player and after changing the episode, I remove the player from the container using controls.remove to add a new one after, and if I add a new player that plays an mpd file, then my program crashes instantly.

https://youtu.be/rzLWW1RClEU

lanceqqe avatar Apr 14 '24 01:04 lanceqqe

Thanks for the repro code. I think I might not be able to understand fully the error you are describing. I tried both URLs and the video player showed up as expected.

Will appreciate if you could help me better understand. Perhaps with a screen record of the issue?

is there any chance of fixing this?

lanceqqe avatar Apr 15 '24 07:04 lanceqqe

Here is what I get on my MacOS:

https://github.com/flet-dev/flet/assets/98978078/fc2f2628-ce50-4802-b492-540458613504

This is perhaps an OS-specific issue?

ndonkoHenri avatar Apr 16 '24 08:04 ndonkoHenri

Here is what I get on my MacOS:

Bildschirmaufnahme.2024-04-16.um.10.11.49.mov This is perhaps an OS-specific issue?

create 2 players in the same window

lanceqqe avatar Apr 16 '24 15:04 lanceqqe

Here is what I get on my MacOS: Bildschirmaufnahme.2024-04-16.um.10.11.49.mov This is perhaps an OS-specific issue?

create 2 players in the same window

did u try?

lanceqqe avatar Apr 18 '24 18:04 lanceqqe

Yeah, it works too:

https://github.com/flet-dev/flet/assets/98978078/76f59e68-1647-48ed-ae87-03d8743746d7

ndonkoHenri avatar Apr 19 '24 07:04 ndonkoHenri

Yeah, it works too:

Bildschirmaufnahme.2024-04-19.um.09.15.29.mov

it would be nice if someone else with windows tried it. I tried on my laptop with win11, same.

lanceqqe avatar Apr 19 '24 21:04 lanceqqe