From 798c850cef6d89bfa453adac37510f4a9f9b8743 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enes=20Yak=C4=B1=C5=9Ft=C4=B1r?= Date: Sun, 1 Nov 2026 10:39:57 +0300 Subject: [PATCH] fix(a11y): improve player controls visibility, restore browser Alt+Left navigation, add back button, and filter successful import notifications (v1.7.3) --- client.js | 29 +++++++++++++++++++++++++---- main.js | 21 ++++++++++++++++++++- package.json | 4 ++-- style.css | 26 ++++++++++++++++++++++++++ 4 files changed, 73 insertions(+), 7 deletions(-) diff --git a/client.js b/client.js index ace4897..b2a9f10 100644 --- a/client.js +++ b/client.js @@ -1963,6 +1963,15 @@ try { } function injectControlBarSeekButtons(playerWrapper) { + // A11y: Video.js büyük oynat butonunu ve denetim çubuğu butonlarını ekran okuyuculara erişilebilir kıl + // big-play-button custom label removed per user preference + var playBtn = (playerWrapper || document).querySelector('.vjs-play-control'); + if (playBtn && !playBtn.hasAttribute('data-yaktube-a11y-label')) { + playBtn.setAttribute('data-yaktube-a11y-label', 'true'); + var videoEl = getVideoElement(); + var isPaused = videoEl ? videoEl.paused : true; + playBtn.setAttribute('aria-label', isPaused ? 'Oynat (Boşluk veya K)' : 'Duraklat (Boşluk veya K)'); + } var controlBar = (playerWrapper || document).querySelector('.vjs-control-bar'); if (!controlBar) return; @@ -2202,7 +2211,7 @@ try { } // Left Arrow or J: Rewind 10s - if (e.key === 'ArrowLeft' || e.key === 'j' || e.key === 'J') { + if ((e.key === 'ArrowLeft' && !e.altKey) || e.key === 'j' || e.key === 'J') { e.preventDefault(); e.stopPropagation(); video.currentTime = Math.max(0, video.currentTime - 10); @@ -2212,7 +2221,7 @@ try { } // Right Arrow or L: Forward 10s - if (e.key === 'ArrowRight' || e.key === 'l' || e.key === 'L') { + if ((e.key === 'ArrowRight' && !e.altKey) || e.key === 'l' || e.key === 'L') { e.preventDefault(); e.stopPropagation(); video.currentTime = Math.min(video.duration || 999999, video.currentTime + 10); @@ -2352,6 +2361,7 @@ try { bar.innerHTML = '🛠️ Video Araçları:' + + '' + '' + '' + '' + @@ -2378,6 +2388,17 @@ try { } // Attach button actions + var backBtn = bar.querySelector('#yaktube-bar-back-btn'); + if (backBtn) { + backBtn.addEventListener('click', function () { + if (window.history.length > 1) { + window.history.back(); + } else { + window.location.href = '/videos/overview'; + } + }); + } + bar.querySelector('#yaktube-bar-speed-btn').addEventListener('click', function () { adjustPlaybackSpeed(true); }); @@ -2544,11 +2565,11 @@ try { announce('10 saniye ileri sarıldı. Konum: ' + formatTime(video.currentTime)); } // Seek 5s Back / Forward (ArrowLeft / ArrowRight or Alt+Left/Right) - else if (e.key === 'ArrowLeft' || (alt && e.key === 'ArrowLeft')) { + else if (e.key === 'ArrowLeft' && !alt) { e.preventDefault(); video.currentTime = Math.max(0, video.currentTime - 5); announce('5 saniye geri sarıldı. Konum: ' + formatTime(video.currentTime)); - } else if (e.key === 'ArrowRight' || (alt && e.key === 'ArrowRight')) { + } else if (e.key === 'ArrowRight' && !alt) { e.preventDefault(); video.currentTime = Math.min(video.duration || 99999, video.currentTime + 5); announce('5 saniye ileri sarıldı. Konum: ' + formatTime(video.currentTime)); diff --git a/main.js b/main.js index 1734e4e..97681c2 100644 --- a/main.js +++ b/main.js @@ -178,9 +178,28 @@ function isContentBlocked(text, list = DEFAULT_BLOCKED_KEYWORDS) { return false; } -async function register({ getRouter, registerSetting, settingsManager, peertubeHelpers, logger }) { +async function register({ registerHook, getRouter, registerSetting, settingsManager, peertubeHelpers, logger }) { const router = getRouter(); + // YakTube Bildirim Filtresi: Başarılı video içe aktarımları (type 7) bildirim kutusunu doldurmasın, + // Sadece başarısız olanlar (type 8 / MY_VIDEO_IMPORT_ERROR) bildirim olarak düşsün + if (typeof registerHook === 'function') { + registerHook({ + target: 'filter:notifier.notification.enabled.result', + handler: async (result, { notification }) => { + if (notification && (notification.type === 7 || notification.type === 'my-video-import-success')) { + return { + webNotificationEnabled: false, + emailNotificationEnabled: false + }; + } + return result; + } + }); + if (logger) logger.info('[YakTube OnDemand] Registered filter:notifier.notification.enabled.result (suppressing successful import notifications).'); + } + + let guestImportLimit = 5; let maxDiskUsagePercent = 85; let customChannelId = ''; diff --git a/package.json b/package.json index 07d071e..a59984c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "peertube-plugin-yaktube-ondemand", - "version": "1.7.2", + "version": "1.7.3", "description": "Accessible On-Demand YouTube Import, Live Streams, Smart Recommendations, Sleep Timer, Touch Gestures, Voice Assistant & A11y Engine for PeerTube", "main": "main.js", "library": "./main.js", @@ -48,4 +48,4 @@ "homepage": "https://yaktube.yakhub.com.tr", "bugs": "https://github.com/yakistir98/peertube-plugin-yaktube-ondemand/issues", "license": "AGPL-3.0-or-later" -} +} \ No newline at end of file diff --git a/style.css b/style.css index a194543..7797e05 100644 --- a/style.css +++ b/style.css @@ -1763,3 +1763,29 @@ my-date-toggle .date-toggle:focus-visible { background-color: rgba(255, 143, 55, 0.15) !important; outline: 2px solid #ff8f37 !important; } + + +/* === YakTube WCAG 2.1 AAA Video Player Accessibility: Keep Controls Accessible === */ + +/* 1. Video duraklatıldığında veya klavye/ekran okuyucu odaklandığında denetim çubuğunu görünür tut */ +.video-js.vjs-paused .vjs-control-bar, +.video-js:focus-within .vjs-control-bar, +.video-js .vjs-control-bar:focus-within, +.video-js.vjs-user-inactive.vjs-paused .vjs-control-bar { + opacity: 1 !important; + visibility: visible !important; + display: flex !important; + pointer-events: auto !important; +} + +/* 2. Büyük merkez oynatma düğmesi PeerTube varsayılanında bırakıldı */ + +/* 3. Tüm Video.js düğmelerinin klavye odağını belirgin kıl */ +.video-js .vjs-control-bar .vjs-button:focus, +.video-js .vjs-control-bar .vjs-button:focus-visible, +.video-js .vjs-big-play-button:focus, +.video-js .vjs-big-play-button:focus-visible { + outline: 3px solid #ff8f37 !important; + outline-offset: 2px !important; + box-shadow: 0 0 10px rgba(255, 143, 55, 0.8) !important; +}