Compare commits
35 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9999d6a633 | ||
|
|
a935fd7d5d | ||
|
|
60293e81e1 | ||
|
|
f54e55fe04 | ||
|
|
b3c42e2100 | ||
|
|
20ddbb32c7 | ||
|
|
14a5075e22 | ||
|
|
accb316a81 | ||
|
|
51c5cdf5bf | ||
|
|
306eff757b | ||
|
|
b8f28a5735 | ||
|
|
0932d9611d | ||
|
|
5e616db0ae | ||
|
|
538b0f2110 | ||
|
|
e717c07c54 | ||
|
|
0fa2d01ca3 | ||
|
|
5299b2a9d5 | ||
|
|
4f244988b9 | ||
|
|
5635a8f05e | ||
|
|
c901da4b0c | ||
|
|
c45cd0281f | ||
|
|
0c3e74829a | ||
|
|
e6b769f099 | ||
|
|
77371f7b98 | ||
|
|
988b800b6d | ||
|
|
4c6514ba9f | ||
|
|
6910eba7d6 | ||
|
|
3585b47b6c | ||
|
|
8170abdc94 | ||
|
|
535c0e17bf | ||
|
|
df1cee0eeb | ||
|
|
16cc56030f | ||
|
|
13ecbac96e | ||
|
|
8bca6f9052 | ||
|
|
217db2a66d |
@@ -12,7 +12,7 @@
|
||||
<!-- <TreatWarningsAsErrors>false</TreatWarningsAsErrors> -->
|
||||
<Title>Jellyfin Media Bar Enhanced Plugin</Title>
|
||||
<Authors>CodeDevMLH</Authors>
|
||||
<Version>1.5.0.8</Version>
|
||||
<Version>1.5.0.24</Version>
|
||||
<RepositoryUrl>https://github.com/CodeDevMLH/jellyfin-plugin-media-bar-enhanced</RepositoryUrl>
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
@@ -161,7 +161,7 @@
|
||||
|
||||
.homeSectionsContainer {
|
||||
position: relative;
|
||||
top: 65vh;
|
||||
margin-top: 65vh;
|
||||
z-index: 6;
|
||||
}
|
||||
|
||||
|
||||
@@ -85,6 +85,7 @@ const STATE = {
|
||||
isMuted: CONFIG.startMuted,
|
||||
customTrailerUrls: {},
|
||||
ytPromise: null,
|
||||
autoplayTimeouts: [],
|
||||
},
|
||||
};
|
||||
|
||||
@@ -605,7 +606,10 @@ const SlideUtils = {
|
||||
getOrCreateSlidesContainer() {
|
||||
let container = document.getElementById("slides-container");
|
||||
if (!container) {
|
||||
container = this.createElement("div", { id: "slides-container" });
|
||||
container = this.createElement("div", {
|
||||
id: "slides-container",
|
||||
className: "noautofocus"
|
||||
});
|
||||
document.body.appendChild(container);
|
||||
}
|
||||
return container;
|
||||
@@ -1413,6 +1417,24 @@ class SlideTimer {
|
||||
*/
|
||||
const VisibilityObserver = {
|
||||
updateVisibility() {
|
||||
const videoPlayer = document.querySelector('.videoPlayerContainer');
|
||||
const trailerPlayer = document.querySelector('.youtubePlayerContainer');
|
||||
|
||||
// If a full screen video player is active, hide slideshow and stop playback
|
||||
if ((videoPlayer && !videoPlayer.classList.contains('hide')) || (trailerPlayer && !trailerPlayer.classList.contains('hide'))) {
|
||||
const container = document.getElementById("slides-container");
|
||||
if (container) {
|
||||
container.style.display = "none";
|
||||
container.style.visibility = "hidden";
|
||||
container.style.pointerEvents = "none";
|
||||
}
|
||||
if (STATE.slideshow.slideInterval) {
|
||||
STATE.slideshow.slideInterval.stop();
|
||||
}
|
||||
SlideshowManager.stopAllPlayback();
|
||||
return;
|
||||
}
|
||||
|
||||
const activeTab = document.querySelector(".emby-tab-button-active");
|
||||
const container = document.getElementById("slides-container");
|
||||
|
||||
@@ -1657,10 +1679,23 @@ const SlideCreator = {
|
||||
|
||||
// Only play if this is the active slide
|
||||
const slide = document.querySelector(`.slide[data-item-id="${itemId}"]`);
|
||||
if (slide && slide.classList.contains('active')) {
|
||||
const isVideoPlayerOpen = document.querySelector('.videoPlayerContainer') || document.querySelector('.youtubePlayerContainer');
|
||||
|
||||
if (slide && slide.classList.contains('active') && !document.hidden && (!isVideoPlayerOpen || isVideoPlayerOpen.classList.contains('hide'))) {
|
||||
event.target.playVideo();
|
||||
|
||||
// Check if it actually started playing after a short delay (handling autoplay blocks)
|
||||
setTimeout(() => {
|
||||
const timeoutId = setTimeout(() => {
|
||||
// Re-check conditions before processing fallback
|
||||
const isVideoPlayerOpenNow = document.querySelector('.videoPlayerContainer') || document.querySelector('.youtubePlayerContainer');
|
||||
if (document.hidden || (isVideoPlayerOpenNow && !isVideoPlayerOpenNow.classList.contains('hide')) || !slide.classList.contains('active')) {
|
||||
console.log(`Navigation detected during autoplay check for ${itemId}, stopping video.`);
|
||||
try {
|
||||
event.target.stopVideo();
|
||||
} catch (e) { console.warn("Error stopping video in timeout:", e); }
|
||||
return;
|
||||
}
|
||||
|
||||
if (event.target.getPlayerState() !== YT.PlayerState.PLAYING &&
|
||||
event.target.getPlayerState() !== YT.PlayerState.BUFFERING) {
|
||||
console.warn(`Autoplay blocked for ${itemId}, attempting muted fallback`);
|
||||
@@ -1669,6 +1704,9 @@ const SlideCreator = {
|
||||
}
|
||||
}, 1000);
|
||||
|
||||
if (!STATE.slideshow.autoplayTimeouts) STATE.slideshow.autoplayTimeouts = [];
|
||||
STATE.slideshow.autoplayTimeouts.push(timeoutId);
|
||||
|
||||
// Pause slideshow timer when video starts if configured
|
||||
if (CONFIG.waitForTrailerToEnd && STATE.slideshow.slideInterval) {
|
||||
STATE.slideshow.slideInterval.stop();
|
||||
@@ -2544,15 +2582,26 @@ const SlideshowManager = {
|
||||
* Used when navigating away from the home screen
|
||||
*/
|
||||
stopAllPlayback() {
|
||||
// 1. Pause all YouTube players
|
||||
// Clear any pending autoplay timeouts
|
||||
if (STATE.slideshow.autoplayTimeouts) {
|
||||
STATE.slideshow.autoplayTimeouts.forEach(id => clearTimeout(id));
|
||||
STATE.slideshow.autoplayTimeouts = [];
|
||||
}
|
||||
|
||||
// 1. Stop all YouTube players
|
||||
if (STATE.slideshow.videoPlayers) {
|
||||
Object.values(STATE.slideshow.videoPlayers).forEach(player => {
|
||||
try {
|
||||
if (player && typeof player.pauseVideo === 'function') {
|
||||
if (player && typeof player.stopVideo === 'function') {
|
||||
player.stopVideo();
|
||||
if (typeof player.clearVideo === 'function') {
|
||||
player.clearVideo();
|
||||
}
|
||||
} else if (player && typeof player.pauseVideo === 'function') {
|
||||
player.pauseVideo();
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn("Error pausing YouTube player:", e);
|
||||
console.warn("Error pausing/stopping YouTube player:", e);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -2655,41 +2704,52 @@ const SlideshowManager = {
|
||||
return;
|
||||
}
|
||||
|
||||
// Only trap keys if focus is on body (neutral) or inside our container.
|
||||
// To allow standard TV navigation to work for other elements (e.g. library cards).
|
||||
const activeEl = document.activeElement;
|
||||
const isBody = activeEl === document.body || !activeEl;
|
||||
const isInContainer = container.contains(activeEl) || activeEl === container;
|
||||
|
||||
if (!isBody && !isInContainer) {
|
||||
const activeElement = document.activeElement;
|
||||
// Check if we're in TV mode (checking class on html or body is more reliable)
|
||||
const isTvMode = document.documentElement.classList.contains('layout-tv') || document.body.classList.contains('layout-tv') || (window.layoutManager && window.layoutManager.tv);
|
||||
const isSlideshowFocused = container.contains(activeElement) || activeElement === container || (!isTvMode && activeElement === document.body);
|
||||
|
||||
const isInputElement = activeElement && (activeElement.tagName === 'INPUT' || activeElement.tagName === 'TEXTAREA' || activeElement.isContentEditable);
|
||||
|
||||
if (isInputElement) {
|
||||
return;
|
||||
}
|
||||
|
||||
const focusElement = document.activeElement;
|
||||
// Check if video player is open
|
||||
const videoPlayer = document.querySelector('.videoPlayerContainer');
|
||||
const trailerPlayer = document.querySelector('.youtubePlayerContainer');
|
||||
if ((videoPlayer && !videoPlayer.classList.contains('hide')) || (trailerPlayer && !trailerPlayer.classList.contains('hide'))) {
|
||||
return;
|
||||
}
|
||||
|
||||
switch (e.key) {
|
||||
case "ArrowRight":
|
||||
if (isTvMode && !isSlideshowFocused) return;
|
||||
SlideshowManager.nextSlide();
|
||||
e.preventDefault();
|
||||
break;
|
||||
|
||||
case "ArrowLeft":
|
||||
if (isTvMode && !isSlideshowFocused) return;
|
||||
SlideshowManager.prevSlide();
|
||||
e.preventDefault();
|
||||
break;
|
||||
|
||||
case " ": // Space bar
|
||||
if (isTvMode && !isSlideshowFocused) return;
|
||||
this.togglePause();
|
||||
e.preventDefault();
|
||||
break;
|
||||
|
||||
case "m": // Mute toggle
|
||||
case "M":
|
||||
if (isTvMode && !isSlideshowFocused) return;
|
||||
this.toggleMute();
|
||||
e.preventDefault();
|
||||
break;
|
||||
|
||||
case "Enter":
|
||||
if (!isSlideshowFocused) return;
|
||||
const currentItemId = STATE.slideshow.itemIds[STATE.slideshow.currentSlideIndex];
|
||||
if (currentItemId) {
|
||||
if (window.Emby && window.Emby.Page) {
|
||||
|
||||
@@ -9,12 +9,12 @@
|
||||
"imageUrl": "https://git.mahom03-spacecloud.de/CodeDevMLH/jellyfin-plugin-media-bar-enhanced/raw/branch/main/logo.png",
|
||||
"versions": [
|
||||
{
|
||||
"version": "1.5.0.8",
|
||||
"changelog": "- fix: keyboard controls in TV mode\n- Add sorting options for content\n- Update mediaBarEnhanced.js and mediaBarEnhanced.css with version 4.0.1 from original repo",
|
||||
"version": "1.5.0.24",
|
||||
"changelog": "- fix: Keyboard controls in TV mode\n- Add sorting options for content\n- Update mediaBarEnhanced.js and mediaBarEnhanced.css with version 4.0.1 from original repo",
|
||||
"targetAbi": "10.11.0.0",
|
||||
"sourceUrl": "https://git.mahom03-spacecloud.de/CodeDevMLH/jellyfin-plugin-media-bar-enhanced/releases/download/v1.5.0.8/Jellyfin.Plugin.MediaBarEnhanced.zip",
|
||||
"checksum": "f0541cd85271cda5ce9fb786b69e8376",
|
||||
"timestamp": "2026-02-09T13:11:29Z"
|
||||
"sourceUrl": "https://git.mahom03-spacecloud.de/CodeDevMLH/jellyfin-plugin-media-bar-enhanced/releases/download/v1.5.0.24/Jellyfin.Plugin.MediaBarEnhanced.zip",
|
||||
"checksum": "3a845b9a81b6305f84ea6bc7058155f8",
|
||||
"timestamp": "2026-02-09T23:53:20Z"
|
||||
},
|
||||
{
|
||||
"version": "1.3.0.3",
|
||||
|
||||
Reference in New Issue
Block a user