Localization
The lang property under config is used to customize the player's language. It has the following structure:
locale: A string that specifies the locale of the player, such as"en"for English or"es"for Spanish.controls: An object that holds the labels for the player's controls.settings: An object that holds the labels used inside the settings menu.ads: An object that holds the labels used by the ad UI.messages: An object that holds the localized strings for informational messages.
vpAudioPlayer("audio-localization").setup({
audio: {
file: "the_audio_file_path"
},
config: {
lang: {
locale: "en",
controls: {
play: "Play",
pause: "Pause",
next: "Next",
back: "Back",
replay: "Replay",
volumeText: "Volume",
mute: "Mute",
unmute: "Unmute",
settings: "Settings",
chromecast: "Chromecast",
playlist: "Playlist",
airplay: "Airplay",
podcast: "Podcast",
playlistTitle: "Continue Listening",
},
settings: {
quality: "Quality",
autoplay: "Autoplay",
playbackSpeed: "Playback speed",
auto: "Auto",
off: "Off",
on: "On",
normal: "Normal",
share: "Share Video",
},
ads: {
skipAd: "Skip Ad",
advertisement: "Advertisement",
},
messages: {
season: "Season",
episode: "Episode",
paywallRestrictedTitle: "This audio includes paid content",
paywallRestrictedDescription: "Please Subscribe to our site to unlock this content.",
},
},
}
});
Controls
| PROPERTY | DESCRIPTION |
|---|---|
| controls Object | Holds the labels for the player controls. |
| play string | Label for the play button. |
| pause string | Label for the pause button. |
| next string | Label for the next audio button. |
| back string | Label for the previous audio button. |
| replay string | Label for the replay button. |
| volumeText string | Label for the volume control. |
| mute string | Label for the mute button. |
| unmute string | Label for the unmute button. |
| settings string | Label for the settings button. |
| chromecast string | Label for the Chromecast button. |
| playlist string | Label for the playlist button. |
| airplay string | Label for the AirPlay button. |
| podcast string | Label for the podcast button. |
| playlistTitle string | Title used at the top of the playlist panel. |
Settings
| PROPERTY | DESCRIPTION |
|---|---|
| settings Object | Holds the labels used inside the settings menu. |
| quality string | Label for the quality option. |
| autoplay string | Label for the autoplay option. |
| playbackSpeed string | Label for the playback speed option. |
| auto string | Label used for the "auto" value (e.g., Auto quality). |
| off string | Label used for the "off" value. |
| on string | Label used for the "on" value. |
| normal string | Label used for the "normal" playback speed. |
| share string | Label for the share option. |
Ads
| PROPERTY | DESCRIPTION |
|---|---|
| ads Object | Holds the labels used by the ad UI. |
| skipAd string | Label for the skip-ad button. |
| advertisement string | Label displayed during ad playback to indicate that an ad is currently playing. |
Messages
| PROPERTY | DESCRIPTION |
|---|---|
| messages Object | Holds the localized strings for informational messages. |
| season string | Label used to prefix the season number (e.g., "Season", "Sezona"). |
| episode string | Label used to prefix the episode number (e.g., "Episode", "Episodi"). |
| paywallRestrictedTitle string | Title shown on the paywall overlay when audio locking blocks playback. |
| paywallRestrictedDescription string | Description shown on the paywall overlay when audio locking blocks playback. |