Git Komut Rehberi & Terminal Asistanı
Sıfırdan Yeni Bir Depo Başlatın:
Mevcut Bir Git Deposu veya Klasörü Gönderin:
Hataları Geri Alma, İptal & Temizlik:
Son commit'i geri al (yapılan değişiklikleri korur):
git reset --soft HEAD~1
Yapılan yerel değişiklikleri iptal et (çalışma ağacını temizler):
git restore .
Takip edilmeyen gereksiz dosyaları sil:
git clean -fd
Değişiklikleri geçici sakla ve geri getir (stash):
git stash git stash pop
Dal (Branch) ve Sürüm Etiketleri:
Yeni dal aç ve geçiş yap:
git checkout -b yeni-ozellik git push -u origin yeni-ozellik
Sürüm etiketi (tag) oluştur ve gönder:
git tag -a v1.0.0 -m "Sürüm 1.0.0" git push origin --tags
feat: add embed player support with 10s seek and speed controls (v1.5.11)
This commit is contained in:
@@ -1231,10 +1231,12 @@ try {
|
|||||||
var toast = document.createElement('div');
|
var toast = document.createElement('div');
|
||||||
toast.id = 'yaktube-quick-toast';
|
toast.id = 'yaktube-quick-toast';
|
||||||
toast.className = 'yaktube-quick-toast';
|
toast.className = 'yaktube-quick-toast';
|
||||||
|
var isEmbed = (typeof isEmbedUrl === 'function' && isEmbedUrl()) || (window.self !== window.top);
|
||||||
|
var toastTop = isEmbed ? '28px' : '80px';
|
||||||
toast.style.cssText =
|
toast.style.cssText =
|
||||||
'position:fixed!important;top:80px!important;left:50%!important;transform:translateX(-50%)!important;' +
|
'position:fixed!important;top:' + toastTop + '!important;left:50%!important;transform:translateX(-50%)!important;' +
|
||||||
'background:rgba(24,24,31,0.92)!important;border:1px solid #ff8f37!important;color:#fff!important;' +
|
'background:rgba(24,24,31,0.92)!important;border:1px solid #ff8f37!important;color:#fff!important;' +
|
||||||
'padding:10px 22px!important;border-radius:30px!important;font-size:14px!important;font-weight:700!important;' +
|
'padding:8px 18px!important;border-radius:30px!important;font-size:13px!important;font-weight:700!important;' +
|
||||||
'box-shadow:0 10px 30px rgba(0,0,0,0.8)!important;z-index:999999!important;pointer-events:none!important;' +
|
'box-shadow:0 10px 30px rgba(0,0,0,0.8)!important;z-index:999999!important;pointer-events:none!important;' +
|
||||||
'backdrop-filter:blur(8px)!important;display:flex!important;align-items:center!important;gap:8px!important;';
|
'backdrop-filter:blur(8px)!important;display:flex!important;align-items:center!important;gap:8px!important;';
|
||||||
toast.innerHTML = (icon ? '<span>' + icon + '</span> ' : '') + '<span>' + message + '</span>';
|
toast.innerHTML = (icon ? '<span>' + icon + '</span> ' : '') + '<span>' + message + '</span>';
|
||||||
@@ -1738,14 +1740,19 @@ try {
|
|||||||
// YAKTUBE ACCESSIBLE VIDEO PLAYER & WATCH PAGE ENGINE (W3C WAI-ARIA)
|
// YAKTUBE ACCESSIBLE VIDEO PLAYER & WATCH PAGE ENGINE (W3C WAI-ARIA)
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
function focusVideoPlayer() {
|
function focusVideoPlayer() {
|
||||||
var playerWrapper = document.getElementById('videojs-wrapper') || document.querySelector('.video-js');
|
var playerWrapper =
|
||||||
|
document.getElementById('videojs-wrapper') ||
|
||||||
|
document.querySelector('.video-js') ||
|
||||||
|
document.getElementById('video-wrapper');
|
||||||
if (playerWrapper) {
|
if (playerWrapper) {
|
||||||
playerWrapper.scrollIntoView({ behavior: 'smooth', block: 'center' });
|
playerWrapper.scrollIntoView({ behavior: 'smooth', block: 'center' });
|
||||||
playerWrapper.focus();
|
playerWrapper.focus();
|
||||||
var titleEl = document.querySelector(
|
var titleEl = document.querySelector(
|
||||||
'h1.video-info-name, .video-info-name h1, my-video-watch h1, .video-title, .title'
|
'h1.video-info-name, .video-info-name h1, my-video-watch h1, .video-title, .title'
|
||||||
);
|
);
|
||||||
var videoTitle = titleEl ? titleEl.textContent.trim() : 'Video';
|
var videoTitle = titleEl
|
||||||
|
? titleEl.textContent.trim()
|
||||||
|
: (document.title ? document.title.replace(/\s*-\s*(PeerTube|YakTube).*$/i, '').trim() : 'Video');
|
||||||
var video = getVideoElement();
|
var video = getVideoElement();
|
||||||
var status = video ? (video.paused ? 'Duraklatıldı' : 'Oynatılıyor') : '';
|
var status = video ? (video.paused ? 'Duraklatıldı' : 'Oynatılıyor') : '';
|
||||||
announce(
|
announce(
|
||||||
@@ -1895,10 +1902,21 @@ try {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function isEmbedUrl() {
|
||||||
|
if (typeof window === 'undefined' || !window.location) return false;
|
||||||
|
var p = window.location.pathname;
|
||||||
|
return p.includes('/videos/embed/') || p.startsWith('/videos/embed/');
|
||||||
|
}
|
||||||
|
|
||||||
function isWatchUrl() {
|
function isWatchUrl() {
|
||||||
if (typeof window === 'undefined' || !window.location) return false;
|
if (typeof window === 'undefined' || !window.location) return false;
|
||||||
var p = window.location.pathname;
|
var p = window.location.pathname;
|
||||||
return p.includes('/videos/watch/') || p.startsWith('/w/') || p.includes('/w/');
|
return (
|
||||||
|
p.includes('/videos/watch/') ||
|
||||||
|
p.startsWith('/w/') ||
|
||||||
|
p.includes('/w/') ||
|
||||||
|
isEmbedUrl()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function injectControlBarSeekButtons(playerWrapper) {
|
function injectControlBarSeekButtons(playerWrapper) {
|
||||||
@@ -1907,6 +1925,7 @@ try {
|
|||||||
|
|
||||||
var rewindBtn = controlBar.querySelector('.yaktube-vjs-rewind-btn');
|
var rewindBtn = controlBar.querySelector('.yaktube-vjs-rewind-btn');
|
||||||
var forwardBtn = controlBar.querySelector('.yaktube-vjs-forward-btn');
|
var forwardBtn = controlBar.querySelector('.yaktube-vjs-forward-btn');
|
||||||
|
var speedBtn = controlBar.querySelector('.yaktube-vjs-speed-btn');
|
||||||
var playControl = controlBar.querySelector('.vjs-play-control');
|
var playControl = controlBar.querySelector('.vjs-play-control');
|
||||||
|
|
||||||
if (!rewindBtn) {
|
if (!rewindBtn) {
|
||||||
@@ -1968,6 +1987,55 @@ try {
|
|||||||
controlBar.appendChild(forwardBtn);
|
controlBar.appendChild(forwardBtn);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!speedBtn) {
|
||||||
|
speedBtn = document.createElement('button');
|
||||||
|
speedBtn.className = 'vjs-control vjs-button yaktube-vjs-seek-btn yaktube-vjs-speed-btn';
|
||||||
|
speedBtn.type = 'button';
|
||||||
|
speedBtn.setAttribute('tabindex', '0');
|
||||||
|
speedBtn.setAttribute('aria-label', 'Oynatma Hızı: 1x (Değiştirmek için tıklayın veya Alt+.)');
|
||||||
|
speedBtn.setAttribute('title', 'Hız: 1x (Alt+.)');
|
||||||
|
speedBtn.innerHTML =
|
||||||
|
'<span class="yaktube-vjs-seek-icon" aria-hidden="true">⚡<span class="yaktube-vjs-speed-val">1x</span></span>' +
|
||||||
|
'<span class="vjs-control-text" aria-live="polite">Hız Değiştir</span>';
|
||||||
|
|
||||||
|
speedBtn.addEventListener('click', function (e) {
|
||||||
|
e.preventDefault();
|
||||||
|
e.stopPropagation();
|
||||||
|
var video = getVideoElement();
|
||||||
|
if (video) {
|
||||||
|
var speeds = [1, 1.25, 1.5, 1.75, 2, 0.5, 0.75];
|
||||||
|
var cur = video.playbackRate || 1;
|
||||||
|
var curIdx = speeds.indexOf(cur);
|
||||||
|
var nextSpeed = curIdx === -1 ? 1 : speeds[(curIdx + 1) % speeds.length];
|
||||||
|
video.playbackRate = nextSpeed;
|
||||||
|
var speedText = nextSpeed + 'x';
|
||||||
|
var numEl = speedBtn.querySelector('.yaktube-vjs-speed-val');
|
||||||
|
if (numEl) numEl.textContent = speedText;
|
||||||
|
speedBtn.setAttribute('aria-label', 'Oynatma Hızı: ' + speedText);
|
||||||
|
speedBtn.setAttribute('title', 'Hız: ' + speedText + ' (Alt+.)');
|
||||||
|
announce('Oynatma hızı: ' + speedText);
|
||||||
|
showQuickToast('⚡ Hız: ' + speedText);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (forwardBtn && forwardBtn.nextSibling) {
|
||||||
|
controlBar.insertBefore(speedBtn, forwardBtn.nextSibling);
|
||||||
|
} else {
|
||||||
|
controlBar.appendChild(speedBtn);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
var v = getVideoElement();
|
||||||
|
if (v) {
|
||||||
|
var curRate = (v.playbackRate || 1) + 'x';
|
||||||
|
var numEl = speedBtn.querySelector('.yaktube-vjs-speed-val');
|
||||||
|
if (numEl && numEl.textContent !== curRate) {
|
||||||
|
numEl.textContent = curRate;
|
||||||
|
speedBtn.setAttribute('aria-label', 'Oynatma Hızı: ' + curRate);
|
||||||
|
speedBtn.setAttribute('title', 'Hız: ' + curRate + ' (Alt+.)');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function enhanceVideoPlayerAccessibility() {
|
function enhanceVideoPlayerAccessibility() {
|
||||||
@@ -2010,10 +2078,12 @@ try {
|
|||||||
var titleEl = document.querySelector(
|
var titleEl = document.querySelector(
|
||||||
'h1.video-info-name, .video-info-name h1, my-video-watch h1, .video-title, .title'
|
'h1.video-info-name, .video-info-name h1, my-video-watch h1, .video-title, .title'
|
||||||
);
|
);
|
||||||
var videoTitle = titleEl ? titleEl.textContent.trim() : 'Video';
|
var videoTitle = titleEl
|
||||||
|
? titleEl.textContent.trim()
|
||||||
|
: (document.title ? document.title.replace(/\s*-\s*(PeerTube|YakTube).*$/i, '').trim() : 'Video');
|
||||||
|
|
||||||
// 3. Setup Top-Level Skip Link: "🎬 Video Oynatıcıya Atla (Alt+P)"
|
// 3. Setup Top-Level Skip Link: "🎬 Video Oynatıcıya Atla (Alt+P)"
|
||||||
if (!skipLink) {
|
if (!skipLink && !isEmbedUrl()) {
|
||||||
skipLink = document.createElement('a');
|
skipLink = document.createElement('a');
|
||||||
skipLink.id = 'yaktube-skip-to-player';
|
skipLink.id = 'yaktube-skip-to-player';
|
||||||
skipLink.className = 'yaktube-skip-link';
|
skipLink.className = 'yaktube-skip-link';
|
||||||
@@ -2027,8 +2097,11 @@ try {
|
|||||||
document.body.insertBefore(skipLink, document.body.firstChild);
|
document.body.insertBefore(skipLink, document.body.firstChild);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 4. Configure Player Container (#videojs-wrapper or .video-js)
|
// 4. Configure Player Container (#videojs-wrapper or .video-js or #video-wrapper)
|
||||||
var playerWrapper = document.getElementById('videojs-wrapper') || document.querySelector('.video-js');
|
var playerWrapper =
|
||||||
|
document.getElementById('videojs-wrapper') ||
|
||||||
|
document.querySelector('.video-js') ||
|
||||||
|
document.getElementById('video-wrapper');
|
||||||
if (playerWrapper) {
|
if (playerWrapper) {
|
||||||
if (!playerWrapper.hasAttribute('data-yaktube-a11y-enhanced')) {
|
if (!playerWrapper.hasAttribute('data-yaktube-a11y-enhanced')) {
|
||||||
playerWrapper.setAttribute('data-yaktube-a11y-enhanced', 'true');
|
playerWrapper.setAttribute('data-yaktube-a11y-enhanced', 'true');
|
||||||
@@ -2206,6 +2279,7 @@ try {
|
|||||||
// 3.1. Injects Accessible Player Action Bar under the Watch Video
|
// 3.1. Injects Accessible Player Action Bar under the Watch Video
|
||||||
function injectAccessiblePlayerBar() {
|
function injectAccessiblePlayerBar() {
|
||||||
if (!isWatchUrl()) return;
|
if (!isWatchUrl()) return;
|
||||||
|
if (isEmbedUrl()) return;
|
||||||
|
|
||||||
var targetContainer = document.querySelector(
|
var targetContainer = document.querySelector(
|
||||||
'my-video-watch, .video-watch, .watch-container, #yaktube-ondemand-container, .player-container, #video-wrapper, #videojs-wrapper'
|
'my-video-watch, .video-watch, .watch-container, #yaktube-ondemand-container, .player-container, #video-wrapper, #videojs-wrapper'
|
||||||
@@ -5315,9 +5389,3 @@ try {
|
|||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('[YakTube] Safe catch error:', err);
|
console.error('[YakTube] Safe catch error:', err);
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function register(options) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
export { register as registerClient };
|
|
||||||
export default register;
|
|
||||||
@@ -838,18 +838,38 @@ async function register({ getRouter, registerSetting, settingsManager, peertubeH
|
|||||||
});
|
});
|
||||||
|
|
||||||
// 6. Video YouTube Origin Detection Route
|
// 6. Video YouTube Origin Detection Route
|
||||||
|
const BASE58_ALPHABET = '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ';
|
||||||
|
function shortToUuid(shortStr) {
|
||||||
|
if (!shortStr || typeof shortStr !== 'string' || shortStr.length < 20 || shortStr.length > 24) return shortStr;
|
||||||
|
if (/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(shortStr)) return shortStr;
|
||||||
|
try {
|
||||||
|
let num = 0n;
|
||||||
|
for (let i = 0; i < shortStr.length; i++) {
|
||||||
|
const idx = BASE58_ALPHABET.indexOf(shortStr[i]);
|
||||||
|
if (idx === -1) return shortStr;
|
||||||
|
num = num * 58n + BigInt(idx);
|
||||||
|
}
|
||||||
|
const hex = num.toString(16).padStart(32, '0');
|
||||||
|
if (hex.length !== 32) return shortStr;
|
||||||
|
return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20, 32)}`;
|
||||||
|
} catch (e) {
|
||||||
|
return shortStr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
router.get('/video-origin/:uuid', async (req, res) => {
|
router.get('/video-origin/:uuid', async (req, res) => {
|
||||||
const uuid = (req.params.uuid || '').trim();
|
const rawParam = (req.params.uuid || '').trim();
|
||||||
if (!uuid) return res.status(400).json({ error: 'UUID required' });
|
if (!rawParam) return res.status(400).json({ error: 'UUID required' });
|
||||||
|
const resolvedUuid = shortToUuid(rawParam);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const rows = await dbQuery(
|
const rows = await dbQuery(
|
||||||
`SELECT v.id, v.uuid, v.name, v.description, vi."targetUrl"
|
`SELECT v.id, v.uuid, v.name, v.description, vi."targetUrl"
|
||||||
FROM "video" v
|
FROM "video" v
|
||||||
LEFT JOIN "videoImport" vi ON vi."videoId" = v.id
|
LEFT JOIN "videoImport" vi ON vi."videoId" = v.id
|
||||||
WHERE v.uuid::text = $1 OR v."shortUUID" = $1 OR v.id::text = $1
|
WHERE v.uuid::text = $1 OR v.id::text = $2
|
||||||
LIMIT 1`,
|
LIMIT 1`,
|
||||||
[uuid]
|
[resolvedUuid, rawParam]
|
||||||
);
|
);
|
||||||
if (rows.length === 0) {
|
if (rows.length === 0) {
|
||||||
return res.status(404).json({ error: 'Video not found' });
|
return res.status(404).json({ error: 'Video not found' });
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "peertube-plugin-yaktube-ondemand",
|
"name": "peertube-plugin-yaktube-ondemand",
|
||||||
"version": "1.5.10",
|
"version": "1.5.11",
|
||||||
"description": "Accessible On-Demand YouTube Import, Live Streams, Smart Recommendations, Sleep Timer, Touch Gestures, Voice Assistant & A11y Engine for PeerTube",
|
"description": "Accessible On-Demand YouTube Import, Live Streams, Smart Recommendations, Sleep Timer, Touch Gestures, Voice Assistant & A11y Engine for PeerTube",
|
||||||
"main": "main.js",
|
"main": "main.js",
|
||||||
"library": "./main.js",
|
"library": "./main.js",
|
||||||
|
|||||||
@@ -1527,7 +1527,8 @@ my-date-toggle .date-toggle:focus-visible {
|
|||||||
line-height: 1 !important;
|
line-height: 1 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.yaktube-vjs-seek-num {
|
.yaktube-vjs-seek-num,
|
||||||
|
.yaktube-vjs-speed-val {
|
||||||
font-size: 10px !important;
|
font-size: 10px !important;
|
||||||
font-weight: 800 !important;
|
font-weight: 800 !important;
|
||||||
font-family:
|
font-family:
|
||||||
|
|||||||
Reference in New Issue
Block a user