Skip to main content

Usage

/*
* Podlove Player Factory
* @param {string, dom node} selector - CSS selector or dom node
* @param {string, object} episode - Path to JSON episode or episode object
* @param {string, object} configuration - Path to JSON config or configuration object
* @returns {Promise} store - Promise returning a redux store
*/

window
.podlovePlayer("#app", "episode.json", "config.json")
.then(store => {
store.subscribe(() => {
console.log(store.getState());
});
});

Signature

  • Selector can be a css selector or a dom node reference
  • An iframe as the canvas is injected into the reference, encapsulating the player
  • Configuration can be provided as a meta object or an url to the configuration json file
  • Canvas width can be defined by the template
  • Canvas height is adapted to players height

Using a selector that matches multiple elements the player will be rendered in the first matching element. The podlovePlayer returns a promise with a redux store as a result that can be used to change the player state from outside.