+function loadLocaleInVideoJS (serverUrl: string, videojs: any, locale: string) {
+ const path = getLocalePath(serverUrl, locale)
+ // It is the default locale, nothing to translate
+ if (!path) return Promise.resolve(undefined)
+
+ let p: Promise<any>
+
+ if (loadLocaleInVideoJS.cache[path]) {
+ p = Promise.resolve(loadLocaleInVideoJS.cache[path])
+ } else {
+ p = fetch(path + '/player.json')
+ .then(res => res.json())
+ .then(json => {
+ loadLocaleInVideoJS.cache[path] = json
+ return json
+ })
+ }
+