Skip to main content

Getting started

This guide will show you how to install and mount the player

Installation

There are multiple ways to install the player depending on your project

npm install '@pathfindr.dev/player'

Create container

Add an empty <div> element with a specified height and width, and an id. This is where the player will be mounted.

<div id="player-container" style="height: 250px; width: 500px"></div>

Initialization

Initialize the player by giving it the id of the container and the options object.

import Player from '@pathfindr.dev/player';
import '@pathfindr.dev/player/dist/player.css';

const options = {
streaming: 'https://vod.pathfindr.dev/stream/video/7e4552f0-ad0f-41bb-932d-8a2be27f2bc7/0f89e4f0-4481-4a04-ad8b-31ba72c2b60c/master.m3u8',
start: 0,
interval: 5,
autoplay: false,
};

const player = new Player("#player-container", options);