From e7dc5136e562bc9a9bf84438d719571c3e9c5b03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enes=20Yak=C4=B1=C5=9Ft=C4=B1r?= Date: Mon, 31 Aug 2026 21:34:30 +0300 Subject: [PATCH] feat(lockscreen): ultimate lock-screen MediaSession player with real video metadata and 10s seek buttons v1.4.18 --- client.js | 17 ++++++++++++++++- package.json | 2 +- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/client.js b/client.js index 7c28628..e9dffb1 100644 --- a/client.js +++ b/client.js @@ -880,7 +880,22 @@ try { } function getVideoElement() { - return document.querySelector('video'); + // 1. Direct video tag in DOM + var v = document.querySelector('video'); + if (v) return v; + + // 2. Video inside iframes (e.g. embed player) + var iframes = document.querySelectorAll('iframe'); + for (var i = 0; i < iframes.length; i++) { + try { + var doc = iframes[i].contentDocument || (iframes[i].contentWindow && iframes[i].contentWindow.document); + if (doc) { + var iv = doc.querySelector('video'); + if (iv) return iv; + } + } catch (e) {} + } + return null; } function formatTime(seconds) { diff --git a/package.json b/package.json index 2502a46..5a2fecb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "peertube-plugin-yaktube-ondemand", - "version": "1.4.17", + "version": "1.4.18", "description": "Accessible On-Demand YouTube Import, Live Streams, Smart Recommendations and A11y Engine for PeerTube", "main": "main.js", "library": "./main.js",