main
朱子楚\zhuzi 2023-03-30 22:59:25 +08:00
parent 4e53936bb7
commit 2008e0f524
3 changed files with 48 additions and 28 deletions

View File

@ -223,6 +223,19 @@ FluScrollablePage{
} }
} }
Rectangle{
height: 12
width: 12
radius: 6
color: FluTheme.primaryColor.dark
anchors{
right: parent.right
top: parent.top
rightMargin: 14
topMargin: 14
}
}
MouseArea{ MouseArea{
id:item_mouse id:item_mouse
anchors.fill: parent anchors.fill: parent

View File

@ -85,25 +85,27 @@ TextField{
return text.pixelSize * 1.0 return text.pixelSize * 1.0
} }
} }
FluIconButton{
iconSource:FluentIcons.ChromeClose
iconSize: 10
width: 20
height: 20
opacity: 0.5
visible: input.text !== ""
anchors{
verticalCenter: parent.verticalCenter
right: parent.right
rightMargin: icon_right.visible ? 25 : 5
}
onClicked:{
input.text = ""
}
}
background: FluTextBoxBackground{ background: FluTextBoxBackground{
inputItem: input inputItem: input
FluIconButton{
iconSource:FluentIcons.ChromeClose
iconSize: 10
width: 20
height: 20
opacity: 0.5
visible: input.text !== ""
anchors{
verticalCenter: parent.verticalCenter
right: parent.right
rightMargin: icon_right.visible ? 25 : 5
}
onClicked:{
input.text = ""
}
}
FluIcon{ FluIcon{
id:icon_right id:icon_right

View File

@ -28,10 +28,11 @@ Rectangle {
property bool autoSeek:true property bool autoSeek:true
source: control.source source: control.source
videoOutput: video_output videoOutput: video_output
audioOutput: AudioOutput{} audioOutput:audio_output
onErrorChanged:(error)=> { onErrorChanged:
console.debug(error) (error)=> {
} console.debug(error)
}
onPositionChanged: { onPositionChanged: {
if(autoSeek){ if(autoSeek){
slider.seek(mediaplayer.position*slider.maxValue/mediaplayer.duration) slider.seek(mediaplayer.position*slider.maxValue/mediaplayer.duration)
@ -52,6 +53,10 @@ Rectangle {
slider.seek(0) slider.seek(0)
} }
AudioOutput{
id:audio_output
}
VideoOutput { VideoOutput {
id:video_output id:video_output
anchors.fill: parent anchors.fill: parent
@ -92,7 +97,7 @@ Rectangle {
mediaplayer.autoSeek = false mediaplayer.autoSeek = false
mediaplayer.pause() mediaplayer.pause()
} }
value:0 value:mediaplayer.position
onReleased: { onReleased: {
mediaplayer.autoSeek = true mediaplayer.autoSeek = true
mediaplayer.play() mediaplayer.play()
@ -100,12 +105,12 @@ Rectangle {
onValueChanged: { onValueChanged: {
if(mediaplayer.autoSeek == false){ if(mediaplayer.autoSeek == false){
mediaplayer.seek(value*mediaplayer.duration/slider.maxValue) mediaplayer.position = value*mediaplayer.duration/slider.maxValue
} }
} }
onLineClickFunc:function(val){ onLineClickFunc:function(val){
mediaplayer.seek(val*mediaplayer.duration/slider.maxValue) mediaplayer.position = val*mediaplayer.duration/slider.maxValue
} }
} }
@ -142,7 +147,7 @@ Rectangle {
iconSize: 17 iconSize: 17
iconSource: FluentIcons.SkipBack10 iconSource: FluentIcons.SkipBack10
onClicked: { onClicked: {
mediaplayer.seek(Math.max(mediaplayer.position-10*1000,0)) mediaplayer.position = Math.max(mediaplayer.position-10*1000,0)
} }
} }
FluIconButton{ FluIconButton{
@ -160,7 +165,7 @@ Rectangle {
iconSize: 17 iconSize: 17
iconSource: FluentIcons.SkipForward30 iconSource: FluentIcons.SkipForward30
onClicked: { onClicked: {
mediaplayer.seek(Math.min(mediaplayer.position+30*1000,mediaplayer.duration)) mediaplayer.position = Math.min(mediaplayer.position+30*1000,mediaplayer.duration)
} }
} }
} }
@ -169,7 +174,7 @@ Rectangle {
FluIconButton{ FluIconButton{
id:btn_volume id:btn_volume
iconSize: 17 iconSize: 17
iconSource: mediaplayer.volume ? FluentIcons.Volume : FluentIcons.Mute iconSource: audio_output.volume ? FluentIcons.Volume : FluentIcons.Mute
anchors{ anchors{
left: parent.left left: parent.left
leftMargin: 5 leftMargin: 5
@ -177,7 +182,7 @@ Rectangle {
bottomMargin: 10 bottomMargin: 10
} }
onClicked: { onClicked: {
mediaplayer.volume = !mediaplayer.volume audio_output.volume = !audio_output.volume
} }
} }
@ -192,7 +197,7 @@ Rectangle {
leftMargin: 10 leftMargin: 10
} }
onValueChanged:{ onValueChanged:{
mediaplayer.volume = value/100 audio_output.volume = value/100
} }
} }