From e22a2d57ec08bfff591a0bc3494d359e80830791 Mon Sep 17 00:00:00 2001 From: Naoto Yamaguchi Date: Sat, 12 Oct 2024 20:06:59 +0900 Subject: Fix seek feature issue Qt6.7 has more limitation from Qt6.5. That cause runtime warning in momiplayer. This patch fix this warning issue. Bug-AGL: SPEC-5162 Change-Id: I9b0de4a619ca774c90fd0c6892ba73b53b58ff58 Signed-off-by: Naoto Yamaguchi --- MediaControls/PlaybackSeekControl.qml | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) (limited to 'MediaControls') diff --git a/MediaControls/PlaybackSeekControl.qml b/MediaControls/PlaybackSeekControl.qml index e41f6cc..85ca4d4 100644 --- a/MediaControls/PlaybackSeekControl.qml +++ b/MediaControls/PlaybackSeekControl.qml @@ -15,13 +15,6 @@ Item { required property MediaPlayer mediaPlayer property alias isMediaSliderPressed: mediaSlider.pressed - function getTime(time : int) { - const h = Math.floor(time / 3600000).toString() - const m = Math.floor(time / 60000).toString() - const s = Math.floor(time / 1000 - m * 60).toString() - return `${h.padStart(2,'0')}:${m.padStart(2,'0')}:${s.padStart(2, '0')}` - } - RowLayout { anchors.fill: root anchors.leftMargin: 200 @@ -31,7 +24,14 @@ Item { id: mediaTime color: Config.secondaryColor font.bold: true - text: root.getTime(root.mediaPlayer.position) + property int mediaTimePosition + mediaTimePosition: root.mediaPlayer.position + onMediaTimePositionChanged : { + const h = Math.floor(mediaTimePosition / 3600000).toString() + const m = Math.floor(mediaTimePosition / 60000).toString() + const s = Math.floor(mediaTimePosition / 1000 - m * 60).toString() + text = `${h.padStart(2,'0')}:${m.padStart(2,'0')}:${s.padStart(2, '0')}` + } } CustomSlider { @@ -51,7 +51,15 @@ Item { id: durationTime color: Config.secondaryColor font.bold: true - text: root.getTime(root.mediaPlayer.duration) + property int durationTimePosition + durationTimePosition: root.mediaPlayer.duration + onDurationTimePositionChanged : { + const h = Math.floor(durationTimePosition / 3600000).toString() + const m = Math.floor(durationTimePosition / 60000).toString() + const s = Math.floor(durationTimePosition / 1000 - m * 60).toString() + text = `${h.padStart(2,'0')}:${m.padStart(2,'0')}:${s.padStart(2, '0')}` + } + } } -- cgit 1.2.3-korg