video.py 963 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. """Wrapping of the next-video component."""
  2. from reflex.components.component import Component
  3. from reflex.utils import console
  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@2.2.0"
  10. is_default = True
  11. # the URL
  12. src: Var[str]
  13. as_: Component | None
  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. console.deprecate(
  24. "next-video",
  25. "The next-video component is deprecated. Use `rx.video` instead.",
  26. deprecation_version="0.7.11",
  27. removal_version="0.8.0",
  28. )
  29. return super().create(*children, **props)