Comparar commits

...

31 Commits

Autor SHA1 Mensagem Data
brandonocasey 44ab9637f1 fix: duration change should not be throttled for duration display update 2017-10-20 17:17:35 -04:00
Gary Katsevman e8511a5799 chore(gh-release): no console log on success (#4657)
We've been printing the resulting value from a successful call to the ghrelease, this was useful for debugging but isn't necessary anymore.
Add the result to the error conditional with some headings.
2017-10-10 11:35:50 -07:00
Gary Katsevman 69577790eb 6.3.3 2017-10-10 13:52:45 -04:00
Brandon Casey b1de506b43 fix: a possible breaking change caused by the use of remainingTimeDisplay (#4655) 2017-10-10 11:35:46 -04:00
TaeSoo 태수 6738f765da docs(hooks): Fix Typo (#4652) 2017-10-06 18:01:54 -07:00
Pat O'Neill 8ec61bbb20 6.3.2 2017-10-04 10:37:26 -04:00
Thijs Triemstra 85a34d1b49 docs: Document how to add a version number to a plugin (#4642) 2017-10-04 10:32:18 -04:00
Pat O'Neill 4658c7bad6 fix: Fix a typo in current time display component. (#4647) 2017-10-04 10:31:10 -04:00
Pat O'Neill 8878acc040 6.3.1 2017-10-03 13:11:27 -04:00
Pat O'Neill 20f7fe991f fix: Make sure time displays use correctly-formatted time. (#4643) 2017-10-03 12:52:58 -04:00
Pat O'Neill f0d9c240fe 6.3.0 2017-10-03 11:04:07 -04:00
Brandon Casey 445eb26722 feat: Add remainingTimeDisplay method to Player (#4620) 2017-10-02 16:29:40 -04:00
Thom 5ca0992cf1 chore(lang): Update Dutch (#4588) 2017-10-02 16:08:04 -04:00
ngoisaosang ac58dbf13a chore(lang): Update Vietnamese (#4625) 2017-10-02 16:04:57 -04:00
Alex Barstow 1ac8065ea6 feat: Do not set focus in sub-menus to prevent undesirable scrolling behavior in iOS (#4607) 2017-10-02 15:29:34 -04:00
Brandon Casey f51d36b053 feat: display currentTime as duration and remainingTime as 0 on ended (#4634) 2017-10-02 11:19:29 -04:00
Brandon Casey fa6f884409 refactor: Create a base time display class, and use it (#4633) 2017-10-02 10:58:30 -04:00
Brandon Casey 335bcded98 fix: reset to a play/pause button when seeking after ended (#4614) 2017-09-20 13:45:47 -04:00
Thijs Triemstra d8ea23e0c9 docs: update player reference in advanced plugins doc (#4622) 2017-09-20 10:55:29 -04:00
Erik Demaine 9d249bb23b docs: Document playbackRates (#4602) 2017-09-19 17:44:36 -04:00
greenkeeper[bot] 7929677f6f chore(package): update remark-validate-links to version 7.0.0 (#4585) 2017-09-19 17:21:39 -04:00
greenkeeper[bot] 6cd785ab7f chore(package): update grunt-browserify to version 5.2.0 (#4578) 2017-09-19 17:21:20 -04:00
Brandon Casey edde614822 chore: alias rollup-dev to watch for development (#4615) 2017-09-14 15:09:52 -04:00
ldayananda 9f969300d7 6.2.8 2017-09-01 13:37:46 -04:00
Matthew Boles 006fb3b705 docs: update to width and height doc comments (#4592) 2017-09-01 13:31:48 -04:00
Gary Katsevman 5e23048370 fix(package): remove pkg.module (#4594)
More info available in #4580.

Fixes #4580.
2017-08-31 16:16:41 -04:00
Gary Katsevman 95c4ae0404 fix: rely on browser or tech to handle autoplay (#4582)
When setting the source, we were calling `play` if `autoplay` was set. We shouldn't do that and instead we should rely on the browser or tech (like Flash) to handle it properly.
2017-08-30 14:29:08 -04:00
Gary Katsevman 9588602d48 docs(COLLABORATOR_GUIDE): how to release Video.js (#4586) 2017-08-30 14:22:04 -04:00
Pat O'Neill 6e2a302af8 6.2.7 2017-08-24 16:20:40 -04:00
Gary Katsevman fe63992bd1 fix: use typeof for checking preload option (#4574) 2017-08-17 17:48:17 -04:00
greenkeeper[bot] 7b251d0d35 chore(package): update rollup to version 0.47.5 (#4572) 2017-08-17 13:30:46 -04:00
19 arquivos alterados com 700 adições e 651 exclusões
+83
Ver Arquivo
@@ -1,3 +1,86 @@
<a name="6.3.3"></a>
## [6.3.3](https://github.com/videojs/video.js/compare/v6.3.2...v6.3.3) (2017-10-10)
### Bug Fixes
* a possible breaking change caused by the use of remainingTimeDisplay ([#4655](https://github.com/videojs/video.js/issues/4655)) ([b1de506](https://github.com/videojs/video.js/commit/b1de506))
### Documentation
* **hooks:** Fix Typo ([#4652](https://github.com/videojs/video.js/issues/4652)) ([6738f76](https://github.com/videojs/video.js/commit/6738f76))
<a name="6.3.2"></a>
## [6.3.2](https://github.com/videojs/video.js/compare/v6.3.1...v6.3.2) (2017-10-04)
### Bug Fixes
* Fix a typo in current time display component. ([#4647](https://github.com/videojs/video.js/issues/4647)) ([4658c7b](https://github.com/videojs/video.js/commit/4658c7b))
### Documentation
* Document how to add a version number to a plugin ([#4642](https://github.com/videojs/video.js/issues/4642)) ([85a34d1](https://github.com/videojs/video.js/commit/85a34d1))
<a name="6.3.1"></a>
## [6.3.1](https://github.com/videojs/video.js/compare/v6.3.0...v6.3.1) (2017-10-03)
### Bug Fixes
* Make sure time displays use correctly-formatted time. ([#4643](https://github.com/videojs/video.js/issues/4643)) ([20f7fe9](https://github.com/videojs/video.js/commit/20f7fe9))
<a name="6.3.0"></a>
# [6.3.0](https://github.com/videojs/video.js/compare/v6.2.8...v6.3.0) (2017-10-03)
### Features
* Add remainingTimeDisplay method to Player ([#4620](https://github.com/videojs/video.js/issues/4620)) ([445eb26](https://github.com/videojs/video.js/commit/445eb26))
* display currentTime as duration and remainingTime as 0 on ended ([#4634](https://github.com/videojs/video.js/issues/4634)) ([f51d36b](https://github.com/videojs/video.js/commit/f51d36b))
* Do not set focus in sub-menus to prevent undesirable scrolling behavior in iOS ([#4607](https://github.com/videojs/video.js/issues/4607)) ([1ac8065](https://github.com/videojs/video.js/commit/1ac8065))
### Bug Fixes
* reset to a play/pause button when seeking after ended ([#4614](https://github.com/videojs/video.js/issues/4614)) ([335bcde](https://github.com/videojs/video.js/commit/335bcde))
### Chores
* alias rollup-dev to watch for development ([#4615](https://github.com/videojs/video.js/issues/4615)) ([edde614](https://github.com/videojs/video.js/commit/edde614))
* **lang:** Update Dutch ([#4588](https://github.com/videojs/video.js/issues/4588)) ([5ca0992](https://github.com/videojs/video.js/commit/5ca0992))
* **lang:** Update Vietnamese ([#4625](https://github.com/videojs/video.js/issues/4625)) ([ac58dbf](https://github.com/videojs/video.js/commit/ac58dbf))
* **package:** update grunt-browserify to version 5.2.0 ([#4578](https://github.com/videojs/video.js/issues/4578)) ([6cd785a](https://github.com/videojs/video.js/commit/6cd785a))
* **package:** update remark-validate-links to version 7.0.0 ([#4585](https://github.com/videojs/video.js/issues/4585)) ([7929677](https://github.com/videojs/video.js/commit/7929677))
### Code Refactoring
* Create a base time display class, and use it ([#4633](https://github.com/videojs/video.js/issues/4633)) ([fa6f884](https://github.com/videojs/video.js/commit/fa6f884))
### Documentation
* Document playbackRates ([#4602](https://github.com/videojs/video.js/issues/4602)) ([9d249bb](https://github.com/videojs/video.js/commit/9d249bb))
* update player reference in advanced plugins doc ([#4622](https://github.com/videojs/video.js/issues/4622)) ([d8ea23e](https://github.com/videojs/video.js/commit/d8ea23e))
<a name="6.2.8"></a>
## [6.2.8](https://github.com/videojs/video.js/compare/v6.2.7...v6.2.8) (2017-09-01)
### Bug Fixes
* rely on browser or tech to handle autoplay ([#4582](https://github.com/videojs/video.js/issues/4582)) ([95c4ae0](https://github.com/videojs/video.js/commit/95c4ae0))
* **package:** remove pkg.module ([#4594](https://github.com/videojs/video.js/issues/4594)) ([5e23048](https://github.com/videojs/video.js/commit/5e23048)), closes [#4580](https://github.com/videojs/video.js/issues/4580)
### Documentation
* **COLLABORATOR_GUIDE:** how to release Video.js ([#4586](https://github.com/videojs/video.js/issues/4586)) ([9588602](https://github.com/videojs/video.js/commit/9588602))
* update to width and height doc comments ([#4592](https://github.com/videojs/video.js/issues/4592)) ([006fb3b](https://github.com/videojs/video.js/commit/006fb3b))
<a name="6.2.7"></a>
## [6.2.7](https://github.com/videojs/video.js/compare/v6.2.6...v6.2.7) (2017-08-24)
### Bug Fixes
* use typeof for checking preload option ([#4574](https://github.com/videojs/video.js/issues/4574)) ([fe63992](https://github.com/videojs/video.js/commit/fe63992))
### Chores
* **package:** update rollup to version 0.47.5 ([#4572](https://github.com/videojs/video.js/issues/4572)) ([7b251d0](https://github.com/videojs/video.js/commit/7b251d0))
<a name="6.2.6"></a>
## [6.2.6](https://github.com/videojs/video.js/compare/v6.2.5...v6.2.6) (2017-08-16)
+142 -15
Ver Arquivo
@@ -259,23 +259,16 @@ git reset --hard upstream/master
## video.js releases
Releasing video.js is partially automated through [`conrib.json`](/contrib.json) scripts. To do a release, you need a couple of things: npm access, GitHub personal access token.
Releasing video.js is partially automated through various scripts.
To do a release, you need a couple of things: npm access, GitHub personal access token.
Releases in video.js are done on npm and GitHub and eventually posted on the CDN. These
are the instructions for the npm/GitHub releases.
Releases in video.js are done on npm and GitHub and eventually posted on the CDN.
These are the instructions for the npm/GitHub releases.
When we do a release, we release it as a `next` tag on npm first and then at least a week later, we promote this release to `latest` on npm.
### Getting dependencies
#### Install contrib
You can install it globally
```sh
npm i -g contrib/contrib
```
#### npm access
To see who currently has access run this:
@@ -285,6 +278,7 @@ npm owner ls video.js
```
If you are a core committer, you can request access to npm from one of the current owners.
Access is managed via an [npm organization][npm org] for [Video.js][vjs npm].
#### GitHub personal access token
@@ -292,23 +286,146 @@ This is used to make a GitHub release on videojs. You can get a token from the [
After generating one, make sure to keep it safe because GitHub will not show the token for you again. A good place to save it is Lastpass Secure Notes.
### Deciding what type of version release
Since we follow the [conventional changelog conventions][conventions],
all commits are prepended with a type, most commonly `feat` and `fix`.
If all the commits are fix or other types such as `test` or `chore`, then the release will be a `patch` release.
If there's even one `feat`, the release will be a `minor` release.
If any commit has a `BREAKING CHANGE` footer, then the release will be a `major` release.
Most common releases will be either `patch` or `minor`.
### Doing a release
To do a release, check out the master branch
It is also recommended you have a clean clone of Video.js for each release line you want to release.
That means having a folder for master/v6 and one for 5.x.
This is because 5.x and 6.x have different versions expecations for release process and have different dependencies.
Plus, during development you could end up with a dirty repo, so, it just usually easier if you have a clean release repo.
```sh
# for v6
git clone git@github.com:videojs/video.js.git videojs-6-release
# for v5
git clone git@github.com:videojs/video.js.git videojs-5-release
```
#### Video.js 6
Make sure go to the master branch and grab the latest updates.
```sh
git checkout master
git pull origin master
```
Then run the contrib command to do the next release. Don't forget to provide your GitHub token so the GitHub release goes through.
At this point, you should run `npm install` because dependencies may have changed.
Then, it's mostly a standard npm package release process with running `npm version`, followed by an `npm publish`.
```sh
VJS_GITHUB_USER=gkatsev VJS_GITHUB_TOKEN=my-personal-access-token contrib release next patch
npm version {major|minor|patch}
```
This makes a patch release, you can also do a `minor` and a `major` release.
Depending on the commits that have been merged, you can choose from `major`, `minor`, or `patch` as the versioning values.
See [deciding what type of version release section](#deciding-what-type-of-version-release).
Optionally, you can run `git show` now to verify that the version update and CHANGELOG automation worked as expected.
Afterwards, you want to push the commit and the tag to the repo.
It's necessary to do this before running `npm publish` because our GitHub release automation
relies on the commit being available on GitHub.
```sh
git push --tags origin master
```
Finally, run `npm publish` with an appropriate tag. Don't forget to supply your token.
```sh
VJS_GITHUB_USER=gkatsev VJS_GITHUB_TOKEN=my-personal-access-token npm publish --tag next
```
After it's done, verify that the GitHub release has the correct changelog output.
This is to make sure that the CHANGELOG didn't get garbled and isn't missing pieces.
If the GitHub release did not work correctly, such as if the GitHub token was not provided,
you can run it manually:
```sh
VJS_GITHUB_USER=gkatsev VJS_GITHUB_TOKEN=123 node build/gh-release.js --prelease
```
#### Video.js 5
Make sure to go to the 5.x branch and grab the latest updates.
```sh
git checkout 5.x
git pull origin 5.x
```
> *Note:* you probably need to delete v6 tags due to the way that the our CHANGELOG lib works.
>
> You can run this to delete them:
> ```sh
> git tag | grep '^v6' | xargs git tag -d
> ```
> This will find all tags that start with `^v6` and delete them.
At this point, you should run `npm install` because dependencies may have changed.
Then, we have a script that automates most of the steps for publishing. It's a little trickier than publishing v6.
##### Edit git-semver-tags
You'll need to edit `git-semver-tags` to support our usage of tags that are not part of the branch.
In the file `node_modules/conventional-changelog-cli/node_modules/conventional-changelog/node_modules/conventional-changelog-core/node_modules/git-semver-tags/index.js`, edit the line that says sets the `cmd` to be:
```js
var cmd = 'git log --all --date-order --decorate --no-color';
```
#### And now for the release
After getting rid of the tags and getting the latest updates, you can just run the release script:
```sh
VJS_GITHUB_USER=gkatsev VJS_GITHUB_TOKEN=123 ./build/bin/release-next.sh
```
It will prompt you for a version change type, so, input `patch` or `minor` or `major`.
See [deciding what type of version release section](#deciding-what-type-of-version-release).
When it's done building everything, it'll show you the commit that's made via the default pager (i.e., less).
At this point you can verify that things look normal rather than, for example, missing all the CSS.
After exiting the pager, it'll make sure you want to continue with publishing.
It will automatically release it as a `next-5` tag on npm.
Then push the local changes up:
```sh
git push --tags origin 5.x
```
Also, you'll need to copy the CHANGELOG for this version and manually edit the GitHub release to include it.
The current release's CHANGELOG could be copied from the [raw CHANGELOG.md file][raw chg] (or locally from the markdown file)
and then pasted into the correct [GitHub release](https://github.com/videojs/video.js/releases).
### Deploy as a patch to the CDN
Follow the steps on the [CDN repo][] for the CDN release process.
If it's a `next` or `next-5` release, only publish the patch version to the CDN.
When the version gets promoted to `latest` or `latest-5`, the corresponding `minor` or `latest` version should be published to the CDN.
### Announcement
An announcement should automatically make it's way to #announcements channel on [slack][], it uses IFTTT and might take a while.
You can also post it to twitter or ask someone (like @gkatsev) to post on your behalf.
If it's a large enough release, consider writing a blog post as well.
## Doc credit
@@ -319,3 +436,13 @@ This collaborator guide was heavily inspired by [node.js's guide](https://github
[pr template]: /.github/PULL_REQUEST_TEMPLATE.md
[conventions]: https://github.com/videojs/conventional-changelog-videojs/blob/master/convention.md
[vjs npm]: http://npmjs.com/org/videojs
[npm org]: https://docs.npmjs.com/misc/orgs
[slack]: http://slack.videojs.com
[CDN repo]: https://github.com/videojs/cdn
[raw chg]: https://raw.githubusercontent.com/videojs/video.js/5.x/CHANGELOG.md
+3 -3
Ver Arquivo
@@ -35,10 +35,10 @@ if (args.prerelease || npmargs.some(function(arg) { return /next/.test(arg); }))
ghrelease(options, function(err, result) {
if (err) {
console.log('Unable to publish release to github');
console.log(err);
console.error('Unable to publish release to github');
console.error('err:', err);
console.error('result:', result);
} else {
console.log('Publish release to github!');
console.log(result);
}
});
-442
Ver Arquivo
@@ -1,442 +0,0 @@
{
"meta": {
"org": "videojs",
"name": "video.js",
"requirements": [
{
"name": "git",
"info": "http://git-scm.com"
},
{
"name": "node.js",
"info": "http://nodejs.org"
}
],
"urls": {
"repo_api": "https://api.github.com/repos/videojs/video.js",
"repo_ui": "https://github.com/videojs/video.js"
},
"branches": {
"development": "master",
"release": "stable"
}
},
"install": {
"desc": "Fork, download, and setup the project",
"steps": [
{ "prompt": "confirm", "desc": "You will now be taken to Github where you will choose an account to fork the project under. Remember which account you choose." },
{ "exec": "open https://github.com/{{meta.org}}/{{meta.name}}/fork" },
{ "prompt": "text", "desc": "Which account did you choose? (no '@')", "id": "owner" },
{ "exec": "git clone https://github.com/{{ owner }}/{{ meta.name }}.git" },
{ "exec": "cd {{ meta.name }}", "desc": "Change to the project directory" },
{ "include": "setup" }
]
},
"setup": {
"desc": "Set up version control and install dependencies",
"steps": [
[ "git fetch origin", "Get all git branches" ],
[ "git checkout -b stable origin/stable", "Create the stable branch for patches" ],
[ "git remote add upstream https://github.com/{{meta.org}}/{{meta.name}}.git", "Add the upstream project as a remote for pulling changes" ],
[ "git fetch upstream", "Get all upstream branches and changes" ],
{ "include": "update all" },
[ "grunt", "Build the library" ]
]
},
"update": {
"all": {
"steps": [
{ "include": "update stable" },
{ "include": "update master" },
[ "npm install", "Download dependencies"]
]
},
"local": {
"master": {
"steps": [
[ "git checkout master", "Switch to the development branch" ],
[ "git pull upstream master", "Get any changes to master in the main project" ]
]
},
"stable": {
"steps": [
[ "git checkout stable", "Switch to the release branch" ],
[ "git pull upstream stable", "Get any changes to stable in the main project" ]
]
},
"patch": {
"steps": [
[ "git checkout patch", "Switch to the patch branch" ],
[ "git pull upstream patch", "Get any changes to patch in the main project" ]
]
}
},
"remote": {
"master": {
"steps": [
{ "include": "update local master" },
[ "git push origin master", "Push any changes to your copy of the main project" ]
]
},
"stable": {
"steps": [
{ "include": "update local stable" },
[ "git push origin stable", "Push any changes to your copy of the main project" ]
]
},
"patch": {
"steps": [
{ "include": "update local patch" },
[ "git push origin patch", "Push any changes to your copy of the main project" ]
]
}
},
"master": {
"steps": [
{ "include": "update remote master" }
]
},
"stable": {
"steps": [
{ "include": "update remote stable" }
]
},
"patch": {
"steps": [
{ "include": "update remote patch" }
]
}
},
"test": "grunt test" ,
"watch": "grunt watch",
"server": "grunt connect",
"feature": {
"desc": "Create a new feature or general enhancement",
"baseBranch": "master",
"start": {
"desc": "Start a new feature",
"steps": [
{ "include": "update {{meta.branches.development}}" },
{ "include": "branch start" }
]
},
"save": {
"desc": "Save changes to your feature",
"steps": [{ "include": "branch save" }]
},
"submit": {
"desc": "Submit a pull request for a feature when it's finished",
"steps": [{ "include": "pull_request submit" }]
},
"delete": {
"desc": "Delete the current feature branch",
"steps": [{ "include": "branch delete" }]
},
"review": {
"desc": "Review a submitted feature",
"steps": [{ "include": "pull_request review" }]
},
"modify": {
"desc": "Modify a submitted feature that you are reviewing",
"steps": [{ "include": "pull_request modify" }]
},
"accept": {
"desc": "Merge a submitted feature",
"steps": [
{ "include": "update {{meta.branches.development}}" },
{ "include": "pull_request accept" }
]
}
},
"patch": {
"desc": "Create an urgent fix for the latest stable version",
"baseBranch": "stable",
"start": {
"desc": "Start a new patch",
"finished": "Make your changes and then run `contrib patch submit`",
"steps": [
{ "include": "update {{meta.branches.release}}" },
{ "include": "branch start" }
]
},
"save": {
"desc": "Save changes to your feature",
"steps": [{ "include": "branch save" }]
},
"submit": {
"desc": "Submit a pull request for a patch when it's finished",
"steps": [{ "include": "pull_request submit" }]
},
"delete": {
"desc": "Delete the current patch branch",
"steps": [{ "include": "branch delete" }]
},
"review": {
"desc": "Review a submitted patch",
"steps": [{ "include": "pull_request review" }]
},
"modify": {
"desc": "Modify a submitted patch that you are reviewing",
"steps": [{ "include": "pull_request modify" }]
},
"accept": {
"desc": "Merge a submitted patch",
"steps": [
{ "include": "update {{meta.branches.release}}" },
{ "include": "pull_request accept" },
[ "git checkout master", "Checkout the developmet branch" ],
[ "git merge stable", "Merge the patch changes" ],
[ "git push upstream master", "Push the development changes" ]
]
}
},
"report": {
"desc": "Submit a bug report",
"steps": [
{ "prompt": "text", "desc": "Create a title that is descriptive of the problem", "id": "title" },
{ "prompt": "text", "desc": "What did you do? (steps to reproduce)", "id": "reproduce" },
{ "prompt": "text", "desc": "What did you expect to happen?", "id": "expected" },
{ "prompt": "text", "desc": "What actually happened?", "id": "actual" },
{ "prompt": "text", "desc": "What version of video.js are you using?", "id": "version" },
{ "prompt": "text", "desc": "Are you using any video.js plugins?", "id": "plugins" },
{ "prompt": "text", "desc": "What browsers/platforms did you experience this in (e.g. Win 7, IE10; Android 4, Chrome;)?", "id": "browsers" },
{ "prompt": "text", "desc": "Is there a URL to a live example, or a jsbin (e.g. http://jsbin.com/axedog/9999/edit)?", "id": "example" },
{ "prompt": "text", "desc": "Are there any other details you'd like to provide?", "id": "details" },
{ "open": "{{meta.urls.repo_ui}}/issues/new?title={{title}}&body=**Steps to reproduce:**\n> {{reproduce}}\n\n**What was expected:**\n> {{expected}}\n\n**What Happened:**\n> {{actual}}\n\n**Video.js Version:**\n> {{version}}\n\n**Plugins:**\n> {{plugins}}\n\n**Browsers experienced on:**\n> {{browsers}}\n\n**Example:**\n> {{example}}\n\n**Other details:**\n> {{details}}" }
],
"finished": "Thanks for submitting a bug report! One of our contributors will address it as soon as possible."
},
"request": {
"desc": "Submit a feature/enhancement request",
"steps": [
{ "prompt": "text", "desc": "Create a title that is descriptive of the enhancement", "id": "title" },
{ "prompt": "text", "desc": "Describe the feature/enhancement (be as detailed as possible so it's clear who, why, and how it would be used)", "id": "describe" },
{ "prompt": "text", "desc": "Is there any existing documentation or related specifications?", "id": "docs" },
{ "prompt": "text", "desc": "Are there any existing examples?", "id": "examples" },
{ "prompt": "confirm", "desc": "You will be redirected to Github where you can submit this issue, OK?" },
{ "open": "{{meta.urls.repo_ui}}/issues/new?title={{ title }}&body=**Describe the feature/enhancement:**\n> {{ describe }}\n\n**Existing docs/specs:**\n> {{ docs }}\n\n**Existing examples:**\n> {{ examples }}" }
],
"finished": "Thanks for submitting a feature request! One of our contributors will address it as soon as possible."
},
"release": {
"desc": "Create and publish releases",
"patch": {
"release_type": "patch",
"description": "Create a patch release from the release branch (stable)",
"steps": [{ "include": "release run" }]
},
"minor": {
"description": "Create a minor release from the development branch (master)",
"release_type": "minor",
"steps": [
{ "include": "update local master" },
{ "include": "update local stable" },
[ "git merge master", "Copy the latest development changes to the release branch" ],
{ "include": "release run" },
[ "git checkout master", "Checkout the developmet branch" ],
[ "git merge stable", "Merge package changes into the dev brach" ],
[ "git push upstream master", "Push the dev branch changes to the repo" ]
]
},
"next": {
"patch": {
"description": "Create a patch release and tag it @next on npm",
"release_type": "patch",
"steps": [{ "include": "release run_next" }]
},
"minor": {
"description": "Create a minor release and tag it @next on npm",
"release_type": "minor",
"steps": [{ "include": "release run_next" }]
},
"major": {
"description": "Create a major release and tag it @next on npm",
"release_type": "major",
"steps": [{ "include": "release run_next" }]
}
},
"prerelease": {
"release_type": "prerelease",
"steps": [{ "include": "release run_next" }]
},
"run_next": {
"steps": [
{ "include": "branch check" },
{ "include": "update local master" },
[ "git checkout -b temp-release-branch master","Create a temporary branch for the dist" ],
[ "grunt version:{{release_type}}", "Bump package versions" ],
[ "./build/bin/version", "Return the current VJS Version from the package.json file", "version" ],
[ "npm run changelog", "Update the changelog with the new release" ],
[ "git commit -am 'v{{version}}'", "Add and commit the package changes" ],
[ "git checkout master", "Checkout the developmet branch" ],
[ "git merge temp-release-branch", "Merge package changes into the dev brach" ],
[ "git push upstream master", "Push the dev branch changes to the repo" ],
[ "git checkout temp-release-branch", "Checkout the temp branch again" ],
[ "grunt dist", "Build the dist" ],
[ "git add es5 dist --force", "Add the (otherwise ignored) release files" ],
[ "git commit -m 'v{{version}} dist'", "Commit the dist changes" ],
[ "git tag -a v{{version}} -m 'v{{version}}'", "Tag the release" ],
[ "git push upstream --tags", "Push the new tag to the repo" ],
[ "grunt github-release:prerelease", "Create a new pre-release on Github" ],
[ "npm publish --tag next", "Publish to npm as 'next'" ],
[ "git checkout master", "Checkout the developmet branch" ],
[ "git branch -D temp-release-branch", "Delete the temp release branch" ]
]
},
"run": {
"steps": [
{ "include": "branch check" },
{ "include": "update local stable" },
[ "npm install", "Ensure dependency updates have been installed" ],
[ "grunt test", "Run tests" ],
[ "grunt version:{{release_type}}", "Bump package versions" ],
[ "./build/bin/version", "Return the current VJS Version from the package.json file", "version" ],
[ "npm run changelog", "Update the changelog with the new release" ],
[ "git commit -am 'v{{version}}'", "Add and commit the package changes" ],
[ "git push upstream stable", "Push the release branch changes to the repo" ],
[ "git checkout -b temp-release-branch stable","Create a temporary branch for the dist" ],
[ "grunt dist", "Build the dist" ],
[ "git add es5 dist --force", "Add the (otherwise ignored) release files" ],
[ "git commit -m 'v{{version}} dist'", "Commit the dist changes" ],
[ "git tag -a v{{version}} -m 'v{{version}}'", "Tag the release" ],
[ "git push upstream --tags", "Push the new tag to the repo" ],
[ "npm publish", "Publish to npm" ],
[ "grunt github-release:release", "Create a new release on Github" ],
[ "git checkout stable", "Checkout the developmet branch" ],
[ "git branch -D temp-release-branch", "Delete the temp release branch" ]
]
}
},
"branch": {
"private": true,
"start": {
"steps": [
{ "prompt": "text", "id": "name", "desc": "Name the branch" },
{ "exec": "git checkout -b {{name}} {{baseBranch}}", "desc": "Create the branch" },
{ "exec": "git push -u origin {{name}}", "desc": "Push the branch to your remote copy of the project" }
]
},
"save": {
"desc": "Commit and push changes made to files in the project",
"steps": [
{ "include": "branch confirm" },
{ "prompt": "text", "id": "message", "desc": "Briefly describe the changes made" },
{ "exec": "git add .", "desc": "Add the changes" },
{ "exec": "git commit -m '{{message}}'", "desc": "Commit the changes" },
{ "exec": "git push origin {{branch_name}}", "desc": "Push the changes to your remote copy of the project" }
]
},
"check": {
"private": true,
"desc": "Check for unsaved changes",
"steps": [
{ "exec": "git diff --exit-code", "desc": "Ensure there's no unadded changes", "fail": "Make sure all changes have been saved (added and committed) or stashed" },
{ "exec": "git diff --cached --exit-code", "desc": "Ensure there's no uncommitted changes", "fail": "Make sure all changes have been saved (added and committed) or stashed" }
]
},
"name": {
"private": true,
"steps": [
{ "exec": "git rev-parse --abbrev-ref HEAD", "desc": "Get the current branch", "id": "branch_name" }
]
},
"confirm": {
"private": true,
"steps": [
{ "include": "branch name" },
{ "prompt": "confirm", "desc": "Are you sure *{{branch_name}}* is the correct branch?" }
]
},
"delete": {
"desc": "Delete the current branch",
"steps": [
{ "include": "branch confirm" },
{ "exec": "git checkout master", "desc": "Exit the branch being deleted" },
{ "exec": "git branch -D {{branch_name}}", "desc": "Delete the local copy of the branch" },
{ "exec": "git push origin :{{branch_name}}", "desc": "Delete the remote copy of the branch" }
]
}
},
"pull_request": {
"private": true,
"desc": "Pull request related commands",
"prepare": {
"private": true,
"steps": [
{ "include": "branch check" },
{ "include": "branch confirm" },
{ "include": "test" },
{ "prompt": "text", "desc": "Which github user or org are you submitting from?", "id": "user" }
]
},
"submit": {
"desc": "Submit a pull request for when the change is finished",
"steps": [
{ "include": "pull_request prepare" },
{ "open": "{{meta.urls.repo_ui}}/compare/videojs:{{baseBranch}}...{{user}}:{{branch_name}}", "desc": "Open the github pull request page" }
]
},
"review": {
"steps": [
{ "prompt": "text", "desc": "What is the the pull request number?", "id": "prNum" },
{ "get": "{{meta.urls.repo_api}}/pulls/{{prNum}}", "desc": "Get the PR information", "id": "pr" },
[ "git fetch {{pr.head.repo.ssh_url}} {{pr.head.ref}}", "Get the pull request changes but don't merge them" ],
[ "git merge-base master FETCH_HEAD", "Get the common ancestor commit", "base" ],
[ "git checkout -b review-{{pr.user.login}}-{{pr.head.ref}} {{base}}", "Create a new local branch for the pull request that has a base of the common commit" ],
[ "git merge FETCH_HEAD", "Merge in the pull request changes" ],
[ "npm install", "Install any new dependencies" ],
[ "grunt test", "Build and run tests" ]
]
},
"modify": {
"desc": "Submit a modification to a pull request that you are currently reviewing",
"steps": [
{ "include": "pull_request prepare" },
{ "prompt": "text", "desc": "What is the the pull request number?", "id": "prNum" },
{ "get": "{{meta.urls.repo_api}}/pulls/{{prNum}}", "desc": "Get the PR information", "id": "pr" },
{ "exec": "git push -u origin {{branch_name}}", "desc": "Push the changes to the remote repo" },
{ "open": "https://github.com/{{user}}/video.js/compare/{{pr.head.label}}...{{user}}:{{branch_name}}", "desc": "Open the github pull request page" }
]
},
"accept": {
"steps": [
{ "prompt": "text", "id": "prNum", "desc": "What is the the pull request number?" },
{ "get": "{{meta.urls.repo_api}}/pulls/{{prNum}}", "desc": "Get the PR information", "id": "pr" },
{ "get": "{{meta.urls.repo_api}}/pulls/{{prNum}}/commits", "desc": "Get the PR commits to access author info", "id": "prCommits" },
[ "git checkout -b {{pr.user.login}}/{{pr.head.ref}} {{pr.base.ref}}", "Create a new branch for merging the changes" ],
[ "git fetch {{pr.head.repo.ssh_url}} {{pr.head.ref}}", "Fetch the changes" ],
[ "git merge --no-commit --squash FETCH_HEAD", "Merge the changes in without committing so they can be squashed" ],
[ "grunt test", "Run tests to make sure they still pass" ],
{ "prompt": "text", "id": "line", "desc": "Describe this change in one line" },
[ "grunt chg-add:'{{{line}}} ([view](https\\://github.com/videojs/video.js/pull/{{prNum}}))'", "Add a line to the changelog" ],
[ "git add CHANGELOG.md", "Add the changlelog change to be committed" ],
[ "git commit -a --author='{{prCommits.[0].commit.author.name}} <{{prCommits.[0].commit.author.email}}>' -m '{{line}}. closes #{{prNum}}'", "Commit the changes" ],
{ "prompt": "confirm", "desc": "Does everything look ok?" },
[ "git checkout {{pr.base.ref}}", "Check out the base branch" ],
[ "git merge {{pr.user.login}}/{{pr.head.ref}}", "Merge the changes" ],
[ "git push origin {{pr.base.ref}}", "Push the changes to your remote copy of the project" ],
[ "git push upstream {{pr.base.ref}}", "Push the changes to the main project" ],
[ "git branch -D {{pr.user.login}}/{{pr.head.ref}}", "Delete the local branch used for merging" ]
]
}
}
}
+1 -1
Ver Arquivo
@@ -14,7 +14,7 @@ Hooks exist so that users can "hook" on to certain Video.js player lifecycle
## Current Hooks
Currently, the following hooks are avialable:
Currently, the following hooks are available:
### beforesetup
+19
Ver Arquivo
@@ -26,6 +26,7 @@
* [languages](#languages)
* [nativeControlsForTouch](#nativecontrolsfortouch)
* [notSupportedMessage](#notsupportedmessage)
* [playbackRates](#playbackrates)
* [plugins](#plugins)
* [sourceOrder](#sourceorder)
* [sources](#sources)
@@ -180,6 +181,24 @@ Explicitly set a default value for [the associated tech option](#nativecontrolsf
Allows overriding the default message that is displayed when Video.js cannot play back a media source.
### `playbackRates`
> Type: `Array`
An array of numbers strictly greater than 0, where 1 means regular speed
(100%), 0.5 means half-speed (50%), 2 means double-speed (200%), etc.
If specified, Video.js displays a control (of class `vjs-playback-rate`)
allowing the user to choose playback speed from among the array of choices.
The choices are presented in the specified order from bottom to top.
For example:
```js
videojs('my-player', {
playbackRates: [0.5, 1, 1.5, 2]
});
```
### `plugins`
> Type: `Object`
+20 -1
Ver Arquivo
@@ -225,6 +225,25 @@ The `dispose` method has several effects:
In addition, if the player is disposed, the disposal of all its advanced plugin instances will be triggered as well.
#### Version
Adding a version number to a plugin is done by defining a `VERSION` property on the plugin before registering it:
```js
ExamplePlugin.VERSION = '1.0.1';
videojs.registerPlugin('examplePlugin', ExamplePlugin);
```
Retrieve it using `videojs.getPluginVersion`:
```js
var version = videojs.getPluginVersion('examplePlugin');
console.log(version); // 1.0.1
```
Note that the [plugin generator](https://github.com/videojs/generator-videojs-plugin) already takes care of adding a version number for you.
### Advanced Example Advanced Plugin
What follows is a complete ES6 advanced plugin that logs a custom message when the player's state changes between playing and paused. It uses all the described advanced features:
@@ -251,7 +270,7 @@ class Advanced extends Plugin {
}
updateState() {
this.setState({playing: !player.paused()});
this.setState({playing: !this.player.paused()});
}
logState(changed) {
+68 -21
Ver Arquivo
@@ -1,37 +1,84 @@
{
"Audio Player": "Audiospeler",
"Video Player": "Videospeler",
"Play": "Afspelen",
"Pause": "Pauze",
"Pause": "Pauzeren",
"Replay": "Opnieuw afspelen",
"Current Time": "Huidige tijd",
"Duration Time": "Looptijd",
"Duration Time": "Tijdsduur",
"Remaining Time": "Resterende tijd",
"Stream Type": "Streamtype",
"LIVE": "LIVE",
"Loaded": "Geladen",
"Progress": "Status",
"Progress": "Voortgang",
"Progress Bar": "Voortgangsbalk",
"progress bar timing: currentTime={1} duration={2}": "{1} van {2}",
"Fullscreen": "Volledig scherm",
"Non-Fullscreen": "Geen volledig scherm",
"Mute": "Geluid uit",
"Unmute": "Geluid aan",
"Playback Rate": "Weergavesnelheid",
"Mute": "Dempen",
"Unmute": "Niet dempen",
"Playback Rate": "Afspeelsnelheid",
"Subtitles": "Ondertiteling",
"subtitles off": "ondertiteling uit",
"Captions": "Bijschriften",
"captions off": "bijschriften uit",
"Chapters": "Hoofdstukken",
"Descriptions": "Beschrijvingen",
"descriptions off": "beschrijvingen off",
"You aborted the media playback": "U hebt de mediaweergave afgebroken.",
"A network error caused the media download to fail part-way.": "De mediadownload is mislukt door een netwerkfout.",
"The media could not be loaded, either because the server or network failed or because the format is not supported.": "De media kon niet worden geladen, vanwege een server- of netwerkfout of doordat het formaat niet wordt ondersteund.",
"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "De mediaweergave is afgebroken vanwege beschadigde data of het mediabestand gebruikt functies die niet door uw browser worden ondersteund.",
"No compatible source was found for this media.": "Voor deze media is geen ondersteunde bron gevonden.",
"Play Video": "Video Afspelen",
"descriptions off": "beschrijvingen uit",
"Audio Track": "Audiospoor",
"Volume Level": "Geluidsniveau",
"You aborted the media playback": "U heeft het afspelen van de media afgebroken",
"A network error caused the media download to fail part-way.": "Een netwerkfout heeft ervoor gezorgd dat het downloaden van de media halverwege is mislukt.",
"The media could not be loaded, either because the server or network failed or because the format is not supported.": "De media kon niet worden geladen, dit komt doordat of de server of het netwerk mislukt of doordat het formaat niet wordt ondersteund.",
"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "Het afspelen van de media is afgebroken door een probleem met beschadeigde gegevens of doordat de media functies gebruikt die uw browser niet ondersteund.",
"No compatible source was found for this media.": "Er is geen geschikte bron voor deze media gevonden.",
"The media is encrypted and we do not have the keys to decrypt it.": "De media is versleuteld en we hebben de sleutels niet om deze te ontsleutelen.",
"Play Video": "Video afspelen",
"Close": "Sluiten",
"Modal Window": "Modal Venster",
"This is a modal window": "Dit is een modaal venster",
"This modal can be closed by pressing the Escape key or activating the close button.": "Dit modaal venster kan gesloten worden door op Escape te drukken of de 'sluiten' knop te activeren.",
", opens captions settings dialog": ", opent bijschriften instellingen venster",
", opens subtitles settings dialog": ", opent ondertiteling instellingen venster",
", opens descriptions settings dialog": ", opent beschrijvingen instellingen venster",
", selected": ", selected"
}
"Close Modal Dialog": "Extra venster sluiten",
"Modal Window": "Extra venster",
"This is a modal window": "Dit is een extra venster",
"This modal can be closed by pressing the Escape key or activating the close button.": "Dit venster kan worden gesloten door op de Escape-toets te drukken of door de sluiten-knop te activeren.",
", opens captions settings dialog": ", opent instellingen-venster voor bijschriften",
", opens subtitles settings dialog": ", opent instellingen-venster voor ondertitelingen",
", opens descriptions settings dialog": ", opent instellingen-venster voor beschrijvingen",
", selected": ", geselecteerd",
"captions settings": "bijschriften-instellingen",
"subtitles settings": "ondertiteling-instellingen",
"descriptions settings": "beschrijvingen-instellingen",
"Text": "Tekst",
"White": "Wit",
"Black": "Zwart",
"Red": "Rood",
"Green": "Groen",
"Blue": "Blauw",
"Yellow": "Geel",
"Magenta": "Magenta",
"Cyan": "Cyaan",
"Background": "Achtergrond",
"Window": "Venster",
"Transparent": "Transparant",
"Semi-Transparent": "Semi-transparant",
"Opaque": "Ondoorzichtig",
"Font Size": "Lettergrootte",
"Text Edge Style": "Stijl tekstrand",
"None": "Geen",
"Raised": "Verhoogd",
"Depressed": "Ingedrukt",
"Uniform": "Uniform",
"Dropshadow": "Schaduw",
"Font Family": "Lettertype",
"Proportional Sans-Serif": "Proportioneel sans-serif",
"Monospace Sans-Serif": "Monospace sans-serif",
"Proportional Serif": "Proportioneel serif",
"Monospace Serif": "Monospace serif",
"Casual": "Luchtig",
"Script": "Script",
"Small Caps": "Kleine hoofdletters",
"Reset": "Herstellen",
"restore all settings to the default values": "alle instellingen naar de standaardwaarden herstellen",
"Done": "Klaar",
"Caption Settings Dialog": "Venster voor bijschriften-instellingen",
"Beginning of dialog window. Escape will cancel and close the window.": "Begin van dialoogvenster. Escape zal annuleren en het venster sluiten.",
"End of dialog window.": "Einde van dialoogvenster."
}
+51 -8
Ver Arquivo
@@ -1,4 +1,6 @@
{
"Audio Player": "Trình phát Audio",
"Video Player": "Trình phát Video",
"Play": "Phát",
"Pause": "Tạm dừng",
"Replay": "Phát lại",
@@ -9,6 +11,8 @@
"LIVE": "TRỰC TIẾP",
"Loaded": "Đã tải",
"Progress": "Tiến trình",
"Progress Bar": "Thanh tiến trình",
"progress bar timing: currentTime={1} duration={2}": "{1} của {2}",
"Fullscreen": "Toàn màn hình",
"Non-Fullscreen": "Thoát toàn màn hình",
"Mute": "Tắt tiếng",
@@ -19,23 +23,62 @@
"Captions": "Chú thích",
"captions off": "tắt chú thích",
"Chapters": "Chương",
"Close Modal Dialog": "Đóng hộp thoại",
"Descriptions": "Mô tả",
"descriptions off": "tắt mô tả",
"Audio Track": "Track âm thanh",
"Volume Level": "Mức âm lượng",
"You aborted the media playback": "Bạn đã hủy việc phát lại media.",
"A network error caused the media download to fail part-way.": "Một lỗi mạng dẫn đến việc tải media bị lỗi.",
"The media could not be loaded, either because the server or network failed or because the format is not supported.": "Video không tải được, mạng hay server có lỗi hoặc định dạng không được hỗ trợ.",
"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "Phát media đã bị hủy do một sai lỗi hoặc media sử dụng những tính năng trình duyệt không hỗ trợ.",
"No compatible source was found for this media.": "Không có nguồn tương thích cho media này.",
"The media is encrypted and we do not have the keys to decrypt it.": "Media đã được mã hóa và chúng tôi không thể giải mã nó.",
"The media is encrypted and we do not have the keys to decrypt it.": "Media đã được mã hóa và chúng tôi không có để giải mã nó.",
"Play Video": "Phát Video",
"Close": "Đóng",
"Close Modal Dialog": "Đóng cửa sổ",
"Modal Window": "Cửa sổ",
"This is a modal window": "Đây là một cửa sổ",
"This modal can be closed by pressing the Escape key or activating the close button.": "Cửa sổ này có thể đóng lại bằng việc nhấn phím Esc hoặc kích hoạt nút đóng.",
", opens captions settings dialog": ", mở hộp thoại thiết lập chú thích",
", opens subtitles settings dialog": ", mở hộp thoại thiết lập phụ đề",
", opens descriptions settings dialog": ", mở hộp thoại thiết lập mô tả",
", selected": ", đã chọn"
}
"This modal can be closed by pressing the Escape key or activating the close button.": "Cửa sổ này có thể thoát bằng việc nhấn phím Esc hoặc kích hoạt nút đóng.",
", opens captions settings dialog": ", mở hộp thoại cài đặt chú thích",
", opens subtitles settings dialog": ", mở hộp thoại cài đặt phụ đề",
", opens descriptions settings dialog": ", mở hộp thoại cài đặt mô tả",
", selected": ", đã chọn",
"captions settings": "cài đặt chú thích",
"subtitles settings": "cài đặt phụ đề",
"descriptions settings": "cài đặt mô tả",
"Text": "Văn bản",
"White": "Trắng",
"Black": "Đen",
"Red": "Đỏ",
"Green": "Xanh lá cây",
"Blue": "Xanh da trời",
"Yellow": "Vàng",
"Magenta": "Đỏ tươi",
"Cyan": "Lam",
"Background": "Nền",
"Window": "Cửa sổ",
"Transparent": "Trong suốt",
"Semi-Transparent": "Bán trong suốt",
"Opaque": "Mờ",
"Font Size": "Kích cỡ phông chữ",
"Text Edge Style": "Dạng viền văn bản",
"None": "None",
"Raised": "Raised",
"Depressed": "Depressed",
"Uniform": "Uniform",
"Dropshadow": "Dropshadow",
"Font Family": "Phông chữ",
"Proportional Sans-Serif": "Proportional Sans-Serif",
"Monospace Sans-Serif": "Monospace Sans-Serif",
"Proportional Serif": "Proportional Serif",
"Monospace Serif": "Monospace Serif",
"Casual": "Casual",
"Script": "Script",
"Small Caps": "Small Caps",
"Reset": "Đặt lại",
"restore all settings to the default values": "khôi phục lại tất cả các cài đặt về giá trị mặc định",
"Done": "Xong",
"Caption Settings Dialog": "Hộp thoại cài đặt chú thích",
"Beginning of dialog window. Escape will cancel and close the window.": "Bắt đầu cửa sổ hộp thoại. Esc sẽ thoát và đóng cửa sổ.",
"End of dialog window.": "Kết thúc cửa sổ hộp thoại."
}
+5 -5
Ver Arquivo
@@ -1,9 +1,8 @@
{
"name": "video.js",
"description": "An HTML5 and Flash video player with a common API and skin for both.",
"version": "6.2.6",
"version": "6.3.3",
"main": "./dist/video.cjs.js",
"module": "./dist/video.es.js",
"style": "./dist/video-js.css",
"copyright": "Copyright Brightcove, Inc. <https://www.brightcove.com/>",
"license": "Apache-2.0",
@@ -23,6 +22,7 @@
"rollup": "babel-node build/rollup.js",
"rollup-minify": "babel-node build/rollup.js --minify",
"rollup-dev": "babel-node build/rollup.js --watch",
"watch": "npm run rollup-dev",
"assets": "node build/assets.js",
"change": "grunt chg-add",
"clean": "grunt clean",
@@ -84,7 +84,7 @@
"grunt-accessibility": "^5.0.0",
"grunt-babel": "^7.0.0",
"grunt-banner": "^0.6.0",
"grunt-browserify": "5.1.0",
"grunt-browserify": "5.2.0",
"grunt-cli": "~1.2.0",
"grunt-concurrent": "^2.3.1",
"grunt-contrib-clean": "^1.0.0",
@@ -134,9 +134,9 @@
"remark-parse": "^4.0.0",
"remark-stringify": "^4.0.0",
"remark-toc": "^4.0.0",
"remark-validate-links": "^6.0.0",
"remark-validate-links": "^7.0.0",
"replace": "^0.3.0",
"rollup": "^0.47.4",
"rollup": "^0.47.5",
"rollup-plugin-babel": "^2.7.1",
"rollup-plugin-commonjs": "^8.0.2",
"rollup-plugin-filesize": "^1.2.1",
+27 -1
Ver Arquivo
@@ -57,6 +57,26 @@ class PlayToggle extends Button {
}
}
/**
* This gets called once after the video has ended and the user seeks so that
* we can change the replay button back to a play button.
*
* @param {EventTarget~Event} [event]
* The event that caused this function to run.
*
* @listens Player#seeked
*/
handleSeeked(event) {
// remove the ended class
this.removeClass('vjs-ended');
if (this.player_.paused()) {
this.handlePause(event);
} else {
this.handlePlay(event);
}
}
/**
* Add the vjs-playing class to the element so it can change appearance.
*
@@ -66,7 +86,6 @@ class PlayToggle extends Button {
* @listens Player#play
*/
handlePlay(event) {
this.removeClass('vjs-ended');
this.removeClass('vjs-paused');
this.addClass('vjs-playing');
// change the button text to "Pause"
@@ -91,12 +110,19 @@ class PlayToggle extends Button {
/**
* Add the vjs-ended class to the element so it can change appearance
*
* @param {EventTarget~Event} [event]
* The event that caused this function to run.
*
* @listens Player#ended
*/
handleEnded(event) {
this.removeClass('vjs-playing');
this.addClass('vjs-ended');
// change the button text to "Replay"
this.controlText('Replay');
// on the next seek remove the replay button
this.one(this.player_, 'seeked', this.handleSeeked);
}
}
@@ -1,18 +1,15 @@
/**
* @file current-time-display.js
*/
import document from 'global/document';
import TimeDisplay from './time-display';
import Component from '../../component.js';
import * as Dom from '../../utils/dom.js';
import {bind, throttle} from '../../utils/fn.js';
import formatTime from '../../utils/format-time.js';
/**
* Displays the current time
*
* @extends Component
*/
class CurrentTimeDisplay extends Component {
class CurrentTimeDisplay extends TimeDisplay {
/**
* Creates an instance of this class.
@@ -25,48 +22,17 @@ class CurrentTimeDisplay extends Component {
*/
constructor(player, options) {
super(player, options);
this.throttledUpdateContent = throttle(bind(this, this.updateContent), 25);
this.on(player, 'timeupdate', this.throttledUpdateContent);
this.on(player, 'ended', this.handleEnded);
}
/**
* Create the `Component`'s DOM element
* Builds the default DOM `className`.
*
* @return {Element}
* The element that was created.
* @return {string}
* The DOM `className` for this object.
*/
createEl() {
const el = super.createEl('div', {
className: 'vjs-current-time vjs-time-control vjs-control'
});
this.contentEl_ = Dom.createEl('div', {
className: 'vjs-current-time-display'
}, {
// tell screen readers not to automatically read the time as it changes
'aria-live': 'off'
}, Dom.createEl('span', {
className: 'vjs-control-text',
textContent: this.localize('Current Time')
}));
this.updateTextNode_();
el.appendChild(this.contentEl_);
return el;
}
/**
* Updates the "current time" text node with new content using the
* contents of the `formattedTime_` property.
*
* @private
*/
updateTextNode_() {
if (this.textNode_) {
this.contentEl_.removeChild(this.textNode_);
}
this.textNode_ = document.createTextNode(` ${this.formattedTime_ || '0:00'}`);
this.contentEl_.appendChild(this.textNode_);
buildCSSClass() {
return 'vjs-current-time';
}
/**
@@ -80,15 +46,36 @@ class CurrentTimeDisplay extends Component {
updateContent(event) {
// Allows for smooth scrubbing, when player can't keep up.
const time = (this.player_.scrubbing()) ? this.player_.getCache().currentTime : this.player_.currentTime();
const formattedTime = formatTime(time, this.player_.duration());
if (formattedTime !== this.formattedTime_) {
this.formattedTime_ = formattedTime;
this.requestAnimationFrame(this.updateTextNode_);
this.updateFormattedTime_(time);
}
/**
* When the player fires ended there should be no time left. Sadly
* this is not always the case, lets make it seem like that is the case
* for users.
*
* @param {EventTarget~Event} [event]
* The `ended` event that caused this to run.
*
* @listens Player#ended
*/
handleEnded(event) {
if (!this.player_.duration()) {
return;
}
this.updateFormattedTime_(this.player_.duration());
}
}
/**
* The text that should display over the `CurrentTimeDisplay`s controls. Added to for localization.
*
* @type {string}
* @private
*/
CurrentTimeDisplay.prototype.controlText_ = 'Current Time';
Component.registerComponent('CurrentTimeDisplay', CurrentTimeDisplay);
export default CurrentTimeDisplay;
@@ -1,18 +1,15 @@
/**
* @file duration-display.js
*/
import document from 'global/document';
import TimeDisplay from './time-display';
import Component from '../../component.js';
import * as Dom from '../../utils/dom.js';
import {bind, throttle} from '../../utils/fn.js';
import formatTime from '../../utils/format-time.js';
/**
* Displays the duration
*
* @extends Component
*/
class DurationDisplay extends Component {
class DurationDisplay extends TimeDisplay {
/**
* Creates an instance of this class.
@@ -26,57 +23,25 @@ class DurationDisplay extends Component {
constructor(player, options) {
super(player, options);
this.throttledUpdateContent = throttle(bind(this, this.updateContent), 25);
// we do not want to/need to throttle duration changes,
// as they should always display the changed duration as
// it has changed
this.on(player, 'durationchange', this.updateContent);
this.on(player, [
'durationchange',
// Also listen for timeupdate and loadedmetadata because removing those
// listeners could have broken dependent applications/libraries. These
// can likely be removed for 7.0.
'loadedmetadata',
'timeupdate'
], this.throttledUpdateContent);
// Also listen for timeupdate (in the parent) and loadedmetadata because removing those
// listeners could have broken dependent applications/libraries. These
// can likely be removed for 7.0.
this.on(player, 'loadedmetadata', this.throttledUpdateContent);
}
/**
* Create the `Component`'s DOM element
* Builds the default DOM `className`.
*
* @return {Element}
* The element that was created.
* @return {string}
* The DOM `className` for this object.
*/
createEl() {
const el = super.createEl('div', {
className: 'vjs-duration vjs-time-control vjs-control'
});
this.contentEl_ = Dom.createEl('div', {
className: 'vjs-duration-display'
}, {
// tell screen readers not to automatically read the time as it changes
'aria-live': 'off'
}, Dom.createEl('span', {
className: 'vjs-control-text',
textContent: this.localize('Duration Time')
}));
this.updateTextNode_();
el.appendChild(this.contentEl_);
return el;
}
/**
* Updates the "current time" text node with new content using the
* contents of the `formattedTime_` property.
*
* @private
*/
updateTextNode_() {
if (this.textNode_) {
this.contentEl_.removeChild(this.textNode_);
}
this.textNode_ = document.createTextNode(` ${this.formattedTime_ || '0:00'}`);
this.contentEl_.appendChild(this.textNode_);
buildCSSClass() {
return 'vjs-duration';
}
/**
@@ -95,11 +60,18 @@ class DurationDisplay extends Component {
if (duration && this.duration_ !== duration) {
this.duration_ = duration;
this.formattedTime_ = formatTime(duration);
this.requestAnimationFrame(this.updateTextNode_);
this.updateFormattedTime_(duration);
}
}
}
/**
* The text that should display over the `DurationDisplay`s controls. Added to for localization.
*
* @type {string}
* @private
*/
DurationDisplay.prototype.controlText_ = 'Duration Time';
Component.registerComponent('DurationDisplay', DurationDisplay);
export default DurationDisplay;
@@ -1,18 +1,14 @@
/**
* @file remaining-time-display.js
*/
import document from 'global/document';
import TimeDisplay from './time-display';
import Component from '../../component.js';
import * as Dom from '../../utils/dom.js';
import {bind, throttle} from '../../utils/fn.js';
import formatTime from '../../utils/format-time.js';
/**
* Displays the time left in the video
*
* @extends Component
*/
class RemainingTimeDisplay extends Component {
class RemainingTimeDisplay extends TimeDisplay {
/**
* Creates an instance of this class.
@@ -25,48 +21,33 @@ class RemainingTimeDisplay extends Component {
*/
constructor(player, options) {
super(player, options);
this.throttledUpdateContent = throttle(bind(this, this.updateContent), 25);
this.on(player, ['timeupdate', 'durationchange'], this.throttledUpdateContent);
this.on(player, 'durationchange', this.throttledUpdateContent);
this.on(player, 'ended', this.handleEnded);
}
/**
* Create the `Component`'s DOM element
* Builds the default DOM `className`.
*
* @return {Element}
* The element that was created.
* @return {string}
* The DOM `className` for this object.
*/
createEl() {
const el = super.createEl('div', {
className: 'vjs-remaining-time vjs-time-control vjs-control'
});
this.contentEl_ = Dom.createEl('div', {
className: 'vjs-remaining-time-display'
}, {
// tell screen readers not to automatically read the time as it changes
'aria-live': 'off'
}, Dom.createEl('span', {
className: 'vjs-control-text',
textContent: this.localize('Remaining Time')
}));
this.updateTextNode_();
el.appendChild(this.contentEl_);
return el;
buildCSSClass() {
return 'vjs-remaining-time';
}
/**
* Updates the "remaining time" text node with new content using the
* contents of the `formattedTime_` property.
* The remaining time display prefixes numbers with a "minus" character.
*
* @param {number} time
* A numeric time, in seconds.
*
* @return {string}
* A formatted time
*
* @private
*/
updateTextNode_() {
if (this.textNode_) {
this.contentEl_.removeChild(this.textNode_);
}
this.textNode_ = document.createTextNode(` -${this.formattedTime_ || '0:00'}`);
this.contentEl_.appendChild(this.textNode_);
formatTime_(time) {
return '-' + super.formatTime_(time);
}
/**
@@ -79,16 +60,44 @@ class RemainingTimeDisplay extends Component {
* @listens Player#durationchange
*/
updateContent(event) {
if (this.player_.duration()) {
const formattedTime = formatTime(this.player_.remainingTime());
if (formattedTime !== this.formattedTime_) {
this.formattedTime_ = formattedTime;
this.requestAnimationFrame(this.updateTextNode_);
}
if (!this.player_.duration()) {
return;
}
// @deprecated We should only use remainingTimeDisplay
// as of video.js 7
if (this.player_.remainingTimeDisplay) {
this.updateFormattedTime_(this.player_.remainingTimeDisplay());
} else {
this.updateFormattedTime_(this.player_.remainingTime());
}
}
/**
* When the player fires ended there should be no time left. Sadly
* this is not always the case, lets make it seem like that is the case
* for users.
*
* @param {EventTarget~Event} [event]
* The `ended` event that caused this to run.
*
* @listens Player#ended
*/
handleEnded(event) {
if (!this.player_.duration()) {
return;
}
this.updateFormattedTime_(0);
}
}
/**
* The text that should display over the `RemainingTimeDisplay`s controls. Added to for localization.
*
* @type {string}
* @private
*/
RemainingTimeDisplay.prototype.controlText_ = 'Remaining Time';
Component.registerComponent('RemainingTimeDisplay', RemainingTimeDisplay);
export default RemainingTimeDisplay;
@@ -0,0 +1,129 @@
/**
* @file time-display.js
*/
import document from 'global/document';
import Component from '../../component.js';
import * as Dom from '../../utils/dom.js';
import {bind, throttle} from '../../utils/fn.js';
import formatTime from '../../utils/format-time.js';
/**
* Displays the time left in the video
*
* @extends Component
*/
class TimeDisplay extends Component {
/**
* Creates an instance of this class.
*
* @param {Player} player
* The `Player` that this class should be attached to.
*
* @param {Object} [options]
* The key/value store of player options.
*/
constructor(player, options) {
super(player, options);
this.throttledUpdateContent = throttle(bind(this, this.updateContent), 25);
this.on(player, 'timeupdate', this.throttledUpdateContent);
}
/**
* Create the `Component`'s DOM element
*
* @return {Element}
* The element that was created.
*/
createEl(plainName) {
const className = this.buildCSSClass();
const el = super.createEl('div', {
className: `${className} vjs-time-control vjs-control`
});
this.contentEl_ = Dom.createEl('div', {
className: `${className}-display`
}, {
// tell screen readers not to automatically read the time as it changes
'aria-live': 'off'
}, Dom.createEl('span', {
className: 'vjs-control-text',
textContent: this.localize(this.controlText_)
}));
this.updateTextNode_();
el.appendChild(this.contentEl_);
return el;
}
/**
* Updates the "remaining time" text node with new content using the
* contents of the `formattedTime_` property.
*
* @private
*/
updateTextNode_() {
if (this.textNode_ && this.contentEl_ && this.contentEl_.contains(this.textNode_)) {
this.contentEl_.removeChild(this.textNode_);
}
this.textNode_ = document.createTextNode(this.formattedTime_ || '0:00');
this.contentEl_.appendChild(this.textNode_);
}
/**
* Generates a formatted time for this component to use in display.
*
* @param {number} time
* A numeric time, in seconds.
*
* @return {string}
* A formatted time
*
* @private
*/
formatTime_(time) {
return formatTime(time);
}
/**
* Updates the time display text node if it has what was passed in changed
* the formatted time.
*
* @param {number} time
* The time to update to
*
* @private
*/
updateFormattedTime_(time) {
const formattedTime = this.formatTime_(time);
if (formattedTime === this.formattedTime_) {
return;
}
this.formattedTime_ = formattedTime;
this.requestAnimationFrame(this.updateTextNode_);
}
/**
* To be filled out in the child class, should update the displayed time
* in accordance with the fact that the current time has changed.
*
* @param {EventTarget~Event} [event]
* The `timeupdate` event that caused this to run.
*
* @listens Player#timeupdate
*/
updateContent(event) {}
}
/**
* The text that should display over the `TimeDisplay`s controls. Added to for localization.
*
* @type {string}
* @private
*/
TimeDisplay.prototype.controlText_ = 'Time';
Component.registerComponent('TimeDisplay', TimeDisplay);
export default TimeDisplay;
+7 -2
Ver Arquivo
@@ -8,6 +8,7 @@ import * as Dom from '../utils/dom.js';
import * as Fn from '../utils/fn.js';
import * as Events from '../utils/events.js';
import toTitleCase from '../utils/to-title-case.js';
import { IS_IOS } from '../utils/browser.js';
import document from 'global/document';
/**
@@ -339,8 +340,12 @@ class MenuButton extends Component {
this.buttonPressed_ = true;
this.menu.lockShowing();
this.menuButton_.el_.setAttribute('aria-expanded', 'true');
// set the focus into the submenu
this.menu.focus();
// set the focus into the submenu, except on iOS where it is resulting in
// undesired scrolling behavior when the player is in an iframe
if (!IS_IOS && !Dom.isInFrame()) {
this.menu.focus();
}
}
}
+17 -9
Ver Arquivo
@@ -605,10 +605,11 @@ class Player extends Component {
}
/**
* A getter/setter for the `Player`'s width.
* A getter/setter for the `Player`'s width. Returns the player's configured value.
* To get the current width use `currentWidth()`.
*
* @param {number} [value]
* The value to set the `Player's width to.
* The value to set the `Player`'s width to.
*
* @return {number}
* The current width of the `Player` when getting.
@@ -618,10 +619,11 @@ class Player extends Component {
}
/**
* A getter/setter for the `Player`'s height.
* A getter/setter for the `Player`'s height. Returns the player's configured value.
* To get the current height use `currentheight()`.
*
* @param {number} [value]
* The value to set the `Player's heigth to.
* The value to set the `Player`'s heigth to.
*
* @return {number}
* The current height of the `Player` when getting.
@@ -1076,7 +1078,6 @@ class Player extends Component {
} catch (e) {
log('deleting tag.poster throws in some browsers', e);
}
this.play();
}
}
@@ -1786,6 +1787,17 @@ class Player extends Component {
return this.duration() - this.currentTime();
}
/**
* A remaining time function that is intented to be used when
* the time is to be displayed directly to the user.
*
* @return {number}
* The rounded time remaining in seconds
*/
remainingTimeDisplay() {
return Math.floor(this.duration()) - Math.floor(this.currentTime());
}
//
// Kind of like an array of portions of the video that have been downloaded.
@@ -2363,10 +2375,6 @@ class Player extends Component {
this.load();
}
if (this.options_.autoplay) {
this.play();
}
// Set the source synchronously if possible (#2326)
}, true);
+1 -1
Ver Arquivo
@@ -302,7 +302,7 @@ class Html5 extends Tech {
el.playerId = this.options_.playerId;
}
if (this.options_.preload !== 'undefined') {
if (typeof this.options_.preload !== 'undefined') {
Dom.setAttribute(el, 'preload', this.options_.preload);
}
+17
Ver Arquivo
@@ -85,6 +85,23 @@ export function isEl(value) {
return isObject(value) && value.nodeType === 1;
}
/**
* Determines if the current DOM is embedded in an iframe.
*
* @return {boolean}
*
*/
export function isInFrame() {
// We need a try/catch here because Safari will throw errors when attempting
// to get either `parent` or `self`
try {
return window.parent !== window.self;
} catch (x) {
return true;
}
}
/**
* Creates functions to query the DOM using a given method.
*