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.skipAd
: The text to use for the skip ad 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.
ads
object contains text strings used in the player's ad display. These include:ad
: This string is used as a label for the ad, typically displayed in the control bar.skip
: This string is used as the label for the skip button, which allows the user to skip the current ad.skipIn
: This string is used as a label for the countdown timer that shows the user how much time is left before they can skip the ad. The countdown timer is typically displayed in the form "Skip in: X seconds".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".
messages
object 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.
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",
skipAd: "Skip Ad",
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: {
ad: "Ad",
skip: "Skip",
skipIn: "Skip in: ",
visit: "Visit Us",
info: "Read more",
simultaneousAds: "Playing {current} out of {total} ads",
adAnnouncement: "Ad in {t} seconds",
},
messages: {
playbackErrorTitle: "",
playbackErrorDescription: "",
geoBlockedTitle: "",
geoBlockedDescription: "",
streamInterruptedTitle: "",
streamInterruptedDescription: "",
},
},
}
});
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. |
skip string | Name of "skip" in specific language. |
skipIn string | Name of "skipIn" in specific language. |
visit string | Name of "visit" in specific language. |
info string | Name of "info" in specific language. |