sezion-player-injector
v2.0.0
Published
UI plugin to get a sezion id from the URL and load the sezion's player
Downloads
2
Readme
sezion-player-injector
UI component to get a sezion id from the url and initialize a sezion's player.
By default, the component will try to auto initialize players on document load.
Please note If you are using the script tag to import the component, all the properties must be accesses through sezionPlayerInjector
Auto init with id in the url
Include in the html the iframe tag with the GlobalSezionPlayerInjectorParams.query
.
The component will try to get the video id from the url using GlobalSezionPlayerInjectorParams.urlSearchParam
<iframe data-sezion-player-injector></iframe>
To disable the auto init use SezionPlayerInjector.GLOBAL.autoInitOnLoad = false
<script src="../dist/sezion-player-injector.js"></script>
<script>
sezionPlayerInjector.SezionPlayerInjector.GLOBAL.autoInitOnLoad = false;
</script>
## Auto init with id in the element
Include in the html the iframe tag with the `GlobalSezionPlayerInjectorParams.query`
```html
<iframe data-sezion-player-injector data-sezion-video-id="videoId"></iframe>
Disable auto init
To disable the auto init use SezionPlayerInjector.GLOBAL.autoInitOnLoad = false
<script src="../dist/sezion-player-injector.js"></script>
<script>
sezionPlayerInjector.SezionPlayerInjector.GLOBAL.autoInitOnLoad = false;
</script>
Manual init
<head>
<script src="../dist/sezion-player-injector.js"></script>
<script>
sezionPlayerInjector.SezionPlayerInjector.GLOBAL.autoInitOnLoad = false;
</script>
</head>
<body>
<iframe id="sezionPlayer"></iframe>
<script>
new sezionPlayerInjector.SezionPlayerInjector({
element:"#sezionPlayer",
videoId:"videoId"
});
</script>
</body>
Examples
Examples are available in the examples
folder.
Also could be checked here:
- http://enproyecto.com/spi/url.html?sezionVideo=5818e54ef0f8f11703fa2b1d
- http://enproyecto.com/spi/attribute.html
- http://enproyecto.com/spi/manual.html
- http://enproyecto.com/spi/disable-auto-init.html
Dev
Available tasks:
npm run build
: Build the sources. Generatesdist
andesm2015
npm run doc
: Generate the docsnpm run changelog
: Generate the changelog