Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
knuurr opened this issue Dec 11, 2024 · 0 comments

Comments

@knuurr
Copy link

knuurr commented Dec 11, 2024

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant