diff options
author | Hugo Locurcio <hugo.locurcio@hugo.pro> | 2021-04-14 20:39:13 +0200 |
---|---|---|
committer | Hugo Locurcio <hugo.locurcio@hugo.pro> | 2021-04-14 20:39:13 +0200 |
commit | ea46639e22b83ff18d7b85c67b732f6e82ae7df3 (patch) | |
tree | 1e2ba6990f077f78a0aabfe25e30f485fb3a8ed5 | |
parent | 9e0f87359b9ae596fa99022ccdad015bd74680ae (diff) |
Print a warning when trying to seek in VideoPlayer
Seeking isn't implemented in built-in video formats and can only
be supported in GDNative-provided video formats.
-rw-r--r-- | doc/classes/VideoPlayer.xml | 1 | ||||
-rw-r--r-- | modules/theora/video_stream_theora.cpp | 1 | ||||
-rw-r--r-- | modules/webm/video_stream_webm.cpp | 2 |
3 files changed, 3 insertions, 1 deletions
diff --git a/doc/classes/VideoPlayer.xml b/doc/classes/VideoPlayer.xml index b2ab356b0d..d905ce4054 100644 --- a/doc/classes/VideoPlayer.xml +++ b/doc/classes/VideoPlayer.xml @@ -74,6 +74,7 @@ </member> <member name="stream_position" type="float" setter="set_stream_position" getter="get_stream_position"> The current position of the stream, in seconds. + [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. </member> <member name="volume" type="float" setter="set_volume" getter="get_volume"> Audio volume as a linear value. diff --git a/modules/theora/video_stream_theora.cpp b/modules/theora/video_stream_theora.cpp index c5f6dc0d99..19f26c87cd 100644 --- a/modules/theora/video_stream_theora.cpp +++ b/modules/theora/video_stream_theora.cpp @@ -603,6 +603,7 @@ float VideoStreamPlaybackTheora::get_playback_position() const { }; void VideoStreamPlaybackTheora::seek(float p_time) { + WARN_PRINT_ONCE("Seeking in Theora and WebM videos is not implemented yet (it's only supported for GDNative-provided video streams)."); } void VideoStreamPlaybackTheora::set_mix_callback(AudioMixCallback p_callback, void *p_userdata) { diff --git a/modules/webm/video_stream_webm.cpp b/modules/webm/video_stream_webm.cpp index 101001cba0..a6b64b342e 100644 --- a/modules/webm/video_stream_webm.cpp +++ b/modules/webm/video_stream_webm.cpp @@ -194,7 +194,7 @@ float VideoStreamPlaybackWebm::get_playback_position() const { } void VideoStreamPlaybackWebm::seek(float p_time) { - //Not implemented + WARN_PRINT_ONCE("Seeking in Theora and WebM videos is not implemented yet (it's only supported for GDNative-provided video streams)."); } void VideoStreamPlaybackWebm::set_audio_track(int p_idx) { |