// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5 import QtQuick 1.0 import Qt 4.7 import "../Shared" Item { id: videoControls width: parent.width height: parent.height property string duration property string position property int videoSliderValue property int videoSliderMaximum property string titleMovieStr property bool show opacity: 0 onOpacityChanged: { if(opacity==1) { videoControlsShowTimer.running = true } } onShowChanged: { if(show) { videoControls.opacity = 1 videoControlsShowTimer.running = true } else videoControls.opacity = 0 } onTitleMovieStrChanged: titleMovie.text = titleMovieStr onPositionChanged: positionLabel.text = position onDurationChanged: durationLabel.text = duration onVideoSliderValueChanged: videoSlider.value = videoSliderValue onVideoSliderMaximumChanged: videoSlider.maximum = videoSliderMaximum //onSliderValueChanged: slide.value = sliderValue MouseArea{ id: mainArea anchors.fill: parent onClicked: { videoControlsShowTimer.restart() } } ImagedButton { id: stopPlayButton anchors.verticalCenter: parent.verticalCenter anchors.right: parent.right anchors.rightMargin: 10 normalStateSource: "./images/player/pause.png" pressedStateSource: "images/player/pause_tap.png" smooth: true property bool isPlayButton: false onIsPlayButtonChanged: { if(isPlayButton){ videoControls.opacity = 1 videoControlsShowTimer.stop() stopPlayButton.normalStateSource = "./images/player/vplay.png" stopPlayButton.pressedStateSource = "images/player/vplay_tap.png" }else{ videoControls.opacity = 0 stopPlayButton.normalStateSource = "./images/player/pause.png" stopPlayButton.pressedStateSource = "images/player/pause_tap.png" } } onClicked: { if(isPlayButton) video.play() // starts the video else video.pause() // the video paused isPlayButton = !isPlayButton console.log("Duration: "+video.duration) } } Slider{ id: slide anchors.left: parent.left anchors.leftMargin: 70 anchors.bottom: parent.bottom anchors.bottomMargin: 115 value: 0.3 onValueChanged: { videoMovie.volume = 1 - slide.value console.log("Volume: "+video.volume)} } ImagedButton { id: mute_shut anchors.left: parent.left anchors.leftMargin: 60 anchors.top: slide.bottom anchors.topMargin: 10 normalStateSource: video.volume == 0 ? "./images/player/mute.png":"./images/player/mute.png" pressedStateSource: video.volume == 0 ? "./images/player/mute_tap.png":"./images/player/mute_tap.png" smooth: true onClicked: {} } ImagedButton { id: more_volume anchors.left: parent.left anchors.leftMargin: 20 anchors.top: slide.top anchors.topMargin: 7 normalStateSource: "./images/player/more_volume.png" pressedStateSource: "./images/player/more_volume_tap.png" smooth: true onClicked: volumeUpPressed() } ImagedButton { id: less_volume anchors.left: parent.left anchors.leftMargin: 20 anchors.bottom: slide.bottom anchors.bottomMargin: 7 normalStateSource: "./images/player/less_volume.png" pressedStateSource: "./images/player/less_volume_tap.png" smooth: true onClicked: volumeDownPressed() } Text { id: titleMovie anchors.left: parent.left anchors.leftMargin: 20 anchors.top: parent.top anchors.topMargin: 8 color: "#ffffff" //font.family: helvetica.name font.pointSize: 8.0 font.bold: true opacity: 1 } Item { id: backButtonArea anchors.right: parent.right anchors.bottom: parent.bottom anchors.left: positionLabel.right anchors.top: back_player.top MouseArea { id: mouse anchors.fill: parent onClicked: { setOrientation('portrait') showTabbar() timerStop() if(hiddenLoader.source == pageModel.get(pageModel.count-1).page) currentLoader.source = "../MovieCard/MovieCard.qml" else hiddenLoader.source = "../MovieCard/MovieCard.qml" } states: [ State { name: "pressed"; when: mouse.pressed === true PropertyChanges { target: back_player font.pointSize: 11 color:"#5f5f5f" } } ] } } Text { id: back_player anchors.right: parent.right anchors.rightMargin: 20 anchors.bottom: parent.bottom anchors.bottomMargin: 15 color: "#ffffff" //font.family: helvetica.name font.pointSize: 9.5 font.bold: true text: "Назад" } Text{ id:positionLabel color: "white" anchors.left: videoSlider.left anchors.bottom: videoSlider.top anchors.bottomMargin: 10 font.pointSize: 8 font.bold: false text: "0:00" } Text{ id:durationLabel color: "white" anchors.right: videoSlider.right anchors.bottom: videoSlider.top anchors.bottomMargin: 10 font.pointSize: 8 font.bold: false text: "0:00" } VideoSlider{ id: videoSlider anchors.bottom: parent.bottom anchors.bottomMargin: 10 anchors.left: parent.left anchors.leftMargin: 20 value: 0 minimum: 0 onValueChanged: { console.log("Value: "+value) videoMovie.position = value } } Timer { id: videoControlsShowTimer interval: 4000 running: false repeat: false onTriggered: { videoControls.opacity = 0 console.log("Controls were hide!") } } function volumeUpPressed(){ videoControls.show = true if (slide.value > 0){ console.log("move up") slide.value=slide.value-0.1 } } function volumeDownPressed(){ videoControls.show = true if (slide.value < 1){ console.log("move down") slide.value=slide.value+0.1 } } }