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

@ -33,19 +33,23 @@
import QtQuick 2.8
import "qrc:/js/helper.js" as Helperjs
//import QtWebView 1.1
import QtWebView 1.1
Rectangle{
color:"transparent"
width:newscolumn.width;
height:newscolumn.width/4*3
property string url:""//htmlview.text
id:newsYplayer
color:"black"
width:root.width;
height:root.height
property string url:""
property string ytcode:""
WebView {
id: webView
anchors.fill: parent
z:1
opacity: 0
url: "qrc:///content/player.html?" + currentVideo.vId
url: root.osSettings.osType=="Android"?"https://youtube.com/watch?v="+ytcode:"qrc:/js/yplayer.html?" + ytcode
Behavior on opacity { NumberAnimation { duration: 200 } }
@ -59,42 +63,13 @@ Rectangle{
case WebView.LoadStoppedStatus:
break
case WebView.LoadFailedStatus:
topInfo.text = "Failed to load the requested video"
print("Failed to load the requested video" + url)
break
}
opacity = 0
}
onTitleChanged: {
currentVideo.status = 1 * title
if (title == videoStatus.paused || title == videoStatus.ready)
panel.state = "list"
else if (title == videoStatus.playing)
panel.state = "hidden"
if (title==2){newsYplayer.destroy()}
}
}
Text{id:htmlview
textFormat:Text.RichText
}
// WebView {id:htmlview;
// anchors.fill: parent
// }
Component.onCompleted:{
// Helperjs.friendicaWebRequest(url,parent,function(document){
// print(document);
//// var metas = document.getElementsByTagName('meta'); //get all the meta tag elements
//// //iterate through them
//// for (i=0; i<metas.length; i++) {
//// if (metas[i].getAttribute("name") == "keywords") {
//// print(metas[i].getAttribute("content"));
//// }
//// else if (metas[i].getAttribute("name") == "description") {
//// console.log(metas[i].getAttribute("content"));
//// }
//// }
// //print(html);
// htmlview.text=""
// })
}
}