VideoPlayer.xml 4.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="VideoPlayer" inherits="Control" version="3.4">
  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.webmproject.org/]WebM[/url] ([code].webm[/code], [VideoStreamWebm]), [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, especially for VP8/VP9.
  11. </description>
  12. <tutorials>
  13. </tutorials>
  14. <methods>
  15. <method name="get_stream_name" qualifiers="const">
  16. <return type="String">
  17. </return>
  18. <description>
  19. Returns the video stream's name, or [code]"&lt;No Stream&gt;"[/code] if no video stream is assigned.
  20. </description>
  21. </method>
  22. <method name="get_video_texture" qualifiers="const">
  23. <return type="Texture">
  24. </return>
  25. <description>
  26. Returns the current frame as a [Texture].
  27. </description>
  28. </method>
  29. <method name="is_playing" qualifiers="const">
  30. <return type="bool">
  31. </return>
  32. <description>
  33. Returns [code]true[/code] if the video is playing.
  34. [b]Note:[/b] The video is still considered playing if paused during playback.
  35. </description>
  36. </method>
  37. <method name="play">
  38. <return type="void">
  39. </return>
  40. <description>
  41. Starts the video playback from the beginning. If the video is paused, this will not unpause the video.
  42. </description>
  43. </method>
  44. <method name="stop">
  45. <return type="void">
  46. </return>
  47. <description>
  48. Stops the video playback and sets the stream position to 0.
  49. [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.
  50. </description>
  51. </method>
  52. </methods>
  53. <members>
  54. <member name="audio_track" type="int" setter="set_audio_track" getter="get_audio_track" default="0">
  55. The embedded audio track to play.
  56. </member>
  57. <member name="autoplay" type="bool" setter="set_autoplay" getter="has_autoplay" default="false">
  58. If [code]true[/code], playback starts when the scene loads.
  59. </member>
  60. <member name="buffering_msec" type="int" setter="set_buffering_msec" getter="get_buffering_msec" default="500">
  61. Amount of time in milliseconds to store in buffer while playing.
  62. </member>
  63. <member name="bus" type="String" setter="set_bus" getter="get_bus" default="&quot;Master&quot;">
  64. Audio bus to use for sound playback.
  65. </member>
  66. <member name="expand" type="bool" setter="set_expand" getter="has_expand" default="true">
  67. 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.
  68. </member>
  69. <member name="paused" type="bool" setter="set_paused" getter="is_paused" default="false">
  70. If [code]true[/code], the video is paused.
  71. </member>
  72. <member name="stream" type="VideoStream" setter="set_stream" getter="get_stream">
  73. The assigned video stream. See description for supported formats.
  74. </member>
  75. <member name="stream_position" type="float" setter="set_stream_position" getter="get_stream_position">
  76. The current position of the stream, in seconds.
  77. [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.
  78. </member>
  79. <member name="volume" type="float" setter="set_volume" getter="get_volume">
  80. Audio volume as a linear value.
  81. </member>
  82. <member name="volume_db" type="float" setter="set_volume_db" getter="get_volume_db" default="0.0">
  83. Audio volume in dB.
  84. </member>
  85. </members>
  86. <signals>
  87. <signal name="finished">
  88. <description>
  89. Emitted when playback is finished.
  90. </description>
  91. </signal>
  92. </signals>
  93. <constants>
  94. </constants>
  95. </class>