This commit is contained in:
LubuWest 2019-12-10 21:12:32 +01:00
commit 7119d5bdf4
292 changed files with 790 additions and 16347 deletions

View file

@ -29,63 +29,39 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
import QtMultimedia 5.8
//import QtMultimedia 5.8
import QtQuick 2.9
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4
//import QtQuick.Controls 2.4
//import QtQuick.Controls.Styles 1.4
Rectangle{
color:"black"
//border.color: "light grey"
width:newscolumn.width;
height:newscolumn.width/4*3//video.hasVideo?newscolumn.width/4*3:10*mm
property alias source:video.source
width:newscolumn.width/2;
height:newscolumn.width/3//video.hasVideo?newscolumn.width/4*3:10*mm
property var attachment:({})
Text{
id:noticeText
text:"\uf144";
color:"light grey"
width:parent.width
font.pixelSize: parent.height/2
x:parent.width/2-parent.height/4
x: (parent.width-contentWidth)/2
y:parent.height/5
visible: video.playbackState!=MediaPlayer.PlayingState
//visible: video.playbackState!=MediaPlayer.PlayingState
}
Video {id:video;
anchors.fill:parent
property string mimetype:""
onErrorChanged:{noticeText.font.pixelSize=3*mm;noticeText.text=errorString}
fillMode: Image.PreserveAspectFit;
autoLoad: false
audioRole: MediaPlayer.VideoRole
MouseArea {anchors.fill:parent;
onClicked:{if(video.playbackState!=MediaPlayer.PlayingState){
video.play()} else{video.pause()}
MouseArea {anchors.fill:parent;
onClicked:{
if(attachment.mimetype=="video/youtube"){
var component = Qt.createComponent("qrc:/qml/newsqml/NewsYplayer.qml");
var videoQml = component.createObject(root,{"ytcode":attachment.url,"mimetype":attachment.mimetype});
} else {
var component = Qt.createComponent("qrc:/qml/newsqml/NewsVideoLarge.qml");
var videoQml = component.createObject(root,{"source": attachment.url,"mimetype": attachment.mimetype});
}
}
}
ProgressBar{
id: videoProgress
width: parent.width
height: 2*mm
anchors.top: video.bottom
z:2
visible:video.playbackState!=MediaPlayer.StoppedState
value: video.position/video.duration
}
ProgressBar{
id: videoBuffer
width: parent.width
height: 2*mm
anchors.top: video.bottom
visible:video.playbackState!=MediaPlayer.StoppedState
value: video.bufferProgress
style:ProgressBarStyle{
progress: Rectangle{
color:"light grey"
}
}
}
// Slider{ id: videoSlider
// width: parent.width
// height: 3*mm