@brightcove/player-url

    1.2.0 • Public • Published

    @brightcove/player-url

    A module for getting a URL to a Brightcove Player.

    Installation

    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.

    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.

    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:

    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.

    <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.

    License

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

    Keywords

    none

    Install

    npm i @brightcove/player-url

    DownloadsWeekly Downloads

    21,268

    Version

    1.2.0

    License

    Apache-2.0

    Unpacked Size

    36.4 kB

    Total Files

    13

    Last publish

    Collaborators

    • tfelippe
    • jordanramey
    • ytaye
    • hikeh
    • ireyes94
    • myerramalla
    • aperezbrightcove
    • lasanchezc
    • akamalakkannan
    • ptamizh
    • salleko
    • jack.terranova
    • brightcove-admin
    • gkatsev
    • tedk
    • abradley-brightcove
    • bc-alive
    • misteroneill
    • mrocajr
    • forbesjo
    • brandonocasey
    • gesinger
    • apadhye
    • marguinbc
    • brightcove-user
    • kmason
    • tomruggs
    • bsahlas
    • cbarstow
    • pdias
    • misterben
    • twalling
    • jwhisenant
    • mjneil
    • abarstow
    • rtezera1
    • rjune
    • larsmaultsby
    • amanningbcov
    • jonbwalsh
    • khaipham
    • wswanbeck
    • mjholland
    • gastafurov
    • adalwani
    • revinkey
    • ekelson-bcove
    • syseng
    • bc_rpeck
    • zhongqil
    • mcarreiro
    • elbadawimustafa
    • asinclair
    • jedwards53
    • hwoodbury
    • jcapitao
    • jblaker
    • mdeltorob
    • bcmauleon
    • paco_oblea_bc
    • jsepulveda
    • dchavez
    • bzhang-bcov
    • biswaranjan
    • barroyo
    • jgouveia
    • bmartinez
    • tteixeira
    • bc-jcarlson
    • eledezma
    • jcueto
    • erodrigues
    • psousa
    • acruzr
    • sgopalakrishna
    • egoulding
    • marcogaray
    • ipadilla
    • jorduno
    • diegocruz1991
    • javibright
    • bcpsalas
    • etobin
    • ackbabe
    • cvillasenor
    • vchistyakov
    • omartinez
    • ilunabcove
    • mgonzalez_bc
    • pdohertybcov
    • muthukumar.bc
    • dmkelly
    • bzizmond
    • jmpmacedo
    • scorreia
    • lescorcio
    • cavieira
    • mbalasubramaniam
    • arunjeyaprasad
    • bvilvanathan
    • kkashalkar
    • anand.gangadharan
    • rahul.yadav
    • rociosantos
    • tshutt
    • fdelgado_bc
    • syurishi
    • agarciabcov
    • priyadharsshini
    • attinder
    • quillad
    • vnavarro
    • lauralopez
    • granganathan
    • skumar85
    • hrodriguez2
    • nhaseena.mohamed
    • jasilvaantonio
    • palvarezbc
    • ericramos
    • carlosabajo
    • tomson.george
    • ingrid.s.cruz
    • hkanagarajan
    • jcarfagno-bc
    • luis_fernando_lopez_ruiz
    • vishal64
    • sarathy.a
    • geethu.karthik
    • esvarez
    • tresa.baji
    • chaselounge
    • yhernandez01
    • luis.garcia.brightcove
    • rodrigofdz
    • pgutierrezgil
    • harish17
    • jjeyaprakash
    • rrajendran1698
    • jlomeli
    • jhurtado
    • lgudino
    • sjimenez
    • rwenger_brightcove
    • rujordan
    • brivn
    • eperez-bc
    • stuartmh
    • jherrerabcov
    • mshiwal
    • jmartinezbrightcove
    • divyaudhayakumar
    • luiscruzbc
    • dflores
    • akatare
    • roman-bc
    • hugo.schoch.bc
    • alexbrightcove
    • chrislarocque
    • tnwanna
    • neethu.n
    • bsahlas.npm
    • dherrera1109
    • hswaminathan
    • lramirez-bc
    • hatondo-bcov
    • echengbc
    • sbarrettbc