Compare commits

..

6 Commits

Author SHA1 Message Date
CodeDevMLH
9b0e3762ac Update manifest.json for release v1.1.2.0 [skip ci] 2026-01-08 15:26:55 +00:00
CodeDevMLH
48f93e3480 Update version to 1.1.2.0
All checks were successful
Auto Release Plugin / build-and-release (push) Successful in 53s
2026-01-08 16:26:04 +01:00
CodeDevMLH
2e9c093cdc Add resumeActivePlayback method to resume video playback when slideshow is active 2026-01-08 16:25:04 +01:00
CodeDevMLH
60593dc855 Update manifest.json for release v1.1.1.0 [skip ci] 2026-01-08 14:54:58 +00:00
CodeDevMLH
0edde43720 Update version to 1.1.1.0
All checks were successful
Auto Release Plugin / build-and-release (push) Successful in 1m3s
2026-01-08 15:53:56 +01:00
CodeDevMLH
0f6938a91d Add stopAllPlayback method to pause all video playback when navigating away from home screen 2026-01-08 15:52:46 +01:00
3 changed files with 78 additions and 1 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.1.0.0</Version> <Version>1.1.2.0</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

@@ -1259,11 +1259,13 @@ const VisibilityObserver = {
if (isVisible) { if (isVisible) {
if (STATE.slideshow.slideInterval && !STATE.slideshow.isPaused) { if (STATE.slideshow.slideInterval && !STATE.slideshow.isPaused) {
STATE.slideshow.slideInterval.start(); STATE.slideshow.slideInterval.start();
SlideshowManager.resumeActivePlayback();
} }
} else { } else {
if (STATE.slideshow.slideInterval) { if (STATE.slideshow.slideInterval) {
STATE.slideshow.slideInterval.stop(); STATE.slideshow.slideInterval.stop();
} }
SlideshowManager.stopAllPlayback();
} }
}, },
@@ -2317,6 +2319,65 @@ const SlideshowManager = {
} }
}, },
/**
* Stops all video playback (YouTube and HTML5)
* Used when navigating away from the home screen
*/
stopAllPlayback() {
// 1. Pause all YouTube players
if (STATE.slideshow.videoPlayers) {
Object.values(STATE.slideshow.videoPlayers).forEach(player => {
try {
if (player && typeof player.pauseVideo === 'function') {
player.pauseVideo();
}
} catch (e) {
console.warn("Error pausing YouTube player:", e);
}
});
}
// 2. Pause all HTML5 videos
const container = document.getElementById("slides-container");
if (container) {
container.querySelectorAll('video').forEach(video => {
try {
video.pause();
} catch (e) {
console.warn("Error pausing HTML5 video:", e);
}
});
}
},
/**
* Resumes playback for the active slide if not globally paused
*/
resumeActivePlayback() {
if (STATE.slideshow.isPaused) return;
const currentItemId = STATE.slideshow.itemIds[STATE.slideshow.currentSlideIndex];
if (!currentItemId) return;
const currentSlide = document.querySelector(`.slide[data-item-id="${currentItemId}"]`);
if (!currentSlide) return;
// 1. Try YouTube Player
const ytPlayer = STATE.slideshow.videoPlayers[currentItemId];
if (ytPlayer && typeof ytPlayer.playVideo === 'function') {
ytPlayer.playVideo();
}
// 2. Try HTML5 Video
const html5Video = currentSlide.querySelector('video');
if (html5Video) {
if (STATE.slideshow.isMuted) {
html5Video.muted = true;
}
html5Video.play().catch(e => console.warn("Error resuming HTML5 video:", e));
}
},
/** /**
* Initializes touch events for swiping * Initializes touch events for swiping
*/ */

View File

@@ -8,6 +8,22 @@
"category": "General", "category": "General",
"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.1.2.0",
"changelog": "- Add method to resume video playback when slideshow is active",
"targetAbi": "10.11.0.0",
"sourceUrl": "https://git.mahom03-spacecloud.de/CodeDevMLH/jellyfin-plugin-media-bar-enhanced/releases/download/v1.1.2.0/Jellyfin.Plugin.MediaBarEnhanced.zip",
"checksum": "a0e8ff5e59b22a1bdedc916cd5e1c16a",
"timestamp": "2026-01-08T15:26:55Z"
},
{
"version": "1.1.1.0",
"changelog": "- Add method to pause all video playback when navigating away from home screen",
"targetAbi": "10.11.0.0",
"sourceUrl": "https://git.mahom03-spacecloud.de/CodeDevMLH/jellyfin-plugin-media-bar-enhanced/releases/download/v1.1.1.0/Jellyfin.Plugin.MediaBarEnhanced.zip",
"checksum": "09da95fc561b11191d23a5cfa30ea731",
"timestamp": "2026-01-08T14:54:57Z"
},
{ {
"version": "1.1.0.0", "version": "1.1.0.0",
"changelog": "- 'custom media IDs' setting is now enabled by default (no input --> random selection)\n- improve GUID handling in slideshow manager to handle seperator and description", "changelog": "- 'custom media IDs' setting is now enabled by default (no input --> random selection)\n- improve GUID handling in slideshow manager to handle seperator and description",