class_videoplayer.rst 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  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>` |
  17. +---------------------------------------+--------------------------------------------------------------------+
  18. | :ref:`bool<class_bool>` | :ref:`autoplay<class_VideoPlayer_property_autoplay>` |
  19. +---------------------------------------+--------------------------------------------------------------------+
  20. | :ref:`int<class_int>` | :ref:`buffering_msec<class_VideoPlayer_property_buffering_msec>` |
  21. +---------------------------------------+--------------------------------------------------------------------+
  22. | :ref:`String<class_String>` | :ref:`bus<class_VideoPlayer_property_bus>` |
  23. +---------------------------------------+--------------------------------------------------------------------+
  24. | :ref:`bool<class_bool>` | :ref:`expand<class_VideoPlayer_property_expand>` |
  25. +---------------------------------------+--------------------------------------------------------------------+
  26. | :ref:`bool<class_bool>` | :ref:`paused<class_VideoPlayer_property_paused>` |
  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>` |
  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 and OGV Theora.
  57. Property Descriptions
  58. ---------------------
  59. .. _class_VideoPlayer_property_audio_track:
  60. - :ref:`int<class_int>` **audio_track**
  61. +----------+------------------------+
  62. | *Setter* | set_audio_track(value) |
  63. +----------+------------------------+
  64. | *Getter* | get_audio_track() |
  65. +----------+------------------------+
  66. The embedded audio track to play.
  67. ----
  68. .. _class_VideoPlayer_property_autoplay:
  69. - :ref:`bool<class_bool>` **autoplay**
  70. +----------+---------------------+
  71. | *Setter* | set_autoplay(value) |
  72. +----------+---------------------+
  73. | *Getter* | has_autoplay() |
  74. +----------+---------------------+
  75. If ``true``, playback starts when the scene loads. Default value: ``false``.
  76. ----
  77. .. _class_VideoPlayer_property_buffering_msec:
  78. - :ref:`int<class_int>` **buffering_msec**
  79. +----------+---------------------------+
  80. | *Setter* | set_buffering_msec(value) |
  81. +----------+---------------------------+
  82. | *Getter* | get_buffering_msec() |
  83. +----------+---------------------------+
  84. Amount of time in milliseconds to store in buffer while playing.
  85. ----
  86. .. _class_VideoPlayer_property_bus:
  87. - :ref:`String<class_String>` **bus**
  88. +----------+----------------+
  89. | *Setter* | set_bus(value) |
  90. +----------+----------------+
  91. | *Getter* | get_bus() |
  92. +----------+----------------+
  93. Audio bus to use for sound playback.
  94. ----
  95. .. _class_VideoPlayer_property_expand:
  96. - :ref:`bool<class_bool>` **expand**
  97. +----------+-------------------+
  98. | *Setter* | set_expand(value) |
  99. +----------+-------------------+
  100. | *Getter* | has_expand() |
  101. +----------+-------------------+
  102. If ``true``, the video scales to the control size. Default value: ``true``.
  103. ----
  104. .. _class_VideoPlayer_property_paused:
  105. - :ref:`bool<class_bool>` **paused**
  106. +----------+-------------------+
  107. | *Setter* | set_paused(value) |
  108. +----------+-------------------+
  109. | *Getter* | is_paused() |
  110. +----------+-------------------+
  111. If ``true``, the video is paused.
  112. ----
  113. .. _class_VideoPlayer_property_stream:
  114. - :ref:`VideoStream<class_VideoStream>` **stream**
  115. +----------+-------------------+
  116. | *Setter* | set_stream(value) |
  117. +----------+-------------------+
  118. | *Getter* | get_stream() |
  119. +----------+-------------------+
  120. ----
  121. .. _class_VideoPlayer_property_stream_position:
  122. - :ref:`float<class_float>` **stream_position**
  123. +----------+----------------------------+
  124. | *Setter* | set_stream_position(value) |
  125. +----------+----------------------------+
  126. | *Getter* | get_stream_position() |
  127. +----------+----------------------------+
  128. The current position of the stream, in seconds.
  129. ----
  130. .. _class_VideoPlayer_property_volume:
  131. - :ref:`float<class_float>` **volume**
  132. +----------+-------------------+
  133. | *Setter* | set_volume(value) |
  134. +----------+-------------------+
  135. | *Getter* | get_volume() |
  136. +----------+-------------------+
  137. Audio volume as a linear value.
  138. ----
  139. .. _class_VideoPlayer_property_volume_db:
  140. - :ref:`float<class_float>` **volume_db**
  141. +----------+----------------------+
  142. | *Setter* | set_volume_db(value) |
  143. +----------+----------------------+
  144. | *Getter* | get_volume_db() |
  145. +----------+----------------------+
  146. Audio volume in dB.
  147. Method Descriptions
  148. -------------------
  149. .. _class_VideoPlayer_method_get_stream_name:
  150. - :ref:`String<class_String>` **get_stream_name** **(** **)** const
  151. Returns the video stream's name.
  152. ----
  153. .. _class_VideoPlayer_method_get_video_texture:
  154. - :ref:`Texture<class_Texture>` **get_video_texture** **(** **)**
  155. Returns the current frame as a :ref:`Texture<class_Texture>`.
  156. ----
  157. .. _class_VideoPlayer_method_is_playing:
  158. - :ref:`bool<class_bool>` **is_playing** **(** **)** const
  159. Returns ``true`` if the video is playing.
  160. ----
  161. .. _class_VideoPlayer_method_play:
  162. - void **play** **(** **)**
  163. Starts the video playback.
  164. ----
  165. .. _class_VideoPlayer_method_stop:
  166. - void **stop** **(** **)**
  167. Stops the video playback.