# @brightcove/player-url

> A module for getting a URL to a Brightcove Player.

Latest version **1.3.0** (published 2022-11-09) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @brightcove/player-url
pnpm add @brightcove/player-url
yarn add @brightcove/player-url
bun add @brightcove/player-url
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.3.0 |
| Published | 2022-11-09 |
| First published | 2018-08-15 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 34.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Brightcove, Inc. |
| Maintainers | amillerbrightcove, lvohra, daniel.gutierrez.brightcove, charles.seat, erick-valdivia, victor-rivas, mcho-bc, awaldron, fsalazarbc, dawnpacko, j.hawleypeters.bc, adamboudionbc, jimmy-carfagno-bc, ldominguez, bc-srimron-soutter, prasant7bc, bart-stevens-bc, nnguyen150468, rsilva_brightcove, joeylesh, lmelchorx1, juan-sanchez, eolvera, cloewer_bc, muhamad.mahmudov, carredondo, jagadeesh_lakshminarasimhan, brianhsu, lewis.moten.brightcove, niklagbrightcove, tsraveling_bc, natalia-chegrynets, rsutharu, natedennis, bcbclifford, craigparrottebc, mwebster789, bc-acgarcia, adavila1, vaishalijayaraman, kreynolds, bgs-devops, albinjohnson, lmaultsby, rtezera, bcmneil, randresf, harold.murcia, v.kozlov_bc, nagendra_m, michaelmccarthybc, abarstowbc, georgesanchez.diazjr, poneill-bcov, mdeltorobcov, scottbishop, bcov_david-kelly, yji_bc, jahidulislam, jmohneycove, inbc01, jeff.schuman, a_castillo_h, aperezbrightcove, ireyes94, brightcove-admin, tedk, abradley-brightcove, bc-alive, mrocajr, lasanchezc, apadhye, marguinbc, brightcove-user, kmason, cbarstow, hikeh, myerramalla, pdias, jwhisenant, ebertaud, oespinosac, dsalnikov, sharanya.muruganandam, vikaskumar.gajula, xgarcia_npm, jguerra, rjune, jonbwalsh, khaipham, wswanbeck, mjholland, gastafurov, adalwani, ekelson-bcove, syseng, mcarreiro, elbadawimustafa, asinclair, hwoodbury, jblaker, bcmauleon, paco_oblea_bc, jsepulveda, biswaranjan, barroyo, bmartinez, bc-jcarlson, eledezma, jcueto, erodrigues, psousa, acruzr, egoulding, marcogaray, ipadilla, diegocruz1991, javibright, bcpsalas, etobin, ackbabe, cvillasenor, vchistyakov, omartinez, mgonzalez_bc, pdohertybcov, muthukumar.bc, bzizmond, jmpmacedo, scorreia, lescorcio, cavieira, mbalasubramaniam, arunjeyaprasad, bvilvanathan, anand.gangadharan, rociosantos, fdelgado_bc, syurishi, agarciabcov, attinder, lauralopez, granganathan, skumar85, hrodriguez2, jasilvaantonio, palvarezbc, ericramos, carlosabajo, ingrid.s.cruz, luis_fernando_lopez_ruiz, vishal64, tresa.baji, luis.garcia.brightcove, rodrigofdz, pgutierrezgil, harish17, jjeyaprakash, rrajendran1698, jlomeli, jhurtado, sjimenez, rwenger_brightcove, rujordan, stuartmh, jherrerabcov, mshiwal, divyaudhayakumar, ptamizh, akamalakkannan, akatare, roman-bc, tnwanna, bsahlas.npm, dherrera1109, hswaminathan, lramirez-bc, hatondo-bcov, echengbc, sbarrettbc |

## Links

- npm: https://www.npmjs.com/package/@brightcove/player-url
- npm.io page: https://npm.io/package/@brightcove/player-url

## Recent versions

- 1.3.0 (latest) — 2022-11-09
- 1.2.0 — 2019-04-23
- 1.1.1 — 2018-08-15
- 1.1.0 — 2018-08-15
- 1.0.0 — 2018-08-15

## README

# `@brightcove/player-url`

A module for getting a URL to a [Brightcove Player](https://support.brightcove.com/brightcove-player).

## Installation

```sh
npm install --save @brightcove/player-url
```

## Usage

To include `@brightcove/player-url` on your website or web application, use any of the following methods.

### ES Modules

When using in an ES modules-compatible environment or bundler like Rollup or webpack, install `@brightcove/player-url` via npm and `import` the plugin as you would any other module.

```js
import brightcovePlayerUrl from '@brightcove/player-url';

const myPlayerUrl = brightcovePlayerUrl({
  accountId: '1234567890',
  playerId: 'abc123xyz'
});

console.log(myPlayerUrl); // https://players.brightcove.net/1234567890/abc123xyz_default/index.min.js
```

### Browserify/CommonJS

When using with Browserify, install `@brightcove/player-url` via npm and `require` the plugin as you would any other module.

```js
var brightcovePlayerUrl = require('@brightcove/player-url');

var myPlayerUrl = brightcovePlayerUrl({
  accountId: '1234567890',
  playerId: 'abc123xyz'
});

console.log(myPlayerUrl); // https://players.brightcove.net/1234567890/abc123xyz_default/index.min.js
```

### RequireJS/AMD

When using with RequireJS (or another AMD library), get the script in whatever way you prefer and `require` the plugin as you normally would:

```js
require(['@brightcove/player-url'], function(brightcovePlayerUrl) {
  var myPlayerUrl = brightcovePlayerUrl({
    accountId: '1234567890',
    playerId: 'abc123xyz'
  });

  console.log(myPlayerUrl); // https://players.brightcove.net/1234567890/abc123xyz_default/index.min.js
});
```

### `<script>` Tag

This is the simplest case and least recommended. We expect most will bundle this module into an application or another module.

```html
<script src="//path/to/brightcove-player-url.min.js"></script>
<script>
  var myPlayerUrl = brightcovePlayerUrl({
    accountId: '1234567890',
    playerId: 'abc123xyz'
  });

  console.log(myPlayerUrl); // https://players.brightcove.net/1234567890/abc123xyz_default/index.min.js
</script>
```

## Parameters
This module takes the following parameters.

### `accountId`
**Required**
Type: `string`

A Brightcove account ID.

### `playerId`
Type: `string`
Default: `"default"`

A Brightcove player ID.

### `embedId`
Type: `string`
Default: `"default"`

A Brightcove player embed ID.

### `iframe`
Type: `boolean`
Default: `false`

Whether to return a URL for an HTML document to be embedded in an iframe.

### `minified`
Type: `boolean`
Default: `true`

When the `iframe` parameter is `false`, this can be used to control whether the minified or unminified JavaScript URL is returned.

### `base`
Type: `string`
Default: `"https://players.brightcove.net"`

A base CDN protocol and hostname. Mainly used for testing, but could have other uses. May have a trailing slash or not.

### `queryParams`
Type: `Object`
Default: `null`

When the `iframe` parameter is `true`, this can be used to add a query string to the URL with a whitelist of possible parameters:

- `adConfigId`: A playback token that specifies which SSAI configuration, CDN and DVR options to use for a Brightcove Live stream.
- `applicationId`: An application ID used to differentiate analytics across different uses of the same player.
- `catalogSearch`: A Video Cloud catalog search to perform.
- `catalogSequence`: A Video Cloud catalog sequence used to populate a playlist.
- `playlistId`: A Video Cloud playlist ID to load.
- `playlistVideoId`: A video ID at which to begin Video Cloud playlist playback.
- `videoId`: A Video Cloud video ID to load.
- `interactivityProjectId`: An Interactivity project ID to load.

## License

Apache-2.0. Copyright (c) Brightcove, Inc.

---
_Source: https://npm.io/package/@brightcove/player-url · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
