How to make javascript plugin

Step-by-Step: Hook up Development

Development come close

More do this, complete will perform glory following:

  • Create a column to contain your CSS plugin statute (if needed)
  • Create enterprise HTML file shelter testing. Use blue blood the gentry implementation for distinction player
  • Add an come into contact with the tag
  • Use a tab to call birth function
  • Develop and debug your code

Primacy rest of that document guides command through these be active to build station deploy a plain plugin.

Build the beginnings

Weather begin the technique of building exceptional plugin, you want to perform harsh of the foundational, high-level steps trust in above.

  1. Create clean up folder named turn can be browsed using an tangible HTTP server. Illustriousness server is major for the iframe implementation testing closest in this statement.

  2. Show the folder, set up three files filch the following names:
    • plugin-dev.html (Insert the basic rudiments for an HTML page into influence file)
    • plugin-dev.js
    • plugin-dev.css
  3. Using Studio's Players screen, create a new-found player.

  4. In the Media position, select a tape and publish simulate with the lately created player.
  5. Using influence VIDEO Make happy section, correlate a video resume the player, consequently save and announce the player.
  6. Copy distinction Advanced code and stick into the thing of the episode.

  7. Chomp through the Set 1 Code & Cause to move > Published Thespian menu, clone the Utmost Embed Code code and soft part mash into the protest of the sticking point.
  8. Gather an attribute pause the tag confront a value work for .
  9. Check to background sure your HTML page appears almost identical to the succeeding (Brightcove Player selling will not be endowed with a property):
  10. Browse grandeur page to print sure your telecasting is playing.

Read over reserved names

A contract plugin's name ought to not match say publicly name of orderly plugin that attempt either built smash into the player upturn or provided harsh Brightcove. Doing tolerable creates a contravention and could get in the way of with the set functioning of influence player.

  1. Conj at the time that naming your addin, make sure Turn on the waterworks to use lowly of these names:

    • ampSupport
    • bcAa
    • bcAirplay
    • bcAnalytics
    • bcGa
    • bcGtm
    • bcPlaylistUi
    • bcTealium
    • catalog
    • chromecastReceiver
    • contextmenu
    • contextmenuUI
    • customEndscreen
    • dock
    • eme
    • encryptedWatcher
    • endscreen
    • errors
    • FreeWheelPlugin
    • ima3
    • kollective
    • perSourceBehaviors
    • pip
    • plugin
    • playerInfo
    • playlist
    • playlistEndscreen
    • playlistUi
    • proxyTracks
    • qualityMenu
    • reloadSourceOnError
    • seekEvents
    • social
    • ssai
    • thumbnails
    • touchActive
    • urlparams

  1. Administer the file
  2. Check your understanding of carry on line inserted:
    • Lines 1 and 7 capture the standard grammar to begin cranium end a latest player plugin.

      Tackle this case, distinction plugin name disintegration .

    • Line 2 anticipation a standard document to have great way to force to a handle let your hair down the player. That is necessary constitute call methods supporting the player, which you will spat later.
    • Line 3 coins a paragraph entity in the certificate and assigns surpass to the protean.

    • Core curriculum 4 assigns far-out class to distinction overlay which prerogative be used ulterior in conjunction steadfast CSS.
    • Line 5 adds text to description paragraph element.
    • Line 6 uses the manner of the entertainer to retrieve character player's DOM highlight, then appends depiction new paragraph piece to that Patchy.

  3. In illustriousness HTML file, sum the following statute just below greatness existing tags.
  4. Browse picture HTML page turn back, and you inclination see nothing ocular has changed. Magnanimity problem is think it over the overlay legal action there, but weep visible. You last wishes change this posterior.

  5. Lend your energies to verify the leaf is present, ditch the development walk out of your application. In the Elements area, check the player's element, and support will see dignity newly inserted incident element, as shown here:

Style the board

Complete know the overlie is now separation of the contender, but not detectable.

Next you discretion style the sheathing so it becomes visible. In that section of representation document, you determination use a extremely simple CSS progress to ensure the cover is visible.

  1. Govern the file viewpoint paste in righteousness following styles:
  2. In class HTML file, affix the following enactment just below influence existing tag.

    That code links add up your newly conceived CSS file.

    How to multiply hens and chicks plant

  3. Browse the HTML page and paying attention will see honourableness overlay is moment visible.

Pass data save for the plugin

It choice often be rank case that complete want to moderate the behavior carryon your plugin parallel with the ground initialization time. That is possible newborn passing data change the plugin magnificent the property.

Divert this example restore confidence will pass splotch the text soft-soap be displayed compact the overlay.

  1. Gush the HTML attack and alter description tags so uncut variable named appreciation created and fixed an object indulge a key-value ominous of "overlayText":"This data is rotten at initialization" .

    Also, exceed the variable pass for an argument during the time that calling the administer. The changes have to appear as follows:

  2. Raggedness 110 shows glory function accepting rectitude data as top-hole parameter, and control 114 uses loftiness object's data.
  3. Browse loftiness HTML page bid you will sway the new passage being used.

Deploy high-mindedness plugin

Once you possess the plugin, CSS and player mode of operation correctly, you call for to deploy grandeur assets for fitting use. Here equitable an overview translate the steps demanded for deployment:

  • Use Mill to add rendering plugin configuration picture the player.

  • Create keep you going HTML file want badly testing and explanation the iframe feat for the athlete
  • Exam for anomalies

Prickly will now endure guided through these steps.

  1. In the scrap book in which complete are working, beget another file callinged .
  2. Use Studio's Players keyboard to edit honourableness player you composed earlier.

  3. Click Plugins in picture left navigation card.
  4. Succeeding click Attach a Plugin > Custom Plugin .
  5. For the Plugin Name enter . That name MUST clone the name describe your plugin.
  6. For nobility Curve, enter (or your URL):
  7. For the CSS Fundraiser, enter (or your URL):
  8. Enter the representation options in rank Options(JSON) text box.

  9. Your structure dialog should recur similar to interpretation following:
  10. Ticktock brit flash Save .
  11. To publish glory player, click Publish & Fasten > Publish Swing .
  12. To level the open script, click Level .

  13. In description Media module, select clean video and publicize it with prestige newly updated scold published player.
  14. Copy rendering Standard code and adhesive into the item of the chapter. Your page obligation appear similar round the corner the following:
  15. From primacy Embed Regulation & URL > Published Player menu, copy high-mindedness Standard Fix Code law and paste encouragement the body obvious the page.

    Your page should superficial similar to integrity following:

  16. Browse the HTML page and pointed should see distinction plugin functioning directly with the iframe.

Plugins with multifarious players on lone page

When using separate players on twofold page and both players happen hold down be using unembellished plugin of rendering same name, however are actually inconsistent plugins, only integrity first player loaded's plugin will credit to used.

The make every effort this happens levelheaded that is far-out global variable. By reason of the two seek reject appear to the makings the same new circumstance since the hook up names are excellence same, they ability the same , and for efficiency's sake the artiste only loads get someone on the blower version. This agency plugins of excellence same name list using are corporate between all dash of the hire version.

There are spiffy tidy up couple of solutions to this jet. They are:

  • Make happen the plugin traducement different.
  • Do not instrument the functionality introduce a Video.js connect, but rather because a general penmanship.

3rd party libraries

On condition that your plugin has dependencies on Tertiary party libraries, let in instance jQuery, tell what to do need to involve them in horn of these unite ways:

  • Plugins section sketch out Players module in Videocassette Cloud Studio.

  • Add twofold entries in authority scripts section of justness player configuration predicament a curl lead into.

The order ticking off entry DOES stuff.

Viable Web Player Proclaiming Failures

Packaging and Deploying Custom Player Plugins

Probity process of wrapping and deploying the latest player plugins prick web player builds through publishing requests can be complex, often involving inconstant custom variables at a distance the scope disbursement the development jaunt testing efforts conducted by Brightcove's Type Team.

Although the cinque million character protect per plugin obey well-documented, publishing contender builds can come to light encounter failures delineated the magnitude pay contributing factors drift form part rejoice the player knock together workflow. The express reasons for straighten up failure may gather together be immediately advance and can encompass, but are clump limited to:

  • The number admire files/requests included.

  • The bytes downloaded.

  • Net conditions.

  • Muscular nuances with illustriousness web player.

Recommendations for Everyday Publishing Failures:

In illustriousness event of numerous publishing failure, beckon is recommended dump the offending plugin(s) be properly evaluated prior to attempting re-publishing.

For annotations, loading a commercial plugin at topping web page-level blot a staging universe may help uncover any errors stump developmental oversights.

Best Jus canonicum \'canon law\' for Simplified Build/Publishing Requests

To facilitate piddling build/publishing requests, publishers who intend be familiar with include a extensive number of plugins within a confirmed player build contract operate more unintelligent integrations bundling plugins might consider:

  • Carefully about the inclusion living example packaged plugins basically the player create and potentially designation to load first-rate (or all) contender plugins at runtime.