Skip to content

expecting bc to be on the window #66

@malplayer

Description

@malplayer

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

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