class_videostreamplayer.rst 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/VideoStreamPlayer.xml.
  6. .. _class_VideoStreamPlayer:
  7. VideoStreamPlayer
  8. =================
  9. **Inherits:** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. Control for playing video streams.
  11. Description
  12. -----------
  13. Control node for playing video streams using :ref:`VideoStream<class_VideoStream>` resources.
  14. Supported video formats are `Ogg Theora <https://www.theora.org/>`__ (``.ogv``, :ref:`VideoStreamTheora<class_VideoStreamTheora>`) and any format exposed via a GDExtension plugin.
  15. \ **Note:** Due to a bug, VideoStreamPlayer does not support localization remapping yet.
  16. \ **Warning:** On HTML5, video playback *will* perform poorly due to missing architecture-specific assembly optimizations.
  17. Properties
  18. ----------
  19. +---------------------------------------+--------------------------------------------------------------------------+---------------+
  20. | :ref:`int<class_int>` | :ref:`audio_track<class_VideoStreamPlayer_property_audio_track>` | ``0`` |
  21. +---------------------------------------+--------------------------------------------------------------------------+---------------+
  22. | :ref:`bool<class_bool>` | :ref:`autoplay<class_VideoStreamPlayer_property_autoplay>` | ``false`` |
  23. +---------------------------------------+--------------------------------------------------------------------------+---------------+
  24. | :ref:`int<class_int>` | :ref:`buffering_msec<class_VideoStreamPlayer_property_buffering_msec>` | ``500`` |
  25. +---------------------------------------+--------------------------------------------------------------------------+---------------+
  26. | :ref:`StringName<class_StringName>` | :ref:`bus<class_VideoStreamPlayer_property_bus>` | ``&"Master"`` |
  27. +---------------------------------------+--------------------------------------------------------------------------+---------------+
  28. | :ref:`bool<class_bool>` | :ref:`expand<class_VideoStreamPlayer_property_expand>` | ``false`` |
  29. +---------------------------------------+--------------------------------------------------------------------------+---------------+
  30. | :ref:`bool<class_bool>` | :ref:`paused<class_VideoStreamPlayer_property_paused>` | ``false`` |
  31. +---------------------------------------+--------------------------------------------------------------------------+---------------+
  32. | :ref:`VideoStream<class_VideoStream>` | :ref:`stream<class_VideoStreamPlayer_property_stream>` | |
  33. +---------------------------------------+--------------------------------------------------------------------------+---------------+
  34. | :ref:`float<class_float>` | :ref:`stream_position<class_VideoStreamPlayer_property_stream_position>` | |
  35. +---------------------------------------+--------------------------------------------------------------------------+---------------+
  36. | :ref:`float<class_float>` | :ref:`volume<class_VideoStreamPlayer_property_volume>` | |
  37. +---------------------------------------+--------------------------------------------------------------------------+---------------+
  38. | :ref:`float<class_float>` | :ref:`volume_db<class_VideoStreamPlayer_property_volume_db>` | ``0.0`` |
  39. +---------------------------------------+--------------------------------------------------------------------------+---------------+
  40. Methods
  41. -------
  42. +-----------------------------------+------------------------------------------------------------------------------------------------+
  43. | :ref:`String<class_String>` | :ref:`get_stream_name<class_VideoStreamPlayer_method_get_stream_name>` **(** **)** |const| |
  44. +-----------------------------------+------------------------------------------------------------------------------------------------+
  45. | :ref:`Texture2D<class_Texture2D>` | :ref:`get_video_texture<class_VideoStreamPlayer_method_get_video_texture>` **(** **)** |const| |
  46. +-----------------------------------+------------------------------------------------------------------------------------------------+
  47. | :ref:`bool<class_bool>` | :ref:`is_playing<class_VideoStreamPlayer_method_is_playing>` **(** **)** |const| |
  48. +-----------------------------------+------------------------------------------------------------------------------------------------+
  49. | void | :ref:`play<class_VideoStreamPlayer_method_play>` **(** **)** |
  50. +-----------------------------------+------------------------------------------------------------------------------------------------+
  51. | void | :ref:`stop<class_VideoStreamPlayer_method_stop>` **(** **)** |
  52. +-----------------------------------+------------------------------------------------------------------------------------------------+
  53. Signals
  54. -------
  55. .. _class_VideoStreamPlayer_signal_finished:
  56. - **finished** **(** **)**
  57. Emitted when playback is finished.
  58. Property Descriptions
  59. ---------------------
  60. .. _class_VideoStreamPlayer_property_audio_track:
  61. - :ref:`int<class_int>` **audio_track**
  62. +-----------+------------------------+
  63. | *Default* | ``0`` |
  64. +-----------+------------------------+
  65. | *Setter* | set_audio_track(value) |
  66. +-----------+------------------------+
  67. | *Getter* | get_audio_track() |
  68. +-----------+------------------------+
  69. The embedded audio track to play.
  70. ----
  71. .. _class_VideoStreamPlayer_property_autoplay:
  72. - :ref:`bool<class_bool>` **autoplay**
  73. +-----------+---------------------+
  74. | *Default* | ``false`` |
  75. +-----------+---------------------+
  76. | *Setter* | set_autoplay(value) |
  77. +-----------+---------------------+
  78. | *Getter* | has_autoplay() |
  79. +-----------+---------------------+
  80. If ``true``, playback starts when the scene loads.
  81. ----
  82. .. _class_VideoStreamPlayer_property_buffering_msec:
  83. - :ref:`int<class_int>` **buffering_msec**
  84. +-----------+---------------------------+
  85. | *Default* | ``500`` |
  86. +-----------+---------------------------+
  87. | *Setter* | set_buffering_msec(value) |
  88. +-----------+---------------------------+
  89. | *Getter* | get_buffering_msec() |
  90. +-----------+---------------------------+
  91. Amount of time in milliseconds to store in buffer while playing.
  92. ----
  93. .. _class_VideoStreamPlayer_property_bus:
  94. - :ref:`StringName<class_StringName>` **bus**
  95. +-----------+----------------+
  96. | *Default* | ``&"Master"`` |
  97. +-----------+----------------+
  98. | *Setter* | set_bus(value) |
  99. +-----------+----------------+
  100. | *Getter* | get_bus() |
  101. +-----------+----------------+
  102. Audio bus to use for sound playback.
  103. ----
  104. .. _class_VideoStreamPlayer_property_expand:
  105. - :ref:`bool<class_bool>` **expand**
  106. +-----------+-------------------+
  107. | *Default* | ``false`` |
  108. +-----------+-------------------+
  109. | *Setter* | set_expand(value) |
  110. +-----------+-------------------+
  111. | *Getter* | has_expand() |
  112. +-----------+-------------------+
  113. If ``true``, the video scales to the control size. Otherwise, the control minimum size will be automatically adjusted to match the video stream's dimensions.
  114. ----
  115. .. _class_VideoStreamPlayer_property_paused:
  116. - :ref:`bool<class_bool>` **paused**
  117. +-----------+-------------------+
  118. | *Default* | ``false`` |
  119. +-----------+-------------------+
  120. | *Setter* | set_paused(value) |
  121. +-----------+-------------------+
  122. | *Getter* | is_paused() |
  123. +-----------+-------------------+
  124. If ``true``, the video is paused.
  125. ----
  126. .. _class_VideoStreamPlayer_property_stream:
  127. - :ref:`VideoStream<class_VideoStream>` **stream**
  128. +----------+-------------------+
  129. | *Setter* | set_stream(value) |
  130. +----------+-------------------+
  131. | *Getter* | get_stream() |
  132. +----------+-------------------+
  133. The assigned video stream. See description for supported formats.
  134. ----
  135. .. _class_VideoStreamPlayer_property_stream_position:
  136. - :ref:`float<class_float>` **stream_position**
  137. +----------+----------------------------+
  138. | *Setter* | set_stream_position(value) |
  139. +----------+----------------------------+
  140. | *Getter* | get_stream_position() |
  141. +----------+----------------------------+
  142. The current position of the stream, in seconds.
  143. \ **Note:** Changing this value won't have any effect as seeking is not implemented yet, except in video formats implemented by a GDExtension add-on.
  144. ----
  145. .. _class_VideoStreamPlayer_property_volume:
  146. - :ref:`float<class_float>` **volume**
  147. +----------+-------------------+
  148. | *Setter* | set_volume(value) |
  149. +----------+-------------------+
  150. | *Getter* | get_volume() |
  151. +----------+-------------------+
  152. Audio volume as a linear value.
  153. ----
  154. .. _class_VideoStreamPlayer_property_volume_db:
  155. - :ref:`float<class_float>` **volume_db**
  156. +-----------+----------------------+
  157. | *Default* | ``0.0`` |
  158. +-----------+----------------------+
  159. | *Setter* | set_volume_db(value) |
  160. +-----------+----------------------+
  161. | *Getter* | get_volume_db() |
  162. +-----------+----------------------+
  163. Audio volume in dB.
  164. Method Descriptions
  165. -------------------
  166. .. _class_VideoStreamPlayer_method_get_stream_name:
  167. - :ref:`String<class_String>` **get_stream_name** **(** **)** |const|
  168. Returns the video stream's name, or ``"<No Stream>"`` if no video stream is assigned.
  169. ----
  170. .. _class_VideoStreamPlayer_method_get_video_texture:
  171. - :ref:`Texture2D<class_Texture2D>` **get_video_texture** **(** **)** |const|
  172. Returns the current frame as a :ref:`Texture2D<class_Texture2D>`.
  173. ----
  174. .. _class_VideoStreamPlayer_method_is_playing:
  175. - :ref:`bool<class_bool>` **is_playing** **(** **)** |const|
  176. Returns ``true`` if the video is playing.
  177. \ **Note:** The video is still considered playing if paused during playback.
  178. ----
  179. .. _class_VideoStreamPlayer_method_play:
  180. - void **play** **(** **)**
  181. Starts the video playback from the beginning. If the video is paused, this will not unpause the video.
  182. ----
  183. .. _class_VideoStreamPlayer_method_stop:
  184. - void **stop** **(** **)**
  185. Stops the video playback and sets the stream position to 0.
  186. \ **Note:** Although the stream position will be set to 0, the first frame of the video stream won't become the current frame.
  187. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  188. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  189. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  190. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  191. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  192. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`