Skip to content

Commit 1a8d33d

Browse files
authored
remove height and with from rx video (#5210)
1 parent b8a0855 commit 1a8d33d

File tree

2 files changed

+24
-10
lines changed

2 files changed

+24
-10
lines changed

pyi_hashes.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,9 @@
111111
"reflex/components/radix/themes/typography/heading.pyi": "5a3b0b8e44bda0fce22c6b1a1f25e68e",
112112
"reflex/components/radix/themes/typography/link.pyi": "45965d95b9f9b76f8f4a3084a5430194",
113113
"reflex/components/radix/themes/typography/text.pyi": "e6aa0ca43ebbd42701a3c72c0312032e",
114-
"reflex/components/react_player/audio.pyi": "972975ed0ba3e1dc4a867da20b11ae8e",
115-
"reflex/components/react_player/react_player.pyi": "63ffffbc24907103f797dcfd85894107",
116-
"reflex/components/react_player/video.pyi": "35ce5ad62e8bff17d9c09d27c362f8dc",
114+
"reflex/components/react_player/audio.pyi": "18fb682ec86d1b44682e1903dff11794",
115+
"reflex/components/react_player/react_player.pyi": "171d829b30c1c0c62e49e4a21cffe50f",
116+
"reflex/components/react_player/video.pyi": "5c93cfe85ba4dcadfddae94a2e36bb4e",
117117
"reflex/components/recharts/__init__.pyi": "a52c9055e37c6ee25ded15688d45e8a5",
118118
"reflex/components/recharts/cartesian.pyi": "9dd16c08abe5205c6c414474e2de2f79",
119119
"reflex/components/recharts/charts.pyi": "3570af4627c601d10ee37033f1b2329c",

reflex/components/react_player/react_player.py

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from typing import TypedDict
5+
from typing import Any, TypedDict
66

77
from reflex.components.component import NoSSRComponent
88
from reflex.event import EventHandler, no_args_event_spec, passthrough_event_spec
@@ -50,12 +50,6 @@ class ReactPlayer(NoSSRComponent):
5050
# Mutes the player
5151
muted: Var[bool]
5252

53-
# Set the width of the player: ex:640px
54-
width: Var[str]
55-
56-
# Set the height of the player: ex:640px
57-
height: Var[str]
58-
5953
# Called when media is loaded and ready to play. If playing is set to true, media will play immediately.
6054
on_ready: EventHandler[no_args_event_spec]
6155

@@ -103,3 +97,23 @@ class ReactPlayer(NoSSRComponent):
10397

10498
# Called when picture-in-picture mode is disabled.
10599
on_disable_pip: EventHandler[no_args_event_spec]
100+
101+
def _render(self, props: dict[str, Any] | None = None):
102+
"""Render the component. Adds width and height set to None because
103+
react-player will set them to some random value that overrides the
104+
css width and height.
105+
106+
Args:
107+
props: The props to pass to the component.
108+
109+
Returns:
110+
The rendered component.
111+
"""
112+
return (
113+
super()
114+
._render(props)
115+
.add_props(
116+
width=Var.create(None),
117+
height=Var.create(None),
118+
)
119+
)

0 commit comments

Comments
 (0)