class_videoplayer.rst 8.0 KB

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