Skip to main content
If you only need to show a video and do not need to control it from your own code, use the embed script. It creates a responsive 16:9 iframe that loads the player for you.
The embed script lives alongside your player build at https://cdn.pnplayer.com/<client>/<version>/embed.js. Find the URL for your latest build on your builds page. For full control over options, controls and events, use the JavaScript integration instead.

Add the script

The id must be exactly pnplayer-js-embed. The script reads its own attributes, builds the iframe and appends it to the end of the page body.

Attributes

string
required
HLS playlist URL of the video to play
string
default:"default"
Player theme: default, netflix or glassy
string
Comma-separated list of caption tracks in the form language:label:format. Label and format are optional and default to the language code and vtt. Files are loaded from the captions folder next to the playlist, so en:English loads https://stream.pnplayer.com/<video-id>/captions/en.vtt.
string
Set to 1 to load chapters.vtt from the same folder as the playlist and show chapter markers on the timeline

Embed the iframe directly

The script is a convenience wrapper around embed.html. You can point an iframe at it yourself when you need to control placement or size.
Include remote-playback and picture-in-picture in the allow attribute, otherwise AirPlay and Picture-in-Picture do not work from inside the iframe.

Query parameters

string
required
URL-encoded HLS playlist URL. Repeat the parameter to build a playlist.
string
One caption track as language:label:format. Repeat the parameter for more tracks.
string
1 to load chapters.vtt
string
default:"0"
1 to start playback automatically
string
default:"0"
1 to start muted
string
default:"default"
default, netflix or glassy
The embed does not send an API key, so playback analytics are not recorded for embedded videos. Use the JavaScript integration with the key option if you need analytics.