60 |
61 |
75 |
76 |
77 |
--------------------------------------------------------------------------------
/lang/ar.json:
--------------------------------------------------------------------------------
1 | {
2 | "No video has been loaded": "لم يتم تحميل أي فيديو",
3 | "Could not download the video": "لا يمكن تحميل الفيديو",
4 | "The video connection was lost, please confirm you are connected to the internet": "فقد الاتصال بالفيديو، يرجى التأكد من الاتصال بالإنترنت",
5 | "The video is bad or in a format that cannot be played on your browser": "جودة الفيديو سيئة أو في صيغة لا يمكن للمتصفحك تشغيلها",
6 | "This video is either unavailable or not supported in this browser": "هذا الفيديو غير متوفر أو غير معتمد في هذا المتصفح",
7 | "Error Code": "كود الخطأ",
8 | "Technical details": "تفاصيل تقنية",
9 | "The video download was cancelled": "تم إلغاء تحميل الفيديو",
10 | "The video you are trying to watch is encrypted and we do not know how to decrypt it": "تم تشفير الفيديو الذي تحاول مشاهدته و لا نعرف كيفية فك تشفيرها",
11 | "An unanticipated problem was encountered, check back soon and try again": "نواجه مشكلة غير متوقعة، تحقق وحاول مرة أخرى بعد قليل",
12 | "This video is restricted from playing on your current domain": "يحظر تشغيل مقطع الفيديو هذا في نطاقك الحالي",
13 | "This video is restricted at your current IP address": "يحظر تشغيل مقطع الفيديو هذا في عنوان IP الحالي الخاص بك",
14 | "This video is restricted from playing in your current geographic region": "يحظر تشغيل مقطع الفيديو هذا في منطقتك الجغرافية الحالية",
15 | "OK": "موافق"
16 | }
17 |
--------------------------------------------------------------------------------
/lang/cs.json:
--------------------------------------------------------------------------------
1 | {
2 | "No video has been loaded": "Nebylo načteno žádné video",
3 | "Could not download the video": "Video nelze stáhnout",
4 | "The video connection was lost, please confirm you are connected to the internet": "Připojení k serveru s videem bylo ztraceno, ujistěte se, že jste připojeni k internetu",
5 | "The video is bad or in a format that cannot be played on your browser": "Video je požkozené, nebo je ve formátu, který nemůže být vaším prohlížečem přehrán",
6 | "This video is either unavailable or not supported in this browser": "Toto video je buď nedostupné nebo nepodporované v tomto prohlížeči",
7 | "Error Code": "Chybový kód",
8 | "Technical details": "Technické informace",
9 | "The video download was cancelled": "Stahování videa bylo přerušeno",
10 | "The video you are trying to watch is encrypted and we do not know how to decrypt it": "Video, které se snažíte přehrát, je zašifrované a my nevíme, jak ho rozšifrovat",
11 | "An unanticipated problem was encountered, check back soon and try again": "Nastal neočekávaný problém, zkuste to brzy znovu",
12 | "This video is restricted from playing on your current domain": "Toto video je zakázané přehrávat na vaší současné doméně",
13 | "This video is restricted at your current IP address": "Toto video je zakázané přehrávat na vaší současné IP adrese",
14 | "This video is restricted from playing in your current geographic region": "Toto video je zakázané přehrávat ve vaší současné geografické oblasti",
15 | "OK": "OK"
16 | }
17 |
--------------------------------------------------------------------------------
/lang/de.json:
--------------------------------------------------------------------------------
1 | {
2 | "No video has been loaded": "Es wurde kein Video geladen.",
3 | "Could not download the video": "Das Video konnte nicht heruntergeladen werden.",
4 | "The video connection was lost, please confirm you are connected to the internet": "Die Videoverbindung wurde abgebrochen. Überprüfen Sie ob eine Internetverbindung besteht.",
5 | "The video is bad or in a format that cannot be played on your browser": "Dieses Video ist beschädigt oder das Format ist mit Ihrem Browser nicht abspielbar.",
6 | "This video is either unavailable or not supported in this browser": "Dieses Video ist entweder nicht verfügbar oder es wird in diesem Browser nicht unterstützt.",
7 | "Error Code": "Fehlercode",
8 | "Technical details": "Technische Details",
9 | "The video download was cancelled": "Das Herunterladen des Videos wurde abgebrochen.",
10 | "The video you are trying to watch is encrypted and we do not know how to decrypt it": "Das Video das Sie versuchen abzuspielen ist verschlüsselt und es kann nicht entschlüsselt werden.",
11 | "An unanticipated problem was encountered, check back soon and try again": "Ein unvorhergesehenes Problem ist aufgetreten, versuchen Sie es in Kürze noch einmal.",
12 | "This video is restricted from playing on your current domain": "Dieses Video darf aufgrund von Einschränkungen für Ihre Domäne nicht abgespielt werden.",
13 | "This video is restricted at your current IP address": "Ihre IP-Adresse ist nicht berechtigt auf dieses Video zuzugreifen.",
14 | "This video is restricted from playing in your current geographic region": "Dieses Video darf aufgrund von Einschränkungen für Ihre geografische Region nicht abgespielt werden.",
15 | "OK": "OK"
16 | }
17 |
--------------------------------------------------------------------------------
/lang/en.json:
--------------------------------------------------------------------------------
1 | {
2 | "No video has been loaded": "No video has been loaded",
3 | "Could not download the video": "Could not download the video",
4 | "The video connection was lost, please confirm you are connected to the internet": "The video connection was lost, please confirm you are connected to the internet",
5 | "The video is bad or in a format that cannot be played on your browser": "The video is bad or in a format that cannot be played on your browser",
6 | "This video is either unavailable or not supported in this browser": "This video is either unavailable or not supported in this browser",
7 | "Error Code": "Error Code",
8 | "Technical details": "Technical details",
9 | "The video download was cancelled": "The video download was cancelled",
10 | "The video you are trying to watch is encrypted and we do not know how to decrypt it": "The video you are trying to watch is encrypted and we do not know how to decrypt it",
11 | "An unanticipated problem was encountered, check back soon and try again": "An unanticipated problem was encountered, check back soon and try again",
12 | "This video is restricted from playing on your current domain": "This video is restricted from playing on your current domain",
13 | "This video is restricted at your current IP address": "This video is restricted at your current IP address",
14 | "This video is restricted from playing in your current geographic region": "This video is restricted from playing in your current geographic region",
15 | "OK": "OK"
16 | }
17 |
--------------------------------------------------------------------------------
/lang/es.json:
--------------------------------------------------------------------------------
1 | {
2 | "No video has been loaded": "No hay ningún vídeo cargado.",
3 | "Could not download the video": "No se ha podido descargar el vídeo.",
4 | "The video connection was lost, please confirm you are connected to the internet": "Se ha perdido la conexión al vídeo. Compruebe si su equipo está conectado a internet.",
5 | "The video is bad or in a format that cannot be played on your browser": "El vídeo está dañado o tiene un formato no reproducible en su navegador.",
6 | "This video is either unavailable or not supported in this browser": "Este vídeo no está disponible o es incompatible con este navegador.",
7 | "Error Code": "Código de error",
8 | "Technical details": "Detalles técnicos",
9 | "The video download was cancelled": "La descarga ha sido cancelada",
10 | "The video you are trying to watch is encrypted and we do not know how to decrypt it": "El vídeo que está tratando de visualizar está encriptado y no es posible desencriptarlo",
11 | "An unanticipated problem was encountered, check back soon and try again": "Ha surgido un problema imprevisto. Vuelva a intentarlo más tarde.",
12 | "This video is restricted from playing on your current domain": "Este vídeo tiene restricciones y no puede reproducirse en su dominio actual.",
13 | "This video is restricted at your current IP address": "Este vídeo tiene restricciones y no puede reproducirse en su dirección IP actual.",
14 | "This video is restricted from playing in your current geographic region": "Este vídeo tiene restricciones y no puede reproducirse en su región geográfica actual."
15 | }
16 |
--------------------------------------------------------------------------------
/lang/fr.json:
--------------------------------------------------------------------------------
1 | {
2 | "No video has been loaded": "Aucune vidéo n'a été chargée.",
3 | "Could not download the video": "Impossible de télécharger la vidéo.",
4 | "The video connection was lost, please confirm you are connected to the internet": "La connexion à la vidéo a été perdue, vérifiez que vous êtes bien connecté à Internet.",
5 | "The video is bad or in a format that cannot be played on your browser": "La vidéo est de mauvaise qualité ou dans un format incompatible avec votre navigateur.",
6 | "This video is either unavailable or not supported in this browser": "Cette vidéo est indisponible ou non prise en charge par ce navigateur.",
7 | "Error Code": "Code d'erreur",
8 | "Technical details": "Détails techniques",
9 | "An unanticipated problem was encountered, check back soon and try again": "Un problème inattendu s’est produit ; veuillez réessayer ultérieurement.",
10 | "This video is restricted from playing on your current domain": "La lecture de cette vidéo est restreinte sur votre domaine actuel.",
11 | "This video is restricted at your current IP address": "Cette vidéo est restreinte sur votre adresse IP actuelle.",
12 | "This video is restricted from playing in your current geographic region": "La lecture de cette vidéo est restreinte dans votre région géographique."
13 | }
14 |
--------------------------------------------------------------------------------
/lang/gl.json:
--------------------------------------------------------------------------------
1 | {
2 | "No video has been loaded": "Non se cargou ningún vídeo",
3 | "Could not download the video": "Non se puido descargar o vídeo",
4 | "The video connection was lost, please confirm you are connected to the internet": "Perdeuse a conexión ao vídeo. Comprobe que o seu equipo estea conectado a Internet",
5 | "The video is bad or in a format that cannot be played on your browser": "O vídeo está danado ou ten un formato incompatible co navegador",
6 | "This video is either unavailable or not supported in this browser": "Este vídeo non está dispoñible ou é incompatible co navegador",
7 | "Error Code": "Código de erro",
8 | "Technical details": "Detalles técnicos",
9 | "The video download was cancelled": "Cancelouse a descarga",
10 | "The video you are trying to watch is encrypted and we do not know how to decrypt it": "O vídeo que está tratando de reproducir está encriptado e non é posible desencriptalo",
11 | "An unanticipated problem was encountered, check back soon and try again": "Xurdiu un problema imprevisto. Volva a intentalo máis tarde.",
12 | "This video is restricted from playing on your current domain": "Este vídeo ten restriccións e non pode reproducirse no seu dominio actual.",
13 | "This video is restricted at your current IP address": "Este vídeo ten restriccións e non pode reproducirse na súa dirección IP actual.",
14 | "This video is restricted from playing in your current geographic region": "Este vídeo ten restriccións e non pode reproducirse na súa rexión xeográfica actual."
15 | }
16 |
--------------------------------------------------------------------------------
/lang/it.json:
--------------------------------------------------------------------------------
1 | {
2 | "No video has been loaded": "Nessun video caricato",
3 | "Could not download the video": "Impossibile eseguire il download dei video",
4 | "The video connection was lost, please confirm you are connected to the internet": "La connessione al video è andata persa. Verificare di essere connessi a Internet",
5 | "The video is bad or in a format that cannot be played on your browser": "Il video è corrotto oppure è in un formato non riproducibile dal browser in uso",
6 | "This video is either unavailable or not supported in this browser": "Questo video non è disponibile oppure non è supportato dal browser in uso",
7 | "Error Code": "Codice di Errore",
8 | "Technical details": "Dettagli tecnici",
9 | "The video download was cancelled": "Nessun video caricato",
10 | "The video you are trying to watch is encrypted and we do not know how to decrypt it": "Il video che si sta cercando di riprodurre è codificato in un formato non riconosciuto",
11 | "An unanticipated problem was encountered, check back soon and try again": "Si è verificato un problema imprevisto. Riprovare più tardi"
12 | }
13 |
--------------------------------------------------------------------------------
/lang/ja.json:
--------------------------------------------------------------------------------
1 | {
2 | "No video has been loaded": "動画をロードできませんでした",
3 | "Could not download the video": "動画をダウンロードできませんでした",
4 | "The video connection was lost, please confirm you are connected to the internet": "動画の接続が失われました。インターネットに接続していることをご確認ください",
5 | "The video is bad or in a format that cannot be played on your browser": "動画になんらかの問題があるか、ご使用のブラウザで再生できない動画フォーマットです。",
6 | "This video is either unavailable or not supported in this browser": "該当の動画は現在有効ではない、又は、ご使用のブラウザでサポートされておりません",
7 | "Error Code": "エラーコード",
8 | "Technical details": "テクニカルディテール",
9 | "The video download was cancelled": "動画のダウンロードが中止されました",
10 | "The video you are trying to watch is encrypted and we do not know how to decrypt it": "暗号化された該当の動画の復号化方法が不明です。",
11 | "An unanticipated problem was encountered, check back soon and try again": "予期しない問題が発生しました。少し経ってから確認し再度お試し下さい。",
12 | "This video is restricted from playing on your current domain": "この動画は制限されているため、該当のドメインでは再生できません。",
13 | "This video is restricted at your current IP address": "この動画は制限されているため、ご使用の環境の IP アドレスでは再生できません。",
14 | "This video is restricted from playing in your current geographic region": "この動画は制限されているため、該当の地域からは再生できません。",
15 | "OK": "OK"
16 | }
17 |
--------------------------------------------------------------------------------
/lang/ko.json:
--------------------------------------------------------------------------------
1 | {
2 | "No video has been loaded": "비디오가 로드되지 않았습니다.",
3 | "Could not download the video": "비디오를 다운로드하지 못 했습니다.",
4 | "The video connection was lost, please confirm you are connected to the internet": "비디오 연결이 끊겼습니다. 인터넷 연결 상태를 확인하십시오.",
5 | "The video is bad or in a format that cannot be played on your browser": "비디오 상태가 불량이거나 브라우저에서 재생할 수 없는 형식입니다.",
6 | "This video is either unavailable or not supported in this browser": "브라우저에서 이 비디오를 사용할 수 없거나 지원하지 않습니다.",
7 | "Error Code": "오류 코드",
8 | "Technical details": "기술 세부사항",
9 | "The video download was cancelled": "비디오 다운로드가 취소되었습니다",
10 | "The video you are trying to watch is encrypted and we do not know how to decrypt it": "재생하려는 비디오가 암호화 되었지만, 어떻게 복호화 하는지 알 수 없습니다.",
11 | "An unanticipated problem was encountered, check back soon and try again": "예상치 못한 문제가 발생했습니다. 확인 후 다시 시도하십시오.",
12 | "This video is restricted from playing on your current domain": "현재 도메인에서 재생이 제한된 비디오입니다.",
13 | "This video is restricted at your current IP address": "현재 IP 주소에서 제한된 비디오입니다.",
14 | "This video is restricted from playing in your current geographic region": "현 소재지에서 재생이 제한된 비디오입니다.",
15 | "OK": "OK"
16 | }
17 |
--------------------------------------------------------------------------------
/lang/pt.json:
--------------------------------------------------------------------------------
1 | {
2 | "No video has been loaded": "Nenhum vídeo foi carregado",
3 | "Could not download the video": "Não foi possível realizar o download do vídeo",
4 | "The video connection was lost, please confirm you are connected to the internet": "A conexão com o vídeo foi perdida. Por favor, confirme que está conectado a internet",
5 | "The video is bad or in a format that cannot be played on your browser": "O vídeo está em um formato que o seu browser não suporta",
6 | "This video is either unavailable or not supported in this browser": "O vídeo não está disponível ou não é suportado pelo seu browser",
7 | "Error Code": "Código do Erro",
8 | "Technical details": "Detalhes técnicos",
9 | "The video download was cancelled": "O download do vídeo foi cancelado",
10 | "The video you are trying to watch is encrypted and we do not know how to decrypt it": "O vídeo que você está tentando assistir é criptografado e nós não sabemos como decodificá-lo",
11 | "An unanticipated problem was encountered, check back soon and try again": "Aconteceu um erro inesperado, tente novamente mais tarde"
12 | }
13 |
--------------------------------------------------------------------------------
/lang/ru.json:
--------------------------------------------------------------------------------
1 | {
2 | "No video has been loaded": "Видео не загружено",
3 | "Could not download the video": "Не удалось загрузить видео",
4 | "The video connection was lost, please confirm you are connected to the internet": "Видеосоединение потеряно; проверьте подключение к интернету",
5 | "The video is bad or in a format that cannot be played on your browser": "Видео некачественное или имеет формат, который не воспроизводится вашим браузером",
6 | "This video is either unavailable or not supported in this browser": "Указанное видео недоступно или не поддерживается браузером",
7 | "Error Code": "Код ошибки",
8 | "Technical details": "Технические подробности",
9 | "The video download was cancelled": "Загрузка видео отменена",
10 | "The video you are trying to watch is encrypted and we do not know how to decrypt it": "Видео, которое вы пытаетесь воспроизвести, зашифровано; метод его расшифровки неизвестен",
11 | "An unanticipated problem was encountered, check back soon and try again": "Возникла неожиданная проблема; повторите попытку через некоторое время"
12 | }
13 |
--------------------------------------------------------------------------------
/lang/tr.json:
--------------------------------------------------------------------------------
1 | {
2 | "No video has been loaded": "Video yüklenmedi",
3 | "Could not download the video": "Video indirilemedi",
4 | "The video connection was lost, please confirm you are connected to the internet": "Bağlantı kesildi. Lütfen internet bağlantınızı kontrol edin",
5 | "The video is bad or in a format that cannot be played on your browser": "Bozuk veya bu tarayıcıda oynatılmayacak bir video formatıdır",
6 | "This video is either unavailable or not supported in this browser": "Video kullanım dışı veya tarayıcı tarafından desteklenmemektedir",
7 | "Error Code": "Hata Kodu",
8 | "Technical details": "Teknik Detaylar",
9 | "The video download was cancelled": "Video'nun indirimi iptal edildi",
10 | "The video you are trying to watch is encrypted and we do not know how to decrypt it": "Şifresi çözülenemeyen bir video izlemeye çalışıyorsunuz",
11 | "An unanticipated problem was encountered, check back soon and try again": "Beklenmedik bir hata oluştu. Lütfen daha sonra deneyin."
12 | }
13 |
--------------------------------------------------------------------------------
/lang/zh-CN.json:
--------------------------------------------------------------------------------
1 | {
2 | "No video has been loaded": "未加载视频",
3 | "Could not download the video": "无法下载视频",
4 | "The video connection was lost, please confirm you are connected to the internet": "视频连接丢失,请确认已连接至互联网",
5 | "The video is bad or in a format that cannot be played on your browser": "视频已损坏,或使用无法在浏览器中播放的格式",
6 | "This video is either unavailable or not supported in this browser": "此视频不可用或不受此浏览器支持",
7 | "Error Code": "错误代码",
8 | "Technical details": "技术细节",
9 | "The video download was cancelled": "视频下载已取消",
10 | "The video you are trying to watch is encrypted and we do not know how to decrypt it": "您尝试观看的视频已加密,而且解密方法未知",
11 | "An unanticipated problem was encountered, check back soon and try again": "发生意外问题,稍后请检查并重试",
12 | "This video is restricted from playing on your current domain": "此视频受到限制,无法在当前域上播放",
13 | "This video is restricted at your current IP address": "此视频受到限制,无法在当前 IP 地址播放",
14 | "This video is restricted from playing in your current geographic region": "此视频受到限制,无法在当前地理区域播放",
15 | "OK": "确定"
16 | }
17 |
--------------------------------------------------------------------------------
/lang/zh-TW.json:
--------------------------------------------------------------------------------
1 | {
2 | "No video has been loaded": "未載入任何影片",
3 | "Could not download the video": "無法載入影片",
4 | "The video connection was lost, please confirm you are connected to the internet": "影片連線已中斷,請確認您已連線至網際網路",
5 | "The video is bad or in a format that cannot be played on your browser": "影片錯誤或使用無法在瀏覽器上播放的格式",
6 | "This video is either unavailable or not supported in this browser": "此影片無法使用或在此瀏覽器中不受支援",
7 | "Error Code": "錯誤代碼",
8 | "Technical details": "技術細節",
9 | "The video download was cancelled": "已取消下載影片",
10 | "The video you are trying to watch is encrypted and we do not know how to decrypt it": "您嘗試觀看的影片已加密,而且解密方法未知",
11 | "An unanticipated problem was encountered, check back soon and try again": "發生未預期的問題,請稍後查看並再試一次",
12 | "This video is restricted from playing on your current domain": "此視訊遭到限制,無法在您目前的網域播放",
13 | "This video is restricted at your current IP address": "此視訊遭到限制,無法在您目前的 IP 位址播放",
14 | "This video is restricted from playing in your current geographic region": "此視訊遭到限制,無法在您目前的地理區域播放",
15 | "OK": "確定"
16 | }
17 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "videojs-errors",
3 | "version": "6.2.0",
4 | "author": "Brightcove, Inc.",
5 | "description": "A Video.js plugin for custom error reporting",
6 | "license": "Apache-2.0",
7 | "main": "dist/videojs-errors.cjs.js",
8 | "module": "dist/videojs-errors.es.js",
9 | "repository": {
10 | "type": "git",
11 | "url": "https://github.com/brightcove/videojs-errors.git"
12 | },
13 | "keywords": [
14 | "videojs",
15 | "videojs-plugin"
16 | ],
17 | "generator-videojs-plugin": {
18 | "version": "7.3.2"
19 | },
20 | "scripts": {
21 | "prebuild": "npm run clean",
22 | "build": "npm-run-all -p build:*",
23 | "build:css": "postcss -o dist/videojs-errors.css --config scripts/postcss.config.js src/plugin.css",
24 | "build:js": "rollup -c scripts/rollup.config.js",
25 | "prebuild:lang": "npm-run-all -s prebuild:lang:*",
26 | "prebuild:lang:chinese-s": "shx cp lang/zh-CN.json lang/zh-Hans.json",
27 | "prebuild:lang:chinese-t": "shx cp lang/zh-TW.json lang/zh-Hant.json",
28 | "build:lang": "vjslang --dir dist/lang",
29 | "postbuild:lang": "shx cp -R lang/* dist/lang/",
30 | "clean": "shx rm -rf ./dist ./test/dist ./lang/zh-Han*.json",
31 | "postclean": "shx mkdir -p ./dist ./test/dist",
32 | "docs": "doctoc README.md",
33 | "lint": "vjsstandard",
34 | "server": "karma start scripts/karma.conf.js --singleRun=false --auto-watch",
35 | "start": "npm-run-all -p server watch",
36 | "pretest": "npm-run-all lint build",
37 | "test": "karma start scripts/karma.conf.js",
38 | "update-changelog": "conventional-changelog -p videojs -i CHANGELOG.md -s",
39 | "version": "is-prerelease || npm run update-changelog && git add CHANGELOG.md",
40 | "watch": "npm-run-all -p watch:*",
41 | "watch:css": "npm run build:css -- -w",
42 | "watch:js": "npm run build:js -- -w",
43 | "posttest": "shx cat test/dist/coverage/text.txt",
44 | "prepublishOnly": "npm run build && vjsverify --skip-es-check"
45 | },
46 | "vjsstandard": {
47 | "ignore": [
48 | "dist",
49 | "docs",
50 | "test/dist"
51 | ]
52 | },
53 | "files": [
54 | "CONTRIBUTING.md",
55 | "dist/",
56 | "docs/",
57 | "index.html",
58 | "scripts/",
59 | "src/",
60 | "test/"
61 | ],
62 | "dependencies": {
63 | "global": "^4.4.0",
64 | "video.js": "^6 || ^7 || ^8"
65 | },
66 | "devDependencies": {
67 | "@babel/cli": "^7.17.10",
68 | "conventional-changelog-cli": "^2.0.31",
69 | "conventional-changelog-videojs": "^3.0.2",
70 | "doctoc": "^2.2.0",
71 | "husky": "^1.0.0-rc.13",
72 | "karma": "^6.4.0",
73 | "lint-staged": "^13.0.1",
74 | "not-prerelease": "^1.0.1",
75 | "npm-merge-driver-install": "^3.0.0",
76 | "npm-run-all": "^4.1.5",
77 | "pkg-ok": "^3.0.0",
78 | "postcss": "^8.4.14",
79 | "postcss-cli": "^8.3.1",
80 | "rollup": "^2.61.1",
81 | "shx": "^0.3.2",
82 | "sinon": "^6.1.5",
83 | "videojs-generate-karma-config": "^8.0.1",
84 | "videojs-generate-postcss-config": "^3.0.0",
85 | "videojs-generate-rollup-config": "^7.0.0",
86 | "videojs-generator-verify": "^4.0.1",
87 | "videojs-languages": "^2.0.0",
88 | "videojs-standard": "^9.0.1"
89 | },
90 | "lint-staged": {
91 | "*.js": "vjsstandard --fix",
92 | "README.md": "npm run docs"
93 | },
94 | "husky": {
95 | "hooks": {
96 | "pre-commit": "lint-staged"
97 | }
98 | }
99 | }
100 |
--------------------------------------------------------------------------------
/scripts/karma.conf.js:
--------------------------------------------------------------------------------
1 | const generate = require('videojs-generate-karma-config');
2 |
3 | module.exports = function(config) {
4 |
5 | // see https://github.com/videojs/videojs-generate-karma-config
6 | // for options
7 | const options = {};
8 |
9 | config = generate(config, options);
10 |
11 | // any other custom stuff not supported by options here!
12 | };
13 |
14 |
--------------------------------------------------------------------------------
/scripts/postcss.config.js:
--------------------------------------------------------------------------------
1 | const generate = require('videojs-generate-postcss-config');
2 |
3 | module.exports = function(context) {
4 | const result = generate({}, context);
5 |
6 | // do custom stuff here
7 |
8 | return result;
9 | };
10 |
--------------------------------------------------------------------------------
/scripts/rollup.config.js:
--------------------------------------------------------------------------------
1 | const generate = require('videojs-generate-rollup-config');
2 |
3 | // see https://github.com/videojs/videojs-generate-rollup-config
4 | // for options
5 | const options = {};
6 | const config = generate(options);
7 |
8 | // Add additonal builds/customization here!
9 |
10 | // export the builds to rollup
11 | export default Object.values(config.builds);
12 |
--------------------------------------------------------------------------------
/src/plugin.css:
--------------------------------------------------------------------------------
1 | /*
2 | Default State: Hidden
3 | -------------------------------------------------------------------------------
4 | */
5 |
6 | .vjs-error-display {
7 | color: #fff;
8 | display: none;
9 | font-family: Helvetica, Arial, sans serif;
10 | font-size: 16px;
11 | line-height: 1.428;
12 | }
13 |
14 | .vjs-error .vjs-error-display {
15 | display: block;
16 | position: absolute;
17 | top: 0;
18 | left: 0;
19 | right: 0;
20 | bottom: 0;
21 | background: rgba(0, 0, 0, 0.5);
22 | }
23 |
24 | .vjs-error .vjs-error-display .vjs-modal-dialog-content {
25 | font-size: 14px;
26 | }
27 |
28 | /*
29 | Full Size Styles
30 | -------------------------------------------------------------------------------
31 | */
32 |
33 | .vjs-errors-dialog {
34 | text-align: left;
35 | border: 1px #999 solid;
36 | overflow: hidden;
37 | position: absolute;
38 | top: 2%;
39 | bottom: 2%;
40 | left: 5%;
41 | right: 5%;
42 | padding-left: 1%;
43 | padding-right: 1%;
44 | background: rgba(24, 24, 24, 0.8);
45 | }
46 |
47 | .vjs-errors-details {
48 | margin-top: 15px;
49 | }
50 |
51 | .vjs-errors-message {
52 | border: 1px #999 solid;
53 | background-color: #2c2c2c;
54 | overflow: auto;
55 | margin-top: 15px;
56 | padding: 15px;
57 | }
58 |
59 | .vjs-errors-ok-button-container {
60 | display: block;
61 | position: absolute;
62 | bottom: 15px;
63 | left: 15px;
64 | right: 15px;
65 | text-align: center;
66 | }
67 |
68 | .vjs-errors-ok-button {
69 | display: block;
70 | margin: 0 auto;
71 | width: 80px;
72 | height: 36px;
73 | background-color: #000;
74 | border: 1px #999 solid;
75 | border-radius: 5px;
76 | color: #999;
77 | font-size: 14px;
78 | cursor: pointer;
79 | }
80 |
81 | .vjs-errors-ok-button:hover {
82 | border: 1px #fff solid;
83 | color: #ccc;
84 | }
85 |
86 | .vjs-errors-timeout-button-container {
87 | display: flex;
88 | flex-direction: row;
89 | justify-content: center;
90 | gap: 10px;
91 | position: absolute;
92 | bottom: 15px;
93 | left: 15px;
94 | right: 15px;
95 | text-align: center;
96 | }
97 |
98 | .vjs-errors-timeout-button-container button {
99 | display: block;
100 | width: 120px;
101 | height: 36px;
102 | background-color: #000;
103 | border: 1px #999 solid;
104 | border-radius: 5px;
105 | color: #999;
106 | font-size: 14px;
107 | cursor: pointer;
108 | }
109 |
110 | .vjs-errors-timeout-button-container button:hover {
111 | border: 1px #fff solid;
112 | color: #ccc;
113 | }
114 |
115 | .vjs-errors-content-container {
116 | overflow: auto;
117 | position: absolute;
118 | padding-bottom: 15px;
119 | top: 0;
120 | left: 15px;
121 | right: 15px;
122 | bottom: 61px; /* dialog padding + ok button + 10 */
123 | }
124 |
125 | .vjs-errors-headline {
126 | font-size: 14px;
127 | font-weight: bold;
128 | padding-right: 3em;
129 | }
130 |
131 | .vjs-errors-dialog .vjs-control.vjs-close-button {
132 | width: 3em;
133 | height: 3em;
134 | top: 0;
135 | }
136 |
137 | /*
138 | "Extra small" Styles
139 | -------------------------------------------------------------------------------
140 | */
141 |
142 | .vjs-xs.vjs-error-display {
143 | font-size: 14px;
144 | background-color: #000;
145 | }
146 |
147 | .vjs-xs.vjs-error-display .vjs-errors-details,
148 | .vjs-xs.vjs-error-display .vjs-errors-message {
149 | display: none;
150 | }
151 |
152 | .vjs-xs .vjs-errors-content-container {
153 | top: 0;
154 | }
155 |
156 | .vjs-xs .vjs-errors-headline {
157 | font-size: 16px;
158 | font-weight: bold;
159 | }
160 |
161 | .vjs-xs .vjs-errors-dialog {
162 | border: none;
163 | top: 0;
164 | bottom: 0;
165 | left: 0;
166 | right: 0;
167 | }
168 |
169 | /*
170 | Media query for player sizes of 600x250 or less. NOTE: This is a
171 | copy of the extra small styles above yet without ".vjs-xs".
172 | -------------------------------------------------------------------------------
173 | */
174 |
175 | @media (max-width: 600px), (max-height: 250px) {
176 | .vjs-error-display {
177 | font-size: 14px;
178 | background-color: #000;
179 | }
180 |
181 | .vjs-error-display .vjs-errors-details,
182 | .vjs-error-display .vjs-errors-message {
183 | display: none;
184 | }
185 |
186 | .vjs-error-display .vjs-errors-content-container {
187 | top: 15px;
188 | }
189 |
190 | .vjs-error-display .vjs-errors-headline {
191 | font-size: 16px;
192 | font-weight: bold;
193 | }
194 |
195 | .vjs-error-display .vjs-errors-dialog {
196 | border: none;
197 | top: 0;
198 | bottom: 0;
199 | left: 0;
200 | right: 0;
201 | }
202 | }
203 |
--------------------------------------------------------------------------------
/src/plugin.js:
--------------------------------------------------------------------------------
1 | import videojs from 'video.js';
2 | import document from 'global/document';
3 | import {version as VERSION} from '../package.json';
4 |
5 | const merge = (videojs.obj && videojs.obj.merge) || videojs.mergeOptions;
6 |
7 | const defaultDismiss = !videojs.browser.IS_IPHONE;
8 |
9 | // Default options for the plugin.
10 | const defaults = {
11 | header: '',
12 | code: '',
13 | message: '',
14 | timeout: 45 * 1000,
15 | backgroundTimeout: 300 * 1000,
16 | dismiss: defaultDismiss,
17 | errors: {
18 | '1': {
19 | type: 'MEDIA_ERR_ABORTED',
20 | headline: 'The video download was cancelled'
21 | },
22 | '2': {
23 | type: 'MEDIA_ERR_NETWORK',
24 | headline: 'The video connection was lost, please confirm you are ' +
25 | 'connected to the internet'
26 | },
27 | '3': {
28 | type: 'MEDIA_ERR_DECODE',
29 | headline: 'The video is bad or in a format that cannot be played on your browser'
30 | },
31 | '4': {
32 | type: 'MEDIA_ERR_SRC_NOT_SUPPORTED',
33 | headline: 'This video is either unavailable or not supported in this browser'
34 | },
35 | '5': {
36 | type: 'MEDIA_ERR_ENCRYPTED',
37 | headline: 'The video you are trying to watch is encrypted and we do not know how ' +
38 | 'to decrypt it'
39 | },
40 | 'unknown': {
41 | type: 'MEDIA_ERR_UNKNOWN',
42 | headline: 'An unanticipated problem was encountered, check back soon and try again'
43 | },
44 | '-1': {
45 | type: 'PLAYER_ERR_NO_SRC',
46 | headline: 'No video has been loaded'
47 | },
48 | '-2': {
49 | type: 'PLAYER_ERR_TIMEOUT',
50 | headline: 'It looks like you\'re having playback issues. Reloading the video may help.'
51 | },
52 | 'PLAYER_ERR_DOMAIN_RESTRICTED': {
53 | headline: 'This video is restricted from playing on your current domain'
54 | },
55 | 'PLAYER_ERR_IP_RESTRICTED': {
56 | headline: 'This video is restricted at your current IP address'
57 | },
58 | 'PLAYER_ERR_GEO_RESTRICTED': {
59 | headline: 'This video is restricted from playing in your current geographic region'
60 | }
61 | }
62 | };
63 |
64 | const initPlugin = function(player, options) {
65 | let monitor;
66 | let waiting;
67 | let isStalling;
68 | const listeners = [];
69 |
70 | const updateErrors = function(updates) {
71 | options.errors = merge(options.errors, updates);
72 |
73 | // Create `code`s from errors which don't have them (based on their keys).
74 | Object.keys(options.errors).forEach(k => {
75 | const err = options.errors[k];
76 |
77 | if (!err.type) {
78 | err.type = k;
79 | }
80 | });
81 | };
82 |
83 | // Make sure we flesh out initially-provided errors.
84 | updateErrors();
85 |
86 | // clears the previous monitor timeout and sets up a new one
87 | const resetMonitor = function() {
88 | // clear out any existing player error now that playback has recovered
89 | if (player.error() && player.error().code === -2) {
90 | player.error(null);
91 | }
92 |
93 | player.clearTimeout(waiting);
94 | player.clearTimeout(monitor);
95 |
96 | if (isStalling) {
97 | isStalling = false;
98 |
99 | player.removeClass('vjs-waiting');
100 | }
101 |
102 | // Disable timeouts in the background altogether according to the backgroundTimeout
103 | // option, or if the player is muted, as browsers may throttle javascript timers to
104 | // 1 minute in that case
105 | const disableValues = [Infinity, -1];
106 | const disableValueMatch = (valArray, option) => valArray.indexOf(option) !== -1;
107 |
108 | if ((document.visibilityState === 'hidden' &&
109 | (player.muted() || disableValueMatch(disableValues, options.backgroundTimeout))) ||
110 | (document.visibilityState === 'visible' && disableValueMatch(disableValues, options.timeout))) {
111 | return;
112 | }
113 |
114 | // start the loading spinner if player has stalled
115 | waiting = player.setTimeout(function() {
116 | // player already has an error
117 | // or is not playing under normal conditions
118 | if (player.error() || player.paused() || player.ended()) {
119 | return;
120 | }
121 |
122 | isStalling = true;
123 | player.addClass('vjs-waiting');
124 | }, 1000);
125 |
126 | monitor = player.setTimeout(function() {
127 | // player already has an error
128 | // or is not playing under normal conditions
129 | if (player.error() || player.paused() || player.ended()) {
130 | return;
131 | }
132 |
133 | player.error({
134 | code: -2,
135 | type: 'PLAYER_ERR_TIMEOUT'
136 | });
137 | }, document.visibilityState === 'hidden' ? options.backgroundTimeout : options.timeout);
138 | };
139 |
140 | // clear any previously registered listeners
141 | const cleanup = function() {
142 | let listener;
143 |
144 | while (listeners.length) {
145 | listener = listeners.shift();
146 | player.off(listener[0], listener[1]);
147 | }
148 | player.clearTimeout(monitor);
149 | player.clearTimeout(waiting);
150 | };
151 |
152 | // creates and tracks a player listener if the player looks alive
153 | const healthcheck = function(type, fn) {
154 | const check = function() {
155 | // if there's an error do not reset the monitor and
156 | // clear the error unless time is progressing
157 | if (!player.error()) {
158 | // playback isn't expected if the player is paused
159 | if (player.paused()) {
160 | return resetMonitor();
161 | }
162 | // playback isn't expected once the video has ended
163 | if (player.ended()) {
164 | return resetMonitor();
165 | }
166 | }
167 |
168 | fn.call(this);
169 | };
170 |
171 | player.on(type, check);
172 | listeners.push([type, check]);
173 | };
174 |
175 | const onPlayStartMonitor = function() {
176 | let lastTime = 0;
177 |
178 | cleanup();
179 |
180 | // if no playback is detected for long enough, trigger a timeout error
181 | resetMonitor();
182 | healthcheck(['timeupdate', 'adtimeupdate'], function() {
183 | const currentTime = player.currentTime();
184 |
185 | // playback is operating normally or has recovered
186 | if (currentTime !== lastTime) {
187 | lastTime = currentTime;
188 | resetMonitor();
189 | }
190 | });
191 |
192 | // Restart timeout monitor when the document transitions between the
193 | // foreground and background
194 | player.off(document, 'visibilitychange', onPlayStartMonitor);
195 | player.on(document, 'visibilitychange', onPlayStartMonitor);
196 | };
197 |
198 | const onPlayNoSource = function() {
199 | if (!player.currentSrc()) {
200 | player.error({
201 | code: -1,
202 | type: 'PLAYER_ERR_NO_SRC'
203 | });
204 | }
205 | };
206 |
207 | const onErrorHandler = function() {
208 | let details = '';
209 | let error = player.error();
210 | const content = document.createElement('div');
211 | let dialogContent = '';
212 |
213 | // In the rare case when `error()` does not return an error object,
214 | // defensively escape the handler function.
215 | if (!error) {
216 | return;
217 | }
218 |
219 | // Stop restarting the monitor on visibilitychanges now that an error has occurred
220 | player.off(document, 'visibilitychange', onPlayStartMonitor);
221 |
222 | error = merge(error, options.errors[error.code || error.type || 0]);
223 |
224 | if (error.message) {
225 | details = `