A custom element for containing a pie player.
see here for more information.
Create the element in the markup and wait for the pie-player-ready
event, in the handler set the properties:
session
- an array of session dataenv
- an env objectcontrollers
- an object that exposes some methods for processing:model(ids, session, env) => Promise<Array[{}]>
- this is used for setting the model data on the ui elements
<script type="text/javascript">
document.addEventListener('DOMContentLoaded', function(){
var player = document.querySelector('pie-player');
player.addEventListener('ready', function(){
player.controllers = //..
player.session(session)
.then(() => player.env(env))
.then(() => console.log('player is ready'))
});
});
</script>
<pie-player>
<my-pie-element data-id="1"></my-pie-element>
</pie-player>
This package exports an es6
module, so you'll have to include it in a build tool like webpack and babel.
- runs selenium > requires jdk 1.8
We use webpack and web-component-tester to test the element. Webpack builds a test bundler and the wct
runs the test suite.
npm test
npm run release