class_videostreamplayer.rst 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384
  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. A control used for video playback.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. A control used for playback of :ref:`VideoStream<class_VideoStream>` resources.
  15. Supported video formats are `Ogg Theora <https://www.theora.org/>`__ (``.ogv``, :ref:`VideoStreamTheora<class_VideoStreamTheora>`) and any format exposed via a GDExtension plugin.
  16. \ **Note:** Due to a bug, VideoStreamPlayer does not support localization remapping yet.
  17. \ **Warning:** On Web, video playback *will* perform poorly due to missing architecture-specific assembly optimizations.
  18. .. rst-class:: classref-reftable-group
  19. Properties
  20. ----------
  21. .. table::
  22. :widths: auto
  23. +---------------------------------------+--------------------------------------------------------------------------+---------------+
  24. | :ref:`int<class_int>` | :ref:`audio_track<class_VideoStreamPlayer_property_audio_track>` | ``0`` |
  25. +---------------------------------------+--------------------------------------------------------------------------+---------------+
  26. | :ref:`bool<class_bool>` | :ref:`autoplay<class_VideoStreamPlayer_property_autoplay>` | ``false`` |
  27. +---------------------------------------+--------------------------------------------------------------------------+---------------+
  28. | :ref:`int<class_int>` | :ref:`buffering_msec<class_VideoStreamPlayer_property_buffering_msec>` | ``500`` |
  29. +---------------------------------------+--------------------------------------------------------------------------+---------------+
  30. | :ref:`StringName<class_StringName>` | :ref:`bus<class_VideoStreamPlayer_property_bus>` | ``&"Master"`` |
  31. +---------------------------------------+--------------------------------------------------------------------------+---------------+
  32. | :ref:`bool<class_bool>` | :ref:`expand<class_VideoStreamPlayer_property_expand>` | ``false`` |
  33. +---------------------------------------+--------------------------------------------------------------------------+---------------+
  34. | :ref:`bool<class_bool>` | :ref:`loop<class_VideoStreamPlayer_property_loop>` | ``false`` |
  35. +---------------------------------------+--------------------------------------------------------------------------+---------------+
  36. | :ref:`bool<class_bool>` | :ref:`paused<class_VideoStreamPlayer_property_paused>` | ``false`` |
  37. +---------------------------------------+--------------------------------------------------------------------------+---------------+
  38. | :ref:`VideoStream<class_VideoStream>` | :ref:`stream<class_VideoStreamPlayer_property_stream>` | |
  39. +---------------------------------------+--------------------------------------------------------------------------+---------------+
  40. | :ref:`float<class_float>` | :ref:`stream_position<class_VideoStreamPlayer_property_stream_position>` | |
  41. +---------------------------------------+--------------------------------------------------------------------------+---------------+
  42. | :ref:`float<class_float>` | :ref:`volume<class_VideoStreamPlayer_property_volume>` | |
  43. +---------------------------------------+--------------------------------------------------------------------------+---------------+
  44. | :ref:`float<class_float>` | :ref:`volume_db<class_VideoStreamPlayer_property_volume_db>` | ``0.0`` |
  45. +---------------------------------------+--------------------------------------------------------------------------+---------------+
  46. .. rst-class:: classref-reftable-group
  47. Methods
  48. -------
  49. .. table::
  50. :widths: auto
  51. +-----------------------------------+------------------------------------------------------------------------------------------------+
  52. | :ref:`float<class_float>` | :ref:`get_stream_length<class_VideoStreamPlayer_method_get_stream_length>` **(** **)** |const| |
  53. +-----------------------------------+------------------------------------------------------------------------------------------------+
  54. | :ref:`String<class_String>` | :ref:`get_stream_name<class_VideoStreamPlayer_method_get_stream_name>` **(** **)** |const| |
  55. +-----------------------------------+------------------------------------------------------------------------------------------------+
  56. | :ref:`Texture2D<class_Texture2D>` | :ref:`get_video_texture<class_VideoStreamPlayer_method_get_video_texture>` **(** **)** |const| |
  57. +-----------------------------------+------------------------------------------------------------------------------------------------+
  58. | :ref:`bool<class_bool>` | :ref:`is_playing<class_VideoStreamPlayer_method_is_playing>` **(** **)** |const| |
  59. +-----------------------------------+------------------------------------------------------------------------------------------------+
  60. | void | :ref:`play<class_VideoStreamPlayer_method_play>` **(** **)** |
  61. +-----------------------------------+------------------------------------------------------------------------------------------------+
  62. | void | :ref:`stop<class_VideoStreamPlayer_method_stop>` **(** **)** |
  63. +-----------------------------------+------------------------------------------------------------------------------------------------+
  64. .. rst-class:: classref-section-separator
  65. ----
  66. .. rst-class:: classref-descriptions-group
  67. Signals
  68. -------
  69. .. _class_VideoStreamPlayer_signal_finished:
  70. .. rst-class:: classref-signal
  71. **finished** **(** **)**
  72. Emitted when playback is finished.
  73. .. rst-class:: classref-section-separator
  74. ----
  75. .. rst-class:: classref-descriptions-group
  76. Property Descriptions
  77. ---------------------
  78. .. _class_VideoStreamPlayer_property_audio_track:
  79. .. rst-class:: classref-property
  80. :ref:`int<class_int>` **audio_track** = ``0``
  81. .. rst-class:: classref-property-setget
  82. - void **set_audio_track** **(** :ref:`int<class_int>` value **)**
  83. - :ref:`int<class_int>` **get_audio_track** **(** **)**
  84. The embedded audio track to play.
  85. .. rst-class:: classref-item-separator
  86. ----
  87. .. _class_VideoStreamPlayer_property_autoplay:
  88. .. rst-class:: classref-property
  89. :ref:`bool<class_bool>` **autoplay** = ``false``
  90. .. rst-class:: classref-property-setget
  91. - void **set_autoplay** **(** :ref:`bool<class_bool>` value **)**
  92. - :ref:`bool<class_bool>` **has_autoplay** **(** **)**
  93. If ``true``, playback starts when the scene loads.
  94. .. rst-class:: classref-item-separator
  95. ----
  96. .. _class_VideoStreamPlayer_property_buffering_msec:
  97. .. rst-class:: classref-property
  98. :ref:`int<class_int>` **buffering_msec** = ``500``
  99. .. rst-class:: classref-property-setget
  100. - void **set_buffering_msec** **(** :ref:`int<class_int>` value **)**
  101. - :ref:`int<class_int>` **get_buffering_msec** **(** **)**
  102. Amount of time in milliseconds to store in buffer while playing.
  103. .. rst-class:: classref-item-separator
  104. ----
  105. .. _class_VideoStreamPlayer_property_bus:
  106. .. rst-class:: classref-property
  107. :ref:`StringName<class_StringName>` **bus** = ``&"Master"``
  108. .. rst-class:: classref-property-setget
  109. - void **set_bus** **(** :ref:`StringName<class_StringName>` value **)**
  110. - :ref:`StringName<class_StringName>` **get_bus** **(** **)**
  111. Audio bus to use for sound playback.
  112. .. rst-class:: classref-item-separator
  113. ----
  114. .. _class_VideoStreamPlayer_property_expand:
  115. .. rst-class:: classref-property
  116. :ref:`bool<class_bool>` **expand** = ``false``
  117. .. rst-class:: classref-property-setget
  118. - void **set_expand** **(** :ref:`bool<class_bool>` value **)**
  119. - :ref:`bool<class_bool>` **has_expand** **(** **)**
  120. 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.
  121. .. rst-class:: classref-item-separator
  122. ----
  123. .. _class_VideoStreamPlayer_property_loop:
  124. .. rst-class:: classref-property
  125. :ref:`bool<class_bool>` **loop** = ``false``
  126. .. rst-class:: classref-property-setget
  127. - void **set_loop** **(** :ref:`bool<class_bool>` value **)**
  128. - :ref:`bool<class_bool>` **has_loop** **(** **)**
  129. If ``true``, the video restarts when it reaches its end.
  130. .. rst-class:: classref-item-separator
  131. ----
  132. .. _class_VideoStreamPlayer_property_paused:
  133. .. rst-class:: classref-property
  134. :ref:`bool<class_bool>` **paused** = ``false``
  135. .. rst-class:: classref-property-setget
  136. - void **set_paused** **(** :ref:`bool<class_bool>` value **)**
  137. - :ref:`bool<class_bool>` **is_paused** **(** **)**
  138. If ``true``, the video is paused.
  139. .. rst-class:: classref-item-separator
  140. ----
  141. .. _class_VideoStreamPlayer_property_stream:
  142. .. rst-class:: classref-property
  143. :ref:`VideoStream<class_VideoStream>` **stream**
  144. .. rst-class:: classref-property-setget
  145. - void **set_stream** **(** :ref:`VideoStream<class_VideoStream>` value **)**
  146. - :ref:`VideoStream<class_VideoStream>` **get_stream** **(** **)**
  147. The assigned video stream. See description for supported formats.
  148. .. rst-class:: classref-item-separator
  149. ----
  150. .. _class_VideoStreamPlayer_property_stream_position:
  151. .. rst-class:: classref-property
  152. :ref:`float<class_float>` **stream_position**
  153. .. rst-class:: classref-property-setget
  154. - void **set_stream_position** **(** :ref:`float<class_float>` value **)**
  155. - :ref:`float<class_float>` **get_stream_position** **(** **)**
  156. The current position of the stream, in seconds.
  157. \ **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.
  158. .. rst-class:: classref-item-separator
  159. ----
  160. .. _class_VideoStreamPlayer_property_volume:
  161. .. rst-class:: classref-property
  162. :ref:`float<class_float>` **volume**
  163. .. rst-class:: classref-property-setget
  164. - void **set_volume** **(** :ref:`float<class_float>` value **)**
  165. - :ref:`float<class_float>` **get_volume** **(** **)**
  166. Audio volume as a linear value.
  167. .. rst-class:: classref-item-separator
  168. ----
  169. .. _class_VideoStreamPlayer_property_volume_db:
  170. .. rst-class:: classref-property
  171. :ref:`float<class_float>` **volume_db** = ``0.0``
  172. .. rst-class:: classref-property-setget
  173. - void **set_volume_db** **(** :ref:`float<class_float>` value **)**
  174. - :ref:`float<class_float>` **get_volume_db** **(** **)**
  175. Audio volume in dB.
  176. .. rst-class:: classref-section-separator
  177. ----
  178. .. rst-class:: classref-descriptions-group
  179. Method Descriptions
  180. -------------------
  181. .. _class_VideoStreamPlayer_method_get_stream_length:
  182. .. rst-class:: classref-method
  183. :ref:`float<class_float>` **get_stream_length** **(** **)** |const|
  184. The length of the current stream, in seconds.
  185. \ **Note:** For :ref:`VideoStreamTheora<class_VideoStreamTheora>` streams (the built-in format supported by Godot), this value will always be zero, as getting the stream length is not implemented yet. The feature may be supported by video formats implemented by a GDExtension add-on.
  186. .. rst-class:: classref-item-separator
  187. ----
  188. .. _class_VideoStreamPlayer_method_get_stream_name:
  189. .. rst-class:: classref-method
  190. :ref:`String<class_String>` **get_stream_name** **(** **)** |const|
  191. Returns the video stream's name, or ``"<No Stream>"`` if no video stream is assigned.
  192. .. rst-class:: classref-item-separator
  193. ----
  194. .. _class_VideoStreamPlayer_method_get_video_texture:
  195. .. rst-class:: classref-method
  196. :ref:`Texture2D<class_Texture2D>` **get_video_texture** **(** **)** |const|
  197. Returns the current frame as a :ref:`Texture2D<class_Texture2D>`.
  198. .. rst-class:: classref-item-separator
  199. ----
  200. .. _class_VideoStreamPlayer_method_is_playing:
  201. .. rst-class:: classref-method
  202. :ref:`bool<class_bool>` **is_playing** **(** **)** |const|
  203. Returns ``true`` if the video is playing.
  204. \ **Note:** The video is still considered playing if paused during playback.
  205. .. rst-class:: classref-item-separator
  206. ----
  207. .. _class_VideoStreamPlayer_method_play:
  208. .. rst-class:: classref-method
  209. void **play** **(** **)**
  210. Starts the video playback from the beginning. If the video is paused, this will not unpause the video.
  211. .. rst-class:: classref-item-separator
  212. ----
  213. .. _class_VideoStreamPlayer_method_stop:
  214. .. rst-class:: classref-method
  215. void **stop** **(** **)**
  216. Stops the video playback and sets the stream position to 0.
  217. \ **Note:** Although the stream position will be set to 0, the first frame of the video stream won't become the current frame.
  218. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  219. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  220. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  221. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  222. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  223. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  224. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`