فهرست منبع

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.
Hugo Locurcio 4 سال پیش
والد
کامیت
ea46639e22
3فایلهای تغییر یافته به همراه3 افزوده شده و 1 حذف شده
  1. 1 0
      doc/classes/VideoPlayer.xml
  2. 1 0
      modules/theora/video_stream_theora.cpp
  3. 1 1
      modules/webm/video_stream_webm.cpp

+ 1 - 0
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.

+ 1 - 0
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) {

+ 1 - 1
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) {