vidply 1.0.25 → 1.0.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -0
- package/dist/dev/{vidply.HLSRenderer-PNP5OPES.js → vidply.HLSRenderer-X46P47LY.js} +7 -1
- package/dist/dev/{vidply.HLSRenderer-PNP5OPES.js.map → vidply.HLSRenderer-X46P47LY.js.map} +2 -2
- package/dist/dev/vidply.esm.js +5 -2
- package/dist/dev/vidply.esm.js.map +2 -2
- package/dist/legacy/vidply.js +10 -1
- package/dist/legacy/vidply.js.map +2 -2
- package/dist/legacy/vidply.min.js +1 -1
- package/dist/legacy/vidply.min.meta.json +5 -5
- package/dist/prod/{vidply.HLSRenderer-4PW35TCX.min.js → vidply.HLSRenderer-LDXSMWTI.min.js} +1 -1
- package/dist/prod/vidply.esm.min.js +1 -1
- package/dist/vidply.css +1 -1
- package/dist/vidply.esm.min.meta.json +8 -8
- package/dist/vidply.min.css +1 -1
- package/package.json +1 -1
- package/src/core/Player.js +7 -2
package/package.json
CHANGED
package/src/core/Player.js
CHANGED
|
@@ -414,7 +414,7 @@ export class Player extends EventEmitter {
|
|
|
414
414
|
|
|
415
415
|
/**
|
|
416
416
|
* Detect language from HTML lang attribute
|
|
417
|
-
* @returns {string|null} Language code if available in translations, null otherwise
|
|
417
|
+
* @returns {string|null} Language code if available in translations or as built-in, null otherwise
|
|
418
418
|
*/
|
|
419
419
|
detectHtmlLanguage() {
|
|
420
420
|
// Try to get lang from html element
|
|
@@ -427,11 +427,16 @@ export class Player extends EventEmitter {
|
|
|
427
427
|
// Normalize the language code (e.g., "en-US" -> "en", "de-DE" -> "de")
|
|
428
428
|
const normalizedLang = htmlLang.toLowerCase().split('-')[0];
|
|
429
429
|
|
|
430
|
-
// Check if this language is available in our translations (
|
|
430
|
+
// Check if this language is available in our translations (already loaded)
|
|
431
431
|
if (i18n.translations[normalizedLang]) {
|
|
432
432
|
return normalizedLang;
|
|
433
433
|
}
|
|
434
434
|
|
|
435
|
+
// Check if this language is available as a built-in that can be loaded on demand
|
|
436
|
+
if (i18n.builtInLanguageLoaders && i18n.builtInLanguageLoaders[normalizedLang]) {
|
|
437
|
+
return normalizedLang;
|
|
438
|
+
}
|
|
439
|
+
|
|
435
440
|
// Language not available, will fallback to English
|
|
436
441
|
this.log(`Language "${htmlLang}" not available, using English as fallback`);
|
|
437
442
|
return null; // Return null instead of 'en' to let the default language handling work
|