2.3.2 • Published 3 years ago

@halleymedia/webtvplayer-types v2.3.2

Weekly downloads
1
License
MIT
Repository
-
Last release
3 years ago

WebTvPlayer type definitions

Use this package to develop a custom skin for Halleymedia's WebTvPlayer v2.

Getting started

Install this package by running this command in your project.

npm install @halleymedia/webtvplayer-types

Then, create a JavaScript module like this one:

import WebTvPlayer from '@halleymedia/webtvplayer-types';
import WebTvPlayerSkin from '@halleymedia/webtvplayer-types/skins/WebTvPlayerSkin';

/**
 * @implements {WebTvPlayerSkin}
 */
export default class MySkin {

    /**
     * @param {WebTvPlayer} playerInstance
     * @returns {Object.<string, HTMLElement>}
     */
    render(playerInstance) {

        //You're encouraged to create small methods to create the UI
        //and/or use a rendering library
        const button = playerInstance.container.ownerDocument.createElement('button');
        button.setAttribute('type', 'button');
        button.innerText = 'Play';
        button.addEventListener('click', function() { playerInstance.play(); }, false);
        playerInstance.container.appendChild(button);

        //You should return a custom element which will be used as the video container
        return {
            'player': playerInstance.container.ownerDocument.createElement('div')
        };
    }

    destroy() {
        //Cleanup here
    }
    
}
2.3.2

3 years ago

2.3.1

4 years ago

2.3.0

4 years ago

2.2.0

4 years ago

2.1.1

4 years ago

2.1.0

4 years ago

2.0.4

4 years ago

2.0.3

4 years ago

2.0.2

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago