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,8 +85,6 @@ TextField{
return text.pixelSize * 1.0 return text.pixelSize * 1.0
} }
} }
background: FluTextBoxBackground{
inputItem: input
FluIconButton{ FluIconButton{
iconSource:FluentIcons.ChromeClose iconSource:FluentIcons.ChromeClose
@ -105,6 +103,10 @@ TextField{
} }
} }
background: FluTextBoxBackground{
inputItem: input
FluIcon{ FluIcon{
id:icon_right id:icon_right
iconSource: input.iconSource iconSource: input.iconSource

View File

@ -28,8 +28,9 @@ 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:
(error)=> {
console.debug(error) console.debug(error)
} }
onPositionChanged: { onPositionChanged: {
@ -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
} }
} }