0.2.0-dev Download ZIP
101 lines ·4.6 KB Raw
| 1 | <?xml version="1.0" encoding="UTF-8" ?> |
| 2 | <class name="VideoStreamPlayer" inherits="Control" api_type="core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> |
| 3 | <brief_description> |
| 4 | A control used for video playback. |
| 5 | </brief_description> |
| 6 | <description> |
| 7 | A control used for playback of [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 GDExtension plugin. |
| 9 | [b]Warning:[/b] On Web, video playback [i]will[/i] perform poorly due to missing architecture-specific assembly optimizations. |
| 10 | </description> |
| 11 | <tutorials> |
| 12 | <link title="Playing videos">$DOCS_URL/tutorials/animation/playing_videos.html</link> |
| 13 | </tutorials> |
| 14 | <methods> |
| 15 | <method name="get_stream_length" qualifiers="const"> |
| 16 | <return type="float" /> |
| 17 | <description> |
| 18 | The length of the current stream, in seconds. |
| 19 | </description> |
| 20 | </method> |
| 21 | <method name="get_stream_name" qualifiers="const"> |
| 22 | <return type="String" /> |
| 23 | <description> |
| 24 | Returns the video stream's name, or [code]"<No Stream>"[/code] if no video stream is assigned. |
| 25 | </description> |
| 26 | </method> |
| 27 | <method name="get_video_texture" qualifiers="const"> |
| 28 | <return type="Texture2D" /> |
| 29 | <description> |
| 30 | Returns the video playback texture. |
| 31 | The texture will be continually updated as the video plays, so call [method Texture2D.get_image] to get a still frame. |
| 32 | </description> |
| 33 | </method> |
| 34 | <method name="is_playing" qualifiers="const"> |
| 35 | <return type="bool" /> |
| 36 | <description> |
| 37 | Returns [code]true[/code] if the video is playing. |
| 38 | [b]Note:[/b] The video is still considered playing if paused during playback. |
| 39 | </description> |
| 40 | </method> |
| 41 | <method name="play"> |
| 42 | <return type="void" /> |
| 43 | <description> |
| 44 | Starts the video playback from the beginning, unless the video is already playing. |
| 45 | [b]Note:[/b] If the video is paused, this will not unpause the video. |
| 46 | </description> |
| 47 | </method> |
| 48 | <method name="stop"> |
| 49 | <return type="void" /> |
| 50 | <description> |
| 51 | Stops the video playback and sets the stream position to 0. |
| 52 | [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. |
| 53 | </description> |
| 54 | </method> |
| 55 | </methods> |
| 56 | <members> |
| 57 | <member name="audio_track" type="int" setter="set_audio_track" getter="get_audio_track" default="0"> |
| 58 | The embedded audio track to play. |
| 59 | </member> |
| 60 | <member name="autoplay" type="bool" setter="set_autoplay" getter="has_autoplay" default="false"> |
| 61 | If [code]true[/code], playback starts when the scene loads. |
| 62 | </member> |
| 63 | <member name="buffering_msec" type="int" setter="set_buffering_msec" getter="get_buffering_msec" default="500"> |
| 64 | Amount of time in milliseconds to store in buffer while playing. |
| 65 | </member> |
| 66 | <member name="bus" type="StringName" setter="set_bus" getter="get_bus" default="&"Master""> |
| 67 | Audio bus to use for sound playback. |
| 68 | </member> |
| 69 | <member name="expand" type="bool" setter="set_expand" getter="has_expand" default="false"> |
| 70 | 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. |
| 71 | </member> |
| 72 | <member name="loop" type="bool" setter="set_loop" getter="has_loop" default="false"> |
| 73 | If [code]true[/code], the video restarts when it reaches its end. |
| 74 | </member> |
| 75 | <member name="paused" type="bool" setter="set_paused" getter="is_paused" default="false"> |
| 76 | If [code]true[/code], the video is paused. |
| 77 | </member> |
| 78 | <member name="speed_scale" type="float" setter="set_speed_scale" getter="get_speed_scale" default="1.0"> |
| 79 | The stream's current speed scale. [code]1.0[/code] is the normal speed, while [code]2.0[/code] is double speed and [code]0.5[/code] is half speed. A speed scale of [code]0.0[/code] pauses the video, similar to setting [member paused] to [code]true[/code]. |
| 80 | </member> |
| 81 | <member name="stream" type="VideoStream" setter="set_stream" getter="get_stream"> |
| 82 | The assigned video stream. See description for supported formats. |
| 83 | </member> |
| 84 | <member name="stream_position" type="float" setter="set_stream_position" getter="get_stream_position"> |
| 85 | The current position of the stream, in seconds. |
| 86 | </member> |
| 87 | <member name="volume" type="float" setter="set_volume" getter="get_volume"> |
| 88 | Audio volume as a linear value. |
| 89 | </member> |
| 90 | <member name="volume_db" type="float" setter="set_volume_db" getter="get_volume_db" default="0.0"> |
| 91 | Audio volume in dB. |
| 92 | </member> |
| 93 | </members> |
| 94 | <signals> |
| 95 | <signal name="finished"> |
| 96 | <description> |
| 97 | Emitted when playback is finished. |
| 98 | </description> |
| 99 | </signal> |
| 100 | </signals> |
| 101 | </class> |