video.py 757 B

1234567891011121314151617181920212223242526272829303132
  1. """Wrapping of the next-video component."""
  2. from typing import Optional
  3. from reflex.components.component import Component
  4. from reflex.vars import Var
  5. from .base import NextComponent
  6. class Video(NextComponent):
  7. """A video component from NextJS."""
  8. tag: str = "Video"
  9. library = "next-video"
  10. is_default: bool = True
  11. # the URL
  12. src: Optional[Var[str]] = None
  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)