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

1.0.4 • Public • Published

Building

npm run build OR tsc build

Module is not published to npm yet, however, you can use it by installing it from local path after build

npm install path-to-this-directory

Usage example

import { DashTech, Player } from 'nas-player';

player = new Player();
player.init(
    new DashTech(),
    video_element,
    "https://dash.akamaized.net/dash264/TestCases/1a/sony/SNE_DASH_SD_CASE1A_REVISED.mpd",
    true,
    false,
    { "X-Custom-Header": "test" },
    {
        "com.widevine.alpha": {
            "serverURL": "<license URL if needed>",
            "httpRequestHeaders": { "X-Custom-Header": "test" }
        }
    },
    (e: any) => {
        console.error('DRM License Error: ' + e.message);
    }
);

When switching streams remember to destroy the player by using destroy() method on player object and recreate the player.

Package Sidebar

Install

npm i nas-player

Weekly Downloads

31

Version

1.0.4

License

MIT

Unpacked Size

30.2 kB

Total Files

20

Last publish

Collaborators

  • palethorn