Audio Tracks


The player supports two options for selecting audio tracks
  1. HLS and DASH (switch just audio)
  2. Manual switching between any sources (switch audio with video)

HLS and DASH

The list of audio tracks for HLS and DASH is automatically generated, if the manifest has a choice, the audio player will display the track names in the options menu. In some cases, the sound and the image may be out of sync.

Switching sources

The source list is passed to the player by the file parameter, the names are enclosed in curly braces, and the options are separated by a symbol ;

{audiotrack}URL1;{audiotrack}URL2;{audiotrack}URL3

Sample

new Playerjs({
  "id":"player",
  "file":"{French}//site.com/video_fr.mp4;{English}//site.com/video_en.mp4"
});

If you need to specify the quality options and audio tracks together, then the quality must be outside

new Playerjs({
  "id":"player",
  "file":"[480p]{French}//site.com/video480_fr.mp4;{English}//site.com/video480_en.mp4,[720p]{French}//site.com/video720_fr.mp4;{English}//site.com/video720_en.mp4"
});

Audio track by default

The default_audio parameter allows you to enable the desired audio track by specifying its name.

var player = new Playerjs({
  "id":"player",
  "file":"//site.com/video.m3u8",
  "default_quality":"French"
});

Remembering the choice

With PRO you can turn on the Memorizing / Memorize selected audiotrack in the settings - in this case selected audio track will be used as default on the current domain if the player has an audio track with such name.




2019 © PlayerJS

Login

Restore password
Sign up
Log in

Sign up free

Sign up
By signing up, you agree to Terms of Service
Login if you have an account

Enterprise

Your name
Website
Email
Phone
Description
Order player

Restore password

Restore
Forgot email? Contact us