Comparar commits
1 Commits
| Autor | SHA1 | Data | |
|---|---|---|---|
| 6665679a32 |
@@ -1,16 +1,3 @@
|
||||
<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)
|
||||
|
||||
|
||||
+15
-142
@@ -259,16 +259,23 @@ git reset --hard upstream/master
|
||||
|
||||
## video.js releases
|
||||
|
||||
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.
|
||||
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.
|
||||
|
||||
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:
|
||||
@@ -278,7 +285,6 @@ 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
|
||||
|
||||
@@ -286,146 +292,23 @@ 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
|
||||
|
||||
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.
|
||||
To do a release, check out the master branch
|
||||
|
||||
```sh
|
||||
git checkout master
|
||||
git pull origin master
|
||||
```
|
||||
|
||||
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`.
|
||||
Then run the contrib command to do the next release. Don't forget to provide your GitHub token so the GitHub release goes through.
|
||||
|
||||
```sh
|
||||
npm version {major|minor|patch}
|
||||
VJS_GITHUB_USER=gkatsev VJS_GITHUB_TOKEN=my-personal-access-token contrib release next patch
|
||||
```
|
||||
|
||||
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
|
||||
```
|
||||
This makes a patch release, you can also do a `minor` and a `major` release.
|
||||
|
||||
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
|
||||
|
||||
@@ -436,13 +319,3 @@ 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
|
||||
|
||||
+442
@@ -0,0 +1,442 @@
|
||||
{
|
||||
"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" ]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -26,7 +26,6 @@
|
||||
* [languages](#languages)
|
||||
* [nativeControlsForTouch](#nativecontrolsfortouch)
|
||||
* [notSupportedMessage](#notsupportedmessage)
|
||||
* [playbackRates](#playbackrates)
|
||||
* [plugins](#plugins)
|
||||
* [sourceOrder](#sourceorder)
|
||||
* [sources](#sources)
|
||||
@@ -181,24 +180,6 @@ 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`
|
||||
|
||||
@@ -251,7 +251,7 @@ class Advanced extends Plugin {
|
||||
}
|
||||
|
||||
updateState() {
|
||||
this.setState({playing: !this.player.paused()});
|
||||
this.setState({playing: !player.paused()});
|
||||
}
|
||||
|
||||
logState(changed) {
|
||||
|
||||
+4
-3
@@ -1,8 +1,9 @@
|
||||
{
|
||||
"name": "video.js",
|
||||
"description": "An HTML5 and Flash video player with a common API and skin for both.",
|
||||
"version": "6.2.8",
|
||||
"version": "6.2.7",
|
||||
"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",
|
||||
@@ -84,7 +85,7 @@
|
||||
"grunt-accessibility": "^5.0.0",
|
||||
"grunt-babel": "^7.0.0",
|
||||
"grunt-banner": "^0.6.0",
|
||||
"grunt-browserify": "5.2.0",
|
||||
"grunt-browserify": "5.1.0",
|
||||
"grunt-cli": "~1.2.0",
|
||||
"grunt-concurrent": "^2.3.1",
|
||||
"grunt-contrib-clean": "^1.0.0",
|
||||
@@ -134,7 +135,7 @@
|
||||
"remark-parse": "^4.0.0",
|
||||
"remark-stringify": "^4.0.0",
|
||||
"remark-toc": "^4.0.0",
|
||||
"remark-validate-links": "^7.0.0",
|
||||
"remark-validate-links": "^6.0.0",
|
||||
"replace": "^0.3.0",
|
||||
"rollup": "^0.47.5",
|
||||
"rollup-plugin-babel": "^2.7.1",
|
||||
|
||||
@@ -1,165 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Video.js Sandbox</title>
|
||||
<script src='../node_modules/es5-shim/es5-shim.js'></script>
|
||||
<script src='../node_modules/es6-shim/es6-shim.js'></script>
|
||||
|
||||
<link href="../build/temp/video-js.css" rel="stylesheet" type="text/css">
|
||||
<script src="../dist/video.js"></script>
|
||||
|
||||
<script src='../node_modules/videojs-flash/dist/videojs-flash.js'></script>
|
||||
<script src="https://unpkg.com/videojs-contrib-hls@latest/dist/videojs-contrib-hls.js"></script>
|
||||
|
||||
<script src="../build/temp/lang/es.js"></script>
|
||||
|
||||
<!-- Set the location of the flash SWF -->
|
||||
<script>
|
||||
// videojs.options.flash.swf = 'http://vjs.zencdn.net/swf/5.3/video-js.swf';
|
||||
videojs.options.flash.swf = 'http://localhost:8000/video-js-swf/dist/video-js.swf';
|
||||
</script>
|
||||
<style>
|
||||
.source-el { background: #FF6961; }
|
||||
.source-js { background: #77DD77; }
|
||||
.options-src { background: #AEC6CF; }
|
||||
.source-el.data-setup { background: red; }
|
||||
.source-js.data-setup { background: green; }
|
||||
.options-src.data-setup { background: blue; }
|
||||
|
||||
.video-js {
|
||||
height: 150px;
|
||||
width: 300px;
|
||||
}
|
||||
|
||||
.wrapper {
|
||||
display: grid;
|
||||
margin: 0 auto;
|
||||
grid-gap: 10px;
|
||||
grid-template-columns: 300px 300px 300px;
|
||||
}
|
||||
.panel > p:first-child {
|
||||
border-bottom: black 1px solid;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<p>All the various ways to embed and source video elements.</p>
|
||||
<p>Pastel color background represent programmatic setup.</p>
|
||||
<p>Vibrant color background represent data-setup.</p>
|
||||
<div class="wrapper">
|
||||
<div class="panel source-el">
|
||||
<p>js setup with source element</p>
|
||||
<p>Div embed, source element</p>
|
||||
<div id="vid01" class="video-js" controls poster="//vjs.zencdn.net/v/oceans.png">
|
||||
<source src="./oceans.mp4" type='video/mp4'>
|
||||
</div>
|
||||
<p>Video embed, source element</p>
|
||||
<video id="vid11" class="video-js" controls poster="//vjs.zencdn.net/v/oceans.png">
|
||||
<source src="./oceans.mp4" type='video/mp4'>
|
||||
</video>
|
||||
<p>injested div el, source element</p>
|
||||
<div data-vjs-player>
|
||||
<video id="vid21" class="video-js" controls poster="//vjs.zencdn.net/v/oceans.png">
|
||||
<source src="./oceans.mp4" type='video/mp4'>
|
||||
</video>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel options-src">
|
||||
<p>js setup with sources options</p>
|
||||
<p>Div embed, js source</p>
|
||||
<div id="vid05" class="video-js" controls poster="//vjs.zencdn.net/v/oceans.png">
|
||||
</div>
|
||||
<p>Video embed, js source</p>
|
||||
<video id="vid15" class="video-js" controls poster="//vjs.zencdn.net/v/oceans.png">
|
||||
</video>
|
||||
<p>injested div el, js source</p>
|
||||
<div data-vjs-player>
|
||||
<video id="vid25" class="video-js" controls poster="//vjs.zencdn.net/v/oceans.png">
|
||||
</video>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel source-js">
|
||||
<p>js setup with js method sources</p>
|
||||
<p>Div embed, js source</p>
|
||||
<div id="vid02" class="video-js" controls>
|
||||
</div>
|
||||
<p>Video embed, js source</p>
|
||||
<video id="vid12" class="video-js" controls>
|
||||
</video>
|
||||
<p>injested div el, js source</p>
|
||||
<div data-vjs-player>
|
||||
<video id="vid22" class="video-js" controls>
|
||||
</video>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel source-el data-setup">
|
||||
<p>data-setup with sourrce elements</p>
|
||||
<p>Div embed, source element</p>
|
||||
<div id="vid03" class="video-js" controls poster="//vjs.zencdn.net/v/oceans.png" data-setup="{}">
|
||||
<source src="./oceans.mp4" type='video/mp4'>
|
||||
</div>
|
||||
<p>Video embed, source element</p>
|
||||
<video id="vid13" class="video-js" controls poster="//vjs.zencdn.net/v/oceans.png" data-setup="{}">
|
||||
<source src="./oceans.mp4" type='video/mp4'>
|
||||
</video>
|
||||
<p>injested div el, source element</p>
|
||||
<div data-vjs-player>
|
||||
<video id="vid23" class="video-js" controls poster="//vjs.zencdn.net/v/oceans.png" data-setup="{}">
|
||||
<source src="./oceans.mp4" type='video/mp4'>
|
||||
</video>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel options-src data-setup">
|
||||
<p>data-setup embeds with sources options</p>
|
||||
<p>Div embed, source element</p>
|
||||
<div id="vid04" class="video-js" controls poster="//vjs.zencdn.net/v/oceans.png" data-setup='{"sources": [{"src":"./oceans.mp4", "type":"video/mp4"}]}'>
|
||||
</div>
|
||||
<p>Video embed, source element</p>
|
||||
<video id="vid14" class="video-js" controls poster="//vjs.zencdn.net/v/oceans.png" data-setup='{"sources": [{"src":"./oceans.mp4", "type":"video/mp4"}]}'>
|
||||
</video>
|
||||
<p>injested div el, source element</p>
|
||||
<div data-vjs-player>
|
||||
<video id="vid24" class="video-js" controls poster="//vjs.zencdn.net/v/oceans.png" data-setup='{"sources": [{"src":"./oceans.mp4", "type":"video/mp4"}]}'>
|
||||
</video>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel source-js data-setup">
|
||||
<p>js setup with js method sources</p>
|
||||
<p>Div embed, js source</p>
|
||||
<div id="vid06" class="video-js" controls poster="//vjs.zencdn.net/v/oceans.png" data-setup="{}">
|
||||
</div>
|
||||
<p>Video embed, js source</p>
|
||||
<video id="vid16" class="video-js" controls poster="//vjs.zencdn.net/v/oceans.png" data-setup="{}">
|
||||
</video>
|
||||
<p>injested div el, js source</p>
|
||||
<div data-vjs-player>
|
||||
<video id="vid26" class="video-js" controls poster="//vjs.zencdn.net/v/oceans.png" data-setup="{}">
|
||||
</video>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
var player01 = videojs('vid01');
|
||||
var player11 = videojs('vid11');
|
||||
var player21 = videojs('vid21');
|
||||
var player01 = videojs('vid02');
|
||||
var player11 = videojs('vid12');
|
||||
var player21 = videojs('vid22');
|
||||
var player05 = videojs('vid05', {sources: [{src:'./oceans.mp4',type:'video/mp4'}]});
|
||||
var player15 = videojs('vid15', {sources: [{src:'./oceans.mp4',type:'video/mp4'}]});
|
||||
var player25 = videojs('vid25', {sources: [{src:'./oceans.mp4',type:'video/mp4'}]});
|
||||
player01.src({src:'./oceans.mp4', type:'video/mp4'});
|
||||
player11.src({src:'./oceans.mp4', type:'video/mp4'});
|
||||
player21.src({src:'./oceans.mp4', type:'video/mp4'});
|
||||
player01.poster('//vjs.zencdn.net/v/oceans.png');
|
||||
player11.poster('//vjs.zencdn.net/v/oceans.png');
|
||||
player21.poster('//vjs.zencdn.net/v/oceans.png');
|
||||
setTimeout(function() {
|
||||
videojs.players.vid06 && videojs.players.vid06.src({src:'./oceans.mp4', type:'video/mp4'});
|
||||
videojs.players.vid16 && videojs.players.vid16.src({src:'./oceans.mp4', type:'video/mp4'});
|
||||
videojs.players.vid26 && videojs.players.vid26.src({src:'./oceans.mp4', type:'video/mp4'});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
+16
-36
@@ -363,7 +363,6 @@ class Player extends Component {
|
||||
// now remove immediately so native controls don't flash.
|
||||
// May be turned back on by HTML5 tech if nativeControlsForTouch is true
|
||||
tag.controls = false;
|
||||
tag.removeAttribute('controls');
|
||||
|
||||
/*
|
||||
* Store the internal state of scrubbing
|
||||
@@ -509,34 +508,16 @@ class Player extends Component {
|
||||
* The DOM element that gets created.
|
||||
*/
|
||||
createEl() {
|
||||
let tag = this.tag;
|
||||
const tag = this.tag;
|
||||
let el;
|
||||
let playerElIngest = this.playerElIngest_ = tag.parentNode && tag.parentNode.hasAttribute && tag.parentNode.hasAttribute('data-vjs-player');
|
||||
const divEmbed = this.tag.tagName.toLowerCase() === 'div';
|
||||
const playerElIngest = this.playerElIngest_ = tag.parentNode && tag.parentNode.hasAttribute && tag.parentNode.hasAttribute('data-vjs-player');
|
||||
|
||||
if (playerElIngest) {
|
||||
el = this.el_ = tag.parentNode;
|
||||
} else if (!divEmbed) {
|
||||
} else {
|
||||
el = this.el_ = super.createEl('div');
|
||||
}
|
||||
|
||||
// Copy over all the attributes from the tag, including ID and class
|
||||
// ID will now reference player box, not the video tag
|
||||
const attrs = Dom.getAttributes(tag);
|
||||
|
||||
if (divEmbed) {
|
||||
el = this.el_ = tag;
|
||||
tag = this.tag = document.createElement('video');
|
||||
while (el.children.length) {
|
||||
tag.appendChild(el.firstChild);
|
||||
el.removeChild(el.firstChild);
|
||||
}
|
||||
|
||||
el.appendChild(tag);
|
||||
|
||||
playerElIngest = this.playerElIngest_ = el;
|
||||
}
|
||||
|
||||
// set tabindex to -1 so we could focus on the player element
|
||||
tag.setAttribute('tabindex', '-1');
|
||||
|
||||
@@ -544,21 +525,17 @@ class Player extends Component {
|
||||
tag.removeAttribute('width');
|
||||
tag.removeAttribute('height');
|
||||
|
||||
// Copy over all the attributes from the tag, including ID and class
|
||||
// ID will now reference player box, not the video tag
|
||||
const attrs = Dom.getAttributes(tag);
|
||||
|
||||
Object.getOwnPropertyNames(attrs).forEach(function(attr) {
|
||||
// workaround so we don't totally break IE7
|
||||
// http://stackoverflow.com/questions/3653444/css-styles-not-applied-on-dynamic-elements-in-internet-explorer-7
|
||||
if (attr === 'class') {
|
||||
el.className += ' ' + attrs[attr];
|
||||
|
||||
if (divEmbed) {
|
||||
tag.className += ' ' + attrs[attr];
|
||||
}
|
||||
} else {
|
||||
el.setAttribute(attr, attrs[attr]);
|
||||
|
||||
if (divEmbed) {
|
||||
tag.setAttribute(attr, attrs[attr]);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -628,11 +605,10 @@ class Player extends Component {
|
||||
}
|
||||
|
||||
/**
|
||||
* A getter/setter for the `Player`'s width. Returns the player's configured value.
|
||||
* To get the current width use `currentWidth()`.
|
||||
* A getter/setter for the `Player`'s width.
|
||||
*
|
||||
* @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.
|
||||
@@ -642,11 +618,10 @@ class Player extends Component {
|
||||
}
|
||||
|
||||
/**
|
||||
* A getter/setter for the `Player`'s height. Returns the player's configured value.
|
||||
* To get the current height use `currentheight()`.
|
||||
* A getter/setter for the `Player`'s height.
|
||||
*
|
||||
* @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.
|
||||
@@ -1101,6 +1076,7 @@ class Player extends Component {
|
||||
} catch (e) {
|
||||
log('deleting tag.poster throws in some browsers', e);
|
||||
}
|
||||
this.play();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2387,6 +2363,10 @@ class Player extends Component {
|
||||
this.load();
|
||||
}
|
||||
|
||||
if (this.options_.autoplay) {
|
||||
this.play();
|
||||
}
|
||||
|
||||
// Set the source synchronously if possible (#2326)
|
||||
}, true);
|
||||
|
||||
|
||||
@@ -31,7 +31,6 @@ const autoSetup = function() {
|
||||
// through each list of elements to build up a new, combined list of elements.
|
||||
const vids = document.getElementsByTagName('video');
|
||||
const audios = document.getElementsByTagName('audio');
|
||||
const divs = document.getElementsByTagName('div');
|
||||
const mediaEls = [];
|
||||
|
||||
if (vids && vids.length > 0) {
|
||||
@@ -46,12 +45,6 @@ const autoSetup = function() {
|
||||
}
|
||||
}
|
||||
|
||||
if (divs && divs.length > 0) {
|
||||
for (let i = 0, e = divs.length; i < e; i++) {
|
||||
mediaEls.push(divs[i]);
|
||||
}
|
||||
}
|
||||
|
||||
// Check if any media elements exist
|
||||
if (mediaEls && mediaEls.length > 0) {
|
||||
|
||||
|
||||
+1
-136
@@ -17,7 +17,7 @@ QUnit.module('video.js', {
|
||||
QUnit.test('should create a video tag and have access children in old IE', function(assert) {
|
||||
const fixture = document.getElementById('qunit-fixture');
|
||||
|
||||
fixture.innerHTML += '<video id="test_vid_id"><source type="video/mp4"></source></video>';
|
||||
fixture.innerHTML += '<video id="test_vid_id"><source type="video/mp4"></video>';
|
||||
|
||||
const vid = document.getElementById('test_vid_id');
|
||||
|
||||
@@ -331,138 +331,3 @@ QUnit.test('should create a new tag for movingMediaElementInDOM', function(asser
|
||||
Html5.isSupported = oldIS;
|
||||
Html5.nativeSourceHandler.canPlayType = oldCPT;
|
||||
});
|
||||
|
||||
/* **************************************************** *
|
||||
* div embed tests copied from video emebed tests above *
|
||||
* **************************************************** */
|
||||
|
||||
QUnit.module('video.js div embed', {
|
||||
beforeEach() {
|
||||
this.clock = sinon.useFakeTimers();
|
||||
},
|
||||
afterEach() {
|
||||
this.clock.restore();
|
||||
}
|
||||
});
|
||||
QUnit.test('should return a video player instance', function(assert) {
|
||||
const fixture = document.getElementById('qunit-fixture');
|
||||
|
||||
fixture.innerHTML += '<div id="test_vid_id"></div>' +
|
||||
'<div id="test_vid_id2"></div>';
|
||||
|
||||
const player = videojs('test_vid_id', { techOrder: ['techFaker'] });
|
||||
|
||||
assert.ok(player, 'created player from tag');
|
||||
assert.ok(player.id() === 'test_vid_id');
|
||||
assert.ok(videojs.getPlayers().test_vid_id === player,
|
||||
'added player to global reference');
|
||||
|
||||
const playerAgain = videojs('test_vid_id');
|
||||
|
||||
assert.ok(player === playerAgain, 'did not create a second player from same tag');
|
||||
|
||||
assert.equal(player, playerAgain, 'we did not make a new player');
|
||||
|
||||
const tag2 = document.getElementById('test_vid_id2');
|
||||
const player2 = videojs(tag2, { techOrder: ['techFaker'] });
|
||||
|
||||
assert.ok(player2.id() === 'test_vid_id2', 'created player from element');
|
||||
|
||||
player.dispose();
|
||||
player2.dispose();
|
||||
});
|
||||
|
||||
QUnit.test('should log about already initalized players if options already passed',
|
||||
function(assert) {
|
||||
const origWarnLog = log.warn;
|
||||
const fixture = document.getElementById('qunit-fixture');
|
||||
const warnLogs = [];
|
||||
|
||||
log.warn = (args) => {
|
||||
warnLogs.push(args);
|
||||
};
|
||||
|
||||
fixture.innerHTML += '<div id="test_vid_id"></div>';
|
||||
|
||||
const player = videojs('test_vid_id', { techOrder: ['techFaker'] });
|
||||
|
||||
assert.ok(player, 'created player from tag');
|
||||
assert.equal(player.id(), 'test_vid_id', 'player has the right ID');
|
||||
assert.equal(warnLogs.length, 0, 'no warn logs');
|
||||
|
||||
const playerAgain = videojs('test_vid_id');
|
||||
|
||||
assert.equal(player, playerAgain, 'did not create a second player from same tag');
|
||||
assert.equal(warnLogs.length, 0, 'no warn logs');
|
||||
|
||||
const playerAgainWithOptions = videojs('test_vid_id', { techOrder: ['techFaker'] });
|
||||
|
||||
assert.equal(player,
|
||||
playerAgainWithOptions,
|
||||
'did not create a second player from same tag');
|
||||
assert.equal(warnLogs.length, 1, 'logged a warning');
|
||||
assert.equal(warnLogs[0],
|
||||
'Player "test_vid_id" is already initialised. Options will not be applied.',
|
||||
'logged the right message');
|
||||
|
||||
log.warn = origWarnLog;
|
||||
|
||||
player.dispose();
|
||||
});
|
||||
|
||||
QUnit.test('should return a video player instance from el html5 tech', function(assert) {
|
||||
const fixture = document.getElementById('qunit-fixture');
|
||||
|
||||
fixture.innerHTML += '<div id="test_vid_id"></div>' +
|
||||
'<div id="test_vid_id2"></div>';
|
||||
|
||||
const vid = document.querySelector('#test_vid_id');
|
||||
|
||||
const player = videojs(vid);
|
||||
|
||||
assert.ok(player, 'created player from tag');
|
||||
assert.ok(player.id() === 'test_vid_id');
|
||||
assert.ok(videojs.getPlayers().test_vid_id === player,
|
||||
'added player to global reference');
|
||||
|
||||
const playerAgain = videojs(vid);
|
||||
|
||||
assert.ok(player === playerAgain, 'did not create a second player from same tag');
|
||||
assert.equal(player, playerAgain, 'we did not make a new player');
|
||||
|
||||
const tag2 = document.getElementById('test_vid_id2');
|
||||
const player2 = videojs(tag2, { techOrder: ['techFaker'] });
|
||||
|
||||
assert.ok(player2.id() === 'test_vid_id2', 'created player from element');
|
||||
|
||||
player.dispose();
|
||||
player2.dispose();
|
||||
});
|
||||
|
||||
QUnit.test('should return a video player instance from el techfaker', function(assert) {
|
||||
const fixture = document.getElementById('qunit-fixture');
|
||||
|
||||
fixture.innerHTML += '<div id="test_vid_id"></div>' +
|
||||
'<div id="test_vid_id2"></div>';
|
||||
|
||||
const vid = document.querySelector('#test_vid_id');
|
||||
const player = videojs(vid, {techOrder: ['techFaker']});
|
||||
|
||||
assert.ok(player, 'created player from tag');
|
||||
assert.ok(player.id() === 'test_vid_id');
|
||||
assert.ok(videojs.getPlayers().test_vid_id === player,
|
||||
'added player to global reference');
|
||||
|
||||
const playerAgain = videojs(vid);
|
||||
|
||||
assert.ok(player === playerAgain, 'did not create a second player from same tag');
|
||||
assert.equal(player, playerAgain, 'we did not make a new player');
|
||||
|
||||
const tag2 = document.getElementById('test_vid_id2');
|
||||
const player2 = videojs(tag2, { techOrder: ['techFaker'] });
|
||||
|
||||
assert.ok(player2.id() === 'test_vid_id2', 'created player from element');
|
||||
|
||||
player.dispose();
|
||||
player2.dispose();
|
||||
});
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário