sezion-player-injector
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

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:

Dev

Available tasks:

  • npm run build: Build the sources. Generates dist and esm2015
  • npm run doc: Generate the docs
  • npm run changelog: Generate the changelog

Readme

Keywords

none

Package Sidebar

Install

npm i sezion-player-injector

Weekly Downloads

1

Version

2.0.0

License

ISC

Unpacked Size

408 kB

Total Files

27

Last publish

Collaborators

  • haztivity