diff --git a/package.json b/package.json index 0c65d92b..fa29602b 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ }, "devDependencies": { "babel-core": "^6.26.3", - "babel-eslint": "^9.0.0", + "babel-eslint": "^10.0.0", "@babel/preset-env": "^7.1.0", "del": "^3.0.0", "eslint": "^5.6.0", @@ -64,7 +64,7 @@ "gulp-svgstore": "^7.0.0", "gulp-uglify-es": "^1.0.4", "gulp-util": "^3.0.8", - "postcss-custom-properties": "^8.0.5", + "postcss-custom-properties": "^8.0.6", "prettier-eslint": "^8.8.2", "prettier-stylelint": "^0.4.2", "remark-cli": "^5.0.0", @@ -73,7 +73,7 @@ "rollup-plugin-commonjs": "^9.1.8", "rollup-plugin-node-resolve": "^3.4.0", "run-sequence": "^2.2.1", - "stylelint": "^9.5.0", + "stylelint": "^9.6.0", "stylelint-config-prettier": "^4.0.0", "stylelint-config-recommended": "^2.1.0", "stylelint-config-sass-guidelines": "^5.2.0", diff --git a/src/js/config/defaults.js b/src/js/config/defaults.js index e6e2d7c1..5e2fc4a9 100644 --- a/src/js/config/defaults.js +++ b/src/js/config/defaults.js @@ -133,6 +133,7 @@ const defaults = { 'settings', 'pip', 'airplay', + 'download', 'fullscreen', ], settings: ['captions', 'quality', 'speed'], @@ -155,6 +156,7 @@ const defaults = { unmute: 'Unmute', enableCaptions: 'Enable captions', disableCaptions: 'Disable captions', + download: 'Download', enterFullscreen: 'Enter fullscreen', exitFullscreen: 'Exit fullscreen', frameTitle: 'Player for {title}', @@ -210,6 +212,7 @@ const defaults = { mute: null, volume: null, captions: null, + download: null, fullscreen: null, pip: null, airplay: null, @@ -245,6 +248,7 @@ const defaults = { 'cuechange', // Custom events + 'download', 'enterfullscreen', 'exitfullscreen', 'captionsenabled', @@ -290,6 +294,7 @@ const defaults = { fastForward: '[data-plyr="fast-forward"]', mute: '[data-plyr="mute"]', captions: '[data-plyr="captions"]', + download: '[data-plyr="download"]', fullscreen: '[data-plyr="fullscreen"]', pip: '[data-plyr="pip"]', airplay: '[data-plyr="airplay"]', diff --git a/src/js/config/types.js b/src/js/config/types.js index 13303573..c9d50937 100644 --- a/src/js/config/types.js +++ b/src/js/config/types.js @@ -15,7 +15,7 @@ export const types = { /** * Get provider by URL - * @param {string} url + * @param {String} url */ export function getProviderByUrl(url) { // YouTube diff --git a/src/js/controls.js b/src/js/controls.js index 661ceb32..785f100d 100644 --- a/src/js/controls.js +++ b/src/js/controls.js @@ -122,17 +122,13 @@ const controls = { }, // Create hidden text label - createLabel(type, attr = {}) { - // Skip i18n for abbreviations and brand names - const universals = { - pip: 'PIP', - airplay: 'AirPlay', - }; - const text = universals[type] || i18n.get(type, this.config); + createLabel(key, attr = {}) { + const text = i18n.get(key, this.config); const attributes = Object.assign({}, attr, { class: [attr.class, this.config.classNames.hidden].filter(Boolean).join(' '), }); + return createElement('span', attributes, text); }, @@ -161,21 +157,32 @@ const controls = { // Create a