video.py 703 B

12345678910111213141516171819202122232425262728293031
  1. """Wrapping of the next-video component."""
  2. from reflex.components.component import Component
  3. from reflex.vars.base import Var
  4. from .base import NextComponent
  5. class Video(NextComponent):
  6. """A video component from NextJS."""
  7. tag = "Video"
  8. library = "next-video"
  9. is_default = True
  10. # the URL
  11. src: Var[str]
  12. as_: Component | None
  13. @classmethod
  14. def create(cls, *children, **props) -> NextComponent:
  15. """Create a Video component.
  16. Args:
  17. *children: The children of the component.
  18. **props: The props of the component.
  19. Returns:
  20. The Video component.
  21. """
  22. return super().create(*children, **props)