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

"google-cast-button" has already been used with this registry #162

Open
ToshY opened this issue Jul 12, 2023 · 0 comments
Open

"google-cast-button" has already been used with this registry #162

ToshY opened this issue Jul 12, 2023 · 0 comments

Comments

@ToshY
Copy link

ToshY commented Jul 12, 2023

Problem

The console shows the following error:

Uncaught DOMException: Failed to execute 'define' on 'CustomElementRegistry': the name "google-cast-button" has already been used with this registry
    at https://www.gstatic.com/cast/sdk/libs/sender/1.0/cast_framework.js:64:39
    at https://www.gstatic.com/cast/sdk/libs/sender/1.0/cast_framework.js:69:234

With that said, the chromecast functionality itself still seems to work.

Reproduction

Example (pseudo) code

watch.js

import videojs from 'video.js';
require('@silvermine/videojs-chromecast')(videojs, {preloadWebComponents: true});

import $ from 'jquery';

# ...

playerOptions = {
    controls: true,
    techOrder: ['chromecast', 'html5'],
    html5: {
        hls: {
            overrideNative: true
        }
    },
    plugins: {
        chromecast: {},
    }
};

let player = videojs('#myPlayer', playerOptions);

Minimal view file with cast_sender.js after watch.js.

watch.html.twig

<head>
    <script src="watch.js"></script>
    <script src="https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1"></script>
</head>

image

Versions

"video.js": "^8.3.0",
"@silvermine/videojs-chromecast": "^1.4.1",

I've read the Initialization Options section, but trying to put JQuery before/after, or turning preloadWebComponents on/off does not seem to resolve the issue.

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