2
0

class_videoplayer.rst 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  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 to play video files.
  12. Member Functions
  13. ----------------
  14. +----------------------------------------+------------------------------------------------------------------------------------------------------------+
  15. | :ref:`int<class_int>` | :ref:`get_audio_track<class_VideoPlayer_get_audio_track>` **(** **)** const |
  16. +----------------------------------------+------------------------------------------------------------------------------------------------------------+
  17. | :ref:`int<class_int>` | :ref:`get_buffering_msec<class_VideoPlayer_get_buffering_msec>` **(** **)** const |
  18. +----------------------------------------+------------------------------------------------------------------------------------------------------------+
  19. | :ref:`VideoStream<class_videostream>` | :ref:`get_stream<class_VideoPlayer_get_stream>` **(** **)** const |
  20. +----------------------------------------+------------------------------------------------------------------------------------------------------------+
  21. | :ref:`String<class_string>` | :ref:`get_stream_name<class_VideoPlayer_get_stream_name>` **(** **)** const |
  22. +----------------------------------------+------------------------------------------------------------------------------------------------------------+
  23. | :ref:`float<class_float>` | :ref:`get_stream_position<class_VideoPlayer_get_stream_position>` **(** **)** const |
  24. +----------------------------------------+------------------------------------------------------------------------------------------------------------+
  25. | :ref:`Texture<class_texture>` | :ref:`get_video_texture<class_VideoPlayer_get_video_texture>` **(** **)** |
  26. +----------------------------------------+------------------------------------------------------------------------------------------------------------+
  27. | :ref:`float<class_float>` | :ref:`get_volume<class_VideoPlayer_get_volume>` **(** **)** const |
  28. +----------------------------------------+------------------------------------------------------------------------------------------------------------+
  29. | :ref:`float<class_float>` | :ref:`get_volume_db<class_VideoPlayer_get_volume_db>` **(** **)** const |
  30. +----------------------------------------+------------------------------------------------------------------------------------------------------------+
  31. | :ref:`bool<class_bool>` | :ref:`has_autoplay<class_VideoPlayer_has_autoplay>` **(** **)** const |
  32. +----------------------------------------+------------------------------------------------------------------------------------------------------------+
  33. | :ref:`bool<class_bool>` | :ref:`has_expand<class_VideoPlayer_has_expand>` **(** **)** const |
  34. +----------------------------------------+------------------------------------------------------------------------------------------------------------+
  35. | :ref:`bool<class_bool>` | :ref:`is_paused<class_VideoPlayer_is_paused>` **(** **)** const |
  36. +----------------------------------------+------------------------------------------------------------------------------------------------------------+
  37. | :ref:`bool<class_bool>` | :ref:`is_playing<class_VideoPlayer_is_playing>` **(** **)** const |
  38. +----------------------------------------+------------------------------------------------------------------------------------------------------------+
  39. | void | :ref:`play<class_VideoPlayer_play>` **(** **)** |
  40. +----------------------------------------+------------------------------------------------------------------------------------------------------------+
  41. | void | :ref:`set_audio_track<class_VideoPlayer_set_audio_track>` **(** :ref:`int<class_int>` track **)** |
  42. +----------------------------------------+------------------------------------------------------------------------------------------------------------+
  43. | void | :ref:`set_autoplay<class_VideoPlayer_set_autoplay>` **(** :ref:`bool<class_bool>` enabled **)** |
  44. +----------------------------------------+------------------------------------------------------------------------------------------------------------+
  45. | void | :ref:`set_buffering_msec<class_VideoPlayer_set_buffering_msec>` **(** :ref:`int<class_int>` msec **)** |
  46. +----------------------------------------+------------------------------------------------------------------------------------------------------------+
  47. | void | :ref:`set_expand<class_VideoPlayer_set_expand>` **(** :ref:`bool<class_bool>` enable **)** |
  48. +----------------------------------------+------------------------------------------------------------------------------------------------------------+
  49. | void | :ref:`set_paused<class_VideoPlayer_set_paused>` **(** :ref:`bool<class_bool>` paused **)** |
  50. +----------------------------------------+------------------------------------------------------------------------------------------------------------+
  51. | void | :ref:`set_stream<class_VideoPlayer_set_stream>` **(** :ref:`VideoStream<class_videostream>` stream **)** |
  52. +----------------------------------------+------------------------------------------------------------------------------------------------------------+
  53. | void | :ref:`set_volume<class_VideoPlayer_set_volume>` **(** :ref:`float<class_float>` volume **)** |
  54. +----------------------------------------+------------------------------------------------------------------------------------------------------------+
  55. | void | :ref:`set_volume_db<class_VideoPlayer_set_volume_db>` **(** :ref:`float<class_float>` db **)** |
  56. +----------------------------------------+------------------------------------------------------------------------------------------------------------+
  57. | void | :ref:`stop<class_VideoPlayer_stop>` **(** **)** |
  58. +----------------------------------------+------------------------------------------------------------------------------------------------------------+
  59. Member Variables
  60. ----------------
  61. - :ref:`int<class_int>` **audio_track**
  62. - :ref:`bool<class_bool>` **autoplay**
  63. - :ref:`bool<class_bool>` **expand**
  64. - :ref:`bool<class_bool>` **paused**
  65. - :ref:`VideoStream<class_videostream>` **stream**
  66. - :ref:`float<class_float>` **volume_db**
  67. Description
  68. -----------
  69. This control has the ability to play video streams. The only format accepted is the OGV Theora, so any other format must be converted before using in a project.
  70. Member Function Description
  71. ---------------------------
  72. .. _class_VideoPlayer_get_audio_track:
  73. - :ref:`int<class_int>` **get_audio_track** **(** **)** const
  74. Get the selected audio track (for multitrack videos).
  75. .. _class_VideoPlayer_get_buffering_msec:
  76. - :ref:`int<class_int>` **get_buffering_msec** **(** **)** const
  77. Get the amount of miliseconds to store in buffer while playing.
  78. .. _class_VideoPlayer_get_stream:
  79. - :ref:`VideoStream<class_videostream>` **get_stream** **(** **)** const
  80. Get the video stream.
  81. .. _class_VideoPlayer_get_stream_name:
  82. - :ref:`String<class_string>` **get_stream_name** **(** **)** const
  83. Get the name of the video stream.
  84. .. _class_VideoPlayer_get_stream_position:
  85. - :ref:`float<class_float>` **get_stream_position** **(** **)** const
  86. Get the current position of the stream, in seconds.
  87. .. _class_VideoPlayer_get_video_texture:
  88. - :ref:`Texture<class_texture>` **get_video_texture** **(** **)**
  89. Get the current frame of the video as a :ref:`Texture<class_texture>`.
  90. .. _class_VideoPlayer_get_volume:
  91. - :ref:`float<class_float>` **get_volume** **(** **)** const
  92. Get the volume of the audio track as a linear value.
  93. .. _class_VideoPlayer_get_volume_db:
  94. - :ref:`float<class_float>` **get_volume_db** **(** **)** const
  95. Get the volume of the audio track in decibels.
  96. .. _class_VideoPlayer_has_autoplay:
  97. - :ref:`bool<class_bool>` **has_autoplay** **(** **)** const
  98. Get whether or not the video is set as autoplay.
  99. .. _class_VideoPlayer_has_expand:
  100. - :ref:`bool<class_bool>` **has_expand** **(** **)** const
  101. Get whether or not the expand property is set.
  102. .. _class_VideoPlayer_is_paused:
  103. - :ref:`bool<class_bool>` **is_paused** **(** **)** const
  104. Get whether or not the video is paused.
  105. .. _class_VideoPlayer_is_playing:
  106. - :ref:`bool<class_bool>` **is_playing** **(** **)** const
  107. Get whether or not the video is playing.
  108. .. _class_VideoPlayer_play:
  109. - void **play** **(** **)**
  110. Start the video playback.
  111. .. _class_VideoPlayer_set_audio_track:
  112. - void **set_audio_track** **(** :ref:`int<class_int>` track **)**
  113. Set the audio track (for multitrack videos).
  114. .. _class_VideoPlayer_set_autoplay:
  115. - void **set_autoplay** **(** :ref:`bool<class_bool>` enabled **)**
  116. Set whether this node should start playing automatically.
  117. .. _class_VideoPlayer_set_buffering_msec:
  118. - void **set_buffering_msec** **(** :ref:`int<class_int>` msec **)**
  119. Set the amount of miliseconds to buffer during playback.
  120. .. _class_VideoPlayer_set_expand:
  121. - void **set_expand** **(** :ref:`bool<class_bool>` enable **)**
  122. Set the expand property. If enabled, the video will grow or shrink to fit the player size, otherwise it will play at the stream resolution.
  123. .. _class_VideoPlayer_set_paused:
  124. - void **set_paused** **(** :ref:`bool<class_bool>` paused **)**
  125. Set whether the video should pause the playback.
  126. .. _class_VideoPlayer_set_stream:
  127. - void **set_stream** **(** :ref:`VideoStream<class_videostream>` stream **)**
  128. Set the video stream for this player.
  129. .. _class_VideoPlayer_set_volume:
  130. - void **set_volume** **(** :ref:`float<class_float>` volume **)**
  131. Set the audio volume as a linear value.
  132. .. _class_VideoPlayer_set_volume_db:
  133. - void **set_volume_db** **(** :ref:`float<class_float>` db **)**
  134. Set the audio volume in decibels.
  135. .. _class_VideoPlayer_stop:
  136. - void **stop** **(** **)**
  137. Stop the video playback.