main
朱子楚 2023-03-25 23:28:48 +08:00
parent dae49a5bfc
commit a2c23231f2
2 changed files with 28 additions and 2 deletions

View File

@ -30,7 +30,9 @@ FluScrollablePage{
FluMediaPlayer{ FluMediaPlayer{
id:player id:player
source:"http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4" source:"http://mirror.aarnet.edu.au/pub/TED-talks/911Mothers_2010W-480p.mp4"
// source:"http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4"
// source:"http://video.chinanews.com/flv/2019/04/23/400/111773_web.mp4"
} }
} }

View File

@ -83,11 +83,19 @@ Rectangle {
enableTip:false enableTip:false
onPressed: { onPressed: {
mediaplayer.autoSeek = false mediaplayer.autoSeek = false
mediaplayer.pause()
} }
onReleased: { onReleased: {
mediaplayer.seek(value*mediaplayer.duration/slider.maxValue)
mediaplayer.autoSeek = true mediaplayer.autoSeek = true
mediaplayer.play()
} }
onValueChanged: {
if(mediaplayer.autoSeek == false){
mediaplayer.seek(value*mediaplayer.duration/slider.maxValue)
}
}
onLineClickFunc:function(val){ onLineClickFunc:function(val){
mediaplayer.seek(val*mediaplayer.duration/slider.maxValue) mediaplayer.seek(val*mediaplayer.duration/slider.maxValue)
} }
@ -131,6 +139,22 @@ Rectangle {
} }
} }
FluIconButton{
iconSize: 17
iconSource: mediaplayer.volume ? FluentIcons.Volume : FluentIcons.Mute
anchors{
left: parent.left
leftMargin: 5
bottom: parent.bottom
bottomMargin: 10
}
onClicked: {
// FluentIcons.SkipBack10 FluentIcons.SkipForward30
mediaplayer.volume = !mediaplayer.volume
}
}
} }
function formatDuration(duration) { function formatDuration(duration) {