class_videoplayer.rst 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the doc/base/classes.xml source instead.
  3. .. _class_VideoPlayer:
  4. VideoPlayer
  5. ===========
  6. **Inherits:** :ref:`Control<class_control>` **<** :ref:`CanvasItem<class_canvasitem>` **<** :ref:`Node<class_node>` **<** :ref:`Object<class_object>`
  7. **Category:** Core
  8. Brief Description
  9. -----------------
  10. Control to play video files.
  11. Member Functions
  12. ----------------
  13. +----------------------------------------+------------------------------------------------------------------------------------------------------------+
  14. | :ref:`int<class_int>` | :ref:`get_audio_track<class_VideoPlayer_get_audio_track>` **(** **)** const |
  15. +----------------------------------------+------------------------------------------------------------------------------------------------------------+
  16. | :ref:`int<class_int>` | :ref:`get_buffering_msec<class_VideoPlayer_get_buffering_msec>` **(** **)** const |
  17. +----------------------------------------+------------------------------------------------------------------------------------------------------------+
  18. | :ref:`VideoStream<class_videostream>` | :ref:`get_stream<class_VideoPlayer_get_stream>` **(** **)** const |
  19. +----------------------------------------+------------------------------------------------------------------------------------------------------------+
  20. | :ref:`String<class_string>` | :ref:`get_stream_name<class_VideoPlayer_get_stream_name>` **(** **)** const |
  21. +----------------------------------------+------------------------------------------------------------------------------------------------------------+
  22. | :ref:`float<class_float>` | :ref:`get_stream_pos<class_VideoPlayer_get_stream_pos>` **(** **)** const |
  23. +----------------------------------------+------------------------------------------------------------------------------------------------------------+
  24. | :ref:`Texture<class_texture>` | :ref:`get_video_texture<class_VideoPlayer_get_video_texture>` **(** **)** |
  25. +----------------------------------------+------------------------------------------------------------------------------------------------------------+
  26. | :ref:`float<class_float>` | :ref:`get_volume<class_VideoPlayer_get_volume>` **(** **)** const |
  27. +----------------------------------------+------------------------------------------------------------------------------------------------------------+
  28. | :ref:`float<class_float>` | :ref:`get_volume_db<class_VideoPlayer_get_volume_db>` **(** **)** const |
  29. +----------------------------------------+------------------------------------------------------------------------------------------------------------+
  30. | :ref:`bool<class_bool>` | :ref:`has_autoplay<class_VideoPlayer_has_autoplay>` **(** **)** const |
  31. +----------------------------------------+------------------------------------------------------------------------------------------------------------+
  32. | :ref:`bool<class_bool>` | :ref:`has_expand<class_VideoPlayer_has_expand>` **(** **)** const |
  33. +----------------------------------------+------------------------------------------------------------------------------------------------------------+
  34. | :ref:`bool<class_bool>` | :ref:`is_paused<class_VideoPlayer_is_paused>` **(** **)** const |
  35. +----------------------------------------+------------------------------------------------------------------------------------------------------------+
  36. | :ref:`bool<class_bool>` | :ref:`is_playing<class_VideoPlayer_is_playing>` **(** **)** const |
  37. +----------------------------------------+------------------------------------------------------------------------------------------------------------+
  38. | void | :ref:`play<class_VideoPlayer_play>` **(** **)** |
  39. +----------------------------------------+------------------------------------------------------------------------------------------------------------+
  40. | void | :ref:`set_audio_track<class_VideoPlayer_set_audio_track>` **(** :ref:`int<class_int>` track **)** |
  41. +----------------------------------------+------------------------------------------------------------------------------------------------------------+
  42. | void | :ref:`set_autoplay<class_VideoPlayer_set_autoplay>` **(** :ref:`bool<class_bool>` enabled **)** |
  43. +----------------------------------------+------------------------------------------------------------------------------------------------------------+
  44. | void | :ref:`set_buffering_msec<class_VideoPlayer_set_buffering_msec>` **(** :ref:`int<class_int>` msec **)** |
  45. +----------------------------------------+------------------------------------------------------------------------------------------------------------+
  46. | void | :ref:`set_expand<class_VideoPlayer_set_expand>` **(** :ref:`bool<class_bool>` enable **)** |
  47. +----------------------------------------+------------------------------------------------------------------------------------------------------------+
  48. | void | :ref:`set_paused<class_VideoPlayer_set_paused>` **(** :ref:`bool<class_bool>` paused **)** |
  49. +----------------------------------------+------------------------------------------------------------------------------------------------------------+
  50. | void | :ref:`set_stream<class_VideoPlayer_set_stream>` **(** :ref:`VideoStream<class_videostream>` stream **)** |
  51. +----------------------------------------+------------------------------------------------------------------------------------------------------------+
  52. | void | :ref:`set_volume<class_VideoPlayer_set_volume>` **(** :ref:`float<class_float>` volume **)** |
  53. +----------------------------------------+------------------------------------------------------------------------------------------------------------+
  54. | void | :ref:`set_volume_db<class_VideoPlayer_set_volume_db>` **(** :ref:`float<class_float>` db **)** |
  55. +----------------------------------------+------------------------------------------------------------------------------------------------------------+
  56. | void | :ref:`stop<class_VideoPlayer_stop>` **(** **)** |
  57. +----------------------------------------+------------------------------------------------------------------------------------------------------------+
  58. Description
  59. -----------
  60. 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.
  61. Member Function Description
  62. ---------------------------
  63. .. _class_VideoPlayer_get_audio_track:
  64. - :ref:`int<class_int>` **get_audio_track** **(** **)** const
  65. Get the selected audio track (for multitrack videos).
  66. .. _class_VideoPlayer_get_buffering_msec:
  67. - :ref:`int<class_int>` **get_buffering_msec** **(** **)** const
  68. Get the amount of miliseconds to store in buffer while playing.
  69. .. _class_VideoPlayer_get_stream:
  70. - :ref:`VideoStream<class_videostream>` **get_stream** **(** **)** const
  71. Get the video stream.
  72. .. _class_VideoPlayer_get_stream_name:
  73. - :ref:`String<class_string>` **get_stream_name** **(** **)** const
  74. Get the name of the video stream.
  75. .. _class_VideoPlayer_get_stream_pos:
  76. - :ref:`float<class_float>` **get_stream_pos** **(** **)** const
  77. Get the current position of the stream, in seconds.
  78. .. _class_VideoPlayer_get_video_texture:
  79. - :ref:`Texture<class_texture>` **get_video_texture** **(** **)**
  80. Get the current frame of the video as a :ref:`Texture<class_texture>`.
  81. .. _class_VideoPlayer_get_volume:
  82. - :ref:`float<class_float>` **get_volume** **(** **)** const
  83. Get the volume of the audio track as a linear value.
  84. .. _class_VideoPlayer_get_volume_db:
  85. - :ref:`float<class_float>` **get_volume_db** **(** **)** const
  86. Get the volume of the audio track in decibels.
  87. .. _class_VideoPlayer_has_autoplay:
  88. - :ref:`bool<class_bool>` **has_autoplay** **(** **)** const
  89. Get whether or not the video is set as autoplay.
  90. .. _class_VideoPlayer_has_expand:
  91. - :ref:`bool<class_bool>` **has_expand** **(** **)** const
  92. Get whether or not the expand property is set.
  93. .. _class_VideoPlayer_is_paused:
  94. - :ref:`bool<class_bool>` **is_paused** **(** **)** const
  95. Get whether or not the video is paused.
  96. .. _class_VideoPlayer_is_playing:
  97. - :ref:`bool<class_bool>` **is_playing** **(** **)** const
  98. Get whether or not the video is playing.
  99. .. _class_VideoPlayer_play:
  100. - void **play** **(** **)**
  101. Start the video playback.
  102. .. _class_VideoPlayer_set_audio_track:
  103. - void **set_audio_track** **(** :ref:`int<class_int>` track **)**
  104. Set the audio track (for multitrack videos).
  105. .. _class_VideoPlayer_set_autoplay:
  106. - void **set_autoplay** **(** :ref:`bool<class_bool>` enabled **)**
  107. Set whether this node should start playing automatically.
  108. .. _class_VideoPlayer_set_buffering_msec:
  109. - void **set_buffering_msec** **(** :ref:`int<class_int>` msec **)**
  110. Set the amount of miliseconds to buffer during playback.
  111. .. _class_VideoPlayer_set_expand:
  112. - void **set_expand** **(** :ref:`bool<class_bool>` enable **)**
  113. 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.
  114. .. _class_VideoPlayer_set_paused:
  115. - void **set_paused** **(** :ref:`bool<class_bool>` paused **)**
  116. Set whether the video should pause the playback.
  117. .. _class_VideoPlayer_set_stream:
  118. - void **set_stream** **(** :ref:`VideoStream<class_videostream>` stream **)**
  119. Set the video stream for this player.
  120. .. _class_VideoPlayer_set_volume:
  121. - void **set_volume** **(** :ref:`float<class_float>` volume **)**
  122. Set the audio volume as a linear value.
  123. .. _class_VideoPlayer_set_volume_db:
  124. - void **set_volume_db** **(** :ref:`float<class_float>` db **)**
  125. Set the audio volume in decibels.
  126. .. _class_VideoPlayer_stop:
  127. - void **stop** **(** **)**
  128. Stop the video playback.