THEOplayer 2.X Demo: Using language localization

This page demonstrates how to configure localization using the THEOplayer API.  Localization can be used to support other languages besides English, which is used in the default THEOplayer UI.
This feature is interesting when you are distributing your content in specific markets where English isn't widespread.

The example below illustrates how you can map the default English labels to Spanish. Hover the cogwheel icon in the control bar with your mouse to see an example of a mapping.

The result:

 

 

The JavaScript code:

// information on setting up THEOplayer and the player object can be found at https://support.theoplayer.com/hc/en-us/articles/115001933305

var videoContainer = document.querySelector('#video-container');
var player = new THEOplayer.Player(videoContainer, {
        libraryLocation: 'https://cdn.theoplayer.com/dash/theoplayer/',
        ui: {
            language: 'langCode',
            languages: { 'langCode':
                {
                    "Play": "Reproducir",
                    "Pause": "Pausa",
                    "Current Time": "Tiempo actual",
                    "Duration Time": "Duración",
                    "Remaining Time": "Tiempo restante",
                    "Stream Type": "Tipo de stream",
                    "LIVE": "EN VIVO",
                    "Live": "En vivo",
                    "Loaded": "Cargado",
                    "Progress": "Progreso",
                    "Fullscreen": "Pantalla completa",
                    "Non-Fullscreen": "Salir de pantalla completa",
                    "Mute": "Mute",
                    "Unmute": "Sonido",
                    "Playback Rate": "Velocidad de reproducción",
                    "Subtitles": "Subtítulos",
                    "subtitles off": "subtítulos off",
                    "Speed": "Velocidad",
                    "Quality": "Calidad",
                    "Options": "Opciones",
                    "Automatic": "Automático",
                    "Captions": "Mayúsculas",
                    "captions off": "Mayúsculas off",
                    "Chapters": "Capítulos",
                    "Close Modal Dialog": "Cerrar Modal Dialog",
                    "Descriptions": "Descripciones",
                    "descriptions off": "Descripciones off",
                    "Audio Track": "Pista de audio",
                    "You aborted the media playback": "Has abortado la reproducción",
                    "A network error caused the media download to fail part-way.": "Un error de red ha provocado que el archivo no se descargue correctamente."
                }
            }
        }
    });

// initial video source
player.source = { 
    sources: [{ 
        src : '//cdn.theoplayer.com/video/elephants-dream/playlist.m3u8',
        type : 'application/x-mpegurl'
    }] 
};