diff options
author | Yuri Sizov <yuris@humnom.net> | 2023-07-12 17:14:44 +0200 |
---|---|---|
committer | Yuri Sizov <yuris@humnom.net> | 2023-07-12 17:14:44 +0200 |
commit | 1978b7c717160effaf1fcb4b0e49c69a27124a9e (patch) | |
tree | 9ff169d382577ed35edf962c0bfda216becdee23 /scene/gui/video_stream_player.cpp | |
parent | 216aa450a69ccece4e509f490200660954db23a0 (diff) | |
parent | e3da9176a0b51459126469718fa19502655a3493 (diff) | |
download | redot-engine-1978b7c717160effaf1fcb4b0e49c69a27124a9e.tar.gz |
Merge pull request #77858 from kinami-imai/expose_videostreamplayer_video_length
Expose VideoStreamPlayer video length
Diffstat (limited to 'scene/gui/video_stream_player.cpp')
-rw-r--r-- | scene/gui/video_stream_player.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/scene/gui/video_stream_player.cpp b/scene/gui/video_stream_player.cpp index 07009ff976..49a24f217d 100644 --- a/scene/gui/video_stream_player.cpp +++ b/scene/gui/video_stream_player.cpp @@ -401,6 +401,13 @@ String VideoStreamPlayer::get_stream_name() const { return stream->get_name(); } +double VideoStreamPlayer::get_stream_length() const { + if (playback.is_null()) { + return 0; + } + return playback->get_length(); +} + double VideoStreamPlayer::get_stream_position() const { if (playback.is_null()) { return 0; @@ -486,6 +493,7 @@ void VideoStreamPlayer::_bind_methods() { ClassDB::bind_method(D_METHOD("get_audio_track"), &VideoStreamPlayer::get_audio_track); ClassDB::bind_method(D_METHOD("get_stream_name"), &VideoStreamPlayer::get_stream_name); + ClassDB::bind_method(D_METHOD("get_stream_length"), &VideoStreamPlayer::get_stream_length); ClassDB::bind_method(D_METHOD("set_stream_position", "position"), &VideoStreamPlayer::set_stream_position); ClassDB::bind_method(D_METHOD("get_stream_position"), &VideoStreamPlayer::get_stream_position); |