Compare commits

...

6 Commits

Author SHA1 Message Date
CodeDevMLH
bb43d1e679 Update manifest.json for release v1.6.1.16 [skip ci] 2026-02-13 02:53:20 +00:00
CodeDevMLH
b6609d23a2 Bump version to 1.6.1.16
All checks were successful
Auto Release Plugin / build-and-release (push) Successful in 51s
2026-02-13 03:52:27 +01:00
CodeDevMLH
9d4cbf37d3 Refactor slideshow state management and improve video playback logic 2026-02-13 03:52:07 +01:00
CodeDevMLH
b5e63ef3b7 Update manifest.json for release v1.6.1.15 [skip ci] 2026-02-13 02:41:24 +00:00
CodeDevMLH
22f9906188 Bump version to 1.6.1.15
All checks were successful
Auto Release Plugin / build-and-release (push) Successful in 50s
2026-02-13 03:40:35 +01:00
CodeDevMLH
ae54ab41a8 Refactor video playback logic to simplify conditions for active slides 2026-02-13 03:40:23 +01:00
3 changed files with 24 additions and 22 deletions

View File

@@ -12,7 +12,7 @@
<!-- <TreatWarningsAsErrors>false</TreatWarningsAsErrors> --> <!-- <TreatWarningsAsErrors>false</TreatWarningsAsErrors> -->
<Title>Jellyfin Media Bar Enhanced Plugin</Title> <Title>Jellyfin Media Bar Enhanced Plugin</Title>
<Authors>CodeDevMLH</Authors> <Authors>CodeDevMLH</Authors>
<Version>1.6.1.14</Version> <Version>1.6.1.16</Version>
<RepositoryUrl>https://github.com/CodeDevMLH/jellyfin-plugin-media-bar-enhanced</RepositoryUrl> <RepositoryUrl>https://github.com/CodeDevMLH/jellyfin-plugin-media-bar-enhanced</RepositoryUrl>
</PropertyGroup> </PropertyGroup>

View File

@@ -1743,14 +1743,15 @@ const SlideCreator = {
const isVideoPlayerOpen = document.querySelector('.videoPlayerContainer') || document.querySelector('.youtubePlayerContainer'); const isVideoPlayerOpen = document.querySelector('.videoPlayerContainer') || document.querySelector('.youtubePlayerContainer');
if (slide && slide.classList.contains('active') && !document.hidden && (!isVideoPlayerOpen || isVideoPlayerOpen.classList.contains('hide'))) { if (slide && slide.classList.contains('active') && !document.hidden && (!isVideoPlayerOpen || isVideoPlayerOpen.classList.contains('hide'))) {
const currentIndex = STATE.slideshow.currentSlideIndex; // MARK: mark
const currentItemId = STATE.slideshow.itemIds[currentIndex]; // const currentIndex = STATE.slideshow.currentSlideIndex;
if (currentItemId !== itemId) { // const currentItemId = STATE.slideshow.itemIds[currentIndex];
console.log(`Slide ${itemId} is no longer active (current: ${currentItemId}), aborting playback.`); // if (currentItemId !== itemId) {
event.target.mute(); // Mute just in case // console.log(`Slide ${itemId} is no longer active (current: ${currentItemId}), aborting playback.`);
return; // event.target.mute(); // Mute just in case
} // return;
event.target.playVideo(); // }
event.target.playVideo();
// Check if it actually started playing after a short delay (handling autoplay blocks) // Check if it actually started playing after a short delay (handling autoplay blocks)
const timeoutId = setTimeout(() => { const timeoutId = setTimeout(() => {
@@ -1826,10 +1827,13 @@ const SlideCreator = {
backdrop.addEventListener('play', (event) => { backdrop.addEventListener('play', (event) => {
const slide = document.querySelector(`.slide[data-item-id="${itemId}"]`); const slide = document.querySelector(`.slide[data-item-id="${itemId}"]`);
const currentIndex = STATE.slideshow.currentSlideIndex; // MARK: mark
const currentItemId = STATE.slideshow.itemIds[currentIndex]; // const currentIndex = STATE.slideshow.currentSlideIndex;
// const currentItemId = STATE.slideshow.itemIds[currentIndex];
if (!slide || !slide.classList.contains('active') || currentItemId !== itemId) { // if (!slide || !slide.classList.contains('active') || currentItemId !== itemId) {
if (!slide || !slide.classList.contains('active')) {
console.log(`Local video ${itemId} started playing but is not active, pausing.`); console.log(`Local video ${itemId} started playing but is not active, pausing.`);
event.target.pause(); event.target.pause();
event.target.currentTime = 0; event.target.currentTime = 0;
@@ -2315,8 +2319,6 @@ const SlideshowManager = {
currentSlide.classList.add("active"); currentSlide.classList.add("active");
STATE.slideshow.currentSlideIndex = index;
// Restore focus for TV mode navigation continuity // Restore focus for TV mode navigation continuity
requestAnimationFrame(() => { requestAnimationFrame(() => {
if (focusSelector) { if (focusSelector) {
@@ -2350,6 +2352,8 @@ const SlideshowManager = {
if (logo) logo.classList.add("animate"); if (logo) logo.classList.add("animate");
} }
STATE.slideshow.currentSlideIndex = index;
if (index === 0 || !previousVisibleSlide) { if (index === 0 || !previousVisibleSlide) {
const dotsContainer = container.querySelector(".dots-container"); const dotsContainer = container.querySelector(".dots-container");
if (dotsContainer) { if (dotsContainer) {
@@ -2704,7 +2708,7 @@ const SlideshowManager = {
videoBackdrop.play().catch(() => { videoBackdrop.play().catch(() => {
setTimeout(() => { setTimeout(() => {
if (videoBackdrop.paused && slide.classList.contains('active')) { if (videoBackdrop.paused) {
console.warn(`Autoplay blocked for ${itemId}, attempting muted fallback`); console.warn(`Autoplay blocked for ${itemId}, attempting muted fallback`);
videoBackdrop.muted = true; videoBackdrop.muted = true;
videoBackdrop.play().catch(err => console.error("Muted fallback failed", err)); videoBackdrop.play().catch(err => console.error("Muted fallback failed", err));
@@ -2715,7 +2719,7 @@ const SlideshowManager = {
} }
// YouTube player // YouTube player
const player = STATE.slideshow.videoPlayers?.[itemId]; const player = STATE.slideshow.videoPlayers && STATE.slideshow.videoPlayers[itemId];
if (player && typeof player.loadVideoById === 'function' && player._videoId) { if (player && typeof player.loadVideoById === 'function' && player._videoId) {
player.loadVideoById({ player.loadVideoById({
videoId: player._videoId, videoId: player._videoId,
@@ -2731,8 +2735,6 @@ const SlideshowManager = {
} }
setTimeout(() => { setTimeout(() => {
if (!slide.classList.contains('active')) return;
if (player.getPlayerState && if (player.getPlayerState &&
player.getPlayerState() !== YT.PlayerState.PLAYING && player.getPlayerState() !== YT.PlayerState.PLAYING &&
player.getPlayerState() !== YT.PlayerState.BUFFERING) { player.getPlayerState() !== YT.PlayerState.BUFFERING) {

View File

@@ -9,12 +9,12 @@
"imageUrl": "https://git.mahom03-spacecloud.de/CodeDevMLH/jellyfin-plugin-media-bar-enhanced/raw/branch/main/logo.png", "imageUrl": "https://git.mahom03-spacecloud.de/CodeDevMLH/jellyfin-plugin-media-bar-enhanced/raw/branch/main/logo.png",
"versions": [ "versions": [
{ {
"version": "1.6.1.14", "version": "1.6.1.16",
"changelog": "- fix tv mode issue\n- refactor video playback management", "changelog": "- fix tv mode issue\n- refactor video playback management",
"targetAbi": "10.11.0.0", "targetAbi": "10.11.0.0",
"sourceUrl": "https://git.mahom03-spacecloud.de/CodeDevMLH/jellyfin-plugin-media-bar-enhanced/releases/download/v1.6.1.14/Jellyfin.Plugin.MediaBarEnhanced.zip", "sourceUrl": "https://git.mahom03-spacecloud.de/CodeDevMLH/jellyfin-plugin-media-bar-enhanced/releases/download/v1.6.1.16/Jellyfin.Plugin.MediaBarEnhanced.zip",
"checksum": "6af6dd96995a90bf91d811467c88da04", "checksum": "a478b0f9b3738f830a34cc0c3e1be78c",
"timestamp": "2026-02-13T02:23:28Z" "timestamp": "2026-02-13T02:53:19Z"
}, },
{ {
"version": "1.6.0.2", "version": "1.6.0.2",