Localization
The lang property is used to customize the player's language. It has the following properties:
locale: A string that specifies the locale of the player, such as "en" for English or "es" for Spanish. This is used to determine which language strings to use in the player.controls: An object that specifies the text to use for the various controls in the player. It has the following properties:play: The text to use for the play button.pause: The text to use for the pause button.next: The text to use for the next button.replay: The text to use for the replay button.volume: The text to use for the volume button.mute: The text to use for the mute button.unmute: The text to use for the unmute button.settings: The text to use for the settings button.theater: The text to use for the theater mode button.fullscreen: The text to use for the fullscreen button.chromecast: The text to use for the Chromecast button.airplay: The text to use for the Airplay button.pictureInPicture: The text to use for the Picture-in-Picture button.related: The text to use for the related videos button.skipIntro: The text to use for the skip intro button.playlistTitle: The text to use for the title of the playlist.upNext: The text to use for the "Up next..." label in the next video popup.live: The text to use for the "LIVE" label in live streams.continueAfterPause: The text to use for the "Continue after pause" label in the next video popup.
**settings**: An object that specifies the text to use for the various settings in the player. It has the following properties:quality: This property specifies the text to be displayed for the quality setting in the settings menu.subtitles: This property specifies the text to be displayed for the subtitles setting in the settings menu.autoplay: This property specifies the text to be displayed for the autoplay setting in the settings menu.playbackRate: This property specifies the text to be displayed for the playback rate setting in the settings menu.auto: This property specifies the text to be displayed for the "auto" option in the settings menu.off: This property specifies the text to be displayed for the "off" option in the settings menu.normal: This property specifies the text to be displayed for the "normal" option in the settings menu.share: This property specifies the text to be displayed for the share video button in the settings menu.
adsobject contains text strings used in the player's ad display. These include:skipAd: This string is used as the label for the skip button, which allows the user to skip the current ad.visit: This string is used as a label for a button that takes the user to a website related to the ad.info: This string is used as a label for a button that provides more information about the ad.simultaneousAds: This string is used as a label for a message that is displayed when multiple ads are being played simultaneously. The message is typically displayed in the form "Playing X out of Y ads".adAnnouncement: This string is used as a label for a message that is displayed before an ad starts. The message is typically displayed in the form "Ad in X seconds".
messagesobject contains localized strings for various error and informational messages that may be displayed in the player. It has the following properties:playbackErrorTitle: The title of the error message that is displayed when there is a problem with playback.playbackErrorDescription: The description of the error message that is displayed when there is a problem with playback.geoBlockedTitle: The title of the error message that is displayed when the video is blocked in the user's region.geoBlockedDescription: The description of the error message that is displayed when the video is blocked in the user's region.streamInterruptedTitle: The title of the error message that is displayed when the video stream is interrupted.streamInterruptedDescription: The description of the error message that is displayed when the video stream is interrupted.ageRestrictedTitle: The title displayed on the age-restriction gate overlay shown before playback for age-gated videos.ageRestrictedDescription: The description displayed on the age-restriction gate overlay shown before playback for age-gated videos.ageRestrictedButton: The label of the confirmation button on the age-restriction gate overlay.
vpPlayer("vp-player-localization").setup({
video: {
file: "the_video_file_path"
},
config: {
lang: {
locale: "en",
controls: {
play: "Play",
pause: "Pause",
next: "Next",
replay: "Replay",
volume: "Volume",
mute: "Mute",
unmute: "Unmute",
settings: "Settings",
theater: "Theater",
fullscreen: "Full screen",
chromecast: "Chromecast",
airplay: "Airplay",
pictureInPicture: "Picture-in-Picture",
related: "Related",
skipIntro: "Skip intro",
playlistTitle: "Continue watching",
upNext: "Up next...",
live: "Live",
continueAfterPause: "",
},
settings: {
quality: "Quality",
subtitles: "Subtitles",
autoplay: "Autoplay",
playbackRate: "Speed",
auto: "Auto",
off: "Off",
normal: "Normal",
share: "Share video",
},
ads: {
skipAd: "Skip ad",
skipAds: "Skip ads",
visit: "Visit us",
info: "Read more",
simultaneousAds: "Playing {current} out of {total} ads",
adAnnouncement: "Ad in {t} seconds",
},
messages: {
playbackErrorTitle: "There was a problem playing this video",
playbackErrorDescription: "Unfortunately, this video could not be played at this moment. Please try refreshing your browser.",
geoBlockedTitle: "Video not available in your country",
geoBlockedDescription: "Unfortunately, the publisher has not made this video available in your country.",
streamInterruptedTitle: "Stream ended or interrupted",
streamInterruptedDescription: "Please be patient while we find the issue or check back for future updates.",
ageRestrictedTitle: "Sorry, this content is age-restricted",
ageRestrictedDescription: "We require the users to be {{age}} years old or over, please confirm your age.",
ageRestrictedButton: "Confirm",
},
},
}
});
| PROPERTY | DESCRIPTION |
|---|---|
| lang Object | Configures the language. |
| controls Object | An object which holds all the control names in a specific language. |
| play string | Name of "play" in specific language. |
| pause string | Name of "pause" in specific language. |
| next string | Name of "next" in specific language. |
| replay string | Name of "replay" in specific language. |
| volume string | Name of "volume" in specific language. |
| mute string | Name of "mute" in specific language. |
| settings string | Name of "settings(in controls)" in specific language. |
| theater string | Name of "theater" in specific language. |
| fullscreen string | Name of "fullscreen" in specific language. |
| chromecast string | Name of "chromecast" in specific language. |
| airplay string | Name of "airplay" in specific language. |
| settings Object | Name of "settings" in specific language. |
| quality string | Name of "quality" in specific language. |
| subtitles string | Name of "subtitles" in specific language. |
| ads Object | Name of "ads" in specific language. |
| skipAd string | Name of "skipAd" in specific language. |
| visit string | Name of "visit" in specific language. |
| info string | Name of "info" in specific language. |