diff options
author | 今井きなみ <kinami.imai@gmail.com> | 2023-06-05 00:59:23 +0200 |
---|---|---|
committer | 今井きなみ <kinami.imai@gmail.com> | 2023-06-05 21:30:38 +0200 |
commit | e3da9176a0b51459126469718fa19502655a3493 (patch) | |
tree | 3d83af372afb117be4d8453b7b281c5ec02a2825 /scene/gui/video_stream_player.cpp | |
parent | 543750a1b3f5696f9ba8e91cb49dc7db05d2ae62 (diff) | |
download | redot-engine-e3da9176a0b51459126469718fa19502655a3493.tar.gz |
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 1f3bbff779..35ebe2dc20 100644 --- a/scene/gui/video_stream_player.cpp +++ b/scene/gui/video_stream_player.cpp @@ -386,6 +386,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; @@ -468,6 +475,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); |