VideoPlayer.xml 3.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="VideoPlayer" inherits="Control" version="4.0">
  3. <brief_description>
  4. Control for playing video streams.
  5. </brief_description>
  6. <description>
  7. Control node for playing video streams using [VideoStream] resources.
  8. Supported video formats are [url=https://www.theora.org/]Ogg Theora[/url] ([code].ogv[/code], [VideoStreamTheora]) and any format exposed via a GDNative plugin using [VideoStreamGDNative].
  9. [b]Note:[/b] Due to a bug, VideoPlayer does not support localization remapping yet.
  10. [b]Warning:[/b] On HTML5, video playback [i]will[/i] perform poorly due to missing architecture-specific assembly optimizations.
  11. </description>
  12. <tutorials>
  13. </tutorials>
  14. <methods>
  15. <method name="get_stream_name" qualifiers="const">
  16. <return type="String" />
  17. <description>
  18. Returns the video stream's name, or [code]"&lt;No Stream&gt;"[/code] if no video stream is assigned.
  19. </description>
  20. </method>
  21. <method name="get_video_texture" qualifiers="const">
  22. <return type="Texture2D" />
  23. <description>
  24. Returns the current frame as a [Texture2D].
  25. </description>
  26. </method>
  27. <method name="is_playing" qualifiers="const">
  28. <return type="bool" />
  29. <description>
  30. Returns [code]true[/code] if the video is playing.
  31. [b]Note:[/b] The video is still considered playing if paused during playback.
  32. </description>
  33. </method>
  34. <method name="play">
  35. <return type="void" />
  36. <description>
  37. Starts the video playback from the beginning. If the video is paused, this will not unpause the video.
  38. </description>
  39. </method>
  40. <method name="stop">
  41. <return type="void" />
  42. <description>
  43. Stops the video playback and sets the stream position to 0.
  44. [b]Note:[/b] Although the stream position will be set to 0, the first frame of the video stream won't become the current frame.
  45. </description>
  46. </method>
  47. </methods>
  48. <members>
  49. <member name="audio_track" type="int" setter="set_audio_track" getter="get_audio_track" default="0">
  50. The embedded audio track to play.
  51. </member>
  52. <member name="autoplay" type="bool" setter="set_autoplay" getter="has_autoplay" default="false">
  53. If [code]true[/code], playback starts when the scene loads.
  54. </member>
  55. <member name="buffering_msec" type="int" setter="set_buffering_msec" getter="get_buffering_msec" default="500">
  56. Amount of time in milliseconds to store in buffer while playing.
  57. </member>
  58. <member name="bus" type="StringName" setter="set_bus" getter="get_bus" default="&amp;&quot;Master&quot;">
  59. Audio bus to use for sound playback.
  60. </member>
  61. <member name="expand" type="bool" setter="set_expand" getter="has_expand" default="true">
  62. If [code]true[/code], the video scales to the control size. Otherwise, the control minimum size will be automatically adjusted to match the video stream's dimensions.
  63. </member>
  64. <member name="paused" type="bool" setter="set_paused" getter="is_paused" default="false">
  65. If [code]true[/code], the video is paused.
  66. </member>
  67. <member name="stream" type="VideoStream" setter="set_stream" getter="get_stream">
  68. The assigned video stream. See description for supported formats.
  69. </member>
  70. <member name="stream_position" type="float" setter="set_stream_position" getter="get_stream_position">
  71. The current position of the stream, in seconds.
  72. [b]Note:[/b] Changing this value won't have any effect as seeking is not implemented yet, except in video formats implemented by a GDNative add-on.
  73. </member>
  74. <member name="volume" type="float" setter="set_volume" getter="get_volume">
  75. Audio volume as a linear value.
  76. </member>
  77. <member name="volume_db" type="float" setter="set_volume_db" getter="get_volume_db" default="0.0">
  78. Audio volume in dB.
  79. </member>
  80. </members>
  81. <signals>
  82. <signal name="finished">
  83. <description>
  84. Emitted when playback is finished.
  85. </description>
  86. </signal>
  87. </signals>
  88. </class>