brightcove / player-loader

An asynchronous script loader and embed generator for the Brightcove Player.
Other
28 stars 15 forks source link

feat: Detect pre-existing players on the page and cache them to avoid downloading players that may exist before player-loader gets to run. #10

Closed misteroneill closed 6 years ago

misteroneill commented 6 years ago

This will help with interoperability with our new webpack plugin. The gist of the workflow will be:

  1. Use player-loader to generate embeds and load players asynchronously.
  2. Add the webpack plugin to prepend your player(s) to your webpack bundle.
  3. Profit... or play videos. Whatever.

The one limitation of this work is that collisions between player IDs from multiple accounts is possible, partly because of the default player ID that is shared by all accounts. Other generated IDs should be extremely unlikely to collide. Regardless, this collision is already possible due to the fact that auto-setup already ignores the account ID in the Brightcove Player (unfortunately).

misteroneill commented 6 years ago

Tests are passing. Time to merge!