video.py 735 B

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