From 1e736b0959751e02ec9c623656dff0307b9c640c Mon Sep 17 00:00:00 2001 From: Lendemor Date: Thu, 22 Feb 2024 20:44:25 +0100 Subject: [PATCH 1/5] add event triggers for rx.video --- .../components/react_player/react_player.py | 27 ++++++++++++++ .../components/react_player/react_player.pyi | 35 +++++++++++-------- 2 files changed, 47 insertions(+), 15 deletions(-) diff --git a/reflex/components/react_player/react_player.py b/reflex/components/react_player/react_player.py index 2e09d4bf9c..dda3ca1c57 100644 --- a/reflex/components/react_player/react_player.py +++ b/reflex/components/react_player/react_player.py @@ -2,6 +2,8 @@ from __future__ import annotations +from typing import Any, Dict + from reflex.components.component import NoSSRComponent from reflex.vars import Var @@ -43,3 +45,28 @@ class ReactPlayer(NoSSRComponent): # Set the height of the player: ex:640px height: Var[str] + + def get_event_triggers(self) -> Dict[str, Any]: + """Get the event triggers. + + Returns: + The event triggers. + """ + return { + "onReady": lambda: [], + "onStart": lambda: [], + "onPlay": lambda: [], + "onProgress": lambda e0: [e0], + "onDuration": lambda e0: [e0], + "onPause": lambda: [], + "onBuffer": lambda: [], + "onBufferEnd": lambda: [], + "onSeek": lambda second: [second], + "onPlaybackRateChange": lambda e0: [], + "onPlaybackQualityChange": lambda e0: [], + "on_ended": lambda: [], # do not fire if loop=True + "on_error": lambda: [], + "on_click_preview": lambda: [], + "onEnablePIP": lambda: [], + "onDisablePIP": lambda: [], + } diff --git a/reflex/components/react_player/react_player.pyi b/reflex/components/react_player/react_player.pyi index 49ab91ab11..5c8b342b1b 100644 --- a/reflex/components/react_player/react_player.pyi +++ b/reflex/components/react_player/react_player.pyi @@ -7,10 +7,12 @@ from typing import Any, Dict, Literal, Optional, Union, overload from reflex.vars import Var, BaseVar, ComputedVar from reflex.event import EventChain, EventHandler, EventSpec from reflex.style import Style +from typing import Any, Dict from reflex.components.component import NoSSRComponent from reflex.vars import Var class ReactPlayer(NoSSRComponent): + def get_event_triggers(self) -> Dict[str, Any]: ... @overload @classmethod def create( # type: ignore @@ -31,49 +33,52 @@ class ReactPlayer(NoSSRComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[ + onBuffer: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - on_click: Optional[ + onBufferEnd: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - on_context_menu: Optional[ + onDisablePIP: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - on_double_click: Optional[ + onDuration: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - on_focus: Optional[ + onEnablePIP: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - on_mount: Optional[ + onPause: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - on_mouse_down: Optional[ + onPlay: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - on_mouse_enter: Optional[ + onPlaybackQualityChange: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - on_mouse_leave: Optional[ + onPlaybackRateChange: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - on_mouse_move: Optional[ + onProgress: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - on_mouse_out: Optional[ + onReady: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - on_mouse_over: Optional[ + onSeek: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - on_mouse_up: Optional[ + onStart: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - on_scroll: Optional[ + on_click_preview: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - on_unmount: Optional[ + on_ended: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_error: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, **props From 38b2d1750bad9c1fbd5fe6eb47a55a8c819a4b34 Mon Sep 17 00:00:00 2001 From: Lendemor Date: Thu, 22 Feb 2024 21:09:23 +0100 Subject: [PATCH 2/5] add pyi for audio/video --- reflex/components/react_player/audio.pyi | 33 +++++++++++++----------- reflex/components/react_player/video.pyi | 33 +++++++++++++----------- 2 files changed, 36 insertions(+), 30 deletions(-) diff --git a/reflex/components/react_player/audio.pyi b/reflex/components/react_player/audio.pyi index d45dbcdafd..b562e77685 100644 --- a/reflex/components/react_player/audio.pyi +++ b/reflex/components/react_player/audio.pyi @@ -32,49 +32,52 @@ class Audio(ReactPlayer): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[ + onBuffer: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - on_click: Optional[ + onBufferEnd: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - on_context_menu: Optional[ + onDisablePIP: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - on_double_click: Optional[ + onDuration: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - on_focus: Optional[ + onEnablePIP: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - on_mount: Optional[ + onPause: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - on_mouse_down: Optional[ + onPlay: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - on_mouse_enter: Optional[ + onPlaybackQualityChange: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - on_mouse_leave: Optional[ + onPlaybackRateChange: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - on_mouse_move: Optional[ + onProgress: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - on_mouse_out: Optional[ + onReady: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - on_mouse_over: Optional[ + onSeek: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - on_mouse_up: Optional[ + onStart: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - on_scroll: Optional[ + on_click_preview: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - on_unmount: Optional[ + on_ended: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_error: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, **props diff --git a/reflex/components/react_player/video.pyi b/reflex/components/react_player/video.pyi index a3c447cb02..36862addd5 100644 --- a/reflex/components/react_player/video.pyi +++ b/reflex/components/react_player/video.pyi @@ -32,49 +32,52 @@ class Video(ReactPlayer): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[ + onBuffer: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - on_click: Optional[ + onBufferEnd: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - on_context_menu: Optional[ + onDisablePIP: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - on_double_click: Optional[ + onDuration: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - on_focus: Optional[ + onEnablePIP: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - on_mount: Optional[ + onPause: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - on_mouse_down: Optional[ + onPlay: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - on_mouse_enter: Optional[ + onPlaybackQualityChange: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - on_mouse_leave: Optional[ + onPlaybackRateChange: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - on_mouse_move: Optional[ + onProgress: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - on_mouse_out: Optional[ + onReady: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - on_mouse_over: Optional[ + onSeek: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - on_mouse_up: Optional[ + onStart: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - on_scroll: Optional[ + on_click_preview: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - on_unmount: Optional[ + on_ended: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_error: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, **props From 4b44026b60d67bd5396f69737605139d95b1e272 Mon Sep 17 00:00:00 2001 From: Lendemor Date: Fri, 23 Feb 2024 15:14:40 +0100 Subject: [PATCH 3/5] use snake_case --- .../components/react_player/react_player.py | 26 +++++++-------- .../components/react_player/react_player.pyi | 32 +++++++++---------- 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/reflex/components/react_player/react_player.py b/reflex/components/react_player/react_player.py index dda3ca1c57..96071e772f 100644 --- a/reflex/components/react_player/react_player.py +++ b/reflex/components/react_player/react_player.py @@ -53,20 +53,20 @@ def get_event_triggers(self) -> Dict[str, Any]: The event triggers. """ return { - "onReady": lambda: [], - "onStart": lambda: [], - "onPlay": lambda: [], - "onProgress": lambda e0: [e0], - "onDuration": lambda e0: [e0], - "onPause": lambda: [], - "onBuffer": lambda: [], - "onBufferEnd": lambda: [], - "onSeek": lambda second: [second], - "onPlaybackRateChange": lambda e0: [], - "onPlaybackQualityChange": lambda e0: [], + "on_ready": lambda: [], + "on_start": lambda: [], + "on_play": lambda: [], + "on_progress": lambda e0: [e0], + "on_duration": lambda e0: [e0], + "on_pause": lambda: [], + "on_buffer": lambda: [], + "on_buffer_end": lambda: [], + "on_seek": lambda second: [second], + "on_playback_rate_change": lambda e0: [], + "on_playback_quality_change": lambda e0: [], "on_ended": lambda: [], # do not fire if loop=True "on_error": lambda: [], "on_click_preview": lambda: [], - "onEnablePIP": lambda: [], - "onDisablePIP": lambda: [], + "on_enable_pip": lambda: [], + "on_disable_pip": lambda: [], } diff --git a/reflex/components/react_player/react_player.pyi b/reflex/components/react_player/react_player.pyi index 5c8b342b1b..5d137d87de 100644 --- a/reflex/components/react_player/react_player.pyi +++ b/reflex/components/react_player/react_player.pyi @@ -33,52 +33,52 @@ class ReactPlayer(NoSSRComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - onBuffer: Optional[ + on_buffer: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - onBufferEnd: Optional[ + on_buffer_end: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - onDisablePIP: Optional[ + on_click_preview: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - onDuration: Optional[ + on_disable_pip: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - onEnablePIP: Optional[ + on_duration: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - onPause: Optional[ + on_enable_pip: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - onPlay: Optional[ + on_ended: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - onPlaybackQualityChange: Optional[ + on_error: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - onPlaybackRateChange: Optional[ + on_pause: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - onProgress: Optional[ + on_play: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - onReady: Optional[ + on_playback_quality_change: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - onSeek: Optional[ + on_playback_rate_change: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - onStart: Optional[ + on_progress: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - on_click_preview: Optional[ + on_ready: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - on_ended: Optional[ + on_seek: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - on_error: Optional[ + on_start: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, **props From 1fb1201435fc88d6a4001c08f71a3644b9f305d7 Mon Sep 17 00:00:00 2001 From: Masen Furer Date: Tue, 11 Jun 2024 10:54:10 -0700 Subject: [PATCH 4/5] Use new-style EventHandler props with comments Allow the PR to pass reflex-web integration test now that inline comments are respected for EventHandler props. --- .../components/react_player/react_player.py | 74 ++++++++++++------- .../components/react_player/react_player.pyi | 48 +++++++++++- 2 files changed, 94 insertions(+), 28 deletions(-) diff --git a/reflex/components/react_player/react_player.py b/reflex/components/react_player/react_player.py index 96071e772f..1c9b20cead 100644 --- a/reflex/components/react_player/react_player.py +++ b/reflex/components/react_player/react_player.py @@ -2,9 +2,8 @@ from __future__ import annotations -from typing import Any, Dict - from reflex.components.component import NoSSRComponent +from reflex.event import EventHandler from reflex.vars import Var @@ -46,27 +45,50 @@ class ReactPlayer(NoSSRComponent): # Set the height of the player: ex:640px height: Var[str] - def get_event_triggers(self) -> Dict[str, Any]: - """Get the event triggers. - - Returns: - The event triggers. - """ - return { - "on_ready": lambda: [], - "on_start": lambda: [], - "on_play": lambda: [], - "on_progress": lambda e0: [e0], - "on_duration": lambda e0: [e0], - "on_pause": lambda: [], - "on_buffer": lambda: [], - "on_buffer_end": lambda: [], - "on_seek": lambda second: [second], - "on_playback_rate_change": lambda e0: [], - "on_playback_quality_change": lambda e0: [], - "on_ended": lambda: [], # do not fire if loop=True - "on_error": lambda: [], - "on_click_preview": lambda: [], - "on_enable_pip": lambda: [], - "on_disable_pip": lambda: [], - } + # Called when media is loaded and ready to play. If playing is set to true, media will play immediately. + on_ready: EventHandler[lambda: []] + + # Called when media starts playing. + on_start: EventHandler[lambda: []] + + # Called when media starts or resumes playing after pausing or buffering. + on_play: EventHandler[lambda: []] + + # Callback containing played and loaded progress as a fraction, and playedSeconds and loadedSeconds in seconds. eg { played: 0.12, playedSeconds: 11.3, loaded: 0.34, loadedSeconds: 16.7 } + on_progress: EventHandler[lambda progress: [progress]] + + # Callback containing duration of the media, in seconds. + on_duration: EventHandler[lambda seconds: [seconds]] + + # Called when media is paused. + on_pause: EventHandler[lambda: []] + + # Called when media starts buffering. + on_buffer: EventHandler[lambda: []] + + # Called when media has finished buffering. Works for files, YouTube and Facebook. + on_buffer_end: EventHandler[lambda: []] + + # Called when media seeks with seconds parameter. + on_seek: EventHandler[lambda seconds: [seconds]] + + # Called when playback rate of the player changed. Only supported by YouTube, Vimeo (if enabled), Wistia, and file paths. + on_playback_rate_change: EventHandler[lambda e0: []] + + # Called when playback quality of the player changed. Only supported by YouTube (if enabled). + on_playback_quality_change: EventHandler[lambda e0: []] + + # Called when media finishes playing. Does not fire when loop is set to true. + on_ended: EventHandler[lambda: []] + + # Called when an error occurs whilst attempting to play media. + on_error: EventHandler[lambda: []] + + # Called when user clicks the light mode preview. + on_click_preview: EventHandler[lambda: []] + + # Called when picture-in-picture mode is enabled. + on_enable_pip: EventHandler[lambda: []] + + # Called when picture-in-picture mode is disabled. + on_disable_pip: EventHandler[lambda: []] diff --git a/reflex/components/react_player/react_player.pyi b/reflex/components/react_player/react_player.pyi index aa7592f32a..476df21cd6 100644 --- a/reflex/components/react_player/react_player.pyi +++ b/reflex/components/react_player/react_player.pyi @@ -7,12 +7,11 @@ from typing import Any, Dict, Literal, Optional, Union, overload from reflex.vars import Var, BaseVar, ComputedVar from reflex.event import EventChain, EventHandler, EventSpec from reflex.style import Style -from typing import Any, Dict from reflex.components.component import NoSSRComponent +from reflex.event import EventHandler from reflex.vars import Var class ReactPlayer(NoSSRComponent): - def get_event_triggers(self) -> Dict[str, Any]: ... @overload @classmethod def create( # type: ignore @@ -33,18 +32,30 @@ class ReactPlayer(NoSSRComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, on_buffer: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, on_buffer_end: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, on_click_preview: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, on_disable_pip: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, on_duration: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, @@ -57,6 +68,33 @@ class ReactPlayer(NoSSRComponent): on_error: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, on_pause: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, @@ -75,12 +113,18 @@ class ReactPlayer(NoSSRComponent): on_ready: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, on_seek: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, on_start: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, **props ) -> "ReactPlayer": """Create the component. From 70561bcd5107c2c10fa1dcc00de386327fdc1853 Mon Sep 17 00:00:00 2001 From: Masen Furer Date: Tue, 11 Jun 2024 10:56:54 -0700 Subject: [PATCH 5/5] regenerate pyi files --- reflex/components/react_player/audio.pyi | 77 +++++++++++++++++++----- reflex/components/react_player/video.pyi | 77 +++++++++++++++++++----- 2 files changed, 122 insertions(+), 32 deletions(-) diff --git a/reflex/components/react_player/audio.pyi b/reflex/components/react_player/audio.pyi index 178b178560..2874117ae9 100644 --- a/reflex/components/react_player/audio.pyi +++ b/reflex/components/react_player/audio.pyi @@ -32,52 +32,97 @@ class Audio(ReactPlayer): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - onBuffer: Optional[ + on_blur: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - onBufferEnd: Optional[ + on_buffer: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - onDisablePIP: Optional[ + on_buffer_end: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - onDuration: Optional[ + on_click: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - onEnablePIP: Optional[ + on_click_preview: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - onPause: Optional[ + on_context_menu: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - onPlay: Optional[ + on_disable_pip: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - onPlaybackQualityChange: Optional[ + on_double_click: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - onPlaybackRateChange: Optional[ + on_duration: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - onProgress: Optional[ + on_enable_pip: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - onReady: Optional[ + on_ended: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - onSeek: Optional[ + on_error: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - onStart: Optional[ + on_focus: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - on_click_preview: Optional[ + on_mount: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - on_ended: Optional[ + on_mouse_down: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - on_error: Optional[ + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_pause: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_play: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_playback_quality_change: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_playback_rate_change: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_progress: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_ready: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_seek: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_start: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_unmount: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, **props diff --git a/reflex/components/react_player/video.pyi b/reflex/components/react_player/video.pyi index be51efe5c2..88c5ed359b 100644 --- a/reflex/components/react_player/video.pyi +++ b/reflex/components/react_player/video.pyi @@ -32,52 +32,97 @@ class Video(ReactPlayer): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - onBuffer: Optional[ + on_blur: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - onBufferEnd: Optional[ + on_buffer: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - onDisablePIP: Optional[ + on_buffer_end: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - onDuration: Optional[ + on_click: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - onEnablePIP: Optional[ + on_click_preview: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - onPause: Optional[ + on_context_menu: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - onPlay: Optional[ + on_disable_pip: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - onPlaybackQualityChange: Optional[ + on_double_click: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - onPlaybackRateChange: Optional[ + on_duration: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - onProgress: Optional[ + on_enable_pip: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - onReady: Optional[ + on_ended: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - onSeek: Optional[ + on_error: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - onStart: Optional[ + on_focus: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - on_click_preview: Optional[ + on_mount: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - on_ended: Optional[ + on_mouse_down: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, - on_error: Optional[ + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_pause: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_play: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_playback_quality_change: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_playback_rate_change: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_progress: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_ready: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_seek: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_start: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_unmount: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, **props