diff --git a/app/Main.qml b/app/Main.qml index 43b7c08..574f73b 100644 --- a/app/Main.qml +++ b/app/Main.qml @@ -60,14 +60,37 @@ Rectangle { profile: defaultProfile settings.fullScreenSupportEnabled: true settings.dnsPrefetchEnabled: true + settings.showScrollBars: false enableSelectOverride: true property var currentWebview: webview property ContextMenuRequest contextMenuRequest: null + property string seekBarOverlayScript: " + if (!document.getElementById('custom-seekbar')) { + + var wrapper= document.createElement('div'); + wrapper.innerHTML= '
'; + + document.getElementById('player-container-id').appendChild(wrapper.firstChild); + var customseekbar = document.getElementById('custom-seekbar'); + + customseekbar.onclick = function(e) { + var vid = document.querySelector('video'); + var offset = customseekbar.getBoundingClientRect(); + var left = (e.pageX - (offset.left + window.scrollX)); + var totalWidth = customseekbar.getBoundingClientRect().width; + var percentage = ( left / totalWidth ); + var vidTime = vid.duration * percentage; + vid.currentTime = parseFloat(vidTime); + }; + }" + settings.pluginsEnabled: true settings.javascriptCanAccessClipboard: true + onUrlChanged: {runJavaScript(seekBarOverlayScript); } + onFullScreenRequested: function(request) { request.accept(); nav.visible = !nav.visible diff --git a/clickable.json b/clickable.json index 1370b16..9666ed3 100644 --- a/clickable.json +++ b/clickable.json @@ -1,5 +1,6 @@ { + "builder": "cmake", "clickable_minimum_required": "6.12.2", - "qt_version": "5.12", + "qt_version": "5.12", "kill": "youtube-web" }