diff --git a/.eslintrc.json b/.eslintrc.json index 63fefe4d..ae86f34f 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -5,8 +5,12 @@ "browser": true, "es6": true }, - "globals": { "Plyr": false, "jQuery": false }, + "globals": { + "Plyr": false, + "jQuery": false + }, "rules": { + "import/no-cycle": 1, "no-const-assign": 1, "no-shadow": 0, "no-this-before-super": 1, @@ -21,19 +25,9 @@ "eqeqeq": [2, "always"], "one-var": [2, "never"], "comma-dangle": [2, "always-multiline"], - "no-restricted-globals": [ - "error", - { - "name": "event", - "message": "Use local parameter instead." - }, - { - "name": "error", - "message": "Use local parameter instead." - } - ], - "array-bracket-newline": [2, { "minItems": 2 }], - "array-element-newline": [2, { "minItems": 2 }] + "spaced-comment": [2, "always"], + "no-restricted-globals": 2, + "no-param-reassign": [2, { "props": false }] }, "parserOptions": { "sourceType": "module" diff --git a/.github/ISSUE_TEMPLATE/bug.md b/.github/ISSUE_TEMPLATE/bug.md new file mode 100644 index 00000000..d4bebdfa --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug.md @@ -0,0 +1,55 @@ +--- +name: Bug report +about: Report an issue or unexpected behaviour with Plyr +--- + + + +### Expected behaviour + +### Actual behaviour + +### Steps to reproduce + +### Environment + +- Browser: +- Version: +- Operating System: +- Version: + +### Console errors (if any) + +### Link to where the bug is happening + + diff --git a/.github/ISSUE_TEMPLATE/feature.md b/.github/ISSUE_TEMPLATE/feature.md new file mode 100644 index 00000000..342ab0f0 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature.md @@ -0,0 +1,10 @@ +--- +name: New feature +about: Request new functionality +--- + + diff --git a/.github/ISSUE_TEMPLATE/improvement.md b/.github/ISSUE_TEMPLATE/improvement.md new file mode 100644 index 00000000..de7e0576 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/improvement.md @@ -0,0 +1,10 @@ +--- +name: Improvement +about: Request a change that isn't a bug or new feature +--- + + diff --git a/.github/issue_template.md b/.github/issue_template.md index f503b944..54f4550b 100644 --- a/.github/issue_template.md +++ b/.github/issue_template.md @@ -1,17 +1,3 @@ - +PLEASE USE OUR SPECIFIC ISSUE TEMPLATES for bug reports, features and improvement suggestions. -### Expected behaviour - -### Actual behaviour - -### Environment - -- Browser: -- Version: -- Operating System: -- Version: - -### Steps to reproduce -- \ No newline at end of file +Our issue tracker is not for support questions. If you need help, follow our support instructions: https://github.com/sampotts/plyr/blob/master/contributing.md#support diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index c4779d3c..f67d769f 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,8 +1,8 @@ ### Link to related issue (if applicable) -### Sumary of proposed changes +### Summary of proposed changes -### Task list - -- [ ] Tested on [supported browsers](https://github.com/sampotts/plyr#browser-support) -- [ ] Gulp build completed \ No newline at end of file +### Checklist +- [ ] Use `develop` as the base branch +- [ ] Exclude the gulp build (`/dist` changes) from the PR +- [ ] Test on [supported browsers](https://github.com/sampotts/plyr#browser-support) diff --git a/.gitignore b/.gitignore index b17cd7c7..878292b0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,11 +1,11 @@ node_modules .DS_Store -aws.json +credentials.json *.mp4 !dist/blank.mp4 index-*.html npm-debug.log +yarn-error.log +package-lock.json *.webm -/package-lock.json .idea/ - diff --git a/.npmignore b/.npmignore index afba951f..32ff635b 100644 --- a/.npmignore +++ b/.npmignore @@ -2,3 +2,10 @@ demo .github .vscode *.code-workspace +credentials.json +bundles.json +yarn.lock +package-lock.json +*.mp4 +*.webm +!dist/blank.mp4 \ No newline at end of file diff --git a/.prettierrc b/.prettierrc index e1544230..cee783d4 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,7 +1,7 @@ { "useTabs": false, "tabWidth": 4, - "printWidth": 160, "singleQuote": true, - "trailingComma": "all" + "trailingComma": "all", + "printWidth": 120 } diff --git a/.stickler.yml b/.stickler.yml new file mode 100644 index 00000000..717ba28c --- /dev/null +++ b/.stickler.yml @@ -0,0 +1,5 @@ +linters: + eslint: +files: + ignore: + - 'node_modules/*' diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..3203fb95 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,8 @@ +language: node_js +node_js: lts/* + +script: +- bash .travis/prevent-base-master.sh +- bash .travis/omit-dist.sh +- npm run lint +- npm run build diff --git a/.travis/omit-dist.sh b/.travis/omit-dist.sh new file mode 100755 index 00000000..f107a6b9 --- /dev/null +++ b/.travis/omit-dist.sh @@ -0,0 +1,5 @@ +#!/bin/bash +if [ $TRAVIS_BRANCH == "develop" ] && $(git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qE "^(demo/)?dist/"); then + echo 'Build output ("dist" and "demo/dist") not permitted in develop' >&2 + exit 1 +fi diff --git a/.travis/prevent-base-master.sh b/.travis/prevent-base-master.sh new file mode 100755 index 00000000..54536a66 --- /dev/null +++ b/.travis/prevent-base-master.sh @@ -0,0 +1,5 @@ +#!/bin/bash +if [ "$TRAVIS_PULL_REQUEST" != "false" ] && [ $TRAVIS_BRANCH == "master" ] && $(git diff --name-only $TRAVIS_COMMIT_RANGE | grep -q "^src/"); then + echo 'The base branch for pull requests must be "develop"' >&2 + exit 1 +fi diff --git a/bower.json b/bower.json deleted file mode 100644 index 53c921b7..00000000 --- a/bower.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "plyr", - "description": "A simple HTML5 media player using custom controls", - "homepage": "http://plyr.io", - "keywords": [ - "Audio", - "Video", - "HTML5 Audio", - "HTML5 Video" - ], - "authors": [ - "Sam Potts " - ], - "dependencies": {}, - "main": [ - "dist/plyr.css", - "dist/plyr.js", - "dist/plyr.svg", - "src/less/plyr.less", - "src/scss/plyr.scss", - "src/js/plyr.js" - ], - "ignore": [ - "node_modules", - "bower_components", - ".gitignore" - ], - "repository": { - "type": "git", - "url": "git://github.com/sampotts/plyr.git" - }, - "license": "MIT" -} \ No newline at end of file diff --git a/changelog.md b/changelog.md index dc09b53d..c382a814 100644 --- a/changelog.md +++ b/changelog.md @@ -1,151 +1,301 @@ -# v3.3.7 +### v3.4.7 -* Poster fixes (thanks @friday) -* Grid tweak +- Fix for Vimeo fullscreen with non native aspect ratios (fixes #854) -# v3.3.6 +### v3.4.6 -* Vimeo fixes for mute state -* Vimeo ID fix (fixes #945) -* Use `
` for poster container -* Tooltip fixes for unicode languages (fixes #943) +- Added picture-in-picture support for Chrome 70+ +- Fixed issue with versioning the SVG sprite in the gulp build script -# v3.3.5 +### v3.4.5 -* Removed `.load()` call as it breaks HLS (see #870) +- Added download button option to download either current source or a custom URL you specify in options +- Prevent immediate hiding of controls on mobile (thanks @jamesoflol) +- Don't hide controls on focusout event (fixes #1122) (thanks @jamesoflol) +- Fix HTML5 quality settings being incorrectly set in local storage (thanks @TechGuard) -# v3.3.4 +### v3.4.4 -* Fix for controls sometimes not showing while video is playing -* Fixed logic for show home tab on option select +- Fixed issue with double binding for `click` and `touchstart` for `clickToPlay` option +- Improved "faux" fullscreen on iPhone X/XS phones with notch +- Babel 7 upgrade (which reduced the polyfilled build by ~10kb!) -# v3.3.3 +### v3.4.3 -* Reverted change to show home tab on option select due to usability regression +- Fixed issue with nodeList for custom playback controls -# v3.3.2 +### v3.4.2 -* Fix for ads running in audio -* Fix for setting poster on source change +- Fix play/pause button state + +### v3.4.1 + +- Bug fix for custom controls (fixes #1161) + +## v3.4.0 + +- Accessibility improvements (see #905) +- Improvements to the way the controls work on iOS +- Demo code clean up +- YouTube quality selection removed due to their poor support for it. As a result, the `qualityrequested` event has been removed +- Controls spacing improvements +- Fix for pressed property missing with custom controls (Fixes #1062) +- Fix #1153: Captions language fallback (thanks @friday) +- Fix for setting pressed property of undefined (Fixes #1102) + +### v3.3.23 + +- Add support for YouTube's hl param (thanks @renaudleo) +- Fix for captions positioning when no controls (thanks @friday and @mjfwebb) +- Fix #1108: Make sure youtube.onReady doesn't run twice (thanks @friday) +- Fix for WebKit redraw loop on the `` elements + +### v3.3.22 + +- Travis & CI improvements (thanks @friday) +- Add navigator.languages fallback for iOS 9 (thanks @friday) + +### v3.3.21 + +- Hide currentTime and progress for streams (thanks @mimse) +- Fixed condition check (thanks @mimse) +- Handle undefined this.player.elements.buttons.play (thanks @klassicd) +- Fix captions.toggle() if there is no toggle button (thanks @friday) + +### v3.3.20 + +- Fix for bug where controls wouldn't show on hover over YouTube video + +### v3.3.19 + +- Remove `pointer-events: none` on embed `