2
0

class_videoplayer.rst 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the VideoPlayer.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_VideoPlayer:
  6. VideoPlayer
  7. ===========
  8. **Inherits:** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  9. **Category:** Core
  10. Brief Description
  11. -----------------
  12. Control for playing video streams.
  13. Properties
  14. ----------
  15. +---------------------------------------+--------------------------------------------------------------------+----------+
  16. | :ref:`int<class_int>` | :ref:`audio_track<class_VideoPlayer_property_audio_track>` | 0 |
  17. +---------------------------------------+--------------------------------------------------------------------+----------+
  18. | :ref:`bool<class_bool>` | :ref:`autoplay<class_VideoPlayer_property_autoplay>` | false |
  19. +---------------------------------------+--------------------------------------------------------------------+----------+
  20. | :ref:`int<class_int>` | :ref:`buffering_msec<class_VideoPlayer_property_buffering_msec>` | 500 |
  21. +---------------------------------------+--------------------------------------------------------------------+----------+
  22. | :ref:`String<class_String>` | :ref:`bus<class_VideoPlayer_property_bus>` | "Master" |
  23. +---------------------------------------+--------------------------------------------------------------------+----------+
  24. | :ref:`bool<class_bool>` | :ref:`expand<class_VideoPlayer_property_expand>` | true |
  25. +---------------------------------------+--------------------------------------------------------------------+----------+
  26. | :ref:`bool<class_bool>` | :ref:`paused<class_VideoPlayer_property_paused>` | false |
  27. +---------------------------------------+--------------------------------------------------------------------+----------+
  28. | :ref:`VideoStream<class_VideoStream>` | :ref:`stream<class_VideoPlayer_property_stream>` | |
  29. +---------------------------------------+--------------------------------------------------------------------+----------+
  30. | :ref:`float<class_float>` | :ref:`stream_position<class_VideoPlayer_property_stream_position>` | |
  31. +---------------------------------------+--------------------------------------------------------------------+----------+
  32. | :ref:`float<class_float>` | :ref:`volume<class_VideoPlayer_property_volume>` | |
  33. +---------------------------------------+--------------------------------------------------------------------+----------+
  34. | :ref:`float<class_float>` | :ref:`volume_db<class_VideoPlayer_property_volume_db>` | 0.0 |
  35. +---------------------------------------+--------------------------------------------------------------------+----------+
  36. Methods
  37. -------
  38. +-------------------------------+------------------------------------------------------------------------------------+
  39. | :ref:`String<class_String>` | :ref:`get_stream_name<class_VideoPlayer_method_get_stream_name>` **(** **)** const |
  40. +-------------------------------+------------------------------------------------------------------------------------+
  41. | :ref:`Texture<class_Texture>` | :ref:`get_video_texture<class_VideoPlayer_method_get_video_texture>` **(** **)** |
  42. +-------------------------------+------------------------------------------------------------------------------------+
  43. | :ref:`bool<class_bool>` | :ref:`is_playing<class_VideoPlayer_method_is_playing>` **(** **)** const |
  44. +-------------------------------+------------------------------------------------------------------------------------+
  45. | void | :ref:`play<class_VideoPlayer_method_play>` **(** **)** |
  46. +-------------------------------+------------------------------------------------------------------------------------+
  47. | void | :ref:`stop<class_VideoPlayer_method_stop>` **(** **)** |
  48. +-------------------------------+------------------------------------------------------------------------------------+
  49. Signals
  50. -------
  51. .. _class_VideoPlayer_signal_finished:
  52. - **finished** **(** **)**
  53. Emitted when playback is finished.
  54. Description
  55. -----------
  56. Control node for playing video streams. Supported formats are `WebM <https://www.webmproject.org/>`_ and `Ogg Theora <https://www.theora.org/>`_.
  57. Property Descriptions
  58. ---------------------
  59. .. _class_VideoPlayer_property_audio_track:
  60. - :ref:`int<class_int>` **audio_track**
  61. +-----------+------------------------+
  62. | *Default* | 0 |
  63. +-----------+------------------------+
  64. | *Setter* | set_audio_track(value) |
  65. +-----------+------------------------+
  66. | *Getter* | get_audio_track() |
  67. +-----------+------------------------+
  68. The embedded audio track to play.
  69. .. _class_VideoPlayer_property_autoplay:
  70. - :ref:`bool<class_bool>` **autoplay**
  71. +-----------+---------------------+
  72. | *Default* | false |
  73. +-----------+---------------------+
  74. | *Setter* | set_autoplay(value) |
  75. +-----------+---------------------+
  76. | *Getter* | has_autoplay() |
  77. +-----------+---------------------+
  78. If ``true``, playback starts when the scene loads.
  79. .. _class_VideoPlayer_property_buffering_msec:
  80. - :ref:`int<class_int>` **buffering_msec**
  81. +-----------+---------------------------+
  82. | *Default* | 500 |
  83. +-----------+---------------------------+
  84. | *Setter* | set_buffering_msec(value) |
  85. +-----------+---------------------------+
  86. | *Getter* | get_buffering_msec() |
  87. +-----------+---------------------------+
  88. Amount of time in milliseconds to store in buffer while playing.
  89. .. _class_VideoPlayer_property_bus:
  90. - :ref:`String<class_String>` **bus**
  91. +-----------+----------------+
  92. | *Default* | "Master" |
  93. +-----------+----------------+
  94. | *Setter* | set_bus(value) |
  95. +-----------+----------------+
  96. | *Getter* | get_bus() |
  97. +-----------+----------------+
  98. Audio bus to use for sound playback.
  99. .. _class_VideoPlayer_property_expand:
  100. - :ref:`bool<class_bool>` **expand**
  101. +-----------+-------------------+
  102. | *Default* | true |
  103. +-----------+-------------------+
  104. | *Setter* | set_expand(value) |
  105. +-----------+-------------------+
  106. | *Getter* | has_expand() |
  107. +-----------+-------------------+
  108. If ``true``, the video scales to the control size.
  109. .. _class_VideoPlayer_property_paused:
  110. - :ref:`bool<class_bool>` **paused**
  111. +-----------+-------------------+
  112. | *Default* | false |
  113. +-----------+-------------------+
  114. | *Setter* | set_paused(value) |
  115. +-----------+-------------------+
  116. | *Getter* | is_paused() |
  117. +-----------+-------------------+
  118. If ``true``, the video is paused.
  119. .. _class_VideoPlayer_property_stream:
  120. - :ref:`VideoStream<class_VideoStream>` **stream**
  121. +----------+-------------------+
  122. | *Setter* | set_stream(value) |
  123. +----------+-------------------+
  124. | *Getter* | get_stream() |
  125. +----------+-------------------+
  126. .. _class_VideoPlayer_property_stream_position:
  127. - :ref:`float<class_float>` **stream_position**
  128. +----------+----------------------------+
  129. | *Setter* | set_stream_position(value) |
  130. +----------+----------------------------+
  131. | *Getter* | get_stream_position() |
  132. +----------+----------------------------+
  133. The current position of the stream, in seconds.
  134. .. _class_VideoPlayer_property_volume:
  135. - :ref:`float<class_float>` **volume**
  136. +----------+-------------------+
  137. | *Setter* | set_volume(value) |
  138. +----------+-------------------+
  139. | *Getter* | get_volume() |
  140. +----------+-------------------+
  141. Audio volume as a linear value.
  142. .. _class_VideoPlayer_property_volume_db:
  143. - :ref:`float<class_float>` **volume_db**
  144. +-----------+----------------------+
  145. | *Default* | 0.0 |
  146. +-----------+----------------------+
  147. | *Setter* | set_volume_db(value) |
  148. +-----------+----------------------+
  149. | *Getter* | get_volume_db() |
  150. +-----------+----------------------+
  151. Audio volume in dB.
  152. Method Descriptions
  153. -------------------
  154. .. _class_VideoPlayer_method_get_stream_name:
  155. - :ref:`String<class_String>` **get_stream_name** **(** **)** const
  156. Returns the video stream's name.
  157. .. _class_VideoPlayer_method_get_video_texture:
  158. - :ref:`Texture<class_Texture>` **get_video_texture** **(** **)**
  159. Returns the current frame as a :ref:`Texture<class_Texture>`.
  160. .. _class_VideoPlayer_method_is_playing:
  161. - :ref:`bool<class_bool>` **is_playing** **(** **)** const
  162. Returns ``true`` if the video is playing.
  163. .. _class_VideoPlayer_method_play:
  164. - void **play** **(** **)**
  165. Starts the video playback.
  166. .. _class_VideoPlayer_method_stop:
  167. - void **stop** **(** **)**
  168. Stops the video playback.