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
- CDN
npm install '@pathfindr.dev/player'
<script src="https://unpkg.com/@pathfindr.dev/player"></script>
<link rel="stylesheet" href="https://unpkg.com/@pathfindr.dev/player/dist/player.css">
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.
- npm
- CDN
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);
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 Pathfindr.Player("#player-container", options);