diff --git a/package-lock.json b/package-lock.json
index daf08ab8..7fe10c84 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "imwald",
- "version": "22.4.1",
+ "version": "22.4.2",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "imwald",
- "version": "22.4.1",
+ "version": "22.4.2",
"license": "MIT",
"dependencies": {
"@asciidoctor/core": "^3.0.4",
diff --git a/package.json b/package.json
index 6e0c5e52..957b16e1 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "imwald",
- "version": "22.4.1",
+ "version": "22.4.2",
"description": "Imwald — a user-friendly Nostr client focused on relay feed browsing, publications, and relay discovery",
"private": true,
"type": "module",
diff --git a/src/components/VideoPlayer/index.tsx b/src/components/VideoPlayer/index.tsx
index d362ff6c..873525f5 100644
--- a/src/components/VideoPlayer/index.tsx
+++ b/src/components/VideoPlayer/index.tsx
@@ -1,3 +1,4 @@
+import { isImwaldElectron } from '@/lib/client-platform'
import { isHlsPlaylistUrl } from '@/lib/url'
import { cn, isInViewport } from '@/lib/utils'
import { useContentPolicy } from '@/providers/ContentPolicyProvider'
@@ -68,7 +69,8 @@ export default function VideoPlayer({
if (!video) return
const hls = new Hls({
- enableWorker: true,
+ // `file:` packaged Electron cannot load bundled worker URLs reliably; main-thread demux is fine here.
+ enableWorker: !isImwaldElectron(),
lowLatencyMode: true
})
hls.loadSource(src)
diff --git a/src/components/YoutubeEmbeddedPlayer/index.tsx b/src/components/YoutubeEmbeddedPlayer/index.tsx
index 89de54c2..aefb4466 100644
--- a/src/components/YoutubeEmbeddedPlayer/index.tsx
+++ b/src/components/YoutubeEmbeddedPlayer/index.tsx
@@ -1,3 +1,4 @@
+import { isImwaldElectron } from '@/lib/client-platform'
import { ensureYouTubeIframeApi } from '@/lib/youtube-iframe-api'
import { parseYoutubeUrl } from '@/lib/youtube-url'
import { cn } from '@/lib/utils'
@@ -32,6 +33,8 @@ export default function YoutubeEmbeddedPlayer({
}, [autoLoadMedia])
const showEmbed = mustLoad || autoLoadMedia || userClickedLoad
+ /** Packaged app uses `file:`; YT’s JS API often errors there; a plain embed iframe works. */
+ const useNativeEmbed = isImwaldElectron()
const posterUrl = useMemo(
() => (videoId ? `https://i.ytimg.com/vi/${videoId}/hqdefault.jpg` : undefined),
@@ -48,6 +51,7 @@ export default function YoutubeEmbeddedPlayer({
)
useEffect(() => {
+ if (useNativeEmbed) return
if (!videoId || !containerRef.current || !showEmbed) return
let cancelled = false
@@ -92,9 +96,9 @@ export default function YoutubeEmbeddedPlayer({
// React often removes the host node first when auto-load media is turned off; YT then hits removeChild errors.
}
}
- }, [videoId, showEmbed])
+ }, [videoId, showEmbed, useNativeEmbed])
- if (error) {
+ if (error && !useNativeEmbed) {
return