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

expecting bc to be on the window #66

Open
malplayer opened this issue Aug 12, 2020 · 3 comments
Open

expecting bc to be on the window #66

malplayer opened this issue Aug 12, 2020 · 3 comments

Comments

@malplayer
Copy link

when dowloading the bc player script it has this code in it

 // Use Node, AMD or browser globals to define a module.
  // See umd/returnExports
  (function (root, factory) {
    if (typeof define === 'function' && define.amd) {
      // AMD. Register as 'bc'
          define('bc', [], function() {
            var result = factory.apply(this, arguments);
            root.videojs.log.warn('DEPRECATION: Using the default named RequireJS module in the Brightcove Player is deprecated. See: https://support.brightcove.com/requirejs-and-brightcove-player#Future_implementation');
            return result;
          });
    } else if (typeof exports === 'object') {
      // Node. Does not work with strict CommonJS, but
      // only CommonJS-like environments that support module.exports,
      // like Node.
      module.exports = factory();
    } else {
      // Browser globals (root is window)
      root.bc = factory(root);

and the loader has this

const initPlayer = (params, embed, resolve, reject) => {
  const {embedId, playerId} = params;
  const bc = window.bc[`${playerId}_${embedId}`] || window.bc;

the loader expect the bc player to be on the window object. can you provided an option for the loader to use require js or some loader to get the bc if the consuming app is using require js

@SLMNBJ
Copy link

SLMNBJ commented Oct 24, 2020

+1

@oleksandr-danylchenko
Copy link

This is still an issue for me. When I try to display the BC video in the wrapping iframe, window.bc is undefined

@marcandre-beaudry
Copy link

Still an issue for me too, I'm using NextJS. window.bc is not defined even when trying to load it in useEffect.

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

4 participants