summaryrefslogtreecommitdiffstats
path: root/scene/gui/video_stream_player.cpp
diff options
context:
space:
mode:
authorYuri Sizov <yuris@humnom.net>2023-07-12 17:14:44 +0200
committerYuri Sizov <yuris@humnom.net>2023-07-12 17:14:44 +0200
commit1978b7c717160effaf1fcb4b0e49c69a27124a9e (patch)
tree9ff169d382577ed35edf962c0bfda216becdee23 /scene/gui/video_stream_player.cpp
parent216aa450a69ccece4e509f490200660954db23a0 (diff)
parente3da9176a0b51459126469718fa19502655a3493 (diff)
downloadredot-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.cpp8
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);