基于之前的播放器添加一些新内容。
添加一些image,显示出播放,暂停,快进,快退 等功能按键。
代码如下:
mport QtQuick 2.0
import QtMultimedia 5.0
Rectangle {
id: playerUI
width: 800
height: 600
color: "black"
MouseArea {
anchors.fill: parent
onClicked: {
startPlay();
}
}
MediaPlayer {
id: mediaPlayer
source: "videos/feng.mp4"
}
VideoOutput {
anchors.fill: parent
source: mediaPlayer
}
function startPlay() {
mediaPlayer.play();
}
Rectangle {
id: playerBar
width: parent.width
height: 100
color: "grey"
opacity: 0.3 //