I need to customize a message like The media could not be loaded, either because the 鈥k failed or because the format is not supported.
I tried to access this code:
https://github.com/videojs/video.js/blob/8f16de277827f77ddd65038bb17d1d7cb88861ee/src/js/media-error.js#L106
To simply override it. But didn't find the way to do it.
I'm aware of https://github.com/brightcove/videojs-errors, but can I'm not sure I need such a complex plugin. Because I just need to customize single message text.
If you're looking to translate the messages, one of the existing translations may be what you're looking for, e.g. http://vjs.zencdn.net/6.2.8/lang/fr.js
Otherwise you can override the text by setting a new "English" translation:
videojs.addLanguage('en', {"The media could not be loaded, either because the server or network failed or because the format is not supported.": "Could not load the video."});
@mister-ben Amazing! It works. thank you. I was looking for override "English".
If you want to just change the text for the error then you should go to video.min.js file and then search that specific error in video.min.js and change the error text. Bear me if its late or it doesn't solve your problem
Most helpful comment
If you're looking to translate the messages, one of the existing translations may be what you're looking for, e.g. http://vjs.zencdn.net/6.2.8/lang/fr.js
Otherwise you can override the text by setting a new "English" translation: