Skip to content

"Domain youtube.com refused connection attempt." Cannot playback embedded locally #9

@knuurr

Description

@knuurr

I'm looking to integrate your package into my project because it aim to mimick an experience of watching Youtube videos as if it was watched in television.

I'm running local environment with npm run dev, and SvelteKit, and any attempt to playback video (I only tried youtube) fails with Domain youtube.com refused connection attempt (this is my translation, as English is not the language I have my OS in).

obraz

Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://www.youtube.com') does not match the recipient window's origin ('http://localhost:5173').

Uncaught TypeError: Cannot read properties of null (reading 'classList')
    at HTMLDocument.onDocumentLoad (chrome-error://chromewebdata/:2943:19)

<Player> was created without expected prop 'playIcon'

Uncaught TypeError: Cannot read properties of null (reading 'classList')
    at HTMLDocument.onDocumentLoad

i tried to add settings to Player element which I found that might be helpful, but in my case this still doesn't work

<Player
  url={currentVideo}
  fluid={true}
  width="100%"
  height="100%"
  controls={true}
  allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"
  config={{
    youtube: {
      playerVars: { origin: "https://www.youtube.com" },
    },
  }}
/>
``

After all I think it's more about `react-player` and Youtube itself than your implementation. But You get it working on demo page, so I thought it's worth asking here too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions