Documentation

Automated Player Localization

Introduction

Radiant Media Player is equipped with various labels acting as helpers to better understand the player UI. Player labels are available in 30 languages. The player will automatically detect which is the preferred language for the viewer and display player labels in that language. Currently supported languages are:

  • Arabic
  • Bengali
  • Chinese (simplified)
  • Danish
  • Dutch
  • English
  • Finnish
  • French
  • German
  • Greek
  • Hebrew
  • Hindi (Devanagari script)
  • Hungarian
  • Indonesian
  • Italian
  • Japanese
  • Korean
  • Norwegian
  • Polish
  • Portuguese
  • Romanian
  • Russian
  • Spanish
  • Swahili
  • Swedish
  • Taiwanese Mandarin
  • Thai
  • Turkish
  • Ukrainian
  • Vietnamese

Feedback welcome! if you spot an area of improvement for a player label in your native language or if you want to help in adding new languages to our player please contact us.

Player settings

labels: Object

When detectViewerLanguage is set to false you can pass to the player a custom list of labels, to support other languages for example. This is done by passing an Object of labels to the player through the labels setting. Default: {}.

fixedLabelsLanguage: String

When fixedLabelsLanguage is set to a specific language (like 'english' or 'dutch') player labels translation will be disabled and forced to the specific language. Default: ''.

Passing custom labels

Below is a list of all player labels. When passing custom labels to the player through the labels setting, you can fill custom text for the wanted slots for all or some languages. Unfilled slots will automatically be filled by the player.

The languages

{
  english: {
   hint: {
     auto: 'Auto',
     play: 'Play',
     pause: 'Pause',
     seek: 'Seek bar',
     enterFullscreen: 'Enter full screen',
     exitFullscreen: 'Exit full screen',
     rewind: 'Rewind',
     forward: 'Forward',
     sharing: 'Share',
     sharingLink: 'Link to video',
     sharingEmbedCode: 'Embed video',
     quality: 'Quality',
     volume: 'Volume',
     mute: 'Mute',
     unmute: 'Unmute',
     minus: 'Minus',
     plus: 'Plus',
     speed: 'Speed',
     captions: 'Captions',
     track: 'Track',
     transcript: 'Transcript',
     audio: 'Audio languages',
     chapters: 'Chapters',
     live: 'LIVE',
     close: 'Close',
     floating: 'Close',
     settings: 'Settings',
     back: 'Back',
     playlist: 'Playlist',
     next: 'Next',
     previous: 'Previous',
     related: 'Related',
     upNext: 'Up Next',
     up: 'Up',
     down: 'Down',
     left: 'Left',
     right: 'Right',
     default: 'Default',
     off: 'Off',
     loop: 'Loop',
     info: 'Information',
     keyboardShortcut: 'Keyboard shortcut'
   },
   fccCaptions: {
     fontColor: 'Font Color',
     fontOpacity: 'Font Opacity',
     fontSize: 'Font Size',
     fontFamily: 'Font Family',
     fontEdge: 'Font Edge',
     backgroundColor: 'Background Color',
     backgroundOpacity: 'Background Opacity',
     windowColor: 'Window Color',
     windowOpacity: 'Window Opacity'
   },
   error: {
     customErrorMessage: 'This content is currently unavailable.',
     noSupportMessage: 'This content cannot be played on this device.',
     noSupportInstallChrome: 'Using the latest version of Google Chrome may help to view this content.'
   },
   ads: {
    controlBarCustomMessage: 'Ad',
    skipMessage: 'Skip ad',
    textForClickUIOnMobile: 'Learn more',
    adBlockDetectedMessage: 'AdBlock detected',
    adBlockMessageMessageExtended: 'Our website needs to show advertisement to our viewers - please allow ads on our website',
    adBlockDetectedButton: 'I have disabled AdBlock'
   }
  }
}

Here are the available language names: arabic, bengali, chinese, danish, finnish, dutch, english, french, german, greek, hebrew, hindi, hungarian, indonesian, italian, japanese, korean, norwegian, polish, portuguese, romanian, russian, spanish, swahili, swedish, taiwanese, thai, turkish, ukrainian, vietnamese.

Player code example for passing custom labels:

<script src="https://cdn.radiantmediatechs.com/rmp/9.16.6/js/rmp.min.js"></script>
<!-- Player container element -->
<div id="rmp"></div>
<script>
const src = {
  mp4: [
    'https://your-mp4-sd-url.mp4',
    'https://your-mp4-hd-url.mp4'
  ]
};
// Define player labels
const labels = {
  english: {
    hint: {
      play: 'Custom Text',
      pause: 'Custom Text'
    }
  },
  spanish: {
    hint: {
      play: 'Texto personalizado',
      pause: 'Texto personalizado'
    }
  }
};
// Player settings
const settings = {
  src: src,
  licenseKey: 'your-license-key',
  width: 640,
  height: 360,
  speed: true,
  sharing: true,
  labels: labels,
  contentMetadata: {
    poster: [
      'https://your-poster-url.jpg'
    ]
  }
};
const rmp = new RadiantMP('rmp');
rmp.init(settings);
</script>

Hiding player labels

If you do not want player labels to be shown within the player you can hide them with the hideExternalPlayerLabels player setting set to true. This setting must be Boolean either true or false. false is the default.

Custom track names

By default the player populates the quality, captions and audio tracks UI labels with information read from the HLS or MPEG-DASH manifest or in-band data. You can override those default values with the customTrackNames setting. This also applies to customizing track labels for progressive download with the customTrackNames.quality setting.

customTrackNames: Object

When customTrackNames is passed to the player, it will read the track labels to be displayed in the player UI from that setting. The labels will be displayed as ordered in each array. Default: {captions: [], quality: [], audio: []}.

Example for using customTrackNames setting:

customTrackNames: {
  captions: ['CC1', 'CC2', 'CC3'],
  quality: ['Q1', 'Q2', 'Q3', 'Q4'],
  audio: ['A1', 'A2']
}

Support notes

Labels are set using the JavaScript textContent property. Take this into account when using special characters.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 3.0 License.

©2015-2024 Radiant Media Player. All Rights Reserved.