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
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
15361a21b6 | ||
|
|
c6e5abf87e | ||
|
|
e161dea9da |
+1
-1
@@ -1,4 +1,4 @@
|
||||
node_modules/
|
||||
docs/
|
||||
*.log
|
||||
.DS_Store
|
||||
dist/
|
||||
@@ -0,0 +1,4 @@
|
||||
docs/
|
||||
*.log
|
||||
.git
|
||||
.github
|
||||
@@ -1827,10 +1827,17 @@
|
||||
function getRecentSearches() {
|
||||
try {
|
||||
var data = localStorage.getItem('yaktube_recent_searches');
|
||||
return data ? JSON.parse(data) : [];
|
||||
} catch (e) {
|
||||
return [];
|
||||
}
|
||||
if (data) {
|
||||
var parsed = JSON.parse(data);
|
||||
if (Array.isArray(parsed) && parsed.length > 0) return parsed;
|
||||
}
|
||||
} catch (e) {}
|
||||
// Default initial recent searches for first-time visitors
|
||||
var defaults = ['Tarkan', 'Barış Manço', 'Yapay Zeka', 'Canlı Haber'];
|
||||
try {
|
||||
localStorage.setItem('yaktube_recent_searches', JSON.stringify(defaults));
|
||||
} catch (e) {}
|
||||
return defaults;
|
||||
}
|
||||
|
||||
function saveRecentSearch(query) {
|
||||
@@ -1867,6 +1874,19 @@
|
||||
{ title: '🎙️ Podcast & Söyleşi', q: 'Podcast Türkçe' }
|
||||
];
|
||||
|
||||
// Auto capture search query from URL into recent searches
|
||||
function captureUrlSearchQuery() {
|
||||
try {
|
||||
var params = new URLSearchParams(window.location.search);
|
||||
var q = params.get('search') || params.get('q');
|
||||
if (q && q.trim().length >= 2) {
|
||||
saveRecentSearch(q.trim());
|
||||
}
|
||||
} catch (e) {}
|
||||
}
|
||||
captureUrlSearchQuery();
|
||||
window.addEventListener('popstate', captureUrlSearchQuery);
|
||||
|
||||
function renderDynamicSearchChips() {
|
||||
var modal = document.getElementById('yaktube-full-search-modal');
|
||||
if (!modal) return;
|
||||
@@ -1970,17 +1990,7 @@
|
||||
'<div id="yaktube-modal-voice-transcript" class="yaktube-modal-voice-transcript">Lütfen aramak istediğiniz videoyu söyleyin...</div>' +
|
||||
'<button id="yaktube-modal-mic-pulse" class="yaktube-modal-mic-pulse-btn" aria-label="Mikrofonu durdur">🎙️</button>' +
|
||||
'</div>' +
|
||||
'<div class="yaktube-modal-section-title">🔥 Hızlı ve Popüler Aramalar</div>' +
|
||||
'<div class="yaktube-modal-chips-grid">' +
|
||||
'<button class="yaktube-modal-chip" data-query="Tarkan">🎵 Tarkan</button>' +
|
||||
'<button class="yaktube-modal-chip" data-query="Barış Manço">🎸 Barış Manço</button>' +
|
||||
'<button class="yaktube-modal-chip" data-query="Python Dersleri">💻 Python Dersleri</button>' +
|
||||
'<button class="yaktube-modal-chip" data-query="Yapay Zeka">🤖 Yapay Zeka</button>' +
|
||||
'<button class="yaktube-modal-chip" data-query="Sesli Kitap">🎧 Sesli Kitap</button>' +
|
||||
'<button class="yaktube-modal-chip" data-query="Canlı Haber">📺 Canlı Haber</button>' +
|
||||
'<button class="yaktube-modal-chip" data-query="Gitar Dersi">🎼 Gitar Dersi</button>' +
|
||||
'<button class="yaktube-modal-chip" data-query="Bilim Belgeseli">🌍 Bilim Belgeseli</button>' +
|
||||
'</div>' +
|
||||
'<div id="yaktube-modal-dynamic-chips-section"></div>' +
|
||||
'<div class="yaktube-modal-hint-footer">' +
|
||||
'<span>💡 <b>Enter</b> ile ara, <b>Shift+V</b> ile sesli ara</span>' +
|
||||
'<span><b>Escape</b> ile kapat</span>' +
|
||||
@@ -2889,7 +2899,12 @@
|
||||
headerButtons.prepend(installBtn);
|
||||
}
|
||||
|
||||
function isYakTubeInstance() {
|
||||
return window.location.hostname.includes('yaktube.yakhub.com.tr') || getInstanceName() === 'YakTube';
|
||||
}
|
||||
|
||||
function injectApkDownloadButton() {
|
||||
if (!isYakTubeInstance()) return;
|
||||
// 1. If inside APK: NEVER show APK button
|
||||
if (isInsideYakTubeApp) {
|
||||
var existBtnApp = document.getElementById('yaktube-apk-download-btn');
|
||||
@@ -2934,6 +2949,7 @@
|
||||
}
|
||||
|
||||
function injectSidebarApkLink() {
|
||||
if (!isYakTubeInstance()) return;
|
||||
// If inside APK: NEVER show in sidebar
|
||||
if (isInsideYakTubeApp) {
|
||||
var existLink = document.getElementById('yaktube-sidebar-apk-link');
|
||||
@@ -2981,3 +2997,132 @@
|
||||
});
|
||||
checkAndInjectWatchPageComments();
|
||||
})();
|
||||
|
||||
// 5. Background Play (Screen-Off / Minimize) & MediaSession Lock-Screen Controls
|
||||
(function initBackgroundPlaybackEngine() {
|
||||
var videoState = {
|
||||
hasPlayed: false,
|
||||
pausedByUser: false,
|
||||
pausedAt: null
|
||||
};
|
||||
|
||||
function attachVideoListeners(video) {
|
||||
if (!video || video.hasAttribute('data-yaktube-bgplay-hooked')) return;
|
||||
video.setAttribute('data-yaktube-bgplay-hooked', 'true');
|
||||
|
||||
video.addEventListener('play', function () {
|
||||
videoState.hasPlayed = true;
|
||||
videoState.pausedByUser = false;
|
||||
updateMediaSessionMetadata(video);
|
||||
});
|
||||
|
||||
video.addEventListener('pause', function () {
|
||||
videoState.pausedAt = Date.now();
|
||||
// If document is visible when paused, it was paused manually by the user
|
||||
if (!document.hidden) {
|
||||
videoState.pausedByUser = true;
|
||||
}
|
||||
});
|
||||
|
||||
video.addEventListener('ended', function () {
|
||||
videoState.hasPlayed = false;
|
||||
videoState.pausedByUser = true;
|
||||
});
|
||||
|
||||
video.addEventListener('timeupdate', function () {
|
||||
updateMediaSessionPosition(video);
|
||||
});
|
||||
}
|
||||
|
||||
function handleVisibilityChange() {
|
||||
if (!document.hidden) return; // Screen is active
|
||||
|
||||
var video = getVideoElement();
|
||||
if (!video) return;
|
||||
|
||||
// If user hasn't played or deliberately paused, do not auto-resume
|
||||
if (!videoState.hasPlayed || videoState.pausedByUser) return;
|
||||
|
||||
var now = Date.now();
|
||||
if (videoState.pausedAt && now - videoState.pausedAt > 1500 && videoState.pausedByUser) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Resume playback when screen locks or tab switches
|
||||
setTimeout(function () {
|
||||
if (video.paused && !videoState.pausedByUser) {
|
||||
video.play().catch(function () {});
|
||||
}
|
||||
}, 50);
|
||||
}
|
||||
|
||||
document.addEventListener('visibilitychange', handleVisibilityChange, false);
|
||||
document.addEventListener('webkitvisibilitychange', handleVisibilityChange, false);
|
||||
|
||||
// MediaSession API Integration (Lock Screen, Bluetooth, Smart Watches)
|
||||
function updateMediaSessionMetadata(video) {
|
||||
if (!('mediaSession' in navigator)) return;
|
||||
|
||||
var titleEl = document.querySelector('h1.video-title, .video-name, my-video-watch h1, .title');
|
||||
var title = titleEl ? titleEl.textContent.trim() : 'YakTube Video';
|
||||
var authorEl = document.querySelector('.actor-name, .channel-name, .video-channel-name, a.actor-link');
|
||||
var artist = authorEl ? authorEl.textContent.trim() : 'YakTube';
|
||||
|
||||
var artwork = [];
|
||||
var thumbEl = document.querySelector('meta[property="og:image"]');
|
||||
if (thumbEl && thumbEl.content) {
|
||||
artwork.push({ src: thumbEl.content, sizes: '512x512', type: 'image/jpeg' });
|
||||
}
|
||||
|
||||
try {
|
||||
navigator.mediaSession.metadata = new MediaMetadata({
|
||||
title: title,
|
||||
artist: artist,
|
||||
album: 'YakTube',
|
||||
artwork: artwork
|
||||
});
|
||||
|
||||
navigator.mediaSession.setActionHandler('play', function () {
|
||||
video.play();
|
||||
announce('Video oynatılıyor.');
|
||||
});
|
||||
navigator.mediaSession.setActionHandler('pause', function () {
|
||||
videoState.pausedByUser = true;
|
||||
video.pause();
|
||||
announce('Video duraklatıldı.');
|
||||
});
|
||||
navigator.mediaSession.setActionHandler('seekbackward', function (details) {
|
||||
var skipTime = details.seekOffset || 10;
|
||||
video.currentTime = Math.max(0, video.currentTime - skipTime);
|
||||
announce(skipTime + ' saniye geri sarıldı.');
|
||||
});
|
||||
navigator.mediaSession.setActionHandler('seekforward', function (details) {
|
||||
var skipTime = details.seekOffset || 10;
|
||||
video.currentTime = Math.min(video.duration || 99999, video.currentTime + skipTime);
|
||||
announce(skipTime + ' saniye ileri sarıldı.');
|
||||
});
|
||||
navigator.mediaSession.setActionHandler('stop', function () {
|
||||
videoState.pausedByUser = true;
|
||||
video.pause();
|
||||
});
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
function updateMediaSessionPosition(video) {
|
||||
if (!('mediaSession' in navigator) || !navigator.mediaSession.setPositionState) return;
|
||||
if (isNaN(video.duration) || isNaN(video.currentTime) || video.duration <= 0) return;
|
||||
try {
|
||||
navigator.mediaSession.setPositionState({
|
||||
duration: video.duration,
|
||||
playbackRate: video.playbackRate || 1,
|
||||
position: Math.min(video.currentTime, video.duration)
|
||||
});
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
// Auto-hook active video elements
|
||||
setInterval(function () {
|
||||
var video = getVideoElement();
|
||||
if (video) attachVideoListeners(video);
|
||||
}, 1000);
|
||||
})();
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "peertube-plugin-yaktube-ondemand",
|
||||
"version": "1.4.6",
|
||||
"version": "1.4.9",
|
||||
"description": "Accessible On-Demand YouTube Import, Live Streams, Smart Recommendations and A11y Engine for PeerTube",
|
||||
"main": "main.js",
|
||||
"library": "./main.js",
|
||||
|
||||
Reference in New Issue
Block a user