audio.pyi 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. """Stub file for reflex/components/react_player/audio.py"""
  2. # ------------------- DO NOT EDIT ----------------------
  3. # This file was generated by `reflex/utils/pyi_generator.py`!
  4. # ------------------------------------------------------
  5. from typing import Any, Dict, Optional, Union, overload
  6. import reflex
  7. from reflex.components.react_player.react_player import ReactPlayer
  8. from reflex.event import BASE_STATE, EventType
  9. from reflex.style import Style
  10. from reflex.vars.base import Var
  11. class Audio(ReactPlayer):
  12. pass
  13. @overload
  14. @classmethod
  15. def create( # type: ignore
  16. cls,
  17. *children,
  18. url: Optional[Union[Var[str], str]] = None,
  19. playing: Optional[Union[Var[bool], bool]] = None,
  20. loop: Optional[Union[Var[bool], bool]] = None,
  21. controls: Optional[Union[Var[bool], bool]] = None,
  22. light: Optional[Union[Var[bool], bool]] = None,
  23. volume: Optional[Union[Var[float], float]] = None,
  24. muted: Optional[Union[Var[bool], bool]] = None,
  25. width: Optional[Union[Var[str], str]] = None,
  26. height: Optional[Union[Var[str], str]] = None,
  27. style: Optional[Style] = None,
  28. key: Optional[Any] = None,
  29. id: Optional[Any] = None,
  30. class_name: Optional[Any] = None,
  31. autofocus: Optional[bool] = None,
  32. custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
  33. on_blur: Optional[EventType[[], BASE_STATE]] = None,
  34. on_buffer: Optional[EventType[[], BASE_STATE]] = None,
  35. on_buffer_end: Optional[EventType[[], BASE_STATE]] = None,
  36. on_click: Optional[EventType[[], BASE_STATE]] = None,
  37. on_click_preview: Optional[EventType[[], BASE_STATE]] = None,
  38. on_context_menu: Optional[EventType[[], BASE_STATE]] = None,
  39. on_disable_pip: Optional[EventType[[], BASE_STATE]] = None,
  40. on_double_click: Optional[EventType[[], BASE_STATE]] = None,
  41. on_duration: Optional[
  42. Union[EventType[[], BASE_STATE], EventType[[float], BASE_STATE]]
  43. ] = None,
  44. on_enable_pip: Optional[EventType[[], BASE_STATE]] = None,
  45. on_ended: Optional[EventType[[], BASE_STATE]] = None,
  46. on_error: Optional[EventType[[], BASE_STATE]] = None,
  47. on_focus: Optional[EventType[[], BASE_STATE]] = None,
  48. on_mount: Optional[EventType[[], BASE_STATE]] = None,
  49. on_mouse_down: Optional[EventType[[], BASE_STATE]] = None,
  50. on_mouse_enter: Optional[EventType[[], BASE_STATE]] = None,
  51. on_mouse_leave: Optional[EventType[[], BASE_STATE]] = None,
  52. on_mouse_move: Optional[EventType[[], BASE_STATE]] = None,
  53. on_mouse_out: Optional[EventType[[], BASE_STATE]] = None,
  54. on_mouse_over: Optional[EventType[[], BASE_STATE]] = None,
  55. on_mouse_up: Optional[EventType[[], BASE_STATE]] = None,
  56. on_pause: Optional[EventType[[], BASE_STATE]] = None,
  57. on_play: Optional[EventType[[], BASE_STATE]] = None,
  58. on_playback_quality_change: Optional[EventType[[], BASE_STATE]] = None,
  59. on_playback_rate_change: Optional[EventType[[], BASE_STATE]] = None,
  60. on_progress: Optional[
  61. Union[
  62. EventType[[], BASE_STATE],
  63. EventType[
  64. [reflex.components.react_player.react_player.Progress], BASE_STATE
  65. ],
  66. ]
  67. ] = None,
  68. on_ready: Optional[EventType[[], BASE_STATE]] = None,
  69. on_scroll: Optional[EventType[[], BASE_STATE]] = None,
  70. on_seek: Optional[
  71. Union[EventType[[], BASE_STATE], EventType[[float], BASE_STATE]]
  72. ] = None,
  73. on_start: Optional[EventType[[], BASE_STATE]] = None,
  74. on_unmount: Optional[EventType[[], BASE_STATE]] = None,
  75. **props,
  76. ) -> "Audio":
  77. """Create the component.
  78. Args:
  79. *children: The children of the component.
  80. url: The url of a video or song to play
  81. playing: Set to true or false to pause or play the media
  82. loop: Set to true or false to loop the media
  83. controls: Set to true or false to display native player controls.
  84. light: Set to true to show just the video thumbnail, which loads the full player on click
  85. volume: Set the volume of the player, between 0 and 1
  86. muted: Mutes the player
  87. width: Set the width of the player: ex:640px
  88. height: Set the height of the player: ex:640px
  89. on_ready: Called when media is loaded and ready to play. If playing is set to true, media will play immediately.
  90. on_start: Called when media starts playing.
  91. on_play: Called when media starts or resumes playing after pausing or buffering.
  92. on_progress: Callback containing played and loaded progress as a fraction, and playedSeconds and loadedSeconds in seconds. eg { played: 0.12, playedSeconds: 11.3, loaded: 0.34, loadedSeconds: 16.7 }
  93. on_duration: Callback containing duration of the media, in seconds.
  94. on_pause: Called when media is paused.
  95. on_buffer: Called when media starts buffering.
  96. on_buffer_end: Called when media has finished buffering. Works for files, YouTube and Facebook.
  97. on_seek: Called when media seeks with seconds parameter.
  98. on_playback_rate_change: Called when playback rate of the player changed. Only supported by YouTube, Vimeo (if enabled), Wistia, and file paths.
  99. on_playback_quality_change: Called when playback quality of the player changed. Only supported by YouTube (if enabled).
  100. on_ended: Called when media finishes playing. Does not fire when loop is set to true.
  101. on_error: Called when an error occurs whilst attempting to play media.
  102. on_click_preview: Called when user clicks the light mode preview.
  103. on_enable_pip: Called when picture-in-picture mode is enabled.
  104. on_disable_pip: Called when picture-in-picture mode is disabled.
  105. style: The style of the component.
  106. key: A unique key for the component.
  107. id: The id for the component.
  108. class_name: The class name for the component.
  109. autofocus: Whether the component should take the focus once the page is loaded
  110. custom_attrs: custom attribute
  111. **props: The props of the component.
  112. Returns:
  113. The component.
  114. """
  115. ...