Browse Source

bug-fixes

imwald
Silberengel 3 weeks ago
parent
commit
21147c9228
  1. 4
      package-lock.json
  2. 2
      package.json
  3. 15
      src/components/YoutubeEmbeddedPlayer/index.tsx

4
package-lock.json generated

@ -1,12 +1,12 @@
{ {
"name": "imwald", "name": "imwald",
"version": "22.5.2", "version": "22.5.3",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "imwald", "name": "imwald",
"version": "22.5.2", "version": "22.5.3",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@asciidoctor/core": "^3.0.4", "@asciidoctor/core": "^3.0.4",

2
package.json

@ -1,6 +1,6 @@
{ {
"name": "imwald", "name": "imwald",
"version": "22.5.2", "version": "22.5.3",
"description": "Imwald — a user-friendly Nostr client focused on relay feed browsing, publications, and relay discovery", "description": "Imwald — a user-friendly Nostr client focused on relay feed browsing, publications, and relay discovery",
"private": true, "private": true,
"type": "module", "type": "module",

15
src/components/YoutubeEmbeddedPlayer/index.tsx

@ -34,9 +34,9 @@ export default function YoutubeEmbeddedPlayer({
const showEmbed = mustLoad || autoLoadMedia || userClickedLoad const showEmbed = mustLoad || autoLoadMedia || userClickedLoad
/** /**
* Electron + dev server (http/https): use the same YT Iframe API as the browser plain `/embed/` iframes often * Electron + dev server (http/https): plain `/embed/` iframes often show error 150; use the Iframe API like the browser.
* show error 150 (player configuration) in Electron while the API path works. * Packaged app loads `file:`: use a plain embed URL only. Do not pass a fake `origin` query param YouTube matches it
* Packaged app loads `file:`; keep a plain iframe there and pass a stable `origin` so YouTube accepts the embed. * to the real embedder and `file:` will not match `https://…`, which triggers error 150.
*/ */
const useNativeEmbed = const useNativeEmbed =
isImwaldElectron() && isImwaldElectron() &&
@ -126,14 +126,7 @@ export default function YoutubeEmbeddedPlayer({
} }
if (useNativeEmbed && videoId) { if (useNativeEmbed && videoId) {
// `file:` has no usable origin for YT; use the canonical web app origin (matches typical production URL). const embedSrc = `https://www.youtube.com/embed/${encodeURIComponent(videoId)}?playsinline=1&rel=0`
const embedParams = new URLSearchParams({
playsinline: '1',
rel: '0',
enablejsapi: '1',
origin: 'https://jumble.imwald.eu'
})
const embedSrc = `https://www.youtube.com/embed/${encodeURIComponent(videoId)}?${embedParams}`
return ( return (
<div <div
className={cn( className={cn(

Loading…
Cancel
Save