Steps
Include PN Player resources in your website head tag
<script async src="https://cdn.pnplayer.com/index-B6OnkU.js" type="module"></script>
<link href="https://cdn.pnplayer.com/index-DN2akQ.css" rel="stylesheet" />
Create an element
In html body create reference element for player to load<div id="pnplayer">
<div id="pn-player"></div>
</div>
Initialize player on the element
<script>
const playerInstance = window.pnplayer("pn-player", {
sources: [
{
title: "Video title",
src: "Video HLS Url",
textTracks: [],
}
]
});
</script>
This loads video player on the pn-player element.
Setup Options
These are the options for configuring the layout and playback behavior of a player.
URL of the track file (VTT/SRT)
Track kind (e.g. subtitles, captions, chapters)
Language code (e.g. en-US)
Track file format (e.g. vtt, srt)
Whether this track is enabled by default
Time (in seconds) when the Skip Intro button should start appearing during playback
Time (in seconds) where the player will seek to when the Skip Intro button is clicked
Text displayed on the Skip Intro button
Playback mode: “playlist” — auto-plays all videos in sources; “multiple” — sources are multiple language/audio versions of the same video
Source of the video being played (e.g. PN Platform, Desktop)
Unique identifier of the user
Unique identifier for your integration ( you can find in dashboard)