Comparar commits

...

267 Commits

Autor SHA1 Mensagem Data
Pat O'Neill ec5b60329f chore: Add package-lock.json file. (#4641) 2017-10-19 11:49:04 -04:00
Pat O'Neill 0287f6e076 fix: Make sure we remove vjs-ended from the play toggle in all appropriate cases. (#4661) 2017-10-13 13:46:51 -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
Gary Katsevman 09ace0c625 6.2.6 2017-08-16 17:32:35 -04:00
Atef Ben Ali 3e63bf3d17 fix(lang): typos in ar.json (#4528) 2017-08-16 14:31:28 -04:00
Gary Katsevman d7f7e05b5c chore(package): update rollup to version 0.47.4 (#4570)
Closes #4561
2017-08-16 14:14:26 -04:00
greenkeeper[bot] 8c21f0afe0 chore(package): update grunt-browserify to version 5.1.0 (#4565) 2017-08-16 14:05:29 -04:00
greenkeeper[bot] f6f9998299 chore(package): update grunt-babel to version 7.0.0 (#4553) 2017-08-16 14:02:00 -04:00
Gary Katsevman d668c4976b fix: make boolean attributes set and check both the associated property and the attribute (#4562)
Make boolean attributes like muted set the property video.muted = {{boolean}} and the attribute video.setAttribute('muted', 'muted') when changing the value.
Also, in html5's createEl, we were setting/updating attributes for various properties but we were only setting the attributes and not also the properties but also autoplay was happening first rather than last which caused autoplay to fail because muted and playsinline weren't necessary set by that time.

Fix #4351.
2017-08-15 17:02:07 -04:00
Rafael Gaspar a6b8425f6b fix: playback rate default text (#4558)
Previously, the default text only said `1` now it says `1x` which matches the look after changing the playback rate.
2017-08-14 17:59:41 -04:00
mister-ben 1f3375e485 docs: updates to faq, language guide, and minor edits (#4556) 2017-08-14 17:02:48 -04:00
Gary Katsevman 19ebc0dda5 chore: improve dev and beginner experience (#4555)
Makes the output of dev rollup and babel watch more quiet.
Add a task to copy .example files over to non .example files if the non .example files are not present.
2017-08-14 16:58:57 -04:00
Gary Katsevman db55bbd3ec fix: remove 'use strict' from rollup because vttjs isn't strict (#4551) 2017-08-14 16:51:05 -04:00
greenkeeper[bot] 6233d14091 chore(package): update klaw-sync to version 3.0.0 (#4544) 2017-08-14 16:39:07 -04:00
Alex Barstow 0c337b3d67 Fix: issue where tracks are disabled and cuepoints are cleared in iOS native player (#4496)
In the HTML5 tech, when we go fullscreen to the native player, listen for change events and restore previous mode state for the metadata text tracks.
2017-08-14 16:36:36 -04:00
Kishan cd2f5106ca fix: set width and height for vjs-button like the SubsCaps button (#4548)
Add a width and height property of 100% to `.vjs-control .vjs-button` selector.

Fixes #4547.
2017-08-10 15:19:59 -04:00
Gary Katsevman 998c0042cb 6.2.5 2017-07-26 16:49:20 -04:00
Gary Katsevman ee014e2e04 fix: only change focus from BPB if not a mouse click (#4497) 2017-07-26 16:09:31 -04:00
Gary Katsevman fe95a7720a chore(greenkeeper): ignore webpack and uglify (#4518) 2017-07-26 13:29:39 -04:00
greenkeeper[bot] 7c80e1300a chore(package): update remark-cli to version 4.0.0 (#4508) 2017-07-25 17:08:26 -04:00
greenkeeper[bot] abb5d67eb2 chore(package): update remark-parse to version 4.0.0 (#4507) 2017-07-25 17:08:12 -04:00
greenkeeper[bot] bbd92ab813 chore(package): update remark-stringify to version 4.0.0 (#4506) 2017-07-25 17:07:21 -04:00
Gary Katsevman d889b660ac 6.2.4 2017-07-14 15:49:06 -04:00
Gary Katsevman 07594bcf59 chore: fix gh-release minimist call (#4489) 2017-07-14 15:48:49 -04:00
Gary Katsevman 14ae1e9658 6.2.3 2017-07-14 15:41:59 -04:00
Gary Katsevman b1ac2e0249 chore(gh-release): add prerelease flag and find right zip (#4488)
Add a --prerelease flag so we can run gh-release.js manually and mark releases as prerelease.
Also, get the correct zip file.
2017-07-14 15:27:48 -04:00
Gary Katsevman 269e504d26 6.2.2 2017-07-14 14:56:58 -04:00
Gary Katsevman 971f633c73 chore(package): update rollup to version 0.45.2 (#4487)
Closes #4475
2017-07-14 14:43:58 -04:00
Gary Katsevman 03fd402ea9 docs: make jsdoc generate anchor names so ToC links work (#4471)
Also, run some more explicit replacement queries so all ToC links work if they're generated differently from gfm.
2017-07-14 14:22:02 -04:00
Gary Katsevman 3a600d0eea chore: add automatic github release (#4466)
This will automatically do a github release with the correct changelog entry and the built zip file.
If a publish is made with `--tag next` it will mark the release as a pre-release.

To use, just add `VJS_GITHUB_USER` and `VJS_GITHUB_TOKEN` env variables as part of the publish command:
```sh
$ VJS_GITHUB_USER=gkatsev VJS_GITHUB_TOKEN=test_token npm publish --tag next
```
2017-07-14 14:21:07 -04:00
Alex Barstow 1e80e59614 test: add unit tests for player.duration() (#4459)
Unit tests for https://github.com/videojs/video.js/pull/4443
2017-07-14 14:20:37 -04:00
Pat O'Neill 7579fc1800 docs: Fix Player#src API documentation. (#4454) 2017-07-14 14:20:00 -04:00
Gary Katsevman 4f43616160 fix(playback rate menu): cycling rates via click (#4486)
In 6.0, we changed the way that Menu Buttons were being created by
wrapping an actual button with a menu sibling in a container. The
playback rate menu also had a rate value display. In 6.x, this rate
value display ended up coming on top of the button itself and capturing
it's clicks. So, we want to remove pointer-events from the rate-value
display and resize the actual button to be the size of the control.
2017-07-14 14:18:23 -04:00
Gary Katsevman 687aae50ff chore: switch to using chrome for testing PRs on travis (#4462) 2017-07-05 09:44:43 +10:00
Aeoril 6986dbb851 chore(build): remove unused var in build/version.js (#4458) 2017-07-04 11:11:29 +10:00
Gary Katsevman 39ff0f4fb6 6.2.1 2017-06-28 16:58:10 +10:00
Gary Katsevman 82c8b80548 fix: auto-removal remote text tracks being removed when not supposed to (#4450)
We added a feature so that remote text tracks can auto-removed when a source changes. However, in 6.x we changed the source behavior to be asynchronous meaning that some text tracks were accidentally being removed when they weren't supposed to be.
For example:
```js
var player = videojs('my-player');
player.src({src: 'video.mp4', type: 'video/mp4'});
 // set second arg to false so that they get auto-removed on source change
player.addRemoteTextTrack({kind: 'captions', src: 'text.vtt', srclang: 'en'}, false);
```
Now when the player loads, this captions track is actually missing because it was removed.

Instead of adding auto-removal tracks immediately to the list, wait until we've selected a source before adding them in.


Fixes #4403 and #4315.
2017-06-28 16:38:29 +10:00
Alex Barstow f5cc165cad fix: player.duration() should return NaN if duration is not known (#4443)
player.duration() currently returns 0 if the duration is not known, when it should return NaN. The problem is that if NaN is passed to player.duration() as an argument, we set the duration to 0. If player.cache_.duration was set to NaN by other means, player.duration() would still return 0.

Modify the player duration() method so that it will 1.) set the cached duration to NaN if it is passed in as an argument, and 2.) return the proper value when called without an argument.
2017-06-28 16:37:00 +10:00
mister-ben b4dc4f85b0 fix: Use passive event listeners for touchstart/touchmove (#4440)
If passive event listening is supported, we should use it.

Fixes #4432.
2017-06-28 16:36:06 +10:00
mister-ben b63666379d fix: Safari picture-in-picture triggers fullscreenchange (#4437)
When picture-in-picture mode is entered on Safari, `webkitbeginfullscreen` is triggered which results in a proxied `fullscreenchange` event and adding the fullscreen class to the player. That causes the tech element to collapse to zero height so that the "this video is playing in picture in picture" placeholder is not visible.
On `webkitbeginfullscreen` check whether the presentation mode is `picture-in-picture` before proxying `fullscreenchange` event.
2017-06-28 16:35:01 +10:00
Pat O'Neill 77ba3d13d9 perf: Various small performance improvements. (#4426)
These are a few performance improvements.

* Use textContent instead of innerHTML for text content.
* Construct TextTrackSettings content with HTML strings where possible because it's a bit faster than manual DOM construction.
* Do minimal DOM updates to time controls. This reduces our timeupdate footprint from ~2-2.5ms to ~1ms!
2017-06-28 16:32:58 +10:00
Jet Fontanilla 7f7ea70cb7 fix: IE10 issue for disableOthers when property access results in "permission denied" (#4395)
Fixes #4378
2017-06-28 16:32:04 +10:00
mister-ben e0824c8294 fix: Update translations to match correct string (#4383)
The lang files were translating "all settings to the default values" instead of "restore all settings to the default values".
2017-06-28 16:31:44 +10:00
Pat O'Neill cc6e82442f docs: Fix links in API docs for several Player events. (#4427) 2017-06-27 09:53:08 +10:00
Caley Shem-Crumrine 97021554cd docs: Update name of FullscreenToggle in documentation (#4410) 2017-06-27 09:52:05 +10:00
Pat O'Neill c4bbe5d120 chore(sandbox): Fix paths in sandbox files. (#4416) 2017-06-27 09:51:05 +10:00
Gary Katsevman 66a0d23e05 chore(package): update husky to version 0.14.1 (#4444)
Closes #4436
2017-06-27 09:44:28 +10:00
greenkeeper[bot] 4bce4a2954 chore(package): update rollup-watch to version 4.0.0 (#4396) 2017-06-27 09:43:42 +10:00
greenkeeper[bot] f87b12c3af chore(package): update rollup to version 0.42.0 (#4392) 2017-06-27 09:43:18 +10:00
ldayananda 9329e3ef8e docs: Fixing player.remoteTextTracks jsdoc (#4417)
Fixes the sidebar link on the docs site for remoteTextTracks.
2017-06-19 16:01:01 -04:00
Gary Katsevman 546bef5321 6.2.0 2017-05-30 15:25:58 -04:00
Gary Katsevman c31836c30c feat: Use Rollup to generate dist files (#4301) 2017-05-25 19:40:35 -04:00
Gary Katsevman a5a68e819a chore: update translations needed (#4380) 2017-05-25 18:32:17 -04:00
greenkeeper[bot] 98160700e5 chore(package): update videojs-flash to version 2.0.0 (#4375) 2017-05-25 18:16:31 -04:00
h0lysl4y3r e5e1c7f269 feat(lang): Create sk.json (#4374) 2017-05-25 18:16:23 -04:00
Hollton 0c16c5f3cf feat(lang): Update zh-CN.json (#4370) 2017-05-25 18:16:01 -04:00
greenkeeper[bot] d57f09f7cf chore(package): update grunt-contrib-cssmin to version 2.2.0 (#4345) 2017-05-25 18:15:42 -04:00
Adrian P. Blunier 2a26c7f87b feat(lang): Adding galician (#4334) 2017-05-25 18:15:33 -04:00
ldayananda eade52e174 test(TextTrackDisplay): Removing incorrect test techOrder (#4379) 2017-05-25 18:05:45 -04:00
ldayananda 188ead1c81 feat: Persist caption/description choice over source changes in emulated tracks (#4295) 2017-05-25 14:09:00 -04:00
Gary Katsevman 8f67b4fc54 6.1.0 2017-05-15 14:35:23 -04:00
Gary Katsevman cb6005eca4 fix: only disable user-selection on sliders (#4354) 2017-05-15 12:04:42 -04:00
Alex Barstow 8d80a5846e feat: add 'playsinline' player option (#4348)
Video.js players can accept a number of standard <video> element options (autoplay, muted, loop, etc), but not currently playsinline, which is now part of the [HTML spec](https://html.spec.whatwg.org/multipage/embedded-content.html#attr-video-playsinline). We should add it to the list of <video> attributes that can be provided to the player as options.
2017-05-12 16:39:37 -04:00
Gary Katsevman 35df35143f feat: deprecate firstplay event (#4353) 2017-05-12 16:38:48 -04:00
Martin Bachwerk 3087830ed7 fix: Only update text track mode if changed (#4298) 2017-05-12 16:35:39 -04:00
Garrett 483e5a2ca5 feat: Add getVideoPlaybackQuality API (#4338)
Provides a tech getter for getVideoPlaybackQuality as specified by the W3C's Media Playback Quality API: https://wicg.github.io/media-playback-quality/.
2017-05-12 15:22:02 -04:00
Gary Katsevman 3dcfa9568a fix: TextTrackButton on Safari and iOS (#4350)
On Safari and iOS, we use native text tracks, so, during text track
button creation, textTracks() is populated. However, `this.kinds_` isn't
necessarily set and ends up throwing.

Instead, we want to move the fallback for `this.kinds_` from the
constructor and right above the usage of `this.kinds_`.
2017-05-12 14:51:12 -04:00
greenkeeper[bot] b5c60f339b fix(package): update global to version 4.3.2 (#4291)
https://greenkeeper.io/
2017-05-11 17:52:30 -04:00
mister-ben 03bab83dde fix: prevent dupe events on enabled ClickableComponents (#4316)
Prevent ClickableComponents re-adding event listeners each time enabled() is called.

* Keeps track of enabled state (this.enabled_)
* enable() doesn't do anything if the component is enabled, so the event handlers are not re-added

Fixes #4312
2017-05-11 17:32:20 -04:00
Owen Edwards f773c473f9 chore: Fix examples and docs and some links (#4279)
* Fix the doc/example/elephantsdream/index.html file, add an index of doc/examples, and update CDN links to use video.js v5.19.
* Add poster from CDN to Elephants Dream examples.
2017-05-11 17:16:12 -04:00
mister-ben ae423df4f5 feat: Add a version class to the player (#4320)
Adds `vjs-v6` class so you can target that version of Video.js.
2017-05-11 17:15:12 -04:00
Pat O'Neill 0a19cf0d6a feat: Add 'beforepluginsetup' event and named plugin setup events (e.g. 'pluginsetup:foo') (#4255)
This adds a beforepluginsetup event as well as beforepluginsetup:$name and pluginsetup:$name events.

The drive behind this is improving the ability for people to make cross-plugin dependencies in a more robust manner.
2017-05-11 17:13:22 -04:00
Stéphane Roucheray da1d8613d7 chore: typo soruce -> source (#4307) 2017-05-11 17:00:59 -04:00
mister-ben da0f1ee681 feat: remove playbackRate blacklist for recent Android Chrome (#4321)
Android Chrome now supports playbackRate properly, so removes the blacklist added in #3246 for newer Chrome versions.
Adds `browser.CHROME_VERSION` as a necessary evil.
No longer blacklists for Chrome 58+ -- this could possibly be fixed since 52, but 58 is all I've been able to test on and most users should keep Chrome up to date.
2017-05-11 16:59:22 -04:00
Dave Kiss cff2e503ef docs(react-guide): Use a React component as a VJS component (#4287) 2017-05-11 16:33:28 -04:00
Brandon Casey 561d5ddf76 fix a comment typo (#4293) 2017-04-19 23:56:07 -04:00
Gary Katsevman d6e56e9222 6.0.1 2017-04-13 16:58:11 -04:00
Gary Katsevman 7490a499ce chore: add slack travis notifications (#4282) 2017-04-13 12:23:31 -04:00
Matthew Neil 1ea00419c9 fix: set IE_VERSION correctly for IE11 (#4281)
videojs.browser.IE_VERSION is null in IE11 because IE11 uses a different user agent string than other IE versions

Fixes #4278
2017-04-13 11:28:03 -04:00
Aaron Chamberlain 230743ecb1 docs: add a Webpack usage guide (#4261) 2017-04-12 18:16:41 -04:00
Garrett 39fd73f781 docs: remove mentions of bower support (#4274)
Since video.js 6 no longer officially supports bower (#4012), remove some old mentions in the docs of bower.
2017-04-12 18:15:54 -04:00
Gary Katsevman 92e5d9fb5a fix: techOrder names can be camelCased. (#4277)
In the new middleware work, the way that new sources were loaded was refactored. We also recently made techs and components work either TitleCased or camelcased. There was one comparison that didn't do the proper check and cause the tech to be reloaded, even if the two techs were the same.
2017-04-12 17:17:33 -04:00
Dennis JongHyuck Won 083f643e63 chore: gitignore all npm-debug.log.* (#4252) 2017-04-07 13:41:30 -04:00
Alex Barstow 02721c7c03 docs(component): Replace VolumeMenuButton with VolumePanel in component tree (#4267)
Video.js 6 has switch to using the VolumePanel instead of the VolumeMenuButton.

Fixes #4266
2017-04-07 13:39:57 -04:00
Gary Katsevman c20ca5cc97 chore(changelog): Update CHANGELOG with v5 changes (#4257) 2017-04-07 13:38:39 -04:00
Gary Katsevman d9d7278282 6.0.0 2017-04-03 17:37:03 -04:00
Gary Katsevman c7fd68d4ae 6.0.0-RC.8 2017-03-31 10:50:26 -04:00
Gary Katsevman e98c65d7a6 fix: remove focus ring from player itself (#4237) 2017-03-30 13:46:52 -04:00
Gary Katsevman 29d733d0d1 chore: ignore qunit and sinon from greenkeeper (#4242) 2017-03-30 13:46:41 -04:00
Gary Katsevman 0908d914ac fix: silence play promise error (#4247) 2017-03-30 13:46:31 -04:00
Gary Katsevman 9274457e4c feat: Make text tracks settings more responsive (#4236) 2017-03-30 11:09:00 -04:00
Gary Katsevman 0d19a05972 chore: remove bower.json (#4238)
Supporting bower is a lot of extra work and there's no insight or
information into its usage.

Closes #4012
2017-03-29 17:38:41 -04:00
Gary Katsevman dc37cb24f2 6.0.0-RC.6 2017-03-24 18:43:52 -04:00
Gary Katsevman 6d876ee6ef chore: 6.x build updates (#4228)
This runs the changelog generation on versioning automatically, if it isn't a pre-release.
It also runs the build and API docs generation on publish and makes sure that the generated API docs are in the published package.
2017-03-24 18:42:39 -04:00
Kevin Litchfield 46dd0aac11 test: fix IE9 rounding issue with lastvolume test (#4230)
#4227 caused an error in IE9 because it returns back a bad float number.
Instead, we toFixed(1) the response
2017-03-24 18:26:28 -04:00
Kevin Litchfield 16c1e0adc0 fix: keep minimum volume after unmuting above 0.1 (#4227)
If, when unmuting, the last volume is below 0.1, force it to be 0.1.

Fixes #4054.
2017-03-24 15:14:41 -04:00
greenkeeper[bot] 7d12c9ea85 chore(package): update videojs-vtt.js to version 0.12.3 (#4221) 2017-03-24 14:38:06 -04:00
Gary Katsevman 312b10ca44 docs(coc): introduce CODE_OF_CONDUCT.md (#4160) 2017-03-23 16:39:17 -04:00
greenkeeper[bot] 022305706c chore(package): update webpack to version 2.3.0 (#4219)
https://greenkeeper.io/
2017-03-23 16:21:35 -04:00
Brandon Casey f2b5a057fe fix: removeCue should work with native passed in cue (#4208) 2017-03-23 14:31:41 -04:00
Brandon Casey dbfba28a10 fix: not showing default text tracks over video (#4216)
This allows default tracks or tracks with a `mode`of `showing` to be seen
when they are added (as we would expect). Rather than only being seen
after the first `modechange` event (aka a selection from the menu). This is done by watching for `loadstart` on Player.
2017-03-23 14:03:15 -04:00
Brandon Casey 61e20786a9 docs: fix links in generated docs (#4200) 2017-03-21 17:13:06 -04:00
Gary Katsevman 0fd7aad850 fix: make sure audio track hides with one item (#4202) 2017-03-15 11:27:52 -04:00
Alex Barstow d79b8a7013 feat: time tooltips will not be added to a player on mobile devices (#4185)
Currently, the behavior of time tooltips is inconsistent across iOS and Android devices so we want to hide the tooltips on mobile devices for the time being.
2017-03-13 11:54:29 -04:00
Brandon Casey 41be5dca4e docs: tech order will only have html5 by default (#4188) 2017-03-13 11:53:30 -04:00
Gary Katsevman 424fa51c28 fix: make load progress buffered regions height 100% (#4190) 2017-03-13 11:53:04 -04:00
Brandon Casey 90030d5e99 feat: Make pause on open optional for ModalDialog via options (#4186)
* The new option is called pauseOnOpen, and defaults to true
* default pauseOnOpen to false in the `ErrorDisplay`
2017-03-13 11:26:33 -04:00
Owen Edwards af1c6e374c chore(docs): Use Elephants Dream video files from CDN for docs/examples/elephantsdream/ (#4181) 2017-03-13 10:54:15 -04:00
Gary Katsevman c829fcff5f 6.0.0-RC.5 2017-03-09 15:45:42 -05:00
Gary Katsevman 23823556d4 6.0.0-RC.4 2017-03-09 13:30:43 -05:00
Gary Katsevman ddde644c78 fix(vttjs): wait till tech el in DOM before loading vttjs (#4177)
The issue is that in Flash, Flash.embed wraps the object element in a div but that object element is what is referenced by this.el(), so, parentNode isn't null but we aren't actually in the DOM. Instead, just check to see whether the tech element is in the DOM or not via node.contains().
2017-03-08 11:27:59 -05:00
Gary Katsevman cb890a965c fix(ie8): various minor ie8 fixes (#4175)
This fixes a logging in the console regarding timetooltips which don't exist. Also, makes sure not to focus the menu button when the captions settings menu item is clicked since the caption settings is getting focused instead. In addition, it makes sure the legend text in the track settings is the foreground color.
2017-03-07 15:44:08 -05:00
Gary Katsevman 1770f00018 fix(icon-placeholder): align icons on ie8 properly (#4174)
Make sure that the button inside the menu button element isn't a
vjs-control but make sure that the icon-placeholder is sized properly.
2017-03-07 15:43:44 -05:00
Pat O'Neill 05e64948c5 chore(test): silence plugin warning from test (#4173) 2017-03-07 14:13:19 -05:00
Gary Katsevman bf787bd5cc chore(package): update uglify-js to version 2.8.8 (#4170)
Closes #4138

https://greenkeeper.io/
2017-03-07 13:59:20 -05:00
Gary Katsevman 67634cf216 fix(tracks): allow forcing native text tracks on or off (#4172)
In addition, the track buttons need to update on the ready event because when the tech loads, it could run with support native captions, so, it needs to know whether to include the captions settings menu.
And all tracks should always be included in player.textTracks() and not just player.remoteTextTracks().
2017-03-07 13:53:57 -05:00
Gary Katsevman 88ee6af431 fix(subs-caps-button): add hide threshold to subs-caps button (#4171)
This is a followup from #4157 but for the subs-caps button.
2017-03-07 13:52:51 -05:00
Justin Anastos c611f9f358 fix(MenuButton): Unify behavior of showing/hiding (#4157)
Implement a `hideThreshold` property that defaults to 1 so
descendants can override it if necessary. Right now the only
descendant that will override will be `CaptionsButton` because
video.js adds a "captions settings" for emulated text tracks.
2017-03-07 11:28:00 -05:00
Gary Katsevman 2ee133f6f8 fix(subs-caps-button): captions items should hide icon from SR (#4158)
Move the CC icon in the SubsCapsMenuItem into an icon-placeholder span. Also, include that information for the screen reader.
In addition, only apply default sizing to icon-placeholder if they're direct descendants of a vjs-control.
2017-03-07 11:26:09 -05:00
Owen Edwards 5ffe1cd49e chore(sandbox): Fix poster image to match the video in the 'combined-tracks.html' example in sandbox (#4164) 2017-03-06 17:21:18 -05:00
Owen Edwards d9ec7bc1ba fix(audio-tracks-button): add wrapper CSS builder to audio tracks menu button (#4163) 2017-03-06 12:17:49 -05:00
Gary Katsevman e5af0a5e21 fix(subs-caps-button): add wrapper CSS builder to subs caps button (#4156) 2017-03-02 17:53:57 -05:00
Gary Katsevman db901c54d9 fix(text track settings): focus subs-caps button if exists over CC button (#4155) 2017-03-02 17:53:47 -05:00
mister-ben 74eb5d4772 feat: Combine captions and subtitles tracks control (#4028) 2017-03-02 15:23:41 -05:00
Gary Katsevman f95815bcd0 chore(tests): make tests not print out errors (#4141) 2017-03-02 15:22:59 -05:00
Gary Katsevman 61d427c7ee fix: add buildWrapperCSSClass methods to all menu buttons (#4147)
In #4034, we changed the way that menu buttons work slightly by introduction a wrapper element with a separate wrapper css builder. However, this broke, at least the playback-rate menu.
This PR adds a buildWrapperCSSClass to each of our menu buttons.
2017-03-02 15:04:35 -05:00
Gary Katsevman a9f8fcb2a2 fix(playback rate menu): playback rate menu items should be selectable (#4149) 2017-03-02 14:55:36 -05:00
greenkeeper[bot] 5265624410 fix(package): update xhr to version 2.4.0 (#4101)
https://greenkeeper.io/
2017-03-02 14:52:02 -05:00
Brandon Casey fb88ae2bfc fix(dom): getBoundingClientRect check that el is defined (#4139)
Verify that el is defined so that we don't throw if we get to this function with an undefined el
2017-03-02 14:51:19 -05:00
Brandon Casey a2b1a33606 fix: cues at startTime 0 do not fire (#4152)
Previously timeupdate would fire before the video was playing, and the tech was not ready. This caused issues when preload was set to auto, because cuechange would fire before the video was even started for cues with a startTime of 0.

Wait for tech to be ready before watching for timeupdate
update unit tests to use TechFaker
Add a unit test to verify that we wait for Tech to be ready.
2017-03-02 14:35:45 -05:00
greenkeeper[bot] 9ef2d07b41 chore(package): update remark-lint to version 6.0.0 (#4129)
https://greenkeeper.io/
2017-03-02 12:00:32 -05:00
greenkeeper[bot] 139567738f chore(package): update remark-validate-links to version 6.0.0 (#4128)
https://greenkeeper.io/
2017-03-02 11:59:32 -05:00
greenkeeper[bot] d5a619d10e chore(package): update remark-toc to version 4.0.0 (#4127)
https://greenkeeper.io/
2017-03-02 11:58:20 -05:00
greenkeeper[bot] dc9ed1cf5f chore(package): update remark-cli to version 3.0.0 (#4126)
https://greenkeeper.io/
2017-03-02 11:58:04 -05:00
Pat O'Neill 326398d312 feat: don't throw when re-registering a plugin unless it's a player method (#4140) 2017-03-02 11:17:42 -05:00
Gary Katsevman 0f57341e38 fix(cues): only copy cue props that don't exist (#4145) 2017-03-02 11:16:12 -05:00
Owen Edwards dacf0ca133 chore: change accessibility test in grunt.js to remove unnecessary warning message. (#4143) 2017-03-02 11:15:49 -05:00
Gary Katsevman 3bbf0199e6 fix: early play should wait for player ready, even if source is available (#4134)
Fixes #4057
2017-03-02 11:15:06 -05:00
Gary Katsevman 6874fa2824 chore: increase browserstack/karma timeouts, dispose player in tests (#4135)
Increase timeout because IE8 can take more than 5 minutes to run.
Increase browser disconnect timeout so that browsers that succeed but don't report back to karma don't fail the build.
Make webpack more quiet.
Dispose players created in hooks tests which also increase stability.
2017-02-28 15:02:18 -05:00
Owen Edwards 715f5847da chore(sandbox): Use Elephants Dream video files from CDN for the sandbox/descriptions.html.example. (#4137) 2017-02-27 13:53:32 -05:00
Gary Katsevman 96a387f723 feat: update videojs-vtt.js and wrap native cues in TextTrack (#4115)
Update videojs-vtt.js and don't auto-export its versions of VTTCue globally.
When our TextTrack object is given a cue, if it's a native cue, wrap it in our emulated vttjs.VTTCue.

Fixes #4093.
2017-02-27 13:52:01 -05:00
Gary Katsevman f558648f44 6.0.0-RC.3 2017-02-22 14:56:33 -05:00
Lionel 8c1302ee34 feat(lang): French translation update (#4118) 2017-02-22 14:25:53 -05:00
Brandon Casey 4388beae91 feat: add a controlText function to MenuButton (#4125) 2017-02-22 14:25:23 -05:00
Gary Katsevman 576ac19214 fix: addChild instance names should be toTitleCased (#4116) 2017-02-22 14:00:15 -05:00
Gary Katsevman db0112053f feat: allow tokens in localize, localize progress bar time (#4060)
It allows you to use string as an key for the language files but have a default value that's different. In this case, we have a key of progress bar timing: currentTime={1} duration={2} which is used so that we have a descriptive key to what is happening. The default value matches that default value in en.json: {1} of {2}. The reason for the default value is so that the translation uses {1} of {2} for the actual localization without requiring en.json to be included in videojs by default.

Fix #4024.
2017-02-21 16:17:00 -05:00
Gary Katsevman 1f7a842348 fix: trap tab focus in modal when hitting s-tab (#4075)
Pretend that the modal dialog is equivalent to the first
focusable/tabbable element when hitting shift-tab.

Fix #4049
2017-02-21 16:07:22 -05:00
Gary Katsevman 0d0dea4da8 feat: fix accessibility of the captions setting dialog (#4050)
This fixes a lot of the issues from #2746 by making the dialog inherit from our actual ModalDialog which now has tab focus trapping.

The Captions Settings dialog has some accessibility issues:
- Field labels and fields are not explicitly associated
- Keyboard focus does not move into the dialog when it is opened
- Keyboard focus is not trapped inside the dialog while it is open
- Keyboard focus does not return to the control which opened the dialog when it is closed
- The extent (top and bottom) of the dialog is not indicated to screen readers
- The dialog cannot be closed with the Esc key
- The meaning of '---' in the select fields is not clear
- The control to close the dialog is labeled "Done" rather than "Close"
- The purpose of the "Defaults" button may not be obvious, and its effect may not be apparent to screen reader users
- Focus highlighting (outline) on the Default and Done buttons is *very* hard to see
- Pressing the Done button doesn’t seem to have the same effect as pressing the Close (x) button; does it trigger the same focus movement
- This requirement to move it back to the triggering element is tricky, since clicking on that item in the CC menu dismisses the CC menu. I need to think about this a little more - either the menu should open again, or the focus should go to the main CC Menu Button
- The focus outline on the whole dialog goes too far to the left (all the way to the edge of the video window, not just to the edge of the dialog)

Fixes #2746.
2017-02-21 15:58:04 -05:00
Kevin Litchfield 181a19f5fd fix: Muting with MuteToggle sets ARIA value of VolumeBar to 0 (#4099)
Currently, the ARIA value of VolumeBar tracks the value of volume. It should instead track the position of the slider on VolumeBar, which tracks volume except when the player is muted, in which case it's 0.

Fixes #4064.
2017-02-21 15:53:56 -05:00
mister-ben 1cb0a97b0b fix: Do not create element for MediaLoader (#4097)
MediaLoader has a div that's unnecessary. See #4070. Also, make sure that Component#dispose does a null check for the element.
2017-02-21 15:50:52 -05:00
Brandon Casey 127cd7827e fix: copy basic plugin properties onto the wrapper (#4100)
Copy basic plugin properties to prevent breaking older basic plugins.
2017-02-21 15:49:42 -05:00
mister-ben 405b29b8f1 fix: remove redundant Html5#play()
play() is defined twice in Html5. The promise handling in the earlier one was moved into Player#play().
2017-02-21 15:48:45 -05:00
Brandon Casey e1b48042dd fix: synchronously shim vtt.js when possible (#4083) 2017-02-21 12:03:17 -05:00
Kevin Litchfield a04f387a72 refactor: MuteToggle#update (#4058) 2017-02-17 12:34:51 -05:00
forbesjo 0da93249d3 fix: make mergeOptions behave the same across browsers (#4088)
* Make an object util function `keys` return an empty array for non objects
* Use that function in object utils instead of `Object.assign`
2017-02-16 16:55:54 -05:00
Brian Wells caff93fbf0 fix(sass): import path has cwd once again (#4061) 2017-02-15 15:44:00 -05:00
mister-ben 65dc81a4e1 docs: Add MediaLoader to components list (#4070) 2017-02-15 15:30:03 -05:00
Lionel 55408683fb fix: Solve a typo in translation files (#4063)
"subititles settings" ->"subtitles settings"
2017-02-15 15:27:17 -05:00
Lionel dc4c1eb88b fix: improve French translation (#4062)
Improved translation of "Casual"
2017-02-15 15:26:24 -05:00
Kevin Litchfield 3c1108c5dc fix: Set MuteButton controlText correctly (#4056) 2017-02-15 15:23:47 -05:00
typicode c3b1d689f6 chore: switch from ghooks to husky (#4074) 2017-02-15 15:22:50 -05:00
mister-ben 17143fd9fe fix: Add lang attribute to player el, so that css :lang() is correct (#4046) 2017-02-15 15:22:10 -05:00
Davy Tran 7ab52d1a59 docs: replace 'autoPlay' by 'autoplay' (#4080)
Fix #3995
2017-02-14 10:41:58 -05:00
Prayag Verma 2433915c64 docs(guides): fix typos in faq guide (#4067)
offical > official
2017-02-12 11:39:31 -05:00
Gary Katsevman 0ac126935a fix: localize aria-labels (#4027)
Fixes #2728.
2017-02-08 17:29:32 -05:00
Gary Katsevman eddc1d71a3 feat: modal dialog accessibility updates (#4025)
If the modal dialog was opened and the focus was preset inside the
player, move the focus to the modal dialog.
When the modal dialog is closed, move the focus back to the previously
active element.
When focus is inside the dialog, trap tab focus. This was inspired by https://github.com/gdkraus/accessible-modal-dialog and ally.js.
2017-02-08 17:29:05 -05:00
Owen Edwards 1b1ba04271 fix: fix the structure of elements in menus to comply with ARIA requirements (#4034)
Fix the structure of elements in menus so that actionable elements are not children of actionable elements, as required by ARIA.
Remove unnecessary aria-labels on menus.
2017-02-08 01:24:30 -05:00
Owen Edwards 6208e4bc72 chore: only report errors during linting in the build process, not warnings (#4041) 2017-02-08 01:16:06 -05:00
Gary Katsevman 3aa79ae9b1 6.0.0-RC.2 2017-02-06 15:58:22 -05:00
Brandon Casey 6541467ad8 fix: support empty src in Player#src (#4030)
Remove some unnecessary code. Filter the input to remove empty objects and what not.
2017-02-06 15:48:38 -05:00
mister-ben 0fc2c1c7a4 docs(guides): fix typos in functions guide (#4035) 2017-02-06 14:41:57 -05:00
Pat O'Neill be27f2aa6e fix: Progress holder gaps cause tooltips misalignment and time tooltip outlines (#4031)
* Address #3645 by using pixel margins
* Fix outlines

Fixes #3645
2017-02-03 16:43:56 -05:00
Gary Katsevman 5748c360af feat: wrap menu item text in a span (#4026)
Fix #4017
2017-02-03 16:35:30 -05:00
mister-ben e176b56843 feat: Expose Tech#resize event as Player#resize (#3979)
Rename Component's resize event to `componentresize` and trigger the Html5 specced resize event on the player.
2017-02-03 16:32:41 -05:00
RevinKey 70d2eb10cf feat(lang): update es.json (#3984) 2017-02-03 16:31:23 -05:00
Gary Katsevman 516c9f9362 feat: toggle playback with space when focused on seekbar (#4005) 2017-02-03 16:31:03 -05:00
Gary Katsevman 4f79e1e299 fix: focus play toggle from Big Play Btn on play (#4018)
If the control bar and playtoggle exist, focus the playtoggle after
triggering play via the keyboard from the Big Play Button.
If the control bar isn't available, then focus the player element.
If play() returns a promise, wait until it resolves to focus,
otherwise, use a setTimeout.

Fixes #2729
2017-02-03 16:30:49 -05:00
Pat O'Neill 60bcc99302 fix: Disable all time tooltips in IE8, as they are broken (#4029) 2017-02-03 13:26:05 -05:00
Brandon Casey da2a1e07f4 fix: accessibility bugs with the VolumeBar (#4023)
* Fixes #4021: drop the decimal places on aria-valuenow and aria-valuetext
* Fixes #4022: aria-valuenow and aria-valuetext not set initially
2017-02-02 15:17:15 -05:00
Owen Edwards 04f23c1a62 fix: disable title attribute on menu items (#4019)
Prevents a title attribute from being applied to MenuItems.
MenuItem indicates to ClickableComponent that the control is not just an icon, so it shouldn't have a title attribute.

Fixes #3699
2017-02-02 14:45:39 -05:00
Gary Katsevman 29c6141de9 feat: allow seeking in full height of progress control (#4004) 2017-02-02 14:42:34 -05:00
Brandon Casey a8f2e43274 feat: videojs.getTech works with TitleCase or camelCase names (#4010)
* Fixes #3986 
* update `techOptions` to look for `TitleCase`/`camelCase` user tech options
* remove deprecated usage of Tech as Component
* add a unit test to verify that registerTech works
* change defaultTech_ to defaultTechOrder_
2017-02-02 14:34:33 -05:00
Brandon Casey fcb5aa8383 test: add tests for obj.assign util (#4014) 2017-02-02 11:26:45 -05:00
Kevin Litchfield 2da4e76ef0 docs: Expand testing info in CONTRIBUTING.md (#4020) 2017-02-02 11:19:01 -05:00
Gary Katsevman 6ad1e5c97b docs: fixup global jsdoc members (#4015) 2017-02-02 11:07:34 -05:00
Brandon Casey 49496195ed chore: Add flash as a dev dependency for testing (#4016)
Add videojs-flash to devDependencies and update sandbox examples to use flash
2017-02-01 17:21:44 -05:00
Gary Katsevman 24d2e7ba33 fix: hide font-icons from assitive technology (#4006)
Wrap font-icons in a span with aria-hidden=true on it.

Fixes #3982.
2017-02-01 14:53:43 -05:00
Gary Katsevman 5bde16a1bc test(ie8): only run mute toggle tests in html5 env (#4003)
IE8 can't run the html5 tech and the mute toggle tests rely on a working
volume and mute functionality which tech faker does not have. Instead of
implementing it in tech faker, skip it on non-html5 environments.
2017-01-31 17:15:56 -05:00
Kevin Litchfield cb42fcfb02 feat: unmute goes back to previously selected volume (#3942)
If a user changed the volume to zero either via the mouse or keyboard, clicking unmute will now restore the volume back to this last position. Previously, the mute and volume values were completely not linked.

Fixes #3909.
2017-01-31 15:29:07 -05:00
Gary Katsevman 5b8b41e546 chore(package): pin karma to 1.3.0 (#4002)
Karma 1.4.0 indavertantely broke IE8 when updating socket.io.
This pins karma to 1.3.0 a version that is known to work on IE8.

See https://github.com/karma-runner/karma/issues/2556
See https://github.com/socketio/socket.io-client/issues/1063
2017-01-31 15:22:03 -05:00
Gary Katsevman f87ada1ee0 fix: allow changing volume in full height of volume control (#3987)
* allow changing volume in full height of volume control
* make volume control have pointer cursor
2017-01-31 15:11:26 -05:00
Gary Katsevman 19b429bddc fix(sass): import path no longer has cwd (#4001)
node-sass updated to remove the cwd from import paths.

Fix #3998
2017-01-31 15:10:31 -05:00
Gary Katsevman c8f5e3a3fc 6.0.0-RC.1 2017-01-30 14:51:09 -05:00
Gary Katsevman 22aade1b61 fix: updating time tooltips when player not in DOM (#3991)
If the time tooltips try to update when the player isn't in the DOM,
they error out because the bounding rects for the player will not be available.
This does a null check and exists early.
2017-01-30 11:43:14 -05:00
Gary Katsevman e34335b012 fix: EventTarget is also evented (#3990)
If you try to delegate an to an EventTarget from an evented component, you'll end up failing because it didn't think that an EventTarget object worked. But it should and does. This adds a check for it in the isEvented function.
2017-01-30 11:41:46 -05:00
Brandon Casey 866a3f37d8 fix: remaining time display width on IE8 and IE9 (#3983)
vjs-no-flex environments like IE8 and IE9 don't work properly with width: auto.
2017-01-27 17:40:03 -05:00
Altay 37a6811fb6 feat(lang): Update tr.json (#3989) 2017-01-27 15:29:39 -05:00
Gary Katsevman 03529163b6 feat: Update MW to require a factory, add *-mw (#3969)
Middleware registration now only accept a factory method which takes a player reference and returns some object that represents the middleware with the various methods on it.
Also, add a use to register a middleware for all types.
2017-01-27 15:09:27 -05:00
Gary Katsevman 2e2ac6f870 refactor: move most volume panel functionality into css state (#3981) 2017-01-27 15:08:20 -05:00
Pat O'Neill 4979ea78d5 fix: Patch a memory leak caused by un-removed track listener(s). (#3976) 2017-01-27 14:56:43 -05:00
Brandon Casey 3585af0fe2 fix: Make Player#techCall_() synchronous again (#3988) 2017-01-27 14:35:00 -05:00
Pat O'Neill d7d7cfeb9f feat: Stateful Components (#3960)
Advanced plugins introduced the concept of mixins and added two: evented and stateful.
This provides Components with the benefits of the stateful mixin
2017-01-26 22:04:34 -05:00
Pat O'Neill 4c3b60c3b6 refactor: Evented Components (#3959)
Advanced plugins introduced the concept of mixins and added two: evented and stateful.
This refactors Component to use the evented mixin, granting it event broadcast/handling capabilities.
2017-01-26 20:53:53 -05:00
Brandon Casey c2545ddb6d feat: make registerTech add that tech to the default techOrder (#3985) 2017-01-26 17:13:27 -05:00
Julien Bouquillon 05b39fe281 docs(guides): Add a basic ReactJS guide and update the FAQ (#3972) 2017-01-26 16:16:52 -05:00
Pat O'Neill 7b0d738e8f docs(guide): Add a ModalDialog guide (#3961) 2017-01-25 17:27:01 -05:00
mister-ben 8e7d8cc959 feat: localize all strings in captions settings (#3974) 2017-01-25 13:54:21 -05:00
Dinis Correia 8888e2b5b5 feat(lang): add European Portuguese translation (#3955) 2017-01-24 15:03:05 -05:00
ngoisaosang 1463e50f7b feat(lang): update Vietnamese lang file (#3964) 2017-01-24 15:00:19 -05:00
mister-ben a0ba8e2360 feat(lang): DE and FR translations of replay (#3963) 2017-01-24 14:58:30 -05:00
greenkeeper[bot] 924fb279ee chore(package): update xhr to version 2.3.3 (#3914)
https://greenkeeper.io/
2017-01-24 12:06:18 -05:00
Gary Katsevman e642295468 docs(jsdoc): introduce a jsdoc template and build on publish (#3910)
Use the TUI JSDoc Template to generate the jsdoc files. Also, build this out on publish.
2017-01-24 11:26:39 -05:00
Brandon Casey de3945db15 docs: ran npm run docs:fix to update TOC on guides (#3971) 2017-01-23 16:26:04 -05:00
Brandon Casey 58f2349302 docs: fix broken links to guides in the faq (#3973) 2017-01-23 16:25:58 -05:00
Gary Katsevman e3424f6a4d 6.0.0-RC.0 2017-01-19 17:48:24 -05:00
Gary Katsevman 34aab3f357 feat: middleware (#3788)
Add middleware support. Middleware can function as go-between between the player and the tech. For example, it can modify the duration that the tech returns to the player. In addition, middleware allow for supporting custom video sources and types.

Currently, middleware can only intercept timeline methods like duration, currentTime, and setCurrentTime.

For example,
```js
videojs.use('video/foo', {
  setSource(src, next) {
    next(null, {
      src: 'http://example.com/video.mp4',
      type: 'video/mp4'
    });
  }
});
```
Will allow you to set a source with type `video/foo` which will play back `video.mp4`.

This makes setting the source asynchronous, which aligns it with the spec a bit more. Methods like play can still be called synchronously on the player after setting the source and the player will play once the source has loaded.

`sourceOrder` option was removed as well and it will now always use source ordering.

BREAKING CHANGE: setting the source is now asynchronous. `sourceOrder` option removed and made the default.
2017-01-19 17:29:09 -05:00
Brandon Casey b387437aed feat: remove flash tech (#3956)
Remove Flash Tech from core. Use videojs-flash if flash is needed.
Also, update DOM method names.

BREAKING CHANGE: remove flash tech from core.
2017-01-19 16:01:56 -05:00
Brandon Casey 524f868e31 feat(volume panel): accessibly volume control (#3957)
Internally uses the VolumeControl and MuteToggle components to create the VolumePanel component. Acts like the old VolumeMenuButton but does not have the screen reader issues of the older version.

BREAKING CHANGE: remove VolumeMenuButton, introduce a new default volume control: VolumePanel.
2017-01-19 15:54:47 -05:00
Pat O'Neill 1ba1f5aabd feat: Time Tooltips (#3836)
Switch to `keepTooltipsInside` by default and simplify DOM structure around the time tooltips and progress control.

BREAKING CHANGE: removal of `keepTooltipsInside` option.
2017-01-19 15:30:47 -05:00
Brandon Casey 49bed07039 refactor: unify all Track and TrackList APIs (#3783)
Unify all track-related usage internally.

BREAKING CHANGE: some externally accessibly functions for tracks are now private.
2017-01-19 15:16:28 -05:00
Gary Katsevman 7bafcc2a55 test: fix tests (#3953)
* Switch to es3 preset for babel so that it runs last. Plugins run before presets and presets run in reverse order. Also, we ran into a weird bug in babel that causes `default` not to be quoted in some cases (https://github.com/babel/babel/issues/4799) which we've worked around here.
* Restore the es-shims for tests and the ie8 fallback script.
* Do a null-check around `Player.players`.
* use more round fractions (like 0.5 and 1) to avoid rounding issues.
2017-01-19 11:17:46 -05:00
Brandon Casey 2037e18235 feat(player): add played(), defaultMuted(), defaultPlaybackRate() (#3845)
Add `played()`, `defaultMuted()` and `defaultPlaybackRate()` methods to the player.

Fixes #523.
2017-01-18 14:59:15 -05:00
Pat O'Neill 8d1653aebc feat: Advanced Class-based Plugins for 6.0 (#3690) 2017-01-18 01:52:23 -05:00
Brandon Casey 8f07f5d57c refactor: Remove method Chaining from videojs (#3860)
Remove method chaining from videojs. This helps keep the methods consistent especially since play() now returns a Promise in some cases. Also, it can add some performance benefits.

BREAKING CHANGE: player methods no longer return a player instance when called. Fixes #3704.
2017-01-18 01:50:22 -05:00
mrocajr 0bba3196d8 chore: Remove component.json and remove references to it (#3866)
Remove component.json and references to it in grunt.js because component is no longer maintained.

BREAKING CHANGE: removal of component.json
2017-01-18 01:48:55 -05:00
Brandon Casey 091bdf9261 feat: Return the native Promise from play() (#3907)
Return the native Promise from `play()` if it exists. `undefined` is returned otherwise.
This comes in as part of the greater effort to remove method chaining.

BREAKING CHANGE: `play()` no longer returns the player object but instead the native Promise or nothing.
2017-01-18 00:53:11 -05:00
Pat O'Neill 29ffbfbc87 feat: Restore all outlines for greater accessibility (#3829)
Restore all outlines on components that are focusable to increase accessibility of these components.

BREAKING CHANGE: restoring the outlines changes the skin slightly and potentially break users. Fixes #3200.
2017-01-18 00:49:12 -05:00
Pat O'Neill 57af15ce8b refactor: Make registerComponent only work with Components (#3802)
Prevent techs (and others) from being registered via registerComponent.
* `registerComponent` now throws if given an object that is not a subclass of Component (or Component itself).
* `registerComponent` now throws if given a non-empty string as its name argument.

BREAKING CHANGE: registerComponent now throws if no name or not a component is passed in.
2017-01-18 00:46:43 -05:00
mrocajr ce6acc832a feat: Replay at ended (#3868)
Made the play button turn into a replay button at the end of the video.
Updated the translations needed docs with "replay".
2017-01-18 00:41:43 -05:00
Gary Katsevman 8622b2648e refactor: expose tech but warn without safety var (#3916)
`Player#tech` can now be called without passing an object into it. It no longer requires passing an object into it, so, current code will not break.
If nothing is passed in, a warning will be logged about knowing what you're doing. If anything is passed in, the warning is silenced.
2017-01-18 00:40:24 -05:00
Brandon Casey 73b6316f3b refactor: remove special loadstart handling (#3906)
This is both a change as well as a bug fix. We tried to have better awareness of when the underlying video element changed underneath us so we can dispose of the source handler but that broke some use cases of MSE. Given that we weren't able to fix it in a reasonable non-breaking and non-invasive solution, we're taking it out.

BREAKING CHANGE: remove the double loadstart handlers that dispose the tech/source handlers if a secondary loadstart event is heard.
2017-01-18 00:38:31 -05:00
Pat O'Neill 844e4f0107 feat: Log Levels (#3853)
Add a log levels and history api: `videojs.log.level()` and `videojs.log.history()`.
`.level()` will return the current level and you can also set it to be one of: `all`, `error`, `off`, or `warn`.
`.history()` will return a list of all things logged since videojs loaded. It can be disabled via `videojs.log.history.disable()` (and re-enabled with `enable()`) as well as cleared with `videojs.log.history.clear()`.
2017-01-18 00:35:42 -05:00
Brandon Casey b07143d276 refactor: do not allow adding children with options passed in as a boolean (#3872)
This has been deprecated throughout 5.0 and being removed. To include a child, you must use an object  or false to exclude it. true will no longer be supported.

BREAKING CHANGE: remove ability to add children with options as a boolean.
2017-01-18 00:31:34 -05:00
Pat O'Neill e12bedbb45 refactor: Remove TimeRanges without an index deprecation warning (#3827)
This aligns the methods with the spec.

BREAKING CHANGE: removing ability to use TimeRange methods without an index.
2017-01-18 00:29:27 -05:00
Pat O'Neill c340dbcccd refactor: Buttons will always use a button element (#3828)
BREAKING CHANGE: button component will always use a button element.
2017-01-18 00:28:01 -05:00
Pat O'Neill 20141202c1 refactor: Remove custom UMD (#3826)
Only use `module.exports` for better compatibility between bundlers and module systems.
2017-01-18 00:27:00 -05:00
Pat O'Neill 5377ffc176 refactor: Remove unused defaultVolume option default (#3915) 2017-01-18 00:26:10 -05:00
Pat O'Neill f8aed4dc32 refactor: Remove deprecated features of extend/Component#extend (#3825)
This removes the Component.extend() method entirely, which has been deprecated since 5.0. Additionally, it removes the deprecated support for an init method in videojs.extend().

BREAKING CHANGE: remove deprecated features.
2017-01-18 00:25:14 -05:00
222 arquivos alterados com 27778 adições e 6470 exclusões
+6 -2
Ver Arquivo
@@ -1,4 +1,8 @@
{
"presets": [ ["es2015", {"loose": true}] ],
"plugins": ["transform-es3-property-literals", "transform-es3-member-expression-literals", "inline-json"]
"presets": [
"es3",
["es2015", {
"loose": true
}]
]
}
+1 -1
Ver Arquivo
@@ -10,7 +10,7 @@ test/*.map
.s3config.json
node_modules
npm-debug.log
npm-debug.log*
sandbox/*
!sandbox/*.example
+36 -1
Ver Arquivo
@@ -1,6 +1,41 @@
{
"source": {
"include": [ "src/js/" ],
"includePattern": ".js$"
},
"opts": {
"destination": "docs/api",
"readme": "docs/index.md",
"template": "node_modules/tui-jsdoc-template",
"package": "package.json",
"recurse": true,
"tutorials": "docs/guides",
"encoding": "utf8"
},
"templates": {
"default": {
"staticFiles": {
"include": ["build/docs/"]
}
},
"logo": {
"url": "http://videojs.com/img/logo.png",
"height": "30px",
"width": "214px"
},
"name": "Video.js Documentation",
"tabNames": {
"tutorials": "Guides"
},
"footerText": "<span class='copyright'><a href='http://videojs.com'>Video.js</a> is a free and open source HTML5 video player. © <a href='https://brightcove.com' target='_blank'>Brightcove, Inc</a>. <a href='https://github.com/videojs/video.js/blob/master/LICENSE' class='button blue' target='_blank'>View license</a></span> <ul class='other-links'><li><a href='http://videojs.com' class='button white'><i class='fa fa-external-link'></i> Video.js</a></li> <li><a href='https://twitter.com/videojs' class='button white' target='_blank'><i class='fa fa-twitter'></i> @videojs</a></li> <li><a href='http://github.com/videojs/video.js' class='button white' target='_blank'><i class='fa fa-github-alt'></i> Source</a></li> </ul>",
"css": [
"styles/videojs.css",
"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.css"
]
},
"plugins": ["plugins/markdown"],
"markdown": {
"tags": ["example"]
"tags": ["example"],
"idInHeadings": true
}
}
+1
Ver Arquivo
@@ -3,3 +3,4 @@
!dist/**
!es5/**
!src/css/**
!docs/api/**
+11 -1
Ver Arquivo
@@ -2,9 +2,13 @@ language: node_js
node_js:
- 4.4
before_install:
- export CHROME_BIN=chromium-browser
- export CHROME_BIN=/usr/bin/google-chrome
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
after_failure:
- npm ls --depth=1
after_success:
- npm run assets
notifications:
irc:
channels:
@@ -13,6 +17,8 @@ notifications:
on_success: never
webhooks:
- http://pam.videojs.com/savage/travis
slack:
secure: LrF8K6mCYWlUt6SvdbGHazyQZSk/opKoiB/wgoGYaGc9+3wYXkVexY0WkO1m6wBKhUqXRAMVMFszr1wqKgdcxtItmFMMj8HqTLI1MVqgKqYX4Ux3CnEHJQiwxIk0aVL7lHLsZTXV/2Y0QIOYmAnCrgy46klETrk0ZuXf5okpu2Q=
env:
global:
- secure: K6JpKwMkfNaJix3Bb0tLjVMzHMJgtBXdd/dvfw1BMb9DCBpd81PqXbDs7yXCddUxnUPTBPxZCrQgWsw71Wn+qEoIG5MU3uOT5A2rBbx/yZonVAGv5ed/9w0xk0OzO383CmPMFqwqtp9YmdmqGjQBkYXVXJjTvNTOAExFSdhO+3U=
@@ -20,8 +26,12 @@ env:
- secure: gglh7xDnURKfXp9T543DD7NG1pQ8HeWh1XtRspBAwr0H7RqJBVDqqODSYSPRFhfld7M6sYmvQIXgil7XlyefnKNTXqCarvaoTg3lbip8kSltXMiNw2V6AVpsQGuja7+XbaM0do70ETTKjW4Kw6wnxEHb78BvGN/hXIeqizUAjanlDAjd7fouaxpTBIbMESe2rI+WRHPis1cmnv8v70Mrh/8Un/NO4gkebGyvA47LTDNIaVqIVjonsndr8WjMv1/PNxQ8LyCO6D64MufrobS7Sec+VuN30apwEsBw8v82MK/MZ3qXu0lUp4+ERTbuc/rymh2wDFTQeG20Kf/NTauSaH6f414KNzIRFj0/xyLAzVZKIscXM2DKXMuskkZuvHLZvaspnZWcPYTjPZl0P88N0RBqnoLdR80dR5bDljNwU2QnSBeol/q1wXNEr6I1VTRFOB+qsHrD1blVMB1I5W3I0ti1aQ7XtgMOGi1kcPb4oFcJdl+3dLFDnyRyaNfdMOnOZYBBHdQCo19Mj/L+nqPGWeeYiEAM6JsuhNjHn5Za5nGf1ztXTimVPOQjyATin0x9kST3soLWSVmdW2dBHUGDVSMhvoLLR+nKSdNQ0KfpqtgrzeLxoVnRYHVBlih41tapM9IG/6BMYnDMaRcc0i54YeUP4oxlxGSyASIenkAgC6w=
- secure: WtIEOSnqDkCZuTlBsxwlVwaRpVTbz7ol8+XSJIZb0aFo1lLisF9cz6s9WrAfX36MaxIcDN9LFZkpXzMvNrNkZWQa1kacGWH1rbx0SiiQ8LMweAcKdnZ5uXlSplBxbJ8bZfXKB1sIHsOsYw/vWhHKkcsDUkAEzQrIiMOhuoUV3s0uKM0knKXIAfNIF0EbDzLIojm+nm+F0n5vM60LRdKesaSt/o2p2LKxdZVoFGrg48D7bdA9VEfMWWRL/evDxJmnX4p+AjBc7mklqZ5F2pYsY6XXQuuS+2Sy+lnxz01kLg+RC4Cpv5dyYfK3h0j8KeyK8IuixycVONWVe9rANq8UaIsMrRN+6uDSC8zXiH4P+h6UDMm3jetc2ZyAfhBA8OyIs5QEShae2Rd7Y3WFJxBp6UVgyj6SkXGxrEdb1ZJgTTl4dyqiP0bYrLePNP2qSJ6OTfNdG791HF077uzXI96ABdMG54Wv9N9T/hmxKwV2Lajx/GZJMmHuwT9tkHKhkcxWea1HYam9QYSFUyJ5THfNk2A9u/r8DkL62MZ85zIQBisrlFjbPAGRejq6qyirBJPAy+FCjhM+oO/i2f2bGkkAfHGT0Og1BcrWVXs54yWdO7UZgie2F+Rmdwinb/GxebZJ+21ZQ4OkVr2t1Skr/PRni9+U7q/6xCLwUJgx45XJ0FE=
sudo: false
dist: trusty
cache:
directories:
- node_modules
addons:
firefox: latest
apt:
packages:
- google-chrome-stable
+523
Ver Arquivo
@@ -1,3 +1,526 @@
<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)
### Bug Fixes
* make boolean attributes set and check both the associated property and the attribute ([#4562](https://github.com/videojs/video.js/issues/4562)) ([d668c49](https://github.com/videojs/video.js/commit/d668c49)), closes [#4351](https://github.com/videojs/video.js/issues/4351)
* playback rate default text ([#4558](https://github.com/videojs/video.js/issues/4558)) ([a6b8425](https://github.com/videojs/video.js/commit/a6b8425))
* remove 'use strict' from rollup because vttjs isn't strict ([#4551](https://github.com/videojs/video.js/issues/4551)) ([db55bbd](https://github.com/videojs/video.js/commit/db55bbd))
* set width and height for vjs-button like the SubsCaps button ([#4548](https://github.com/videojs/video.js/issues/4548)) ([cd2f510](https://github.com/videojs/video.js/commit/cd2f510)), closes [#4547](https://github.com/videojs/video.js/issues/4547)
* **lang:** typos in ar.json ([#4528](https://github.com/videojs/video.js/issues/4528)) ([3e63bf3](https://github.com/videojs/video.js/commit/3e63bf3))
### Chores
* improve dev and beginner experience ([#4555](https://github.com/videojs/video.js/issues/4555)) ([19ebc0d](https://github.com/videojs/video.js/commit/19ebc0d))
* **package:** update grunt-babel to version 7.0.0 ([#4553](https://github.com/videojs/video.js/issues/4553)) ([f6f9998](https://github.com/videojs/video.js/commit/f6f9998))
* **package:** update grunt-browserify to version 5.1.0 ([#4565](https://github.com/videojs/video.js/issues/4565)) ([8c21f0a](https://github.com/videojs/video.js/commit/8c21f0a))
* **package:** update klaw-sync to version 3.0.0 ([#4544](https://github.com/videojs/video.js/issues/4544)) ([6233d14](https://github.com/videojs/video.js/commit/6233d14))
* **package:** update rollup to version 0.47.4 ([#4570](https://github.com/videojs/video.js/issues/4570)) ([d7f7e05](https://github.com/videojs/video.js/commit/d7f7e05)), closes [#4561](https://github.com/videojs/video.js/issues/4561)
### Documentation
* updates to faq, language guide, and minor edits ([#4556](https://github.com/videojs/video.js/issues/4556)) ([1f3375e](https://github.com/videojs/video.js/commit/1f3375e))
<a name="6.2.5"></a>
## [6.2.5](https://github.com/videojs/video.js/compare/v6.2.4...v6.2.5) (2017-07-26)
### Bug Fixes
* only change focus from BPB if not a mouse click ([#4497](https://github.com/videojs/video.js/issues/4497)) ([ee014e2](https://github.com/videojs/video.js/commit/ee014e2))
### Chores
* **greenkeeper:** ignore webpack and uglify ([#4518](https://github.com/videojs/video.js/issues/4518)) ([fe95a77](https://github.com/videojs/video.js/commit/fe95a77))
* **package:** update remark-cli to version 4.0.0 ([#4508](https://github.com/videojs/video.js/issues/4508)) ([7c80e13](https://github.com/videojs/video.js/commit/7c80e13))
* **package:** update remark-parse to version 4.0.0 ([#4507](https://github.com/videojs/video.js/issues/4507)) ([abb5d67](https://github.com/videojs/video.js/commit/abb5d67))
* **package:** update remark-stringify to version 4.0.0 ([#4506](https://github.com/videojs/video.js/issues/4506)) ([bbd92ab](https://github.com/videojs/video.js/commit/bbd92ab))
<a name="6.2.4"></a>
## [6.2.4](https://github.com/videojs/video.js/compare/v6.2.3...v6.2.4) (2017-07-14)
### Chores
* fix gh-release minimist call ([#4489](https://github.com/videojs/video.js/issues/4489)) ([07594bc](https://github.com/videojs/video.js/commit/07594bc))
<a name="6.2.3"></a>
## [6.2.3](https://github.com/videojs/video.js/compare/v6.2.2...v6.2.3) (2017-07-14)
### Chores
* **gh-release:** add prerelease flag and find right zip ([#4488](https://github.com/videojs/video.js/issues/4488)) ([b1ac2e0](https://github.com/videojs/video.js/commit/b1ac2e0))
<a name="6.2.2"></a>
## [6.2.2](https://github.com/videojs/video.js/compare/v6.2.1...v6.2.2) (2017-07-14)
### Bug Fixes
* **playback rate menu:** cycling rates via click ([#4486](https://github.com/videojs/video.js/issues/4486)) ([4f43616](https://github.com/videojs/video.js/commit/4f43616))
### Chores
* **build:** remove unused var in build/version.js ([#4458](https://github.com/videojs/video.js/issues/4458)) ([6986dbb](https://github.com/videojs/video.js/commit/6986dbb))
* add automatic github release ([#4466](https://github.com/videojs/video.js/issues/4466)) ([3a600d0](https://github.com/videojs/video.js/commit/3a600d0))
* switch to using chrome for testing PRs on travis ([#4462](https://github.com/videojs/video.js/issues/4462)) ([687aae5](https://github.com/videojs/video.js/commit/687aae5))
* **package:** update rollup to version 0.45.2 ([#4487](https://github.com/videojs/video.js/issues/4487)) ([971f633](https://github.com/videojs/video.js/commit/971f633)), closes [#4475](https://github.com/videojs/video.js/issues/4475)
### Documentation
* Fix Player#src API documentation. ([#4454](https://github.com/videojs/video.js/issues/4454)) ([7579fc1](https://github.com/videojs/video.js/commit/7579fc1))
* make jsdoc generate anchor names so ToC links work ([#4471](https://github.com/videojs/video.js/issues/4471)) ([03fd402](https://github.com/videojs/video.js/commit/03fd402))
### Tests
* add unit tests for player.duration() ([#4459](https://github.com/videojs/video.js/issues/4459)) ([1e80e59](https://github.com/videojs/video.js/commit/1e80e59))
<a name="6.2.1"></a>
## [6.2.1](https://github.com/videojs/video.js/compare/v6.2.0...v6.2.1) (2017-06-28)
### Bug Fixes
* auto-removal remote text tracks being removed when not supposed to ([#4450](https://github.com/videojs/video.js/issues/4450)) ([82c8b80](https://github.com/videojs/video.js/commit/82c8b80)), closes [#4403](https://github.com/videojs/video.js/issues/4403) [#4315](https://github.com/videojs/video.js/issues/4315)
* IE10 issue for disableOthers when property access results in "permission denied" ([#4395](https://github.com/videojs/video.js/issues/4395)) ([7f7ea70](https://github.com/videojs/video.js/commit/7f7ea70)), closes [#4378](https://github.com/videojs/video.js/issues/4378)
* player.duration() should return NaN if duration is not known ([#4443](https://github.com/videojs/video.js/issues/4443)) ([f5cc165](https://github.com/videojs/video.js/commit/f5cc165))
* Safari picture-in-picture triggers fullscreenchange ([#4437](https://github.com/videojs/video.js/issues/4437)) ([b636663](https://github.com/videojs/video.js/commit/b636663))
* Update translations to match correct string ([#4383](https://github.com/videojs/video.js/issues/4383)) ([e0824c8](https://github.com/videojs/video.js/commit/e0824c8))
* Use passive event listeners for touchstart/touchmove ([#4440](https://github.com/videojs/video.js/issues/4440)) ([b4dc4f8](https://github.com/videojs/video.js/commit/b4dc4f8)), closes [#4432](https://github.com/videojs/video.js/issues/4432)
### Chores
* **package:** update husky to version 0.14.1 ([#4444](https://github.com/videojs/video.js/issues/4444)) ([66a0d23](https://github.com/videojs/video.js/commit/66a0d23)), closes [#4436](https://github.com/videojs/video.js/issues/4436)
* **package:** update rollup to version 0.42.0 ([#4392](https://github.com/videojs/video.js/issues/4392)) ([f87b12c](https://github.com/videojs/video.js/commit/f87b12c))
* **package:** update rollup-watch to version 4.0.0 ([#4396](https://github.com/videojs/video.js/issues/4396)) ([4bce4a2](https://github.com/videojs/video.js/commit/4bce4a2))
* **sandbox:** Fix paths in sandbox files. ([#4416](https://github.com/videojs/video.js/issues/4416)) ([c4bbe5d](https://github.com/videojs/video.js/commit/c4bbe5d))
### Documentation
* Fix links in API docs for several Player events. ([#4427](https://github.com/videojs/video.js/issues/4427)) ([cc6e824](https://github.com/videojs/video.js/commit/cc6e824))
* Fixing player.remoteTextTracks jsdoc ([#4417](https://github.com/videojs/video.js/issues/4417)) ([9329e3e](https://github.com/videojs/video.js/commit/9329e3e))
* Update name of FullscreenToggle in documentation ([#4410](https://github.com/videojs/video.js/issues/4410)) ([9702155](https://github.com/videojs/video.js/commit/9702155))
### Performance Improvements
* Various small performance improvements. ([#4426](https://github.com/videojs/video.js/issues/4426)) ([77ba3d1](https://github.com/videojs/video.js/commit/77ba3d1))
<a name="6.2.0"></a>
# [6.2.0](https://github.com/videojs/video.js/compare/v6.1.0...v6.2.0) (2017-05-30)
### Features
* Persist caption/description choice over source changes in emulated tracks ([#4295](https://github.com/videojs/video.js/issues/4295)) ([188ead1](https://github.com/videojs/video.js/commit/188ead1))
* **lang:** Adding galician ([#4334](https://github.com/videojs/video.js/issues/4334)) ([2a26c7f](https://github.com/videojs/video.js/commit/2a26c7f))
* **lang:** Create sk.json ([#4374](https://github.com/videojs/video.js/issues/4374)) ([e5e1c7f](https://github.com/videojs/video.js/commit/e5e1c7f))
* **lang:** Update zh-CN.json ([#4370](https://github.com/videojs/video.js/issues/4370)) ([0c16c5f](https://github.com/videojs/video.js/commit/0c16c5f))
* Use Rollup to generate dist files ([#4301](https://github.com/videojs/video.js/issues/4301)) ([c31836c](https://github.com/videojs/video.js/commit/c31836c))
### Chores
* **package:** update grunt-contrib-cssmin to version 2.2.0 ([#4345](https://github.com/videojs/video.js/issues/4345)) ([d57f09f](https://github.com/videojs/video.js/commit/d57f09f))
* **package:** update videojs-flash to version 2.0.0 ([#4375](https://github.com/videojs/video.js/issues/4375)) ([9816070](https://github.com/videojs/video.js/commit/9816070))
* update translations needed ([#4380](https://github.com/videojs/video.js/issues/4380)) ([a5a68e8](https://github.com/videojs/video.js/commit/a5a68e8))
### Tests
* **TextTrackDisplay:** Removing incorrect test techOrder ([#4379](https://github.com/videojs/video.js/issues/4379)) ([eade52e](https://github.com/videojs/video.js/commit/eade52e))
<a name="6.1.0"></a>
# [6.1.0](https://github.com/videojs/video.js/compare/v6.0.1...v6.1.0) (2017-05-15)
### Features
* Add 'beforepluginsetup' event and named plugin setup events (e.g. 'pluginsetup:foo') ([#4255](https://github.com/videojs/video.js/issues/4255)) ([0a19cf0](https://github.com/videojs/video.js/commit/0a19cf0))
* add 'playsinline' player option ([#4348](https://github.com/videojs/video.js/issues/4348)) ([8d80a58](https://github.com/videojs/video.js/commit/8d80a58))
* Add a version class to the player ([#4320](https://github.com/videojs/video.js/issues/4320)) ([ae423df](https://github.com/videojs/video.js/commit/ae423df))
* Add getVideoPlaybackQuality API ([#4338](https://github.com/videojs/video.js/issues/4338)) ([483e5a2](https://github.com/videojs/video.js/commit/483e5a2))
* deprecate firstplay event ([#4353](https://github.com/videojs/video.js/issues/4353)) ([35df351](https://github.com/videojs/video.js/commit/35df351))
* remove playbackRate blacklist for recent Android Chrome ([#4321](https://github.com/videojs/video.js/issues/4321)) ([da0f1ee](https://github.com/videojs/video.js/commit/da0f1ee))
### Bug Fixes
* **package:** update global to version 4.3.2 ([#4291](https://github.com/videojs/video.js/issues/4291)) ([b5c60f3](https://github.com/videojs/video.js/commit/b5c60f3))
* only disable user-selection on sliders ([#4354](https://github.com/videojs/video.js/issues/4354)) ([cb6005e](https://github.com/videojs/video.js/commit/cb6005e))
* Only update text track mode if changed ([#4298](https://github.com/videojs/video.js/issues/4298)) ([3087830](https://github.com/videojs/video.js/commit/3087830))
* prevent dupe events on enabled ClickableComponents ([#4316](https://github.com/videojs/video.js/issues/4316)) ([03bab83](https://github.com/videojs/video.js/commit/03bab83)), closes [#4312](https://github.com/videojs/video.js/issues/4312)
* TextTrackButton on Safari and iOS ([#4350](https://github.com/videojs/video.js/issues/4350)) ([3dcfa95](https://github.com/videojs/video.js/commit/3dcfa95))
### Chores
* Fix examples and docs and some links ([#4279](https://github.com/videojs/video.js/issues/4279)) ([f773c47](https://github.com/videojs/video.js/commit/f773c47))
* typo soruce -> source ([#4307](https://github.com/videojs/video.js/issues/4307)) ([da1d861](https://github.com/videojs/video.js/commit/da1d861))
### Documentation
* **react-guide:** Use a React component as a VJS component ([#4287](https://github.com/videojs/video.js/issues/4287)) ([cff2e50](https://github.com/videojs/video.js/commit/cff2e50))
<a name="6.0.1"></a>
## [6.0.1](https://github.com/videojs/video.js/compare/v6.0.0...v6.0.1) (2017-04-13)
### Bug Fixes
* set IE_VERSION correctly for IE11 ([#4281](https://github.com/videojs/video.js/issues/4281)) ([1ea0041](https://github.com/videojs/video.js/commit/1ea0041)), closes [#4278](https://github.com/videojs/video.js/issues/4278)
* techOrder names can be camelCased. ([#4277](https://github.com/videojs/video.js/issues/4277)) ([92e5d9f](https://github.com/videojs/video.js/commit/92e5d9f))
### Chores
* **changelog:** Update CHANGELOG with v5 changes ([#4257](https://github.com/videojs/video.js/issues/4257)) ([c20ca5c](https://github.com/videojs/video.js/commit/c20ca5c))
* add slack travis notifications ([#4282](https://github.com/videojs/video.js/issues/4282)) ([7490a49](https://github.com/videojs/video.js/commit/7490a49))
* gitignore all npm-debug.log.* ([#4252](https://github.com/videojs/video.js/issues/4252)) ([083f643](https://github.com/videojs/video.js/commit/083f643))
### Documentation
* **component:** Replace VolumeMenuButton with VolumePanel in component tree ([#4267](https://github.com/videojs/video.js/issues/4267)) ([02721c7](https://github.com/videojs/video.js/commit/02721c7)), closes [#4266](https://github.com/videojs/video.js/issues/4266)
* add a Webpack usage guide ([#4261](https://github.com/videojs/video.js/issues/4261)) ([230743e](https://github.com/videojs/video.js/commit/230743e))
* remove mentions of bower support ([#4274](https://github.com/videojs/video.js/issues/4274)) ([39fd73f](https://github.com/videojs/video.js/commit/39fd73f))
<a name="6.0.0"></a>
# [6.0.0](https://github.com/videojs/video.js/compare/v5.16.0...v6.0.0) (2017-04-03)
### Features
* `videojs.getTech` works with `TitleCase` or `camelCase` names ([#4010](https://github.com/videojs/video.js/issues/4010)) ([a8f2e43](https://github.com/videojs/video.js/commit/a8f2e43)), closes [#3986](https://github.com/videojs/video.js/issues/3986)
* add a controlText function to MenuButton ([#4125](https://github.com/videojs/video.js/issues/4125)) ([4388bea](https://github.com/videojs/video.js/commit/4388bea))
* Advanced Class-based Plugins for 6.0 ([#3690](https://github.com/videojs/video.js/issues/3690)) ([8d1653a](https://github.com/videojs/video.js/commit/8d1653a))
* allow seeking in full height of progress control ([#4004](https://github.com/videojs/video.js/issues/4004)) ([29c6141](https://github.com/videojs/video.js/commit/29c6141))
* allow tokens in localize, localize progress bar time ([#4060](https://github.com/videojs/video.js/issues/4060)) ([db01120](https://github.com/videojs/video.js/commit/db01120)), closes [#4024](https://github.com/videojs/video.js/issues/4024)
* Combine captions and subtitles tracks control ([#4028](https://github.com/videojs/video.js/issues/4028)) ([74eb5d4](https://github.com/videojs/video.js/commit/74eb5d4))
* don't throw when re-registering a plugin unless it's a player method ([#4140](https://github.com/videojs/video.js/issues/4140)) ([326398d](https://github.com/videojs/video.js/commit/326398d))
* Expose Tech#resize event as Player#resize ([#3979](https://github.com/videojs/video.js/issues/3979)) ([e176b56](https://github.com/videojs/video.js/commit/e176b56))
* **lang:** Update tr.json ([#3989](https://github.com/videojs/video.js/issues/3989)) ([37a6811](https://github.com/videojs/video.js/commit/37a6811))
* fix accessibility of the captions setting dialog ([#4050](https://github.com/videojs/video.js/issues/4050)) ([0d0dea4](https://github.com/videojs/video.js/commit/0d0dea4)), closes [#2746](https://github.com/videojs/video.js/issues/2746) [#2746](https://github.com/videojs/video.js/issues/2746)
* localize all strings in captions settings ([#3974](https://github.com/videojs/video.js/issues/3974)) ([8e7d8cc](https://github.com/videojs/video.js/commit/8e7d8cc))
* Log Levels ([#3853](https://github.com/videojs/video.js/issues/3853)) ([844e4f0](https://github.com/videojs/video.js/commit/844e4f0))
* make `registerTech` add that tech to the default `techOrder` ([#3985](https://github.com/videojs/video.js/issues/3985)) ([c2545dd](https://github.com/videojs/video.js/commit/c2545dd))
* Make pause on open optional for ModalDialog via options ([#4186](https://github.com/videojs/video.js/issues/4186)) ([90030d5](https://github.com/videojs/video.js/commit/90030d5))
* **lang:** update Vietnamese lang file ([#3964](https://github.com/videojs/video.js/issues/3964)) ([1463e50](https://github.com/videojs/video.js/commit/1463e50))
* Make text tracks settings more responsive ([#4236](https://github.com/videojs/video.js/issues/4236)) ([9274457](https://github.com/videojs/video.js/commit/9274457))
* middleware ([#3788](https://github.com/videojs/video.js/issues/3788)) ([34aab3f](https://github.com/videojs/video.js/commit/34aab3f))
* modal dialog accessibility updates ([#4025](https://github.com/videojs/video.js/issues/4025)) ([eddc1d7](https://github.com/videojs/video.js/commit/eddc1d7))
* remove flash tech ([#3956](https://github.com/videojs/video.js/issues/3956)) ([b387437](https://github.com/videojs/video.js/commit/b387437))
* Replay at ended ([#3868](https://github.com/videojs/video.js/issues/3868)) ([ce6acc8](https://github.com/videojs/video.js/commit/ce6acc8))
* Restore all outlines for greater accessibility ([#3829](https://github.com/videojs/video.js/issues/3829)) ([29ffbfb](https://github.com/videojs/video.js/commit/29ffbfb))
* Return the native Promise from play() ([#3907](https://github.com/videojs/video.js/issues/3907)) ([091bdf9](https://github.com/videojs/video.js/commit/091bdf9))
* Stateful Components ([#3960](https://github.com/videojs/video.js/issues/3960)) ([d7d7cfe](https://github.com/videojs/video.js/commit/d7d7cfe))
* Time Tooltips ([#3836](https://github.com/videojs/video.js/issues/3836)) ([1ba1f5a](https://github.com/videojs/video.js/commit/1ba1f5a))
* time tooltips will not be added to a player on mobile devices ([#4185](https://github.com/videojs/video.js/issues/4185)) ([d79b8a7](https://github.com/videojs/video.js/commit/d79b8a7))
* toggle playback with space when focused on seekbar ([#4005](https://github.com/videojs/video.js/issues/4005)) ([516c9f9](https://github.com/videojs/video.js/commit/516c9f9))
* unmute goes back to previously selected volume ([#3942](https://github.com/videojs/video.js/issues/3942)) ([cb42fcf](https://github.com/videojs/video.js/commit/cb42fcf)), closes [#3909](https://github.com/videojs/video.js/issues/3909)
* Update MW to require a factory, add *-mw ([#3969](https://github.com/videojs/video.js/issues/3969)) ([0352916](https://github.com/videojs/video.js/commit/0352916))
* update videojs-vtt.js and wrap native cues in TextTrack ([#4115](https://github.com/videojs/video.js/issues/4115)) ([96a387f](https://github.com/videojs/video.js/commit/96a387f)), closes [#4093](https://github.com/videojs/video.js/issues/4093)
* wrap menu item text in a span ([#4026](https://github.com/videojs/video.js/issues/4026)) ([5748c36](https://github.com/videojs/video.js/commit/5748c36)), closes [#4017](https://github.com/videojs/video.js/issues/4017)
* **lang:** add European Portuguese translation ([#3955](https://github.com/videojs/video.js/issues/3955)) ([8888e2b](https://github.com/videojs/video.js/commit/8888e2b))
* **lang:** DE and FR translations of replay ([#3963](https://github.com/videojs/video.js/issues/3963)) ([a0ba8e2](https://github.com/videojs/video.js/commit/a0ba8e2))
* **lang:** French translation update ([#4118](https://github.com/videojs/video.js/issues/4118)) ([8c1302e](https://github.com/videojs/video.js/commit/8c1302e))
* **lang:** update es.json ([#3984](https://github.com/videojs/video.js/issues/3984)) ([70d2eb1](https://github.com/videojs/video.js/commit/70d2eb1))
* **player:** add played(), defaultMuted(), defaultPlaybackRate() ([#3845](https://github.com/videojs/video.js/issues/3845)) ([2037e18](https://github.com/videojs/video.js/commit/2037e18)), closes [#523](https://github.com/videojs/video.js/issues/523)
* **volume panel:** accessibly volume control ([#3957](https://github.com/videojs/video.js/issues/3957)) ([524f868](https://github.com/videojs/video.js/commit/524f868))
### Bug Fixes
* accessibility bugs with the VolumeBar ([#4023](https://github.com/videojs/video.js/issues/4023)) ([da2a1e0](https://github.com/videojs/video.js/commit/da2a1e0)), closes [#4021](https://github.com/videojs/video.js/issues/4021) [#4022](https://github.com/videojs/video.js/issues/4022)
* add buildWrapperCSSClass methods to all menu buttons ([#4147](https://github.com/videojs/video.js/issues/4147)) ([61d427c](https://github.com/videojs/video.js/commit/61d427c))
* Add lang attribute to player el, so that css :lang() is correct ([#4046](https://github.com/videojs/video.js/issues/4046)) ([17143fd](https://github.com/videojs/video.js/commit/17143fd))
* addChild instance names should be toTitleCased ([#4116](https://github.com/videojs/video.js/issues/4116)) ([576ac19](https://github.com/videojs/video.js/commit/576ac19))
* allow changing volume in full height of volume control ([#3987](https://github.com/videojs/video.js/issues/3987)) ([f87ada1](https://github.com/videojs/video.js/commit/f87ada1))
* copy basic plugin properties onto the wrapper ([#4100](https://github.com/videojs/video.js/issues/4100)) ([127cd78](https://github.com/videojs/video.js/commit/127cd78))
* cues at startTime 0 do not fire ([#4152](https://github.com/videojs/video.js/issues/4152)) ([a2b1a33](https://github.com/videojs/video.js/commit/a2b1a33))
* Disable all time tooltips in IE8, as they are broken ([#4029](https://github.com/videojs/video.js/issues/4029)) ([60bcc99](https://github.com/videojs/video.js/commit/60bcc99))
* disable title attribute on menu items ([#4019](https://github.com/videojs/video.js/issues/4019)) ([04f23c1](https://github.com/videojs/video.js/commit/04f23c1)), closes [#3699](https://github.com/videojs/video.js/issues/3699)
* Do not create element for MediaLoader ([#4097](https://github.com/videojs/video.js/issues/4097)) ([1cb0a97](https://github.com/videojs/video.js/commit/1cb0a97))
* early play should wait for player ready, even if source is available ([#4134](https://github.com/videojs/video.js/issues/4134)) ([3bbf019](https://github.com/videojs/video.js/commit/3bbf019)), closes [#4057](https://github.com/videojs/video.js/issues/4057)
* EventTarget is also evented ([#3990](https://github.com/videojs/video.js/issues/3990)) ([e34335b](https://github.com/videojs/video.js/commit/e34335b))
* fix the structure of elements in menus to comply with ARIA requirements ([#4034](https://github.com/videojs/video.js/issues/4034)) ([1b1ba04](https://github.com/videojs/video.js/commit/1b1ba04))
* focus play toggle from Big Play Btn on play ([#4018](https://github.com/videojs/video.js/issues/4018)) ([4f79e1e](https://github.com/videojs/video.js/commit/4f79e1e)), closes [#2729](https://github.com/videojs/video.js/issues/2729)
* hide font-icons from assitive technology ([#4006](https://github.com/videojs/video.js/issues/4006)) ([24d2e7b](https://github.com/videojs/video.js/commit/24d2e7b)), closes [#3982](https://github.com/videojs/video.js/issues/3982)
* improve French translation ([#4062](https://github.com/videojs/video.js/issues/4062)) ([dc4c1eb](https://github.com/videojs/video.js/commit/dc4c1eb))
* keep minimum volume after unmuting above 0.1 ([#4227](https://github.com/videojs/video.js/issues/4227)) ([16c1e0a](https://github.com/videojs/video.js/commit/16c1e0a)), closes [#4054](https://github.com/videojs/video.js/issues/4054)
* localize aria-labels ([#4027](https://github.com/videojs/video.js/issues/4027)) ([0ac1269](https://github.com/videojs/video.js/commit/0ac1269)), closes [#2728](https://github.com/videojs/video.js/issues/2728)
* Make `Player#techCall_()` synchronous again ([#3988](https://github.com/videojs/video.js/issues/3988)) ([3585af0](https://github.com/videojs/video.js/commit/3585af0))
* make load progress buffered regions height 100% ([#4190](https://github.com/videojs/video.js/issues/4190)) ([424fa51](https://github.com/videojs/video.js/commit/424fa51))
* make mergeOptions behave the same across browsers ([#4088](https://github.com/videojs/video.js/issues/4088)) ([0da9324](https://github.com/videojs/video.js/commit/0da9324))
* make sure audio track hides with one item ([#4202](https://github.com/videojs/video.js/issues/4202)) ([0fd7aad](https://github.com/videojs/video.js/commit/0fd7aad))
* Muting with `MuteToggle` sets ARIA value of `VolumeBar` to 0 ([#4099](https://github.com/videojs/video.js/issues/4099)) ([181a19f](https://github.com/videojs/video.js/commit/181a19f)), closes [#4064](https://github.com/videojs/video.js/issues/4064)
* not showing default text tracks over video ([#4216](https://github.com/videojs/video.js/issues/4216)) ([dbfba28](https://github.com/videojs/video.js/commit/dbfba28))
* Patch a memory leak caused by un-removed track listener(s). ([#3976](https://github.com/videojs/video.js/issues/3976)) ([4979ea7](https://github.com/videojs/video.js/commit/4979ea7))
* Progress holder gaps cause tooltips misalignment and time tooltip outlines ([#4031](https://github.com/videojs/video.js/issues/4031)) ([be27f2a](https://github.com/videojs/video.js/commit/be27f2a)), closes [#3645](https://github.com/videojs/video.js/issues/3645)
* remaining time display width on IE8 and IE9 ([#3983](https://github.com/videojs/video.js/issues/3983)) ([866a3f3](https://github.com/videojs/video.js/commit/866a3f3))
* **MenuButton:** Unify behavior of showing/hiding ([#4157](https://github.com/videojs/video.js/issues/4157)) ([c611f9f](https://github.com/videojs/video.js/commit/c611f9f))
* remove focus ring from player itself ([#4237](https://github.com/videojs/video.js/issues/4237)) ([e98c65d](https://github.com/videojs/video.js/commit/e98c65d))
* **audio-tracks-button:** add wrapper CSS builder to audio tracks menu button ([#4163](https://github.com/videojs/video.js/issues/4163)) ([d9ec7bc](https://github.com/videojs/video.js/commit/d9ec7bc))
* **cues:** only copy cue props that don't exist ([#4145](https://github.com/videojs/video.js/issues/4145)) ([0f57341](https://github.com/videojs/video.js/commit/0f57341))
* **dom:** getBoundingClientRect check that el is defined ([#4139](https://github.com/videojs/video.js/issues/4139)) ([fb88ae2](https://github.com/videojs/video.js/commit/fb88ae2))
* **icon-placeholder:** align icons on ie8 properly ([#4174](https://github.com/videojs/video.js/issues/4174)) ([1770f00](https://github.com/videojs/video.js/commit/1770f00))
* **ie8:** various minor ie8 fixes ([#4175](https://github.com/videojs/video.js/issues/4175)) ([cb890a9](https://github.com/videojs/video.js/commit/cb890a9))
* **package:** update xhr to version 2.4.0 ([#4101](https://github.com/videojs/video.js/issues/4101)) ([5265624](https://github.com/videojs/video.js/commit/5265624))
* **playback rate menu:** playback rate menu items should be selectable ([#4149](https://github.com/videojs/video.js/issues/4149)) ([a9f8fcb](https://github.com/videojs/video.js/commit/a9f8fcb))
* **sass:** import path has cwd once again ([#4061](https://github.com/videojs/video.js/issues/4061)) ([caff93f](https://github.com/videojs/video.js/commit/caff93f))
* **sass:** import path no longer has cwd ([#4001](https://github.com/videojs/video.js/issues/4001)) ([19b429b](https://github.com/videojs/video.js/commit/19b429b)), closes [#3998](https://github.com/videojs/video.js/issues/3998)
* **subs-caps-button:** add hide threshold to subs-caps button ([#4171](https://github.com/videojs/video.js/issues/4171)) ([88ee6af](https://github.com/videojs/video.js/commit/88ee6af))
* remove redundant Html5#play() ([405b29b](https://github.com/videojs/video.js/commit/405b29b))
* removeCue should work with native passed in cue ([#4208](https://github.com/videojs/video.js/issues/4208)) ([f2b5a05](https://github.com/videojs/video.js/commit/f2b5a05))
* Set MuteButton controlText correctly ([#4056](https://github.com/videojs/video.js/issues/4056)) ([3c1108c](https://github.com/videojs/video.js/commit/3c1108c))
* silence play promise error ([#4247](https://github.com/videojs/video.js/issues/4247)) ([0908d91](https://github.com/videojs/video.js/commit/0908d91))
* Solve a typo in translation files ([#4063](https://github.com/videojs/video.js/issues/4063)) ([5540868](https://github.com/videojs/video.js/commit/5540868))
* support empty src in `Player#src` ([#4030](https://github.com/videojs/video.js/issues/4030)) ([6541467](https://github.com/videojs/video.js/commit/6541467))
* synchronously shim vtt.js when possible ([#4083](https://github.com/videojs/video.js/issues/4083)) ([e1b4804](https://github.com/videojs/video.js/commit/e1b4804))
* trap tab focus in modal when hitting s-tab ([#4075](https://github.com/videojs/video.js/issues/4075)) ([1f7a842](https://github.com/videojs/video.js/commit/1f7a842)), closes [#4049](https://github.com/videojs/video.js/issues/4049)
* updating time tooltips when player not in DOM ([#3991](https://github.com/videojs/video.js/issues/3991)) ([22aade1](https://github.com/videojs/video.js/commit/22aade1))
* **subs-caps-button:** add wrapper CSS builder to subs caps button ([#4156](https://github.com/videojs/video.js/issues/4156)) ([e5af0a5](https://github.com/videojs/video.js/commit/e5af0a5))
* **subs-caps-button:** captions items should hide icon from SR ([#4158](https://github.com/videojs/video.js/issues/4158)) ([2ee133f](https://github.com/videojs/video.js/commit/2ee133f))
* **text track settings:** focus subs-caps button if exists over CC button ([#4155](https://github.com/videojs/video.js/issues/4155)) ([db901c5](https://github.com/videojs/video.js/commit/db901c5))
* **tracks:** allow forcing native text tracks on or off ([#4172](https://github.com/videojs/video.js/issues/4172)) ([67634cf](https://github.com/videojs/video.js/commit/67634cf))
* **vttjs:** wait till tech el in DOM before loading vttjs ([#4177](https://github.com/videojs/video.js/issues/4177)) ([ddde644](https://github.com/videojs/video.js/commit/ddde644))
### Chores
* 6.x build updates ([#4228](https://github.com/videojs/video.js/issues/4228)) ([6d876ee](https://github.com/videojs/video.js/commit/6d876ee))
* Add flash as a dev dependency for testing ([#4016](https://github.com/videojs/video.js/issues/4016)) ([4949619](https://github.com/videojs/video.js/commit/4949619))
* change accessibility test in grunt.js to remove unnecessary warning message. ([#4143](https://github.com/videojs/video.js/issues/4143)) ([dacf0ca](https://github.com/videojs/video.js/commit/dacf0ca))
* **package:** update remark-validate-links to version 6.0.0 ([#4128](https://github.com/videojs/video.js/issues/4128)) ([1395677](https://github.com/videojs/video.js/commit/1395677))
* ignore qunit and sinon from greenkeeper ([#4242](https://github.com/videojs/video.js/issues/4242)) ([29d733d](https://github.com/videojs/video.js/commit/29d733d))
* increase browserstack/karma timeouts, dispose player in tests ([#4135](https://github.com/videojs/video.js/issues/4135)) ([6874fa2](https://github.com/videojs/video.js/commit/6874fa2))
* only report errors during linting in the build process, not warnings ([#4041](https://github.com/videojs/video.js/issues/4041)) ([6208e4b](https://github.com/videojs/video.js/commit/6208e4b))
* remove bower.json ([#4238](https://github.com/videojs/video.js/issues/4238)) ([0d19a05](https://github.com/videojs/video.js/commit/0d19a05)), closes [#4012](https://github.com/videojs/video.js/issues/4012)
* **package:** update webpack to version 2.3.0 ([#4219](https://github.com/videojs/video.js/issues/4219)) ([0223057](https://github.com/videojs/video.js/commit/0223057))
* Remove component.json and remove references to it ([#3866](https://github.com/videojs/video.js/issues/3866)) ([0bba319](https://github.com/videojs/video.js/commit/0bba319))
* **docs:** Use Elephants Dream video files from CDN for docs/examples/elephantsdream/ ([#4181](https://github.com/videojs/video.js/issues/4181)) ([af1c6e3](https://github.com/videojs/video.js/commit/af1c6e3))
* **package:** pin karma to 1.3.0 ([#4002](https://github.com/videojs/video.js/issues/4002)) ([5b8b41e](https://github.com/videojs/video.js/commit/5b8b41e))
* **package:** update remark-cli to version 3.0.0 ([#4126](https://github.com/videojs/video.js/issues/4126)) ([dc9ed1c](https://github.com/videojs/video.js/commit/dc9ed1c))
* **package:** update remark-lint to version 6.0.0 ([#4129](https://github.com/videojs/video.js/issues/4129)) ([9ef2d07](https://github.com/videojs/video.js/commit/9ef2d07))
* **package:** update remark-toc to version 4.0.0 ([#4127](https://github.com/videojs/video.js/issues/4127)) ([d5a619d](https://github.com/videojs/video.js/commit/d5a619d))
* **package:** update uglify-js to version 2.8.8 ([#4170](https://github.com/videojs/video.js/issues/4170)) ([bf787bd](https://github.com/videojs/video.js/commit/bf787bd)), closes [#4138](https://github.com/videojs/video.js/issues/4138)
* **package:** update videojs-vtt.js to version 0.12.3 ([#4221](https://github.com/videojs/video.js/issues/4221)) ([7d12c9e](https://github.com/videojs/video.js/commit/7d12c9e))
* **package:** update xhr to version 2.3.3 ([#3914](https://github.com/videojs/video.js/issues/3914)) ([924fb27](https://github.com/videojs/video.js/commit/924fb27))
* switch from ghooks to husky ([#4074](https://github.com/videojs/video.js/issues/4074)) ([c3b1d68](https://github.com/videojs/video.js/commit/c3b1d68))
* **sandbox:** Fix poster image to match the video in the 'combined-tracks.html' example in sandbox ([#4164](https://github.com/videojs/video.js/issues/4164)) ([5ffe1cd](https://github.com/videojs/video.js/commit/5ffe1cd))
* **sandbox:** Use Elephants Dream video files from CDN for the sandbox/descriptions.html.example. ([#4137](https://github.com/videojs/video.js/issues/4137)) ([715f584](https://github.com/videojs/video.js/commit/715f584))
* **test:** silence plugin warning from test ([#4173](https://github.com/videojs/video.js/issues/4173)) ([05e6494](https://github.com/videojs/video.js/commit/05e6494))
* **tests:** make tests not print out errors ([#4141](https://github.com/videojs/video.js/issues/4141)) ([f95815b](https://github.com/videojs/video.js/commit/f95815b))
### Code Refactoring
* Buttons will always use a button element ([#3828](https://github.com/videojs/video.js/issues/3828)) ([c340dbc](https://github.com/videojs/video.js/commit/c340dbc))
* do not allow adding children with options passed in as a boolean ([#3872](https://github.com/videojs/video.js/issues/3872)) ([b07143d](https://github.com/videojs/video.js/commit/b07143d))
* Evented Components ([#3959](https://github.com/videojs/video.js/issues/3959)) ([4c3b60c](https://github.com/videojs/video.js/commit/4c3b60c))
* expose tech but warn without safety var ([#3916](https://github.com/videojs/video.js/issues/3916)) ([8622b26](https://github.com/videojs/video.js/commit/8622b26))
* Make registerComponent only work with Components ([#3802](https://github.com/videojs/video.js/issues/3802)) ([57af15c](https://github.com/videojs/video.js/commit/57af15c))
* move most volume panel functionality into css state ([#3981](https://github.com/videojs/video.js/issues/3981)) ([2e2ac6f](https://github.com/videojs/video.js/commit/2e2ac6f))
* MuteToggle#update ([#4058](https://github.com/videojs/video.js/issues/4058)) ([a04f387](https://github.com/videojs/video.js/commit/a04f387))
* Remove custom UMD ([#3826](https://github.com/videojs/video.js/issues/3826)) ([2014120](https://github.com/videojs/video.js/commit/2014120))
* Remove deprecated features of extend/Component#extend ([#3825](https://github.com/videojs/video.js/issues/3825)) ([f8aed4d](https://github.com/videojs/video.js/commit/f8aed4d))
* Remove method Chaining from videojs ([#3860](https://github.com/videojs/video.js/issues/3860)) ([8f07f5d](https://github.com/videojs/video.js/commit/8f07f5d))
* remove special loadstart handling ([#3906](https://github.com/videojs/video.js/issues/3906)) ([73b6316](https://github.com/videojs/video.js/commit/73b6316))
* Remove TimeRanges without an index deprecation warning ([#3827](https://github.com/videojs/video.js/issues/3827)) ([e12bedb](https://github.com/videojs/video.js/commit/e12bedb))
* Remove unused defaultVolume option default ([#3915](https://github.com/videojs/video.js/issues/3915)) ([5377ffc](https://github.com/videojs/video.js/commit/5377ffc))
* unify all Track and TrackList APIs ([#3783](https://github.com/videojs/video.js/issues/3783)) ([49bed07](https://github.com/videojs/video.js/commit/49bed07))
### Documentation
* Add MediaLoader to components list ([#4070](https://github.com/videojs/video.js/issues/4070)) ([65dc81a](https://github.com/videojs/video.js/commit/65dc81a))
* Expand testing info in `CONTRIBUTING.md` ([#4020](https://github.com/videojs/video.js/issues/4020)) ([2da4e76](https://github.com/videojs/video.js/commit/2da4e76))
* fix broken links to guides in the faq ([#3973](https://github.com/videojs/video.js/issues/3973)) ([58f2349](https://github.com/videojs/video.js/commit/58f2349))
* fix links in generated docs ([#4200](https://github.com/videojs/video.js/issues/4200)) ([61e2078](https://github.com/videojs/video.js/commit/61e2078))
* fixup global jsdoc members ([#4015](https://github.com/videojs/video.js/issues/4015)) ([6ad1e5c](https://github.com/videojs/video.js/commit/6ad1e5c))
* minor fix to currentTime() comment: "setting" not "getting" ([#3944](https://github.com/videojs/video.js/issues/3944)) ([6578ed9](https://github.com/videojs/video.js/commit/6578ed9))
* **coc:** introduce CODE_OF_CONDUCT.md ([#4160](https://github.com/videojs/video.js/issues/4160)) ([312b10c](https://github.com/videojs/video.js/commit/312b10c))
* ran `npm run docs:fix` to update TOC on guides ([#3971](https://github.com/videojs/video.js/issues/3971)) ([de3945d](https://github.com/videojs/video.js/commit/de3945d))
* **guide:** Add a `ModalDialog` guide ([#3961](https://github.com/videojs/video.js/issues/3961)) ([7b0d738](https://github.com/videojs/video.js/commit/7b0d738))
* **guides:** Add a basic ReactJS guide and update the FAQ ([#3972](https://github.com/videojs/video.js/issues/3972)) ([05b39fe](https://github.com/videojs/video.js/commit/05b39fe))
* replace 'autoPlay' by 'autoplay' ([#4080](https://github.com/videojs/video.js/issues/4080)) ([7ab52d1](https://github.com/videojs/video.js/commit/7ab52d1)), closes [#3995](https://github.com/videojs/video.js/issues/3995)
* tech order will only have html5 by default ([#4188](https://github.com/videojs/video.js/issues/4188)) ([41be5dc](https://github.com/videojs/video.js/commit/41be5dc))
* **guides:** fix typos in faq guide ([#4067](https://github.com/videojs/video.js/issues/4067)) ([2433915](https://github.com/videojs/video.js/commit/2433915))
* **guides:** fix typos in functions guide ([#4035](https://github.com/videojs/video.js/issues/4035)) ([0fc2c1c](https://github.com/videojs/video.js/commit/0fc2c1c))
* **jsdoc:** introduce a jsdoc template and build on publish ([#3910](https://github.com/videojs/video.js/issues/3910)) ([e642295](https://github.com/videojs/video.js/commit/e642295))
### Tests
* **ie8:** only run mute toggle tests in html5 env ([#4003](https://github.com/videojs/video.js/issues/4003)) ([5bde16a](https://github.com/videojs/video.js/commit/5bde16a))
* add tests for obj.assign util ([#4014](https://github.com/videojs/video.js/issues/4014)) ([fcb5aa8](https://github.com/videojs/video.js/commit/fcb5aa8))
* fix IE9 rounding issue with lastvolume test ([#4230](https://github.com/videojs/video.js/issues/4230)) ([46dd0aa](https://github.com/videojs/video.js/commit/46dd0aa))
* fix tests ([#3953](https://github.com/videojs/video.js/issues/3953)) ([7bafcc2](https://github.com/videojs/video.js/commit/7bafcc2))
### BREAKING CHANGES
* setting the source is now asynchronous. `sourceOrder` option removed and made the default.
* remove deprecated features.
* **volume panel:** remove VolumeMenuButton, introduce a new default volume control: VolumePanel.
* removal of `keepTooltipsInside` option.
* some externally accessibly functions for tracks are now private.
* player methods no longer return a player instance when called. Fixes #3704.
* removal of component.json
* remove flash tech from core.
* restoring the outlines changes the skin slightly and potentially break users. Fixes #3200.
* registerComponent now throws if no name or not a component is passed in.
* remove the double loadstart handlers that dispose the tech/source handlers if a secondary loadstart event is heard.
* remove ability to add children with options as a boolean.
* removing ability to use TimeRange methods without an index.
* button component will always use a button element.
* `play()` no longer returns the player object but instead the native Promise or nothing.
<a name="5.19.1"></a>
## [5.19.1](https://github.com/videojs/video.js/compare/v5.19.0...v5.19.1) (2017-03-27)
### Bug Fixes
* not showing default text tracks over video ([#4217](https://github.com/videojs/video.js/issues/4217)) ([4653922](https://github.com/videojs/video.js/commit/4653922))
* removeCue should work with native passed in cue ([#4209](https://github.com/videojs/video.js/issues/4209)) ([3974944](https://github.com/videojs/video.js/commit/3974944))
### Chores
* **package:** update videojs-vtt.js to 0.12.3 ([#4223](https://github.com/videojs/video.js/issues/4223)) ([ad770fb](https://github.com/videojs/video.js/commit/ad770fb))
<a name="5.19.0"></a>
# [5.19.0](https://github.com/videojs/video.js/compare/v5.18.4...v5.19.0) (2017-03-15)
### Features
* Make pause on open optional for ModalDialog via options ([#4187](https://github.com/videojs/video.js/issues/4187)) ([4ec3b56](https://github.com/videojs/video.js/commit/4ec3b56))
### Bug Fixes
* make load progress buffered regions height 100% ([#4191](https://github.com/videojs/video.js/issues/4191)) ([398c6e9](https://github.com/videojs/video.js/commit/398c6e9))
* make sure audio track hides with one item ([#4203](https://github.com/videojs/video.js/issues/4203)) ([c069655](https://github.com/videojs/video.js/commit/c069655))
<a name="5.18.4"></a>
## [5.18.4](https://github.com/videojs/video.js/compare/v5.18.3...v5.18.4) (2017-03-08)
### Bug Fixes
* **vttjs:** wait till tech el in DOM before loading vttjs ([#4176](https://github.com/videojs/video.js/issues/4176)) ([ad86eec](https://github.com/videojs/video.js/commit/ad86eec))
<a name="5.18.3"></a>
## [5.18.3](https://github.com/videojs/video.js/compare/v5.18.2...v5.18.3) (2017-03-06)
<a name="5.18.1"></a>
## [5.18.1](https://github.com/videojs/video.js/compare/v5.18.0...v5.18.1) (2017-03-03)
### Bug Fixes
* **cues:** only copy cue props that don't exist ([#4146](https://github.com/videojs/video.js/issues/4146)) ([de08669](https://github.com/videojs/video.js/commit/de08669))
* cue-points with a startTime of 0 ([#4148](https://github.com/videojs/video.js/issues/4148)) ([e7d4b47](https://github.com/videojs/video.js/commit/e7d4b47))
* make sure that cues copy over their id ([#4154](https://github.com/videojs/video.js/issues/4154)) ([072c277](https://github.com/videojs/video.js/commit/072c277))
* **MenuButton:** Unify behavior of showing/hiding ([#3993](https://github.com/videojs/video.js/issues/3993)) ([4367c69](https://github.com/videojs/video.js/commit/4367c69))
* **playback rate menu:** playback rate menu items should be selectable ([#4150](https://github.com/videojs/video.js/issues/4150)) ([288edd1](https://github.com/videojs/video.js/commit/288edd1))
### Chores
* **build:** lint errors only and silence webpack ([#4153](https://github.com/videojs/video.js/issues/4153)) ([b1ca344](https://github.com/videojs/video.js/commit/b1ca344))
* **package:** update video-js-swf to 5.3.0 ([#4161](https://github.com/videojs/video.js/issues/4161)) ([2bcfe21](https://github.com/videojs/video.js/commit/2bcfe21))
<a name="5.18.0"></a>
# [5.18.0](https://github.com/videojs/video.js/compare/v5.17.0...v5.18.0) (2017-02-27)
### Features
* focus play toggle from Big Play Btn on play ([#4132](https://github.com/videojs/video.js/issues/4132)) ([dcc615a](https://github.com/videojs/video.js/commit/dcc615a)), closes [#2729](https://github.com/videojs/video.js/issues/2729)
* update videojs-vtt.js and wrap native cues in TextTrack ([#4131](https://github.com/videojs/video.js/issues/4131)) ([3d4aebc](https://github.com/videojs/video.js/commit/3d4aebc)), closes [#4093](https://github.com/videojs/video.js/issues/4093)
### Bug Fixes
* **sass:** import path has cwd once again ([#4076](https://github.com/videojs/video.js/issues/4076)) ([c02c6c6](https://github.com/videojs/video.js/commit/c02c6c6))
* addChild instance names should be toTitleCased ([#4117](https://github.com/videojs/video.js/issues/4117)) ([fa97309](https://github.com/videojs/video.js/commit/fa97309))
* make mergeOptions behave the same across browsers ([#4090](https://github.com/videojs/video.js/issues/4090)) ([ce19ed5](https://github.com/videojs/video.js/commit/ce19ed5))
* synchronously shim vtt.js when possible ([#4082](https://github.com/videojs/video.js/issues/4082)) ([b5727a6](https://github.com/videojs/video.js/commit/b5727a6))
<a name="5.17.0"></a>
# [5.17.0](https://github.com/videojs/video.js/compare/v5.16.0...v5.17.0) (2017-02-07)
### Bug Fixes
* Patch a memory leak caused by un-removed track listener(s). ([#3975](https://github.com/videojs/video.js/issues/3975)) ([bca44c0](https://github.com/videojs/video.js/commit/bca44c0))
* remove title attribute on menu items, fixes [#3699](https://github.com/videojs/video.js/issues/3699) ([#4009](https://github.com/videojs/video.js/issues/4009)) ([91874a3](https://github.com/videojs/video.js/commit/91874a3))
### Chores
* change accessibility test in grunt.js to remove unnecessary warning message. ([#4008](https://github.com/videojs/video.js/issues/4008)) ([daad492](https://github.com/videojs/video.js/commit/daad492))
* **package:** update swf to 5.2.0 ([#4040](https://github.com/videojs/video.js/issues/4040)) ([dab893b](https://github.com/videojs/video.js/commit/dab893b))
### Documentation
* minor fix to currentTime() comment: "setting" not "getting" ([#3944](https://github.com/videojs/video.js/issues/3944)) ([6578ed9](https://github.com/videojs/video.js/commit/6578ed9))
<a name="5.16.0"></a>
# [5.16.0](https://github.com/videojs/video.js/compare/v5.15.1...v5.16.0) (2017-01-12)
+128
Ver Arquivo
@@ -0,0 +1,128 @@
# Contributor Covenant Code of Conduct
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
## Table of Contents
* [Our Pledge](#our-pledge)
* [Our Standards](#our-standards)
* [Our Responsibilities](#our-responsibilities)
* [Scope](#scope)
* [Other Community Standards](#other-community-standards)
* [Enforcement](#enforcement)
* [Further Enforcement](#further-enforcement)
* [Who Watches the Watchers?](#who-watches-the-watchers)
* [Attribution](#attribution)
## Our Pledge
In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level of experience,
nationality, personal appearance, race, religion, or sexual identity and
orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment
include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.
## Scope
This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.
### Other Community Standards
As a project on GitHub, this project is additionally covered by the [GitHub Community Guidelines](https://help.github.com/articles/github-community-guidelines/).
Additionally, as a project hosted on npm, is is covered by [npm, Inc's Code of Conduct](https://www.npmjs.com/policies/conduct).
Enforcement of those guidelines after violations overlapping with the above are the responsibility of the entities, and enforcement may happen in any or all of the services/communities.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at gary@videojs.com or @gkatsev on [slack][]. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.
### Further Enforcement
If you've already followed the [initial enforcement steps](#enforcement), these are the steps maintainers will take for further enforcement, as needed:
1. Repeat the request to stop.
1. If the person doubles down, they will have offending messages removed or edited by a maintainers given an official warning. The PR or Issue may be locked.
1. If the behavior continues or is repeated later, the person will be blocked from participating for 24 hours.
1. If the behavior continues or is repeated after the temporary block, a long-term (6-12mo) ban will be used.
On top of this, maintainers may remove any offending messages, images, contributions, etc, as they deem necessary.
Maintainers reserve full rights to skip any of these steps, at their discretion, if the violation is considered to be a serious and/or immediate threat to the health and well-being of members of the community. These include any threats, serious physical or verbal attacks, and other such behavior that would be completely unacceptable in any social setting that puts our members at risk.
Members expelled from events or venues with any sort of paid attendance will not be refunded.
### Who Watches the Watchers?
Maintainers and other leaders who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. These may include anything from removal from the maintainer team to a permanent ban from the community.
Additionally, as a project hosted on both GitHub and npm, [their own Codes of Conducts may be applied against maintainers of this project](#other-community-standards), externally of this project's procedures.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at [http://contributor-covenant.org/version/1/4][version]
The [Other Community Standards](#other-community-standards), [Further Enforcement](#further-enforcement),
and [Who Watches the Watchers?](#who-watches-the-watchers) sections are based on [weallbehave][weallbehave],
which is based on the [WeAllJS Code of Conduct][wealljs].
[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
[wealljs]: https://wealljs.org/code-of-conduct
[weallbehave]: https://npm.im/weallbehave
[slack]: http://slack.videojs.com
+142 -14
Ver Arquivo
@@ -259,22 +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 bower and GitHub and eventually posted on the CDN. This is the instruction for the npm/bower/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:
@@ -284,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
@@ -291,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
@@ -318,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
+8 -2
Ver Arquivo
@@ -140,13 +140,17 @@ npm install
#### Running tests
To run the tests all you need to do is run
Tests can be run either from the shell or from the browser.
To run the tests from the shell, just run
```sh
npm test
```
This will build video.js locally and run the tests using [Karma](https://karma-runner.github.io/1.0/index.html) which runs our tests in actual browsers.
This will build video.js locally and run the test suite using [Karma](https://karma-runner.github.io/1.0/index.html), which runs our tests in actual browsers.
To run tests from the browser, first start a local server with `npm start` (this also watches for changes and rebuilds video.js and the test files as necessary). Then navigate to `http://localhost:9999/test`, and you'll see a page that displays the results of all the tests. To rerun the tests after making changes, just refresh the page. To run an individual test, click the "Rerun" link next to the test's title.
#### Building videojs
@@ -275,6 +279,8 @@ Tests attached to bug fixes should fail before the change and succeed with it.
npm test
```
See [Running tests](#running-tests) for more information.
#### Step 6: Push
```sh
+16 -3
Ver Arquivo
@@ -10,16 +10,23 @@
> Video.js is a web video player built from the ground up for an HTML5 world. It supports HTML5 and Flash video, as well as YouTube and Vimeo (through [plugins][plugins]). It supports video playback on desktops and mobile devices. This project was started mid 2010, and the player is now used on over ~~50,000~~ ~~100,000~~ ~~200,000~~ [400,000 websites][builtwith].
## Table of Contents
* [Quick Start](#quick-start)
* [Contributing](#contributing)
* [Code of Conduct](#code-of-conduct)
* [License](#license)
## Quick Start
Thanks to the awesome folks over at [Fastly][fastly], there's a free, CDN hosted version of Video.js that anyone can use. Add these tags to your document's `<head>`:
```html
<link href="//vjs.zencdn.net/5.11/video-js.min.css" rel="stylesheet">
<script src="//vjs.zencdn.net/5.11/video.min.js"></script>
<link href="//vjs.zencdn.net/5.19/video-js.min.css" rel="stylesheet">
<script src="//vjs.zencdn.net/5.19/video.min.js"></script>
```
> For the latest URLs, check out the [Getting Started][getting-started] page on our website.
> For the latest version of video.js and URLs to use, check out the [Getting Started][getting-started] page on our website.
Next, using Video.js is as simple as creating a `<video>` element, but with an additional `data-setup` attribute. At a minimum, this attribute must have a value of `'{}'`, but it can include any Video.js [options][options] - just make sure it contains valid JSON!
@@ -79,6 +86,10 @@ Video.js is a free and open source library, and we appreciate any help you're wi
_Video.js uses [BrowserStack][browserstack] for compatibility testing._
## [Code of Conduct][coc]
Please note that this project is released with a [Contributor Code of Conduct][coc]. By participating in this project you agree to abide by its terms.
## [License][license]
Video.js is [licensed][license] under the Apache License, Version 2.0.
@@ -120,3 +131,5 @@ Video.js is [licensed][license] under the Apache License, Version 2.0.
[travis-link]: https://travis-ci.org/videojs/video.js
[vjs]: http://videojs.com
[coc]: CODE_OF_CONDUCT.md
-24
Ver Arquivo
@@ -1,24 +0,0 @@
{
"name": "video.js",
"description": "An HTML5 and Flash video player with a common API and skin for both.",
"main": [
"dist/video.js",
"dist/video-js.css"
],
"moduleType": "es6",
"keywords": [
"videojs",
"html5",
"flash",
"video",
"player"
],
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests",
"build"
]
}
+65
Ver Arquivo
@@ -0,0 +1,65 @@
const fs = require('fs');
const zlib = require('zlib');
const Promise = require('bluebird');
const klawSync = require('klaw-sync');
const filesize = require('filesize');
const Table = require('cli-table');
const files = klawSync('dist/', {
ignore: ['examples', 'lang', 'font', 'ie8', '*.zip', '*.gz'],
nodir: true
});
Promise.all(files.map(gzipAndStat))
.then(mapFiles)
.then(function(files) {
logTable(files);
return files;
})
.then(cleanup)
.catch(function(err) {
console.error(err.stack);
});
function cleanup(files) {
files.forEach(function(file) {
fs.unlinkSync('dist/' + file[0] + '.gz');
});
}
function mapFiles(files) {
return files.map(function(file) {
const path = file[0].path;
const fileStat = file[0].stats;
const gzStat = file[1];
return [file[0].path.split('dist/')[1], filesize(fileStat.size), filesize(gzStat.size)];
});
}
function gzipAndStat(file) {
return new Promise(function(resolve, reject) {
const readStream = fs.createReadStream(file.path);
const writeStream = fs.createWriteStream(file.path + '.gz');
const gzip = zlib.createGzip();
readStream.pipe(gzip).pipe(writeStream).on('close', function() {
const gzStat = fs.statSync(file.path + '.gz');
resolve([file, gzStat]);
})
.on('error', reject);
});
}
function logTable(files) {
const table = new Table({
head: ['filename', 'size', 'gzipped'],
colAligns: ['left', 'right', 'right'],
style: {
border: ['white']
}
});
table.push.apply(table, files);
console.log(table.toString());
}
+33
Ver Arquivo
@@ -0,0 +1,33 @@
var unified = require('unified');
var markdown = require('remark-parse');
var stringify = require('remark-stringify');
var fs = require('fs');
module.exports = function() {
var processor = unified()
.use(markdown, {commonmark: true})
.use(stringify);
var ast = processor.parse(fs.readFileSync('./CHANGELOG.md'));
var changelog = [];
changelog.push(processor.stringify(ast.children[0]));
// start at 1 so we get the first anchor tag
// and can break on the second
for (var i = 1; i < ast.children.length; i++) {
var item = processor.stringify(ast.children[i]);
if (/^<a name="/.test(item)) {
break;
}
if (/^###/.test(item)) {
item = '\n' + item + '\n';
}
changelog.push(item);
}
return changelog.join('\n');
};
+29
Ver Arquivo
@@ -0,0 +1,29 @@
#resizer,
footer {
background-color: #ECEEF1;
color: #868688;
padding: 3px 10px;
}
.footer-text {
padding: 3px;
display: block;
}
footer .copyright {
float: left;
}
footer .other-links {
margin: 0;
padding: 0;
float: right;
}
footer .other-links li {
display: inline;
}
footer .logo {
display: none;
}
+44
Ver Arquivo
@@ -0,0 +1,44 @@
var replace = require("replace");
var path = require('path')
var apiPath = path.join(__dirname, '..', 'docs', 'api');
var replacements = [
{find: /\/docs\/guides\/(.+)\.md/g, replace: 'tutorial-$1.html'},
{find: /tutorial-tech.html/g, replace: 'tutorial-tech_.html'},
{find: /\/docs\/guides\//g, replace: '#'},
{find: /(\<h[1-6] id="(?:.*)?)video-js(.*)?"\>/g, replace: '$1videojs$2">'},
{find: /(\<h[1-6] id="(?:.*)?)don-t(.*)?"\>/g, replace: '$1dont$2">'},
{find: /(\<h[1-6] id="(?:.*)?)node-js(.*)?"\>/g, replace: '$1nodejs$2">'},
{find: /(\<h[1-6] id="(?:.*)?)vtt-js(.*)?"\>/g, replace: '$1vttjs$2">'},
{find: /(\<h[1-6] id=")-(.*)("\>)/g, replace: '$1$2$3'},
{find: /(\<h[1-6] id=")(.*)-("\>)/g, replace: '$1$2$3'},
{find: /(\<h[1-6] id=".*)-docs-guides-.*-md("\>)/g, replace: '$1$2'},
// replace all children with children-1
{find: /\<h3 id="children"\>/g, replace: '<h3 id="children-1">'},
// remove the -1 from the first item
{find: /\<h3 id="children-1"\>/, replace: '<h3 id="children">'},
{find: '<h4 id="nativecontrolsfortouch">', replace: '<h4 id="nativecontrolsfortouch-1">'},
{find: '<h3 id="videojs-(audio|video)track">', replace: '<h3 id="videojs$1track">'},
{find: '<h3 id="text-tracks">', replace: '<h3 id="text-tracks-1">'},
{find: '<h2 id="q-how-can-i-hide-the-links-to-my-video-subtitles-audio-tracks">',
replace: '<h2 id="q-how-can-i-hide-the-links-to-my-videosubtitlesaudiotracks">'},
{find: '<h3 id="dispose-http-docs-videojs-com-player-html-dispose">',
replace: '<h3 id="dispose">'},
{find: '<h4 id="effect-on-player-width-and-player-height">',
replace: '<h4 id="effect-on-playerwidth-and-playerheight">'},
{find: '<h4 id="i-want-to-have-a-single-source-and-dont-care-about-live-adaptive-streaming">',
replace: '<h4 id="i-want-to-have-a-single-source-and-dont-care-about-liveadaptive-streaming">'},
{find: '<h2 id="api-docs-api">', replace: '<h2 id="api-docs">'},
{find: '<h2 id="guides-docs-guides">', replace: '<h2 id="guides">'}
];
replacements.forEach(function(obj) {
replace({
regex: obj.find,
replacement: obj.replace,
paths: [apiPath],
recursive: true,
silent: true
});
});
+44
Ver Arquivo
@@ -0,0 +1,44 @@
var ghrelease = require('gh-release');
var currentChangelog = require('./current-changelog.js');
var safeParse = require('safe-json-parse/tuple');
var pkg = require('../package.json')
var minimist = require('minimist');
var args = minimist(process.argv.slice(2), {
boolean: ['prerelease'],
default: {
prerelease: false
},
alias: {
p: 'prerelease'
}
});
var options = {
owner: 'videojs',
repo: 'video.js',
body: currentChangelog(),
assets: ['./dist/video-js-'+pkg.version+'.zip'],
endpoint: 'https://api.github.com',
auth: {
username: process.env.VJS_GITHUB_USER,
password: process.env.VJS_GITHUB_TOKEN
}
};
var tuple = safeParse(process.env.npm_config_argv);
var npmargs = tuple[0] ? [] : tuple[1].cooked;
if (args.prerelease || npmargs.some(function(arg) { return /next/.test(arg); })) {
options.prerelease = true;
}
ghrelease(options, function(err, result) {
if (err) {
console.error('Unable to publish release to github');
console.error('err:', err);
console.error('result:', result);
} else {
console.log('Publish release to github!');
}
});
+35 -18
Ver Arquivo
@@ -145,6 +145,10 @@ module.exports = function(grunt) {
files: ['src/css/**/*'],
tasks: ['skin']
},
lang: {
files: ['lang/**/*.json'],
tasks: ['vjslanguages']
}
},
connect: {
dev: {
@@ -263,25 +267,25 @@ module.exports = function(grunt) {
options: {
release: 'major'
},
src: ['package.json', 'component.json']
src: ['package.json']
},
minor: {
options: {
release: 'minor'
},
src: ['package.json', 'component.json']
src: ['package.json']
},
patch: {
options: {
release: 'patch'
},
src: ['package.json', 'component.json']
src: ['package.json']
},
prerelease: {
options: {
release: 'prerelease'
},
src: ['package.json', 'component.json']
src: ['package.json']
},
css: {
options: {
@@ -404,10 +408,10 @@ module.exports = function(grunt) {
],
dev: [
'shell:babel',
'browserify:watch',
'browserify:watchnovtt',
'shell:rollupwatch',
'browserify:tests',
'watch:skin',
'watch:lang',
'watch:dist'
],
// Run multiple watch tasks in parallel
@@ -443,14 +447,32 @@ module.exports = function(grunt) {
}
},
shell: {
rollup: {
command: 'npm run rollup',
options: {
preferLocal: true
}
},
rollupall: {
command: 'npm run rollup -- --no-progress && npm run rollup-minify -- --no-progress',
options: {
preferLocal: true
}
},
rollupwatch: {
command: 'npm run rollup-dev',
optoins: {
preferLocal: true
}
},
babel: {
command: 'npm run babel -- --watch',
command: 'npm run babel -- --watch --quiet',
options: {
preferLocal: true
}
},
lint: {
command: 'npm run lint',
command: 'npm run lint -- --errors',
options: {
preferLocal: true
}
@@ -468,7 +490,7 @@ module.exports = function(grunt) {
}
},
webpack: {
command: 'webpack test/require/webpack.js build/temp/webpack.js',
command: 'webpack --hide-modules test/require/webpack.js build/temp/webpack.js',
options: {
preferLocal: true
}
@@ -483,8 +505,8 @@ module.exports = function(grunt) {
error: true
},
ignore: [
// Ignore the warning about needing <optgroup> elements
'WCAG2AA.Principle1.Guideline1_3.1_3_1.H85.2'
// Ignore warning about contrast of the "vjs-no-js" fallback link
'WCAG2AA.Principle1.Guideline1_4.1_4_3.G18.BgImage'
]
},
@@ -504,12 +526,7 @@ module.exports = function(grunt) {
'shell:lint',
'clean:build',
'babel:es5',
'browserify:build',
'browserify:buildnovtt',
'usebanner:novtt',
'usebanner:vtt',
'uglify',
'shell:rollupall',
'skin',
'version:css',
@@ -558,7 +575,7 @@ module.exports = function(grunt) {
});
// Run while developing
grunt.registerTask('dev', ['connect:dev', 'concurrent:dev']);
grunt.registerTask('dev', ['sandbox', 'connect:dev', 'concurrent:dev']);
grunt.registerTask('watchAll', ['build', 'connect:dev', 'concurrent:watchAll']);
grunt.registerTask('test-a11y', ['copy:a11y', 'accessibility']);
+212
Ver Arquivo
@@ -0,0 +1,212 @@
import { rollup } from 'rollup';
import duration from 'humanize-duration';
import watch from 'rollup-watch';
import babel from 'rollup-plugin-babel';
import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import json from 'rollup-plugin-json';
import filesize from 'rollup-plugin-filesize';
import progress from 'rollup-plugin-progress';
import ignore from 'rollup-plugin-ignore';
import uglify from 'rollup-plugin-uglify';
import minimist from 'minimist';
import _ from 'lodash';
import pkg from '../package.json';
import fs from 'fs';
const args = minimist(process.argv.slice(2), {
boolean: ['watch', 'minify', 'progress'],
default: {
progress: true
},
alias: {
w: 'watch',
m: 'minify',
p: 'progress'
}
});
if (args.watch) {
args.progress = false;
}
const compiledLicense = _.template(fs.readFileSync('./build/license-header.txt', 'utf8'));
const bannerData = _.pick(pkg, ['version', 'copyright']);
const primedResolve = resolve({
jsnext: true,
main: true,
browser: true
});
const primedCjs = commonjs({
sourceMap: false
});
const primedBabel = babel({
babelrc: false,
exclude: 'node_modules/**',
presets: [
'es3',
['es2015', {
loose: true,
modules: false
}]
],
plugins: ['external-helpers']
});
const es = {
options: {
entry: 'src/js/video.js',
plugins: [
json(),
primedBabel,
args.progress ? progress() : {},
filesize()
],
onwarn(warning) {
if (warning.code === 'UNUSED_EXTERNAL_IMPORT' ||
warning.code === 'UNRESOLVED_IMPORT') {
return;
}
// eslint-disable-next-line no-console
console.warn(warning.message);
},
legacy: true
},
banner: compiledLicense(Object.assign({includesVtt: true}, bannerData)),
useStrict: false,
format: 'es',
dest: 'dist/video.es.js'
};
const cjs = Object.assign({}, es, {
format: 'cjs',
dest: 'dist/video.cjs.js'
});
const umd = {
options: {
entry: 'src/js/video.js',
plugins: [
primedResolve,
json(),
primedCjs,
primedBabel,
args.progress ? progress() : {},
filesize()
],
legacy: true
},
banner: compiledLicense(Object.assign({includesVtt: true}, bannerData)),
useStrict: false,
format: 'umd',
dest: 'dist/video.js'
};
const minifiedUmd = Object.assign({}, _.cloneDeep(umd), {
dest: 'dist/video.min.js'
});
minifiedUmd.options.plugins.splice(4, 0, uglify({
preserveComments: 'some',
screwIE8: false,
mangle: true,
compress: {
/* eslint-disable camelcase */
sequences: true,
dead_code: true,
conditionals: true,
booleans: true,
unused: true,
if_return: true,
join_vars: true,
drop_console: true
/* eslint-enable camelcase */
}
}));
const novttUmd = Object.assign({}, _.cloneDeep(umd), {
banner: compiledLicense(Object.assign({includesVtt: false}, bannerData)),
dest: 'dist/alt/video.novtt.js'
});
novttUmd.options.plugins.unshift(ignore(['videojs-vtt.js']));
const minifiedNovttUmd = Object.assign({}, _.cloneDeep(minifiedUmd), {
banner: compiledLicense(Object.assign({includesVtt: false}, bannerData)),
dest: 'dist/alt/video.novtt.min.js'
});
minifiedNovttUmd.options.plugins.unshift(ignore(['videojs-vtt.js']));
function runRollup({options, useStrict, format, dest, banner}) {
rollup(options)
.then(function(bundle) {
bundle.write({
useStrict,
format,
dest,
banner,
moduleName: 'videojs',
sourceMap: false
});
}, function(err) {
// eslint-disable-next-line no-console
console.error(err);
});
}
if (!args.watch) {
if (args.minify) {
runRollup(minifiedUmd);
runRollup(minifiedNovttUmd);
} else {
runRollup(es);
runRollup(cjs);
runRollup(umd);
runRollup(novttUmd);
}
} else {
const props = ['format', 'dest', 'banner', 'useStrict'];
const watchers = [
['es', watch({rollup},
Object.assign({},
es.options,
_.pick(es, props)))],
['cjs', watch({rollup},
Object.assign({},
cjs.options,
_.pick(cjs, props)))],
['umd', watch({rollup},
Object.assign({moduleName: 'videojs'},
umd.options,
_.pick(umd, props)))],
['novtt', watch({rollup},
Object.assign({moduleName: 'videojs'},
novttUmd.options,
_.pick(novttUmd, props)))]
];
watchers.forEach(function([type, watcher]) {
watcher.on('event', (details) => {
if (details.code === 'BUILD_START') {
// eslint-disable-next-line no-console
console.log(`Bundling ${type}...`);
return;
}
if (details.code === 'BUILD_END') {
// eslint-disable-next-line no-console
console.log(`Bundled ${type} in %s`, duration(details.duration));
return;
}
if (details.code === 'ERROR') {
// eslint-disable-next-line no-console
console.error(details.error.toString());
return;
}
});
});
}
+33
Ver Arquivo
@@ -0,0 +1,33 @@
const fs = require('fs');
const path = require('path');
const klawSync = require('klaw-sync');
module.exports = function(grunt) {
grunt.registerTask('sandbox', 'copy over sandbox example files if necessary', function() {
const files = klawSync('sandbox/').filter((file) => path.extname(file.path) === '.example');
const changes = files.map(function(file) {
const p = path.parse(file.path);
const nonExample = path.join(p.dir, p.name);
return {
file: file.path,
copy: nonExample
};
})
.filter(function(change) {
return !fs.existsSync(change.copy);
});
changes.forEach(function(change) {
grunt.file.copy(change.file, change.copy);
});
if (changes.length) {
grunt.log.writeln("Updated Sandbox files for:");
grunt.log.writeln('\t' + changes.map((chg) => chg.copy).join('\n\t'));
} else {
grunt.log.writeln("No sandbox updates necessary");
}
});
};
+19
Ver Arquivo
@@ -0,0 +1,19 @@
var safeParse = require("safe-json-parse/tuple");
var tuple = safeParse(process.env.npm_config_argv);
var npm_config_argv = tuple[1]
if (tuple[0]) {
process.exit(1);
}
var sh = require('shelljs');
var prereleaseType = npm_config_argv['remain'][0];
var approvedTypes = {
'major': 1,
'minor': 1,
'patch': 1
}
if (prereleaseType in approvedTypes) {
sh.exec('npm run changelog');
}
-22
Ver Arquivo
@@ -1,22 +0,0 @@
{
"name": "video.js",
"description": "An HTML5 and Flash video player with a common API and skin for both.",
"version": "5.16.0",
"keywords": [
"videojs",
"html5",
"flash",
"video",
"player"
],
"scripts": ["dist/video-js/video.dev.js"],
"styles": ["dist/video-js/video-js.css"],
"files": ["dist/video-js/video-js.swf"],
"fonts": [
"dist/video-js/font/vjs.eot",
"dist/video-js/font/vjs.svg",
"dist/video-js/font/vjs.ttf",
"dist/video-js/font/vjs.woff"
],
"main": "dist/video-js/video.dev.js"
}
-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" ]
]
}
}
}
+13 -17
Ver Arquivo
@@ -1,34 +1,28 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Video.js Text Descriptions, Chapters &amp; Captions Example</title>
<link href="../../video-js.css" rel="stylesheet" type="text/css">
<script src="../../video.js"></script>
<!-- Set the location of the flash SWF -->
<script>
videojs.setGlobalOptions({
flash: {
swf: '../../video-js.swf'
}
});
</script>
<link href="http://vjs.zencdn.net/5.19/video-js.css" rel="stylesheet">
<script src="http://vjs.zencdn.net/ie8/1.1/videojs-ie8.min.js"></script>
<script src="http://vjs.zencdn.net/5.19/video.js"></script>
</head>
<body>
<p style="background-color:#eee; border: 1px solid #777; padding: 10px; font-size: .8em; line-height: 1.5em; font-family: Verdana, sans-serif;">This page demonstrates a text descriptions track (intended primarily for blind and visually impaired consumers of visual media)</p>
<!-- NOTE: we have to disable native Text Track support for the HTML5 tech,
since even HTML5 video players with native Text Track support
don't currently support 'description' text tracks in any
useful way! -->
useful way! Currently this means that iOS will not display
ANY text tracks -->
<video id="example_video_1" class="video-js vjs-default-skin" controls preload="none" width="640" height="360"
data-setup='{ "html5" : { "nativeTextTracks" : false } }'>
<source src="https://archive.org/download/ElephantsDream/ed_hd.mp4" type="video/mp4">
<source src="https://archive.org/download/ElephantsDream/ed_hd.ogv" type="video/ogv">
data-setup='{ "html5" : { "nativeTextTracks" : false } }'
poster="http://d2zihajmogu5jn.cloudfront.net/elephantsdream/poster.png">
<source src="//d2zihajmogu5jn.cloudfront.net/elephantsdream/ed_hd.mp4" type="video/mp4">
<source src="//d2zihajmogu5jn.cloudfront.net/elephantsdream/ed_hd.ogg" type="video/ogg">
<track kind="captions" src="captions.en.vtt" srclang="en" label="English" default></track><!-- Tracks need an ending tag thanks to IE9 -->
<track kind="captions" src="captions.sv.vtt" srclang="sv" label="Swedish"></track>
@@ -42,5 +36,7 @@
<p class="vjs-no-js">To view this video please enable JavaScript, and consider upgrading to a web browser that <a href="http://videojs.com/html5-video-support/" target="_blank">supports HTML5 video</a></p>
</video>
</body>
</html>
+18
Ver Arquivo
@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Index of video.js examples</title>
</head>
<body>
<h1>Index of video.js examples</h1>
<ul>
<li><a href="simple-embed">Video.js HTML5 video player simple example</a></li>
<li><a href="elephantsdream">Elephants Dream video with text descriptions, chapters &amp; captions example</a></li>
</ul>
</body>
</html>
+4 -5
Ver Arquivo
@@ -1,15 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Video.js | HTML5 Video Player</title>
<link href="http://vjs.zencdn.net/5.0.2/video-js.css" rel="stylesheet">
<script src="http://vjs.zencdn.net/ie8/1.1.0/videojs-ie8.min.js"></script>
<script src="http://vjs.zencdn.net/5.0.2/video.js"></script>
<link href="http://vjs.zencdn.net/5.19/video-js.css" rel="stylesheet">
<script src="http://vjs.zencdn.net/ie8/1.1/videojs-ie8.min.js"></script>
<script src="http://vjs.zencdn.net/5.19/video.js"></script>
</head>
<body>
<video id="example_video_1" class="video-js vjs-default-skin" controls preload="none" width="640" height="264" poster="http://vjs.zencdn.net/v/oceans.png" data-setup="{}">
@@ -22,6 +20,7 @@
<!-- Tracks need an ending tag thanks to IE9 -->
<p class="vjs-no-js">To view this video please enable JavaScript, and consider upgrading to a web browser that <a href="http://videojs.com/html5-video-support/" target="_blank">supports HTML5 video</a></p>
</video>
</body>
</html>
-309
Ver Arquivo
@@ -1,309 +0,0 @@
# FAQ
## Table of Contents
* [Q: What is video.js?](#q-what-is-videojs)
* [Q: How do I install video.js?](#q-how-do-i-install-videojs)
* [Q: Is video.js on bower?](#q-is-videojs-on-bower)
* [Q: What do video.js version numbers mean?](#q-what-do-videojs-version-numbers-mean)
* [Q: How can I troubleshoot playback issues?](#q-how-can-i-troubleshoot-playback-issues)
* [Q: A video does not play in a specific browser. Why?](#q-a-video-does-not-play-in-a-specific-browser-why)
* [Q: Why does the entire video download before playback? Why does the video load for a long time?](#q-why-does-the-entire-video-download-before-playback-why-does-the-video-load-for-a-long-time)
* [Q: I see an error thrown that mentions vdata12345. What is that?](#q-i-see-an-error-thrown-that-mentions-vdata12345-what-is-that)
* [Q: I think I found a bug with video.js or I want to add a feature. What should I do?](#q-i-think-i-found-a-bug-with-videojs-or-i-want-to-add-a-feature-what-should-i-do)
* [if you think that you can fix the issue or add the feature](#if-you-think-that-you-can-fix-the-issue-or-add-the-feature)
* [If you don't think you can fix the issue or add the feature](#if-you-dont-think-you-can-fix-the-issue-or-add-the-feature)
* [Q: What is a reduced test case?](#q-what-is-a-reduced-test-case)
* [Q: What media formats does video.js support?](#q-what-media-formats-does-videojs-support)
* [Q: How to I autoplay the video?](#q-how-to-i-autoplay-the-video)
* [Q: How can I autoplay a video on a mobile device?](#q-how-can-i-autoplay-a-video-on-a-mobile-device)
* [Q: How can I play RTMP video in video.js?](#q-how-can-i-play-rtmp-video-in-videojs)
* [Q: How can I hide the links to my video/subtitles/audio/tracks?](#q-how-can-i-hide-the-links-to-my-videosubtitlesaudiotracks)
* [Q: What is a plugin?](#q-what-is-a-plugin)
* [Q: How do I make a plugin for video.js?](#q-how-do-i-make-a-plugin-for-videojs)
* [Q: Where can I find a list of video.js plugins?](#q-where-can-i-find-a-list-of-videojs-plugins)
* [Q: How can I get my plugin listed on the website?](#q-how-can-i-get-my-plugin-listed-on-the-website)
* [Q: Where can I find a list of video.js skins?](#q-where-can-i-find-a-list-of-videojs-skins)
* [Q: Does video.js work as an audio only player?](#q-does-videojs-work-as-an-audio-only-player)
* [Q: Does video.js support audio tracks?](#q-does-videojs-support-audio-tracks)
* [Q: Does video.js support video tracks?](#q-does-videojs-support-video-tracks)
* [Q: Does video.js support text tracks (captions, subtitles, etc)?](#q-does-videojs-support-text-tracks-captions-subtitles-etc)
* [Q: Does video.js support HLS (HTTP Live streaming) video?](#q-does-videojs-support-hls-http-live-streaming-video)
* [Q: Does video.js support MPEG Dash video?](#q-does-videojs-support-mpeg-dash-video)
* [Q: Does video.js support live video?](#q-does-videojs-support-live-video)
* [Q: Can video.js wrap around YouTube videos?](#q-can-videojs-wrap-around-youtube-videos)
* [Q: Can video.js wrap around Vimeo videos?](#q-can-videojs-wrap-around-vimeo-videos)
* [Q: Does video.js support DRM video?](#q-does-videojs-support-drm-video)
* [Q: Does video.js have any support for advertisement integrations?](#q-does-videojs-have-any-support-for-advertisement-integrations)
* [Q: Can video.js be required in node.js?](#q-can-videojs-be-required-in-nodejs)
* [Q: Does video.js work with webpack?](#q-does-videojs-work-with-webpack)
## Q: What is video.js?
video.js is an extendable framework/library around the native video element. It does the following:
* Offers a plugin API so that different types of video can be handed to the native
video element (e.g. HLS, Flash, HTML5 video, etc).
* Unifies the native video api across browsers (polyfilling support for features
if necessary)
* Offers an extendable and themable UI
* Takes care of accessibility for the user (in-progress)
* Has a set of core plugins that offer support for tons of additional video formats.
* [videojs-contrib-hls][hls]
* [videojs-contrib-dash][dash]
* Support for DRM video via a core plugin
* [videojs-contrib-eme][eme]
* Lots of plugins which offer support for all kinds of features. See the [plugin list on videojs.com][plugin-list]
## Q: How do I install video.js?
Currently video.js can be installed using bower, npm, serving a release file from
a github tag, or even using a CDN hosted version. For information on doing any of those
see the [install guide][install-guide].
## Q: Is video.js on bower?
Yes! See the [install guide][install-guide] for more information.
## Q: What do video.js version numbers mean?
video.js follows [semver][semver] which means that the API should not change
out from under a user unless there is a major version increase.
## Q: How can I troubleshoot playback issues?
See the [troubleshooting guide][troubleshooting]. If troubleshooting does not
solve your issue, please submit a [pull request or an issue][pr-issue-question].
## Q: A video does not play in a specific browser. Why?
See the [troubleshooting guide][troubleshooting]. If troubleshooting does not
solve your issue, please submit a [pull request or an issue][pr-issue-question].
## Q: Why does the entire video download before playback? Why does the video load for a long time?
See the [troubleshooting guide][troubleshooting]. If troubleshooting does not
solve your issue, please submit a [pull request or an issue][pr-issue-question].
## Q: I see an error thrown that mentions `vdata12345`. What is that?
See the [troubleshooting guide][troubleshooting]. If troubleshooting does not
solve your issue, please submit a [pull request or an issue][pr-issue-question].
## Q: I think I found a bug with video.js or I want to add a feature. What should I do?
### if you think that you can fix the issue or add the feature
Submit a pull request to the [video.js repo][vjs-prs].
Make sure to follow the [contributing guide][contributing-prs] and
the [pull request template][pr-template].
### If you don't think you can fix the issue or add the feature
Open an [issue on the video.js repo][vjs-issues]. Make
sure that you follow the [issue template][issue-template] and the
[contributing guide][contributing-issues] so that we can better assist you
with your issue.
## Q: What is a reduced test case?
A reduced test case is an example of the problem that you are facing in isolation.
Think of it as example page that reproduces the issue in the least amount of possible code.
We have a [starter example][starter-example] for reduced test cases. To learn more
about reduced test cases visit [css-tricks](https://css-tricks.com/reduced-test-cases/)
## Q: What media formats does video.js support?
This depends on the formats supported by the browser's HTML5 video element, and the playback
techs made available to video.js. For example, video.js 5 includes the Flash tech by default which
enables the playback of FLV video where the Flash plugin is available. For more information
on media formats see the [troubleshooting guide][troubleshooting].
## Q: How to I autoplay the video?
Video.js supports the standard html5 `autoplay` attribute on the video element.
It also supports it as an option to video.js or as a method invocation on the player.
```html
<video autoplay controls class="video-js">
```
```js
var player = videojs('my-video', {
autoplay: true
});
// or
player.autoplay(true);
```
### Q: How can I autoplay a video on a mobile device?
Most mobile devices have blocked autoplaying videos until recently.
For mobile devices that don't support autoplaying, autoplay isn't supported by video.js.
For those devices that support autoplaying, like iOS10 and Chrome for Android 53+,
you must mute the video or have a video without audio tracks to be able to play it.
For example:
```html
<video muted autoplay playsinline>
```
Will make an inline, muted, autoplaying video on an iPhone with iOS10.
## Q: How can I play RTMP video in video.js?
Make sure that the Flash tech is available -- RTMP is not playable on browsers without Flash including mobile. Then, just set the rtmp source with
an appropriate type -- `rtmp/mp4` or `rtmp/flv`.
The main thing to be aware of is that video.js splits the connection url and stream name with the `&` character.
So, you'd want to update the url to follow that format. For example: `rtmp://example.com/live&foo` or `rtmp://example.com/fms&mp4:path/to/file.mp4`.
If the server requires query parameters for authentication, these should be added to the connection part url, for example `rtmp://example.com/live?token=1234&foo`.
## Q: How can I hide the links to my video/subtitles/audio/tracks?
It's impossible to hide the network requests a browser makes and difficult to
sufficiently obfuscate URLs in the source. Techniques such as token authentication may
help but are outside of the scope of video.js.
For content that must be highly secure [videojs-contrib-eme][eme] adds DRM support.
## Q: What is a plugin?
A plugin is a group of reusable functionality that can be re-used by others. For instance a plugin could add
a button to video.js that makes the video replay 10 times in a row before it stops playback for good. If such
a plugin existed and was published users could include it on their page to share that functionality.
## Q: How do I make a plugin for video.js?
See the [plugin guide][plugin-guide] for information on making a plugin for video.js.
<!-- TODO: Once these is a button guide, add this back in
## Q: How do I add a button to video.js?
See the [button guide][button-guide] for information on adding a button to video.js.
-->
## Q: Where can I find a list of video.js plugins?
The official [list of plugins on videojs.com][plugin-list].
## Q: How can I get my plugin listed on the website?
Add the 'videojs-plugin' [keyword to your array in package.json][npm-keywords]
and publish your package to npm. If you use the [plugin generator][generator] this will be done automatically for you. See
the [plugins guide][plugin-guide] for more information.
## Q: Where can I find a list of video.js skins?
See the [video.js github wiki][skins-list].
## Q: Does video.js work as an audio only player?
Yes! It can be used to play audio only files in a `<video>` or `<audio>` tag. The
difference being that the `<audio>` tag will not have a blank display area and the `<video>`
tag will. Note that audio only will not work with the Flash playback tech.
## Q: Does video.js support audio tracks?
Yes! See the [audio tracks guide][audio-tracks] for information on using audio tracks.
## Q: Does video.js support video tracks?
The code for video tracks exists but it has not been tested. See the [video tracks guide][video-tracks]
for more information on using video tracks.
## Q: Does video.js support text tracks (captions, subtitles, etc)?
Yes! See the [text tracks guide][text-tracks] for information on using text tracks.
## Q: Does video.js support HLS (HTTP Live streaming) video?
video.js supports HLS video if the native HTML5 element supports HLS (e.g. Safari, Edge,
Chrome for Android, and iOS). For browsers without native support see the [videojs-contrib-hls][hls]
project which adds support.
## Q: Does video.js support MPEG Dash video?
video.js itself does not support MPEG DASH, however an offical project called [videojs-contrib-dash][dash]
adds support for MPEG DASH video.
## Q: Does video.js support live video?
Yes! Video.js adds support for live videos via the Flash tech which supports RTMP streams.
The official HLS tech, [videojs-contrib-hls][hls], will add support for live HLS video
if you add it to your page with video.js.
## Q: Can video.js wrap around YouTube videos?
No. There is an official plugin that adds support. It is called [videojs-youtube][youtube].
## Q: Can video.js wrap around Vimeo videos?
No. There is an official plugin that adds support. It is called [videojs-vimeo][vimeo].
## Q: Does video.js support DRM video?
No. There is an official plugin that adds support. It is called [videojs-contrib-eme][eme].
## Q: Does video.js have any support for advertisement integrations?
No. There is an official plugin that adds support. It is called [videojs-contrib-ads][ads].
## Q: Can video.js be required in node.js?
Yes! Please [submit an issue or open a pull request][pr-issue-question] if this does not work.
## Q: Does video.js work with webpack?
Yes! Please [submit an issue or open a pull request][pr-issue-question] if this does not work.
[plugin-guide]: plugins.md
[install-guide]: http://videojs.com/getting-started/
[troubleshooting]: troubleshooting.md
[video-tracks]: video-tracks.md
[audio-tracks]: audio-tracks.md
[text-tracks]: text-tracks.md
[pr-issue-question]: #q-i-think-i-found-a-bug-with-videojs-or-i-want-to-add-a-feature-what-should-i-do
[hls]: http://github.com/videojs/videojs-contrib-hls
[dash]: http://github.com/videojs/videojs-contrib-dash
[eme]: https://github.com/videojs/videojs-contrib-eme
[generator]: https://github.com/videojs/generator-videojs-plugin
[youtube]: https://github.com/videojs/videojs-youtube
[vimeo]: https://github.com/videojs/videojs-vimeo
[ads]: https://github.com/videojs/videojs-contrib-ads
[pr-template]: http://github.com/videojs/video.js/blob/master/.github/PULL_REQUEST_TEMPLATE.md
[issue-template]: http://github.com/videojs/video.js/blob/master/.github/ISSUE_TEMPLATE.md
[plugin-list]: http://videojs.com/plugins
[skins-list]: https://github.com/videojs/video.js/wiki/Skins
[contributing-issues]: http://github.com/videojs/video.js/blob/master/CONTRIBUTING.md#filing-issues
[contributing-prs]: http://github.com/videojs/video.js/blob/master/CONTRIBUTING.md#contributing-code
[vjs-issues]: https://github.com/videojs/video.js/issues
[vjs-prs]: https://github.com/videojs/video.js/pulls
[npm-keywords]: https://docs.npmjs.com/files/package.json#keywords
[semver]: http://semver.org/
[starter-example]: http://jsbin.com/axedog/edit?html,output
+7 -3
Ver Arquivo
@@ -25,7 +25,7 @@ cross-browser implementation of audio tracks.
They must be added programmatically.
* Video.js only stores track representations. Switching audio tracks for playback is
_not handled by Video.js_ and must be handled elsewhere - for example,
[videojs-contrib-hls](http://github.com/videojs/videojs-contrib-hls) handles switching
[videojs-contrib-hls][hls] handles switching
audio tracks to support track selection through the UI.
## Working with Audio Tracks
@@ -91,7 +91,7 @@ player.audioTracks().removeTrack(track);
## API
For more complete information, refer to the
[Video.js API docs](http://docs.videojs.com/docs/api/index.html), specifically:
[Video.js API docs](http://docs.videojs.com/), specifically:
* `Player#audioTracks`
* `AudioTrackList`
@@ -140,7 +140,7 @@ The valid [BCP 47](https://tools.ietf.org/html/bcp47) code for the language of t
track, e.g. `"en"` for English or `"es"` for Spanish.
For supported language translations, please see the [languages folder (/lang)](https://github.com/videojs/video.js/tree/master/lang)
located in the Video.js root and refer to the [languages guide](languages.md) for more
located in the Video.js root and refer to the [languages guide][languages-guide] for more
information on languages in Video.js.
#### `enabled`
@@ -154,4 +154,8 @@ than one, the last one to be enabled will end up being the only one. While the s
allows for more than one track to be enabled, Safari and most implementations only allow
one audio track to be enabled at a time.
[languages-guide]: /docs/guides/languages.md
[spec-audiotrack]: https://html.spec.whatwg.org/multipage/embedded-content.html#audiotrack
[hls]: http://github.com/videojs/videojs-contrib-hls
+16 -15
Ver Arquivo
@@ -10,26 +10,26 @@ The architecture of the Video.js player is centered around components. The `Play
* [Basic Example](#basic-example)
* [Using Options](#using-options)
* [Event Listening](#event-listening)
* [using on](#using-on)
* [Using on](#using-on)
* [Using off](#using-off)
* [Using one](#using-one)
* [Using trigger](#using-trigger)
* [Default Component Tree](#default-component-tree)
* [Specific Component Details](#specific-component-details)
* [Progress Control](#progress-control)
* [Volume Panel](#volume-panel)
* [Text Track Settings](#text-track-settings)
## What is a Component?
A component is a JavaScript object that has the following features:
* An associated DOM element.
* An associated DOM element, in almost all cases.
* An association to a `Player` object.
* The ability to manage any number of child components.
* The ability to listen for and trigger events.
* A lifecycle of initialization and disposal.
For more specifics on the programmatic interface of a component, see [the component API docs](http://docs.videojs.com/docs/api/component.html).
For more specifics on the programmatic interface of a component, see [the component API docs][api].
## Creating a Component
@@ -75,7 +75,7 @@ console.log(button.el());
## Component Children
Again, refer to [the component API docs](http://docs.videojs.com/docs/api/component.html) for complete details on methods available for managing component structures.
Again, refer to [the component API docs][api] for complete details on methods available for managing component structures.
### Basic Example
@@ -195,8 +195,8 @@ myComponent.trigger('eventType');
// does nothing
```
If myFunc gets excluded, *all* listeners for the event type will get removed. If
eventType gets excluded, *all* listeners will get removed from the component.
If myFunc gets excluded, _all_ listeners for the event type will get removed. If
eventType gets excluded, _all_ listeners will get removed from the component.
You can use `off` to remove listeners that get added to other elements or
components using:
@@ -285,13 +285,14 @@ The default component structure of the Video.js player looks something like this
```tree
Player
├── MediaLoader (has no DOM element)
├── PosterImage
├── TextTrackDisplay
├── LoadingSpinner
├── BigPlayButton
├─┬ ControlBar
│ ├── PlayToggle
│ ├── VolumeMenuButton
│ ├── VolumePanel
│ ├── CurrentTimeDisplay (hidden by default)
│ ├── TimeDivider (hidden by default)
│ ├── DurationDisplay (hidden by default)
@@ -316,24 +317,24 @@ Player
## Specific Component Details
### Progress Control
### Volume Panel
The progress control has a grandchild component, the mouse time display, which shows a time tooltip that follows the mouse cursor.
The `VolumePanel` includes the `MuteToggle` and the `VolumeControl` Components, which will be hidden if volume changes are not supported. There is one important option for the `VolumePanel` which can make your `VolumeControl` appear vertically over the `MuteToggle`. This can be set by passing `VolumePanel` `{inline: false}` as the default behavior is a horizontal `VolumeControl` with `{inline: true}`.
By default, the progress control is sandwiched inside the control bar between the volume menu button and the remaining time display. Some skins attempt to move the it above the control bar and have it span the full width of the player. In these cases, it is less than ideal to have the tooltips leave the bounds of the player. This can be prevented by setting the `keepTooltipsInside` option on the progress control.
Example of a vertical `VolumeControl`
```js
let player = videojs('myplayer', {
controlBar: {
progressControl: {
keepTooltipsInside: true
volumePanel: {
inline: false
}
}
});
```
> **Note:** This makes the tooltips use a real element instead of pseudo-elements so targeting them with CSS is different.
### Text Track Settings
The text track settings component is only available when using emulated text tracks.
[api]: http://docs.videojs.com/Component.html
+112
Ver Arquivo
@@ -0,0 +1,112 @@
# Debugging
## Table of Contents
* [Logging](#logging)
* [API Overview](#api-overview)
* [Log Safely](#log-safely)
* [Log Objects Usefully](#log-objects-usefully)
* [Log Levels](#log-levels)
* [Available Log Levels](#available-log-levels)
* [History](#history)
## Logging
Video.js includes `videojs.log`, a lightweight wrapper around a subset of [the `console` API][console]. The available methods are `videojs.log`, `videojs.log.warn`, and `videojs.log.error`.
### API Overview
Most of these methods should be fairly self-explanatory, but for complete details, see [the API docs][api].
| Method | Alias Of | Matching Level(s) |
| ------------------------------- | --------------- | ----------------- |
| `videojs.log()` | `console.log` | all |
| `videojs.log.warn()` | `console.warn` | all, warn |
| `videojs.log.error()` | `console.error` | all, warn, error |
| `videojs.log.level()` | n/a | n/a |
| `videojs.log.history()` | n/a | n/a |
| `videojs.log.history.clear()` | n/a | n/a |
| `videojs.log.history.disable()` | n/a | n/a |
| `videojs.log.history.enable()` | n/a | n/a |
For descriptions of these features, please refer to the sections below.
### Log Safely
Unlike the `console`, it's safe to leave `videojs.log` calls in your code. They won't throw errors when the `console` doesn't exist.
### Log Objects Usefully
Similar to the `console`, any number of mixed-type values can be passed to `videojs.log` methods:
```js
videojs.log('this is a string', {butThis: 'is an object'});
```
However, certain browser consoles (namely, IE10 and lower) do not support non-string values. Video.js improves on this situation by passing objects through `JSON.stringify` before logging them in IE10 and below. In other words, instead of the above producing this:
```txt
VIDEOJS: this is a string [object Object]
```
it will produce this:
```txt
VIDEOJS: this is a string {"butThis": "is an object"}
```
### Log Levels
Unlike the `console`, `videojs.log` includes the concept of logging levels. These levels toggle logging methods on or off.
Levels are exposed through the `videojs.log.level` method. This method acts as both a getter and setter for the current logging level. With no arguments, it returns the current logging level:
```js
videojs.log.level(); // "all"
```
By passing a string, the logging level can be changed to one of the available logging levels:
```js
videojs.log.level('error'); // show only error messages and suppress others
videojs.log('foo'); // does nothing
videojs.log.warn('foo'); // does nothing
videojs.log.error('foo'); // logs "foo" as an error
```
### Available Log Levels
* **all** (default): enables all logging methods
* **error**: only show `log.error` messages
* **off**: disable all logging methods
* **warn**: only show `log.warn` _and_ `log.error` messages
### History
> **Note:** In Video.js 5, `videojs.log.history` was an array. As of Video.js 6, it is a function which returns an array. This change was made to provide a richer, safer logging history API.
By default, the `videojs.log` module tracks a history of _everything_ passed to it regardless of logging level:
```js
videojs.log.history(); // an array of everything that's been logged up to now
```
This will work even when logging is set to **off**.
This can be useful, but it can also be a source of memory leaks. For example, logged objects will be retained in history even if references are removed everywhere else!
To avoid this problem, history can be disabled or enabled via method calls (using the `disable` and `enable` methods respectively). Disabling history is as easy as:
```js
videojs.log.history.disable();
```
Finally, the history (if enabled) can be cleared at any time via:
```js
videojs.log.history.clear();
```
[api]: http://docs.videojs.com/
[console]: https://developer.mozilla.org/en-US/docs/Web/API/Console
+3 -3
Ver Arquivo
@@ -4,13 +4,13 @@
* [Overview](#overview)
* [on() and addEventListener()](#on-and-addeventlistener)
* [off() and removeEventListener](#off-and-removeeventlistener)
* [off() and removeEventListener()](#off-and-removeeventlistener)
* [one()](#one)
* [trigger() and dispatchEvent](#trigger-and-dispatchevent)
* [trigger() and dispatchEvent()](#trigger-and-dispatchevent)
## Overview
Events in video.js are setup so that they mimic the DOM API that is used on object, but also have helpful shorthand functions with the same functionality.
Events in Video.js are setup so that they mimic the DOM API that is used on object, but also have helpful shorthand functions with the same functionality.
## `on()` and `addEventListener()`
+364
Ver Arquivo
@@ -0,0 +1,364 @@
# FAQ
## Table of Contents
* [Q: What is Video.js?](#q-what-is-videojs)
* [Q: How do I install Video.js?](#q-how-do-i-install-videojs)
* [Q: Is Video.js on bower?](#q-is-videojs-on-bower)
* [Q: What do Video.js version numbers mean?](#q-what-do-videojs-version-numbers-mean)
* [Q: How can I troubleshoot playback issues?](#q-how-can-i-troubleshoot-playback-issues)
* [Q: A video does not play in a specific browser. Why?](#q-a-video-does-not-play-in-a-specific-browser-why)
* [Q: Why does the entire video download before playback? Why does the video load for a long time?](#q-why-does-the-entire-video-download-before-playback-why-does-the-video-load-for-a-long-time)
* [Q: I see an error thrown that mentions vdata12345. What is that?](#q-i-see-an-error-thrown-that-mentions-vdata12345-what-is-that)
* [Q: I think I found a bug with Video.js or I want to add a feature. What should I do?](#q-i-think-i-found-a-bug-with-videojs-or-i-want-to-add-a-feature-what-should-i-do)
* [if you think that you can fix the issue or add the feature](#if-you-think-that-you-can-fix-the-issue-or-add-the-feature)
* [If you don't think you can fix the issue or add the feature](#if-you-dont-think-you-can-fix-the-issue-or-add-the-feature)
* [Q: What is a reduced test case?](#q-what-is-a-reduced-test-case)
* [Q: What media formats does Video.js support?](#q-what-media-formats-does-videojs-support)
* [Q: How does Video.js choose which source to use?](#q-how-does-videojs-choose-which-source-to-use)
* [Q: How to I autoplay the video?](#q-how-to-i-autoplay-the-video)
* [Q: How can I autoplay a video on a mobile device?](#q-how-can-i-autoplay-a-video-on-a-mobile-device)
* [Q: How can I play RTMP video in Video.js?](#q-how-can-i-play-rtmp-video-in-videojs)
* [Q: How can I hide the links to my video/subtitles/audio/tracks?](#q-how-can-i-hide-the-links-to-my-videosubtitlesaudiotracks)
* [Q: Can I turn off Video.js logging?](#q-can-i-turn-off-videojs-logging)
* [Q: What is a plugin?](#q-what-is-a-plugin)
* [Q: How do I make a plugin for Video.js?](#q-how-do-i-make-a-plugin-for-videojs)
* [Q: Where can I find a list of Video.js plugins?](#q-where-can-i-find-a-list-of-videojs-plugins)
* [Q: How can I get my plugin listed on the website?](#q-how-can-i-get-my-plugin-listed-on-the-website)
* [Q: Where can I find a list of Video.js skins?](#q-where-can-i-find-a-list-of-videojs-skins)
* [Q: Does Video.js work as an audio only player?](#q-does-videojs-work-as-an-audio-only-player)
* [Q: Does Video.js support audio tracks?](#q-does-videojs-support-audio-tracks)
* [Q: Does Video.js support video tracks?](#q-does-videojs-support-video-tracks)
* [Q: Does Video.js support text tracks (captions, subtitles, etc)?](#q-does-videojs-support-text-tracks-captions-subtitles-etc)
* [Q: Does Video.js support HLS (HTTP Live streaming) video?](#q-does-videojs-support-hls-http-live-streaming-video)
* [Q: Does Video.js support MPEG Dash video?](#q-does-videojs-support-mpeg-dash-video)
* [Q: Does Video.js support live video?](#q-does-videojs-support-live-video)
* [Q: Can Video.js wrap around YouTube videos?](#q-can-videojs-wrap-around-youtube-videos)
* [Q: Can Video.js wrap around Vimeo videos?](#q-can-videojs-wrap-around-vimeo-videos)
* [Q: Does Video.js support DRM video?](#q-does-videojs-support-drm-video)
* [Q: Does Video.js have any support for advertisement integrations?](#q-does-videojs-have-any-support-for-advertisement-integrations)
* [Q: Can Video.js be required in node.js?](#q-can-videojs-be-required-in-nodejs)
* [Q: Does Video.js work with webpack?](#q-does-videojs-work-with-webpack)
* [Q: Does Video.js work with react?](#q-does-videojs-work-with-react)
## Q: What is Video.js?
Video.js is an extendable framework/library around the native video element. It does the following:
* Offers a plugin API so that different types of video can be handed to the native
video element (e.g. [HLS][hls], [Flash][flash], HTML5 video, etc).
* Unifies the native video API across browsers (polyfilling support for features
if necessary)
* Offers an extendable and themable UI
* Ensures accessibility for keyboard and screen reader users
* Has a set of core plugins that offer support for additional video formats:
* [videojs-contrib-hls][hls]
* [videojs-contrib-dash][dash]
* Supports DRM video via a core plugin:
* [videojs-contrib-eme][eme]
* Is extensible with lots of plugins offering support for all kinds of features. See the [plugin list on videojs.com][plugin-list]
## Q: How do I install Video.js?
Currently Video.js can be installed using npm, serving a release file from
a GitHub tag, or even using a CDN hosted version. For information on doing any of those
see the [setup guide][install-guide].
## Q: Is Video.js on bower?
Versions prior to Video.js 6 support bower, however, as of Video.js 6, bower is no
longer officially supported. Please see https://github.com/videojs/video.js/issues/4012
for more information.
## Q: What do Video.js version numbers mean?
Video.js follows [semver][semver] which means that the API should not change
out from under a user unless there is a major version increase.
## Q: How can I troubleshoot playback issues?
See the [troubleshooting guide][troubleshooting]. If troubleshooting does not
solve your issue, please ask in [Slack][slack] or submit an [issue][pr-issue-question].
When seeking help about a playback issue the problem is often specific to the video file used, the way the video is hosted or the browser, so make sure to include all of that information and a [reduced test case](#q-what-is-a-reduced-test-case).
## Q: A video does not play in a specific browser. Why?
See the [troubleshooting guide][troubleshooting]. If troubleshooting does not
solve your issue, please ask in [Slack][slack] or submit an [issue][pr-issue-question].
## Q: Why does the entire video download before playback? Why does the video load for a long time?
See the [troubleshooting guide][troubleshooting]. If troubleshooting does not
solve your issue, please ask in [Slack][slack] or submit an [issue][pr-issue-question].
## Q: I see an error thrown that mentions `vdata12345`. What is that?
See the [troubleshooting guide][troubleshooting]. If troubleshooting does not
solve your issue, please ask in [Slack][slack] or submit an [issue][pr-issue-question].
## Q: I think I found a bug with Video.js or I want to add a feature. What should I do?
### If you think that you can fix the issue or add the feature
A pull request would be very welcome in the [Video.js repo][vjs-prs].
Make sure to follow the [contributing guide][contributing-prs] and
the [pull request template][pr-template].
### If you don't think you can fix the issue or add the feature
Open an [issue on the Video.js repo][vjs-issues]. Make
sure that you follow the [issue template][issue-template] and the
[contributing guide][contributing-issues] so that we can better assist you
with your issue.
## Q: What is a reduced test case?
A reduced test case is an example of the problem that you are facing in isolation.
Think of it as example page that reproduces the issue in the least amount of possible code.
It's important to add a reduced case. Even if the problem seems obvious it may not be to
others. Having a example to refer to also makes the difference between somebody being able
to take a look and immediately see what's wrong, and needing to take time to recreate what
they think you are describing.
We have a [starter example][starter-example] for reduced test cases. To learn more
about reduced test cases visit [css-tricks][reduced-test-case]
## Q: What media formats does Video.js support?
This depends on the formats supported by the browser's HTML5 video element, and the playback
techs/plugins made available to Video.js. For more information on media formats see the [troubleshooting guide][troubleshooting].
## Q: How does Video.js choose which source to use?
When an array of sources is available, Video.js test each source in the order given. For each source, each tech in the [`techOrder`][techorder] will be checked to see if it can play it whether directly or via source handler (such as videojs-contrib-hls). The first match will be chosen.
## Q: How to I autoplay the video?
Video.js supports the standard html5 `autoplay` attribute on the video element.
It also supports it as an option to Video.js or as a method invocation on the player.
```html
<video autoplay controls class="video-js">
```
```js
var player = videojs('my-video', {
autoplay: true
});
// or
player.autoplay(true);
```
### Q: How can I autoplay a video on a mobile device?
Most mobile devices have blocked autoplaying videos until recently.
For mobile devices that don't support autoplaying, autoplay isn't supported by Video.js.
For those devices that support autoplaying, like iOS10 and Chrome for Android 53+,
you must mute the video or have a video without audio tracks to be able to play it.
For example:
```html
<video muted autoplay playsinline>
```
Will make an inline, muted, autoplaying video on an iPhone with iOS10.
## Q: How can I play RTMP video in Video.js?
RTMP requires Flash to play back. You'll need both a browser that supports Flash and the Flash tech.
In Video.js version 6, the Flash tech is not included by default and is available as a separate [videojs-flash package][flash]. In previous versions it was builtin to Video.js.
The RTMP source should be set with an appropriate type -- `rtmp/mp4` or `rtmp/flv`.
Be aware of that Video.js splits the connection url and stream name with the `&` character, for example: `rtmp://example.com/live&foo` or `rtmp://example.com/fms&mp4:path/to/file.mp4`.
If the server requires query parameters for authentication, these should be added to the connection part URL, for example `rtmp://example.com/live?token=1234&foo`.
Bear in mind that mobile browsers do not support Flash, and modern desktop browsers make it increasingly difficult to use Flash or disable it by default for your end users. Consider moving to a modern format such as HLS or DASH.
## Q: How can I hide the links to my video/subtitles/audio/tracks?
It's impossible to hide the network requests a browser makes and difficult to
sufficiently obfuscate URLs in the source. Techniques such as token authentication may
help but are outside of the scope of Video.js.
For content that must be highly secure [videojs-contrib-eme][eme] adds DRM support.
## Q: Can I turn off Video.js logging?
Yes! This can be achieved by adding the following code _after_ including Video.js, but _before_ creating any player(s):
```js
videojs.log.level('off');
```
For more information, including which logging levels are available, check out the [debugging guide][debug-guide].
## Q: What is a plugin?
A plugin is a group of reusable functionality that can be re-used by others. For instance a plugin could add
a button to Video.js that makes the video replay 10 times in a row before it stops playback for good. If such
a plugin existed and was published users could include it on their page to share that functionality.
## Q: How do I make a plugin for Video.js?
See the [plugin guide][plugin-guide] for information on making a plugin for Video.js.
## Q: How do I add a button to Video.js?
See the [components guide][components-guide] for an example of adding a button to Video.js.
## Q: Where can I find a list of Video.js plugins?
A list of plugins published to npm with the `videojs-plugin` keyword is maintained [on videojs.com][plugin-list].
## Q: How can I get my plugin listed on the website?
Add the 'videojs-plugin' [keyword to your array in package.json][npm-keywords]
and publish your package to npm. If you use the [plugin generator][generator] this will be done automatically for you. See
the [plugins guide][plugin-guide] for more information.
## Q: Where can I find a list of Video.js skins?
See the [Video.js GitHub wiki][skins-list].
## Q: Does Video.js work as an audio only player?
Yes! It can be used to play audio only files in a `<video>` or `<audio>` tag.
Note that audio-only sources do not work with the Flash playback tech.
## Q: Does Video.js support audio tracks?
Yes! See the [audio tracks guide][audio-tracks] for information on using audio tracks.
## Q: Does Video.js support video tracks?
Alternate video tracks support is in development. See [video tracks guide][video-tracks]
for more information on using video tracks.
## Q: Does Video.js support text tracks (captions, subtitles, etc)?
Yes! See the [text tracks guide][text-tracks] for information on using text tracks.
## Q: Does Video.js support HLS (HTTP Live streaming) video?
Video.js supports HLS video if the native HTML5 element supports HLS (e.g. Safari, Edge,
Chrome for Android, and iOS). For browsers without native support the [videojs-contrib-hls][hls]
project which adds support.
Note that for non-native playback of HLS it is essential that the server hosting the video sets [CORS headers][cors].
## Q: Does Video.js support MPEG DASH video?
MPEG DASH support is provided byt the [videojs-contrib-dash][dash]
package.
Like HLS, DASH streams require [CORS headers][cors].
## Q: Does Video.js support live video?
Yes! Common formats for live are HLS or historically RTMP.
HLS is supported via [videojs-contrib-hls][hls]. and RTMP via [videojs-flash][flash].
## Q: Can Video.js play YouTube videos?
There is an official plugin that adds support, [videojs-youtube][youtube].
## Q: Can Video.js play Vimeo videos?
There is an official plugin that adds support, [videojs-vimeo][vimeo].
## Q: Does Video.js support DRM video?
There is an official plugin that adds support, [videojs-contrib-eme][eme].
## Q: Does Video.js have any support for advertisement integrations?
There is an official plugin that adds core advertising support, [videojs-contrib-ads][ads]. Further plugins build on this which handle the communication with the ad server and display of the ad, for instance [Google's IMA plugin][google-ima].
## Q: Can Video.js be required in node.js?
Yes! Video.js is [published on NPM][node].
## Q: Does Video.js work with webpack?
Yes! See the [Webpack and Video.js configuration guide][webpack-guide].
## Q: Does Video.js work with react?
Yes! See [ReactJS integration example][react-guide].
[ads]: https://github.com/videojs/videojs-contrib-ads
[audio-tracks]: /docs/guides/audio-tracks.md
[contributing-issues]: http://github.com/videojs/video.js/blob/master/CONTRIBUTING.md#filing-issues
[contributing-prs]: http://github.com/videojs/video.js/blob/master/CONTRIBUTING.md#contributing-code
[components-guide]: /docs/guides/components.md
[cors]: https://enable-cors.org
[dash]: http://github.com/videojs/videojs-contrib-dash
[debug-guide]: /docs/guides/debugging.md
[eme]: https://github.com/videojs/videojs-contrib-eme
[flash]: https://github.com/videojs/videojs-flash
[generator]: https://github.com/videojs/generator-videojs-plugin
[google-ima]: https://github.com/googleads/videojs-ima
[hls]: http://github.com/videojs/videojs-contrib-hls
[install-guide]: http://videojs.com/getting-started/
[issue-template]: http://github.com/videojs/video.js/blob/master/.github/ISSUE_TEMPLATE.md
[node]: https://www.npmjs.com/package/video.js
[npm-keywords]: https://docs.npmjs.com/files/package.json#keywords
[plugin-guide]: /docs/guides/plugins.md
[plugin-list]: http://videojs.com/plugins
[pr-issue-question]: #q-i-think-i-found-a-bug-with-videojs-or-i-want-to-add-a-feature-what-should-i-do
[pr-template]: http://github.com/videojs/video.js/blob/master/.github/PULL_REQUEST_TEMPLATE.md
[react-guide]: /docs/guides/react.md
[reduced-test-case]: https://css-tricks.com/reduced-test-cases/
[semver]: http://semver.org/
[skins-list]: https://github.com/videojs/video.js/wiki/Skins
[slack]: https://videojs.slack.com
[starter-example]: http://jsbin.com/axedog/edit?html,output
[techorder]: [cors]: /docs/guides/options.md#techorder
[text-tracks]: /docs/guides/text-tracks.md
[troubleshooting]: /docs/guides/troubleshooting.md
[video-tracks]: /docs/guides/video-tracks.md
[vimeo]: https://github.com/videojs/videojs-vimeo
[vjs-issues]: https://github.com/videojs/video.js/issues
[vjs-prs]: https://github.com/videojs/video.js/pulls
[webpack-guide]: /docs/guides/webpack.md
[youtube]: https://github.com/videojs/videojs-youtube
+16 -16
Ver Arquivo
@@ -1,6 +1,6 @@
# Hooks
Hooks exist so that users can "hook" on to certain video.js player lifecycle
Hooks exist so that users can "hook" on to certain Video.js player lifecycle
## Table of Contents
@@ -14,27 +14,27 @@ 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
`beforesetup` is called just before the player is created. This allows:
* modification of the options passed to the video.js function (`videojs('some-id, options)`)
* modification of the options passed to the Video.js function (`videojs('some-id, options)`)
* modification of the dom video element that will be used for the player
`beforesetup` hook functions should:
* take two arguments
1. videoEl: dom video element that video.js is going to use to create a player
1. options: options that video.js was intialized with and will later pass to the player during creation
* return options that will merge and override options that video.js with intialized with
1. videoEl: dom video element that Video.js is going to use to create a player
1. options: options that Video.js was intialized with and will later pass to the player during creation
* return options that will merge and override options that Video.js with intialized with
Example: adding beforesetup hook
```js
var beforeSetup = function(videoEl, options) {
// videoEl.id will be some-id here, since that is what video.js
// videoEl.id will be some-id here, since that is what Video.js
// was created with
videoEl.className += ' some-super-class';
@@ -58,16 +58,16 @@ videojs('some-id', {autoplay: true, controls: true});
`setup` is called just after the player is created. This allows:
* plugin or custom functionalify to intialize on the player
* plugin or custom functionality to intialize on the player
* changes to the player object itself
`setup` hook functions:
* Take one argument
* player: the player that video.js created
* player: the player that Video.js created
* Don't have to return anything
Example: adding setup hook
Example: adding a setup hook
```js
var setup = function(player) {
@@ -76,7 +76,7 @@ Example: adding setup hook
};
var foo = function() {};
videojs.plugin('foo', foo);
videojs.registerPlugin('foo', foo);
videojs.hook('setup', setup);
var player = videojs('some-id', {autoplay: true, controls: true});
```
@@ -85,7 +85,7 @@ Example: adding setup hook
### Adding
In order to use hooks you must first include video.js in the page or script that you are using. Then you add hooks using `videojs.hook(<name>, function)` before running the `videojs()` function.
In order to use hooks you must first include Video.js in the page or script that you are using. Then you add hooks using `videojs.hook(<name>, function)` before running the `videojs()` function.
Example: adding hooks
@@ -102,13 +102,13 @@ videojs.hook('setup', function(player) {
var player = videojs('vid1', {autoplay: false});
```
After adding your hooks they will automatically be run at the correct time in the video.js lifecycle.
After adding your hooks they will automatically be run at the correct time in the Video.js lifecycle.
### Getting
To access the array of hooks that currently exists and will be run on the video.js object you can use the `videojs.hooks` function.
To access the array of hooks that currently exists and will be run on the Video.js object you can use the `videojs.hooks` function.
Example: getting all hooks attached to video.js
Example: getting all hooks attached to Video.js
```js
var beforeSetupHooks = videojs.hooks('beforesetup');
@@ -117,7 +117,7 @@ var setupHooks = videojs.hooks('setup');
### Removing
To stop hooks from being executed during the video.js lifecycle you will remove them using `videojs.removeHook`.
To stop hooks from being executed during the Video.js lifecycle you will remove them using `videojs.removeHook`.
Example: remove a hook that was defined by you
+33 -31
Ver Arquivo
@@ -1,8 +1,9 @@
# Languages
Multiple language support allows for users of non-English locales to natively interact with the Video.js player.
Video.js includes localization support to present text in a language other than the default English where appropriate.
For an up-to-date list of the languages Video.js supports, see the [languages folder (`lang`)][lang-supported]. These JSON files are converted to JavaScript during the Video.js build process.
For an up-to-date list of the languages Video.js supports, see the [languages folder (`lang`)][lang-supported].
Some translations may be less complete than others - see the [translations needed doc][translations-needed] for a table of strings that are missing from the translations available. Contributions are welcome to update those that are incomplete.
## Table of Contents
@@ -22,7 +23,9 @@ For an up-to-date list of the languages Video.js supports, see the [languages fo
## Using Video.js Languages
Video.js ships with multiple translations (in `dist/lang/`) in JavaScript files. Each of these files can be included in a web page to provide support for that language in _all_ Video.js players:
Video.js ships with multiple translations (in `dist/lang/`) in JavaScript files.
Add the lang script for each language you need to support.
Each of these files can be included in a web page to provide support for that language in _all_ Video.js players:
```html
<script src="//example.com/path/to/video.min.js"></script>
@@ -31,7 +34,7 @@ Video.js ships with multiple translations (in `dist/lang/`) in JavaScript files.
## Contributing to Video.js Translations
We welcome new translations and improvements to existing ones! Please see the [contributing document](../../CONTRIBUTING.md) to get started contributing to Video.js and continue reading for specifics on how to contribute to translations of Video.js...
We welcome new translations and improvements to existing ones! Please see the [contributing document](../../CONTRIBUTING.md) to get started contributing to Video.js and continue reading for specifics on how to contribute to translations of Video.js.
### JSON Format
@@ -50,20 +53,18 @@ Video.js uses a JSON object to describe a language, where the keys are English a
### File Naming
Translations are always found in the `lang/` directory.
Translations are found in the `lang/` directory.
Each file's name should be the [standard language code][lang-codes] that is most appropriate. For example, "es" for Spanish or "zh-CN" for Chinese.
Finally, each file's extension is always `.json`.
Each file's name should be the [standard language code][lang-codes] that is most appropriate, with a `.json` extension. For example, "es.json" for Spanish or "zh-CN.json" for simplified Chinese.
### Updating an Existing Translation
If there is a [missing translation](../translations-needed.md), mistake, or room for improvement in an existing translation, don't hesitate to open a pull request!
If there is a [missing translation](/docs/translations-needed.md), mistake, or room for improvement in an existing translation, don't hesitate to open a pull request!
1. Edit the relevant JSON file and make the necessary changes.
1. Verify the language compiles by running `grunt dist`.
1. Verify the translation appears properly in the player UI.
1. Run `grunt check-translations` to update the [missing translation document](../translations-needed.md).
1. Run `grunt check-translations` to update the [missing translation document](/docs/translations-needed.md).
1. Commit and open a pull request on GitHub.
### Writing a New Translation
@@ -80,20 +81,14 @@ cp lang/en.json lang/${NEW_LANG_CODE}.json
Otherwise, the process is the same as [updating an existing translation](#updating-an-existing-translation).
## Advanced Language Usage
The instructions above for [using Video.js languages](#using-videojs-languages) should be sufficient for the majority of use-cases. However, languages can be provided at runtime.
In each case, these custom language definitions _take precedence over any Video.js-provided languages!_
### Adding Languages via the API
In addition to the stand-alone scripts provided by Video.js, the API supports manual definition of new languages via the `addLanguage` method. It takes two arguments: the [standard language code][lang-codes] and a [language definition object](#json-format).
```js
videojs.addLanguage('es', {
'Play': 'Reproducción',
'Pause': 'Pausa',
Play: 'Reproducción',
Pause: 'Pausa',
'Current Time': 'Tiempo reproducido',
'Duration Time': 'Duración total',
'Remaining Time': 'Tiempo restante',
@@ -101,39 +96,44 @@ videojs.addLanguage('es', {
});
```
### Per-Player Languages
`addLanguage()` will overwrite existing translations if the object includes strings previously translated. However text that has already been localised will not be updated after generation.
In addition to providing languages to Video.js itself, individual `Player` instances can be provided custom language support via [the `languages` option](options.md#languages):
### Per-Player Translations
In addition to providing languages to Video.js itself, individual `Player` instances can be provided custom language support via [the `languages` option](/docs/guides/options.md#languages):
```js
// Provide a custom definition of Spanish to this player.
videojs('my-player', {
languages: {
es: {...}
es: {
Play: 'Reproducir'
}
}
});
```
### Setting Default Player Language
### Setting Player Language
Player instances can also have a default language via [the `language` option](options.md#language):
The language used by a player instance may be set via [the `language` option](/docs/guides/options.md#language):
```js
// Set the default language to Spanish for this player.
// Set the language to Spanish for this player.
videojs('my-player', {
language: 'es'
});
```
Additionally, the `language` method of the player can be used to set the language after instantiation (e.g., `language('es')`). However, this is not recommended as it does not update the UI in place. _Setting the language via options is always preferred._
The `language` method of the player _can_ be used to set the language after instantiation with `language('es')`. However, this is generally not useful as it does not update text that is already in place.
### Determining Player Language
The player language is set to one of the following in descending priority:
* The language [specified in options](#setting-default-player-language)
* The language specified by the closest element with a `lang` attribute. This could be the player itself or a parent element. Usually, the document language is specified on the `<html>` tag.
* Browser language preference; the first language if more than one is configured
* The language specified by a `lang` attribute on the player element.
* The language specified by the closest parent element with a `lang` attribute, up to and including the `<html>` element.
* The browser language preference; the first language if more than one is configured
* English
#### Internal Language Selection
@@ -143,14 +143,16 @@ The player language is set to one of the following in descending priority:
## References
For information on translation/localization in plugins, see [the plugins guide](plugins.md).
For information on translation/localization in plugins, see [the plugins guide](/docs/guides/plugins.md).
Standard languages codes [are defined by the IANA][lang-codes].
For all existing/supported languages, please see the [languages lolder (`lang/`)][lang-supported] folder located in the project root.
For all existing/supported languages, please see the [languages folder (`lang/`)][lang-supported] folder located in the project root.
[lang-en]: https://github.com/videojs/video.js/tree/master/lang/en.json
[lang-en]: /lang/en.json
[lang-supported]: https://github.com/videojs/video.js/tree/master/lang
[lang-supported]: /lang
[lang-codes]: http://www.iana.org/assignments/language-subtag-registry/language-subtag-registry
[translations-needed]: https://github.com/videojs/video.js/blob/master/docs/translations-needed.md
+78
Ver Arquivo
@@ -0,0 +1,78 @@
# Using the Modal Dialog Component
The `ModalDialog` component is part of Video.js core and provides a baked-in UI for full-player overlays.
## Table of Contents
* [Creating a ModalDialog](#creating-a-modaldialog)
* [Example Using createModal()](#example-using-createmodal)
* [Example Using the ModalDialog Constructor](#example-using-the-modaldialog-constructor)
* [Styling Modals Independently](#styling-modals-independently)
## Creating a ModalDialog
Aside from the [built-in Video.js component-creation methods][creating-component], the player includes a `createModal()` helper method.
We'll demonstrate both approaches in this document by creating a modal that opens when the player becomes paused and resumes playback when it is closed.
### Example Using `createModal()`
The `createModal()` method is intended for creating one-off modals that need to open for some temporary purpose. Therefore, they open themselves immediately upon creation and, by default, dispose themselves immediately upon closing.
```js
var player = videojs('my-player');
player.on('pause', function() {
// Modals are temporary by default. They dispose themselves when they are
// closed; so, we can create a new one each time the player is paused and
// not worry about leaving extra nodes hanging around.
var modal = player.createModal('This is a modal!');
// When the modal closes, resume playback.
modal.on('modalclose', function() {
player.play();
});
});
```
The `createModal()` method also takes a second argument - an object containing options for the modal. Refer to [the API documentation][api-doc] for a full set of options.
### Example Using the `ModalDialog` Constructor
Unlike when using `createModal()`, a modal created with any of the [common component creation methods][creating-component] _does not_ open by default. This makes this approach better suited to modals that are expected to live in the DOM indefinitely.
```js
var player = videojs('my-player');
var ModalDialog = videojs.getComponent('ModalDialog');
var modal = new ModalDialog(player, {
// We don't want this modal to go away when it closes.
temporary: false
});
player.addChild(modal);
player.on('pause', function() {
modal.open();
});
player.on('play', function() {
modal.close();
});
```
Both of these examples are equivalent when it comes to the user's experience. Implementors should use whichever better suits their use-case.
## Styling Modals Independently
A common need for modals is to style them independently from one another. The recommended approach for this is to add a custom class to your modal and target that using CSS:
```js
modal.addClass('vjs-my-fancy-modal');
```
[api-doc]: http://docs.videojs.com/ModalDialog.html
[creating-component]: /docs/guides/components.md#creating-a-component
+61 -56
Ver Arquivo
@@ -1,6 +1,6 @@
# Video.js Options Reference
> **Note:** This document is only a reference for available options. To learn about passing options to Video.js, see [the setup guide](setup.md#options).
> **Note:** This document is only a reference for available options. To learn about passing options to Video.js, see [the setup guide](/docs/guides/setup.md#options).
## Table of Contents
@@ -26,6 +26,7 @@
* [languages](#languages)
* [nativeControlsForTouch](#nativecontrolsfortouch)
* [notSupportedMessage](#notsupportedmessage)
* [playbackRates](#playbackrates)
* [plugins](#plugins)
* [sourceOrder](#sourceorder)
* [sources](#sources)
@@ -36,12 +37,17 @@
* [${componentName}](#componentname)
* [Tech Options](#tech-options)
* [${techName}](#techname)
* [flash](#flash)
* [swf](#swf)
* [html5](#html5)
* [nativeControlsForTouch](#nativecontrolsfortouch-1)
* [nativeAudioTracks](#nativeaudiotracks)
* [nativeTextTracks](#nativetexttracks)
* [nativeVideoTracks](#nativevideotracks)
## Standard `<video>` Element Options
Each of these options is also available as a [standard `<video>` element attribute][video-attrs]; so, they can be defined in all three manners [outlined in the setup guide](setup.md#options). Typically, defaults are not listed as this is left to browser vendors.
Each of these options is also available as a [standard `<video>` element attribute][video-attrs]; so, they can be defined in all three manners [outlined in the setup guide](/docs/guides/setup.md#options). Typically, defaults are not listed as this is left to browser vendors.
### `autoplay`
@@ -151,7 +157,7 @@ The `inactivityTimeout` determines how many milliseconds of inactivity is requir
A [language code][lang-codes] matching one of the available languages in the player. This sets the initial language for a player, but it can always be changed.
Learn more about [languages in Video.js](languages.md).
Learn more about [languages in Video.js][languages].
### `languages`
@@ -159,7 +165,7 @@ Learn more about [languages in Video.js](languages.md).
Customize which languages are available in a player. The keys of this object will be [language codes][lang-codes] and the values will be objects with English keys and translated values.
Learn more about [languages in Video.js](languages.md).
Learn more about [languages in Video.js][languages]
> **Note**: Generally, this option is not needed and it would be better to pass your custom languages to `videojs.addLanguage()`, so they are available in all players!
@@ -175,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`
@@ -201,50 +225,7 @@ player.boo({baz: false});
Although, since the `plugins` option is an object, the order of initialization is not guaranteed!
See [the plugins guide](plugins.md) for more information on Video.js plugins.
### `sourceOrder`
> Type: `boolean`, Default: `false`
>
> **Note:** In video.js 6.0, this option will default to `true`.
Tells Video.js to prefer the order of [`sources`](#sources) over [`techOrder`](#techorder) in selecting a source and playback tech.
Given the following example:
```js
videojs('my-player', {
sourceOrder: true,
sources: [{
src: '//path/to/video.flv',
type: 'video/x-flv'
}, {
src: '//path/to/video.mp4',
type: 'video/mp4'
}, {
src: '//path/to/video.webm',
type: 'video/webm'
}],
techOrder: ['html5', 'flash']
});
```
Normally, the fact that HTML5 comes before Flash in the `techOrder` would mean Video.js would look for a compatible _source_ for HTML5 and would pick either the MP4 or WebM video (depending on browser support) only falling back to Flash if no compatible source for HTML5 was found.
However, because the `sourceOrder` is `true`, Video.js flips that process around. It will look for a compatible _tech_ for each source in order. Presumably, it would first find a match between the FLV (since it's first in the source order) and the Flash tech.
In summary, the default algorithm is:
* for each tech:
* for each source:
* if tech can play source, use this tech/source combo
With `sourceOrder: true`, the algorithm becomes:
* for each source:
* for each tech:
* if tech can play source, use this tech/source combo
See [the plugins guide][plugins] for more information on Video.js plugins.
### `sources`
@@ -275,9 +256,9 @@ Using `<source>` elements will have the same effect:
### `techOrder`
> Type: `Array`, Default: `['html5', 'flash']`
> Type: `Array`, Default: `['html5']`
Defines the order in which Video.js techs are preferred. By default, this means that the `Html5` tech is preferred, but Video.js will fall back to `Flash` if no `Html5`-compatible source can be found.
Defines the order in which Video.js techs are preferred. By default, this means that the `Html5` tech is preferred. Other regisetered techs will be added after this tech in the order in which they are registered.
### `vtt.js`
@@ -285,13 +266,13 @@ Defines the order in which Video.js techs are preferred. By default, this means
Allows overriding the default URL to vtt.js, which may be loaded asynchronously to polyfill support for `WebVTT`.
This option will be used in the "novtt" build of video.js (i.e. `video.novtt.js`). Otherwise, vtt.js is bundled with video.js.
This option will be used in the "novtt" build of Video.js (i.e. `video.novtt.js`). Otherwise, vtt.js is bundled with Video.js.
## Component Options
The Video.js player is a component. Like all components, you can define what children it includes, what order they appear in, and what options are passed to them.
This is meant to be a quick reference; so, for more detailed information on components in Video.js, check out the [components guide](components.md).
This is meant to be a quick reference; so, for more detailed information on components in Video.js, check out the [components guide](/docs/guides/components.md).
### `children`
@@ -318,7 +299,7 @@ The `children` options can also be passed as an `Object`. In this case, it is us
videojs('my-player', {
children: {
controlBar: {
fullscreenControl: false
fullscreenToggle: false
}
}
});
@@ -333,7 +314,7 @@ Components can be given custom options via the _lower-camel-case variant of the
```js
videojs('my-player', {
controlBar: {
fullscreenControl: false
fullscreenToggle: false
}
});
```
@@ -346,7 +327,11 @@ videojs('my-player', {
Video.js playback technologies (i.e. "techs") can be given custom options as part of the options passed to the `videojs` function. They should be passed under the _lower-case variant of the tech name_ (e.g. `"flash"` or `"html5"`).
This is not used in most implementations, but one case where it may be is dictating where the Video.js SWF file is located for the `Flash` tech:
### `flash`
#### `swf`
Specifies where the Video.js SWF file is located for the `Flash` tech:
```js
videojs('my-player', {
@@ -356,26 +341,46 @@ videojs('my-player', {
});
```
However, this is a case where changing the global defaults is more useful:
However, changing the global defaults is generally more appropriate:
```js
videojs.options.flash.swf = '//path/to/videojs.swf'
```
### `html5`
#### `nativeControlsForTouch`
> Type: `boolean`
Only supported by the `Html5` tech, this option can be set to `true` to force native controls for touch devices.
#### `nativeAudioTracks`
> Type: `boolean`
Can be set to `false` to disable native audio track support. Most commonly used with [videojs-contrib-hls][videojs-contrib-hls].
#### `nativeTextTracks`
> Type: `boolean`
Can be set to `false` to force emulation of text tracks instead of native support. The `nativeCaptions` option also exists, but is simply an alias to `nativeTextTracks`.
#### `nativeVideoTracks`
> Type: `boolean`
Can be set to `false` to disable native video track support. Most commonly used with [videojs-contrib-hls][videojs-contrib-hls].
[plugins]: /docs/guides/plugins.md
[languages]: /docs/guides/languages.md
[ios-10-updates]: https://webkit.org/blog/6784/new-video-policies-for-ios/
[lang-codes]: http://www.iana.org/assignments/language-subtag-registry/language-subtag-registry
[video-attrs]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/video#Attributes
[videojs-contrib-hls]: https://github.com/videojs/videojs-contrib-hls
+21 -20
Ver Arquivo
@@ -1,6 +1,6 @@
# Player Workflows
This document outlines many considerations for using Video.js for advanced player workflows. Be sure to read [the setup guide](setup.md) first!
This document outlines many considerations for using Video.js for advanced player workflows. Be sure to read [the setup guide](/docs/guides/setup.md) first!
## Table of Contents
@@ -31,9 +31,9 @@ After an instance has been created it can be accessed globally in two ways:
No matter the term used for it, web applications are becoming common. Not everything is a static, load-once-and-done web page anymore! This means that developers need to be able to manage the full lifecycle of a video player - from creation to destruction. Video.js supports player removal through the `dispose()` method.
### [`dispose()`](http://docs.videojs.com/docs/api/player.html#Methodsdispose)
### [`dispose()`](http://docs.videojs.com/Player.html#dispose)
This method is available on all Video.js players and [components](http://docs.videojs.com/docs/api/component.html#Methodsdispose). It is _the only_ supported method of removing a Video.js player from both the DOM and memory. For example, the following code sets up a player and then disposes it when media playback is complete:
This method is available on all Video.js players and [components](http://docs.videojs.com/Component.html#dispose). It is _the only_ supported method of removing a Video.js player from both the DOM and memory. For example, the following code sets up a player and then disposes it when media playback is complete:
```js
var player = videojs('my-player');
@@ -99,7 +99,7 @@ Example
```js
var myPlayer = videojs('some-player-id');
myPlayer.src("http://www.example.com/path/to/video.mp4");
myPlayer.src('http://www.example.com/path/to/video.mp4');
myPlayer.ready(function() {
// get
var howLoudIsIt = myPlayer.volume();
@@ -113,7 +113,7 @@ Volume can also be muted (without actually changing the volume value) using the
```js
var myPlayer = videojs('some-player-id');
myPlayer.src("http://www.example.com/path/to/video.mp4");
myPlayer.src('http://www.example.com/path/to/video.mp4');
myPlayer.ready(function() {
// get, should be false
console.log(myPlayer.muted());
@@ -131,7 +131,7 @@ To check if the player is currently fullscreen call the `isFullscreen` function
```js
var myPlayer = videojs('some-player-id');
myPlayer.src("http://www.example.com/path/to/video.mp4");
myPlayer.src('http://www.example.com/path/to/video.mp4');
myPlayer.ready(function() {
// get, should be false
console.log(myPlayer.isFullscreen());
@@ -149,7 +149,7 @@ To request that the player enter fullscreen call `requestFullscreen`.
```js
var myPlayer = videojs('some-player-id');
myPlayer.src("http://www.example.com/path/to/video.mp4");
myPlayer.src('http://www.example.com/path/to/video.mp4');
myPlayer.ready(function() {
myPlayer.requestFullscreen();
});
@@ -160,7 +160,7 @@ To exit fullscreen call `exitFullscreen`
```js
var myPlayer = videojs('some-player-id');
myPlayer.src("http://www.example.com/path/to/video.mp4");
myPlayer.src('http://www.example.com/path/to/video.mp4');
myPlayer.ready(function() {
myPlayer.requestFullscreen();
myPlayer.exitFullscreen();
@@ -174,7 +174,7 @@ myPlayer.ready(function() {
```js
var myPlayer = videojs('some-player-id');
myPlayer.src("http://www.example.com/path/to/video.mp4");
myPlayer.src('http://www.example.com/path/to/video.mp4');
myPlayer.ready(function() {
myPlayer.play();
});
@@ -185,7 +185,7 @@ myPlayer.ready(function() {
```js
var myPlayer = videojs('some-player-id');
myPlayer.src("http://www.example.com/path/to/video.mp4");
myPlayer.src('http://www.example.com/path/to/video.mp4');
myPlayer.ready(function() {
myPlayer.play();
myPlayer.pause();
@@ -197,7 +197,7 @@ myPlayer.ready(function() {
```js
var myPlayer = videojs('some-player-id');
myPlayer.src("http://www.example.com/path/to/video.mp4");
myPlayer.src('http://www.example.com/path/to/video.mp4');
myPlayer.ready(function() {
// true
@@ -224,7 +224,7 @@ myPlayer.ready(function() {
```js
var myPlayer = videojs('some-player-id');
myPlayer.src("http://www.example.com/path/to/video.mp4");
myPlayer.src('http://www.example.com/path/to/video.mp4');
myPlayer.ready(function() {
// set current time to 2 minutes into the video
myPlayer.currentTime(120);
@@ -239,7 +239,7 @@ myPlayer.ready(function() {
```js
var myPlayer = videojs('some-player-id');
myPlayer.src("http://www.example.com/path/to/video.mp4");
myPlayer.src('http://www.example.com/path/to/video.mp4');
myPlayer.ready(function() {
var lengthOfVideo = myPlayer.duration();
});
@@ -249,7 +249,7 @@ myPlayer.ready(function() {
```js
var myPlayer = videojs('some-player-id');
myPlayer.src("http://www.example.com/path/to/video.mp4");
myPlayer.src('http://www.example.com/path/to/video.mp4');
myPlayer.ready(function() {
myPlayer.currentTime(10);
@@ -263,7 +263,7 @@ myPlayer.ready(function() {
```js
var myPlayer = videojs('some-player-id');
myPlayer.src("http://www.example.com/path/to/video.mp4");
myPlayer.src('http://www.example.com/path/to/video.mp4');
myPlayer.ready(function() {
var bufferedTimeRange = myPlayer.buffered();
@@ -288,7 +288,7 @@ myPlayer.ready(function() {
```js
var myPlayer = videojs('some-player-id');
myPlayer.src("http://www.example.com/path/to/video.mp4");
myPlayer.src('http://www.example.com/path/to/video.mp4');
myPlayer.ready(function() {
// example 0.11 aka 11%
var howMuchIsDownloaded = myPlayer.bufferedPercent();
@@ -302,7 +302,7 @@ Passing a source to the player via the API. (this can also be done using options
```js
var myPlayer = videojs('some-player-id');
myPlayer.src("http://www.example.com/path/to/video.mp4");
myPlayer.src('http://www.example.com/path/to/video.mp4');
```
**Source Object (or element):** A javascript object containing information
@@ -351,10 +351,9 @@ function on the player.
```js
var myPlayer = videojs('some-player-id');
myPlayer.src("http://www.example.com/path/to/video.mp4");
myPlayer.src('http://www.example.com/path/to/video.mp4');
myPlayer.ready(function() {
// function call throws an error if we
// dont add {IWillNotUseThisInPlugins: true}
// tech() will error with no argument
var tech = myPlayer.tech({IWillNotUseThisInPlugins: true});
});
```
@@ -367,6 +366,8 @@ Coming soon...
### React
See [ReactJS integration example](/docs/guides/react.md)
### Ember
### Angular
+332 -27
Ver Arquivo
@@ -1,58 +1,363 @@
# Plugins
# Video.js Plugins
If you've built something cool with Video.js, you can easily share it with the rest of the world by creating a plugin. Although, you can roll your own, you can also use [generator-videojs-plugin](https://github.com/dmlap/generator-videojs-plugin), a [Yeoman](http://yeoman.io) generator that provides scaffolding for video.js plugins including:
One of the great strengths of Video.js is its ecosystem of plugins that allow authors from all over the world to share their video player customizations. This includes everything from the simplest UI tweaks to new [playback technologies and source handlers][tech]!
* [Grunt](http://gruntjs.com) for build management
* [npm](https://www.npmjs.org) for dependency management
* [QUnit](http://qunitjs.com) for testing
Because we view plugins as such an important part of Video.js, the organization is committed to maintaining a robust set of tools for plugin authorship:
## Step 1: Write Some Javascript
* [generator-videojs-plugin][generator]
You may have already done this step. Code up something interesting and then wrap it in a function. At the most basic level, that's all a video.js plugin is. By convention, plugins take a hash of options as their first argument:
A [Yeoman][yeoman] generator for scaffolding a Video.js plugin project. Additionally, it offers a set of [conventions for plugin authorship][standards] that, if followed, make authorship, contribution, and usage consistent and predictable.
In short, the generator sets up plugin authors to focus on writing their plugin - not messing with tools.
## Writing a Basic Plugin
If you've written a Video.js plugin before, the basic plugin concept should be familiar. It's similar to a jQuery plugin in that the core idea is that you're adding a method to the player.
### Write a JavaScript Function
A basic plugin is a plain JavaScript function:
```js
function examplePlugin(options) {
this.on('play', function(e) {
console.log('playback has started!');
if (options.customClass) {
this.addClass(options.customClass);
}
this.on('playing', function() {
videojs.log('playback began!');
});
}
```
By convention, plugins are passed an `options` object; however, you can realistically accept whatever arguments you want. This example plugin will add a custom class (whatever is passed in as `options.customClass`) and, whenever playback begins, it will log a message to the browser console.
> **Note:** The value of `this` in the plugin function is the player instance; so, you have access to [its complete API][api-player].
### Register a Basic Plugin
Now that we have a function that does something with a player, all that's left is to register the plugin with Video.js:
```js
videojs.registerPlugin('examplePlugin', examplePlugin);
```
After that, any player will automatically have an `examplePlugin` method on its prototype!
> **Note:** The only stipulation with the name of the plugin is that it cannot conflict with any existing plugin or player method.
## Writing an Advanced Plugin
Video.js 6 introduced advanced plugins: these are plugins that share a similar API with basic plugins, but are class-based and offer a range of extra features out of the box.
While reading the following sections, you may want to refer to the [Plugin API docs][api-plugin] for more detail.
### Write a JavaScript Class/Constructor
If you're familiar with creating [components][components], this process is similar. An advanced plugin starts with a JavaScript class (a.k.a. a constructor function).
If you're using ES6 already, you can use that syntax with your transpiler/language of choice (Babel, TypeScript, etc):
```js
const Plugin = videojs.getPlugin('plugin');
class ExamplePlugin extends Plugin {
constructor(player, options) {
super(player, options);
if (options.customClass) {
player.addClass(options.customClass);
}
player.on('playing', function() {
videojs.log('playback began!');
});
}
}
```
Or with ES5:
```js
var Plugin = videojs.getPlugin('plugin');
var ExamplePlugin = videojs.extend(Plugin, {
constructor: function(player, options) {
Plugin.call(this, player, options);
if (options.customClass) {
player.addClass(options.customClass);
}
player.on('playing', function() {
videojs.log('playback began!');
});
}
});
```
For now, this example advanced plugin does the exact same thing as the basic plugin described above - not to worry, we will make it more interesting as we continue!
### Register an Advanced Plugin
The registration process for advanced plugins is identical to [the process for basic plugins](#register-a-basic-plugin).
```js
videojs.registerPlugin('examplePlugin', ExamplePlugin);
```
> **Note:** Because ES6 classes are syntactic sugar on top of existing constructor function and prototype architecture in JavaScript, in all cases `registerPlugin`'s second argument is a function.
### Key Differences from Basic Plugins
Advanced plugins have two key differences from basic plugins that are important to understand before describing their advanced features.
#### The Value of `this`
With basic plugins, the value of `this` in the plugin function will be the _player_.
With advanced plugins, the value of `this` is the _instance of the plugin class_. The player is passed to the plugin constructor as its first argument (and is automatically applied to the plugin instance as the `player` property) and any further arguments are passed after that.
#### The Player Plugin Name Property
Both basic plugins and advanced plugins are set up by calling a method on a player with a name matching the plugin (e.g., `player.examplePlugin()`).
However, with advanced plugins, this method acts like a factory function and it is _replaced_ for the current player by a new function which returns the plugin instance:
```js
// `examplePlugin` has not been called, so it is a factory function.
player.examplePlugin();
// `examplePlugin` is now a function that returns the same instance of
// `ExamplePlugin` that was generated by the previous call.
player.examplePlugin().someMethodName();
```
With basic plugins, the method does not change - it is always the same function. It is up to the authors of basic plugins to deal with multiple calls to their plugin function.
### Features of Advanced Plugins
Up to this point, our example advanced plugin is functionally identical to our example basic plugin. However, advanced plugins bring with them a great deal of benefit that is not built into basic plugins.
#### Events
Like components, advanced plugins offer an implementation of events. This includes:
* The ability to listen for events on the plugin instance using `on` or `one`:
```js
player.examplePlugin().on('example-event', function() {
videojs.log('example plugin received an example-event');
});
```
* The ability to `trigger` custom events on a plugin instance:
```js
player.examplePlugin().trigger('example-event');
```
* The ability to stop listening to custom events on a plugin instance using `off`:
```js
player.examplePlugin().off('example-event');
```
By offering a built-in events system, advanced plugins offer a wider range of options for code structure with a pattern familiar to most web developers.
##### Extra Event Data
All events triggered by plugins include an additional data object as a second argument. This object has three properties:
- `name`: The name of the plugin (e.g. `"examplePlugin"`) as a string.
- `plugin`: The plugin constructor (e.g. `ExamplePlugin`).
- `instance`: The plugin constructor instance.
#### Statefulness
A new concept introduced for advanced plugins is _statefulness_. This is similar to React components' `state` property and `setState` method.
Advanced plugin instances each have a `state` property, which is a plain JavaScript object - it can contain any keys and values the plugin author wants.
A default `state` can be provided by adding a static property to a plugin constructor:
```js
ExamplePlugin.defaultState = {
customClass: 'default-custom-class'
};
```
When it's activated, `this` will be the Video.js player your plugin is attached to. You can use anything you'd like in the [Video.js API](./api.md) when you're writing a plugin: change the `src`, mess up the DOM, or listen for and emit your own events.
## Step 2: Registering A Plugin
It's time to give the rest of the world the opportunity to be awed by your genius. When your plugin is loaded, it needs to let Video.js know this amazing new functionality is now available:
When the `state` is updated via the `setState` method, the plugin instance fires a `"statechanged"` event, but _only if something changed!_ This event can be used as a signal to update the DOM or perform some other action. The event object passed to listeners for this event includes, an object describing the changes that occurred on the `state` property:
```js
videojs.plugin('examplePlugin', examplePlugin);
player.examplePlugin().on('statechanged', function(e) {
if (e.changes && e.changes.customClass) {
this.player
.removeClass(e.changes.customClass.from)
.addClass(e.changes.customClass.to);
}
});
player.examplePlugin().setState({customClass: 'another-custom-class'});
```
From this point on, your plugin will be added to the Video.js prototype and will show up as a property on every instance created. Make sure you choose a unique name that doesn't clash with any of the properties already in Video.js. Which leads us to...
#### Lifecycle
## Step 3: Using A Plugin
There are two ways to initialize a plugin. If you're creating your video tag dynamically, you can specify the plugins you'd like to initialize with it and any options you want to pass to them:
Like components, advanced plugins have a lifecycle. They can be created with their factory function and they can be destroyed using their `dispose` method:
```js
videojs('vidId', {
// set up a example plugin instance
player.examplePlugin();
// dispose of it anytime thereafter
player.examplePlugin().dispose();
```
The `dispose` method has several effects:
* Triggers a `"dispose"` event on the plugin instance.
* Cleans up all event listeners on the plugin instance, which helps avoid errors caused by events being triggered after an object is cleaned up.
* Removes plugin state and references to the player to avoid memory leaks.
* Reverts the player's named property (e.g. `player.examplePlugin`) _back_ to the original factory function, so the plugin can be set up again.
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:
```js
import videojs from 'video.js';
const Plugin = videojs.getPlugin('plugin');
class Advanced extends Plugin {
constructor(player, options) {
super(player, options);
// Whenever the player emits a playing or paused event, we update the
// state if necessary.
this.on(player, ['playing', 'paused'], this.updateState);
this.on('statechanged', this.logState);
}
dispose() {
super.dispose();
videojs.log('the advanced plugin is being disposed');
}
updateState() {
this.setState({playing: !this.player.paused()});
}
logState(changed) {
videojs.log(`the player is now ${this.state.playing ? 'playing' : 'paused'}`);
}
}
videojs.registerPlugin('advanced', Advanced);
const player = videojs('example-player');
player.advanced();
// This will begin playback, which will trigger a "playing" event, which will
// update the state of the plugin, which will cause a message to be logged.
player.play();
// This will pause playback, which will trigger a "paused" event, which will
// update the state of the plugin, which will cause a message to be logged.
player.pause();
player.advanced().dispose();
// This will begin playback, but the plugin has been disposed, so it will not
// log any messages.
player.play();
```
This example may be a bit pointless in reality, but it demonstrates the sort of flexibility offered by advanced plugins over basic plugins.
## Setting up a Plugin
There are two ways to set up (or initialize) a plugin on a player. Both ways work identically for both basic and advanced plugins.
The first way is during creation of the player. Using the `plugins` option, a plugin can be automatically set up on a player:
```js
videojs('example-player', {
plugins: {
examplePlugin: {
exampleOption: true
customClass: 'example-class'
}
}
});
```
If you've already initialized your video tag, you can activate a plugin at any time by calling its setup function directly:
Otherwise, a plugin can be manually set up:
```js
var video = videojs('cool-vid');
video.examplePlugin({ exampleOption: true });
var player = videojs('example-player');
player.examplePlugin({customClass: 'example-class'});
```
That's it. Head on over to the [Video.js wiki](https://github.com/videojs/video.js/wiki/Plugins) and add your plugin to the list so everyone else can check it out.
These two methods are functionally identical - use whichever you prefer!
## How should I use the Video.js icons in my plugin?
### Plugin Setup Events
If you'd like to use any of the icons available in the [Video.js icon set](http://videojs.github.io/font/), please target them via the CSS class names instead of codepoints. The codepoints _may_ change between versions of the font, so using the class names ensures that your plugin will stay up to date with any font changes.
Occasionally, a use-case arises where some code needs to wait for a plugin to be initialized. As of Video.js 6, this can be achieved by listening for `pluginsetup` events on the player.
For any given plugin initialization, there are four events to be aware of:
- `beforepluginsetup`: Triggered immediately before any plugin is initialized.
- `beforepluginsetup:examplePlugin` Triggered immediately before the `examplePlugin` is initialized.
- `pluginsetup`: Triggered after any plugin is initialized.
- `pluginsetup:examplePlugin`: Triggered after he `examplePlugin` is initialized.
These events work for both basic and advanced plugins. They are triggered on the player and each includes an object of [extra event data](#extra-event-data) as a second argument to its listeners.
## References
* [Player API][api-player]
* [Plugin API][api-plugin]
* [Plugin Generator][generator]
* [Plugin Conventions][standards]
[components]: /docs/guides/components.md
[tech]: /docs/guides/tech.md
[api-player]: http://docs.videojs.com/Player.html
[api-plugin]: http://docs.videojs.com/Plugin.html
[generator]: https://github.com/videojs/generator-videojs-plugin
[spellbook]: https://github.com/videojs/spellbook
[standards]: https://github.com/videojs/generator-videojs-plugin/blob/master/docs/standards.md
[yeoman]: http://yeoman.io
+147
Ver Arquivo
@@ -0,0 +1,147 @@
# Video.js and ReactJS integration
Here's a basic ReactJS player implementation.
It just instantiates the Video.js player on `componentDidMount` and destroys it on `componentWillUnmount`.
```jsx
import React from 'react';
import videojs from 'video.js'
export default class VideoPlayer extends React.Component {
componentDidMount() {
// instantiate Video.js
this.player = videojs(this.videoNode, this.props, function onPlayerReady() {
console.log('onPlayerReady', this)
});
}
// destroy player on unmount
componentWillUnmount() {
if (this.player) {
this.player.dispose()
}
}
// wrap the player in a div with a `data-vjs-player` attribute
// so videojs won't create additional wrapper in the DOM
// see https://github.com/videojs/video.js/pull/3856
render() {
return (
<div data-vjs-player>
<video ref={ node => this.videoNode = node } className="video-js"></video>
</div>
)
}
}
```
You can then use it like this: (see [options guide][options] for option information)
```jsx
const videoJsOptions = {
autoplay: true,
controls: true,
sources: [{
src: '/path/to/video.mp4',
type: 'video/mp4'
}]
}
return <VideoPlayer { ...videoJsOptions } />
```
Don't forget to include the Video.js CSS, located at `video.js/dist/video-js.css`.
[options]: /docs/guides/options.md
## Using a React Component as a Video JS Component
```jsx
/**
* EpisodeList.js
*
* This is just a plain ol' React component.
* the vjsComponent methods, player methods etc. are available via
* the vjsComponent prop (`this.props.vjsComponent`)
*/
import React, { Component, PropTypes } from 'react';
class EpisodeList extends Component {
render() {
return (
<div>
<h1>{this.props.body}</h1>
</div>
);
}
}
/**
* vjsEpisodeList.js
*
* Here is where we register a Video JS Component and
* mount the React component to it when the player is ready.
*/
import EpisodeList from './EpisodeList';
import ReactDOM from 'react-dom';
import videojs from 'video.js';
const vjsComponent = videojs.getComponent('Component');
class vjsEpisodeList extends vjsComponent {
constructor(player, options) {
super(player, options);
/* Bind the current class context to the mount method */
this.mount = this.mount.bind(this);
/* When player is ready, call method to mount React component */
player.ready(() => {
this.mount();
});
}
/**
* We will render out the React EpisodeList component into the DOM element
* generated automatically by the VideoJS createEl() method.
*
* We fetch that generated element using `this.el()`, a method provided by the
* vjsComponent class that this class is extending.
*/
mount() {
ReactDOM.render(<EpisodeList vjsComponent={this} body="Episodes" />, this.el() );
}
}
/**
* Make sure to register the vjsComponent so Video JS knows it exists
*/
vjsComponent.registerComponent('vjsEpisodeList', vjsEpisodeList);
export default vjsEpisodeList;
/**
* VideoPlayer.js
* Check the above example for how to integrate the rest of this class.
*/
// ...
componentDidMount() {
// instantiate Video.js
this.player = videojs(this.videoNode, this.props, function onPlayerReady() {
console.log('onPlayerReady', this)
});
/**
* Fetch the controlBar component and add the new vjsEpisodeList component as a child
* You can pass options here if desired in the second object.
*/
this.player.getChild('controlBar').addChild('vjsEpisodeList', {});
}
// ...
```
+13 -5
Ver Arquivo
@@ -14,7 +14,7 @@
## Getting Video.js
Video.js is officially available via CDN, npm, and Bower.
Video.js is officially available via CDN and npm.
Video.js works out of the box with not only HTML `<script>` and `<link>` tags, but also all major bundlers/packagers/builders, such as Browserify, Node, WebPack, etc.
@@ -82,7 +82,7 @@ videojs(document.querySelector('.video-js'));
## Options
> **Note:** This guide only covers how to pass options during player setup. For a complete reference on _all_ available options, see the [options guide](options.md).
> **Note:** This guide only covers how to pass options during player setup. For a complete reference on _all_ available options, see the [options guide](/docs/guides/options.md).
There are three ways to pass options to Video.js. Because Video.js decorates an HTML5 `<video>` element, many of the options available are also available as [standard `<video>` tag attributes][video-attrs]:
@@ -96,6 +96,8 @@ Alternatively, you can use the `data-setup` attribute to pass options as [JSON][
<video data-setup='{"controls": true, "autoplay": false, "preload": "auto"}'...>
```
> **Note:** You _must_ use single-quotes around the value of `data-setup` as it contains a JSON string which must use double quotes.
Finally, if you're not using the `data-setup` attribute to trigger the player setup, you can pass in an object of player options as the second argument to the `videojs` function:
```js
@@ -106,6 +108,8 @@ videojs('my-player', {
});
```
> **Note:** Do not use both `data-setup` and an options object.
### Global Defaults
Default options for all players can be found at `videojs.options` and can be changed directly. For example, to set `{autoplay: true}` for all future players:
@@ -171,11 +175,15 @@ player.on('ready', function() {
});
```
In each case, the callback is called asynchronously - _even if the player is already ready!_
In each case, the callback is called asynchronously.
An important distinction between the above methods is that adding an listener for `ready` with `on()` _must_ be done before the player is ready. With `player.ready()`, the function is called immediately if the player is already ready.
## Advanced Player Workflows
For a discussion of more advanced player workflows, see the [player workflows guide](player-workflows.md).
For a discussion of more advanced player workflows, see the [player workflows guide][player-workflows].
[player-workflows]: /docs/guides/player-workflows.md
[boolean-attrs]: https://www.w3.org/TR/2011/WD-html5-20110525/common-microsyntaxes.html#boolean-attributes
@@ -185,7 +193,7 @@ For a discussion of more advanced player workflows, see the [player workflows gu
[video-attrs]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/video#Attributes
[videojs]: http://docs.videojs.com/docs/api/video.html
[videojs]: http://docs.videojs.com/module-videojs.html
[w3c-media-events]: https://www.w3.org/2010/05/video/mediaevents.html
+47 -24
Ver Arquivo
@@ -1,12 +1,14 @@
# Playback Technology ("Tech")
Playback Technology refers to the specific browser or plugin technology used to play the video or audio. When using HTML5, the playback technology is the video or audio element. When using Flash, the playback technology is the specific Flash player used, e.g. Flowplayer, YouTube Player, video-js.swf, etc. (not just "Flash"). This could also include Silverlight, Quicktime, or any other plugin that will play back video in the browser, as long as there is an API wrapper written for it.
Playback Technology refers to the specific browser or plugin technology used to play the video or audio. When using HTML5, the playback technology is the video or audio element. When using Flash from [videojs-flash][flash], the playback technology is the video-js.swf Flash object. When using the [videojs-youtube][youtube] tech, the playback technology is the You Tube player. The tech also includes an API wrapper to translate between the Video.js controls and API to the specific playback technology used.
Essentially we're using HTML5 and plugins only as video decoders, and using HTML and JavaScript to create a consistent API and skinning experience across all of them.
Essentially we're using html5 and plugins only as video decoders, and using HTML and JavaScript to create a consistent API and skinning experience across all of them.
In addition to techs there are source handlers. Source handlers add the capability to play additional source types to techs. For example, the [videojs-contrib-hls][hls] source handler enables the HTML5 and Flash techs to play HLS.
## Building an API Wrapper
We'll write a more complete guide on writing a wrapper soon, but for now the best resource is the [Video.js](https://github.com/zencoder/video-js/tree/master/src) source where you can see how both the HTML5 and video-js.swf API wrappers were created.
We'll write a more complete guide on writing a wrapper soon, but for now the best resource is the [Video.js](https://github.com/videojs/video.js/tree/master/src/js/tech) source where you can see how the HTML5 API wrapper is created.
## Required Methods
@@ -39,7 +41,7 @@ exitFullScreen
## Adding Playback Technology
When adding additional Tech to a video player, make sure to add the supported tech to the video object.
When additional techs are added they are automatically added to the `techOrder`. You can modify the `techOrder` to change the priority of each tech.
### Tag Method:
@@ -57,47 +59,58 @@ videojs("videoID", {
## Technology Ordering
By default Video.js performs "Tech-first" ordering when it searches for a source/tech combination to play videos. This means that if you have two sources and two techs, video.js will try to play each video with the first tech in the `techOrder` option property before moving on to try the next playback technology.
When Video.js is given an array of sources, which to use is determined by finding the first supported source / tech combination. Each tech will be queried in the order specified in `techOrder` whether it can play the first source. The first match wins. If no tech can play the first source, then the next will be tested. It's important to set the `type` of each source correctly for this test to be accurate.
Tech-first ordering can present a problem if you have a `sourceHandler` that supports both `Html5` and `Flash` techs such as videojs-contrib-hls.
For example, given the following video element:
For example, given the following video element, assuming the [videojs-flash][flash] tech and [videojs-contrib-hls][hls] source handler are available:
```html
<video data-setup='{"techOrder": ["html5", "flash"]}'>
<!-- "techOrder": ["html5", "flash"] -->
<video
<source src="http://your.static.provider.net/path/to/video.m3u8" type="application/x-mpegURL">
<source src="http://your.static.provider.net/path/to/video.mp4" type="video/mp4">
</video>
```
There is a good chance that the mp4 source will be selected on platforms that do not have media source extensions. Video.js will try all sources against the first playback technology, in this case `Html5`, and select the first source that can play - in this case MP4.
The HLS source will be tested first. The first tech is html5.
* Safari can play HLS in a standard HTML5 video element, so HLS will be played using the html5 tech
* Chrome can't play HLS in the standard HTML5 video element on its own, but the videojs-contrib-hls source handler _can_ play HLS via [Media Source Extensions][mse] in HTML5. So HLS will be played in the html5 tech
* IE 10 can't play HLS natively, and doesn't support Media Source Extensions. As the source cannot be played in HTML5, the Flash tech can be tested. The videojs-contrib-hls source handler can play HLS in the Flash tech, so HLS will be played in the Flash tech.
In "Tech-first" mode, the tests run something like this:
Can video.m3u8 play with Html5? No...
Can video.mp4 play with Html5? Yes! Use the second source.
Video.js now provides another method of selecting the source - "Source-first" ordering. In this mode, Video.js tries the first source against every tech in `techOrder` before moving onto the next source.
With a player setup as follows:
Now take the same sources again with videojs-contrib-hls but without videojs-flash:
```html
<video data-setup='{"techOrder": ["html5", "flash"], "sourceOrder": true}'>
<!-- "techOrder": ["html5"] -->
<video
<source src="http://your.static.provider.net/path/to/video.m3u8" type="application/x-mpegURL">
<source src="http://your.static.provider.net/path/to/video.mp4" type="video/mp4">
</video>
```
The Flash-based HLS support will be tried before falling back to the MP4 source.
* Safari will play HLS in the html5 tech
* Chrome will play HLS in the html5 tech by means of videojs-contrib-hls
* IE 10 can't play HLS in either the html5 or Flash tech. Next the MP4 source will be tested. MP4 can be played by HTML5, so that source-tech pair will be used.
In "Source-first" mode, the tests run something like this:
Can video.m3u8 play with Html5? No...
Can video.m3u8 play with Flash? Yes! Use the first source.
This time, we have videojs-flash but not videojs-contrib-hls:
```html
<!-- "techOrder": ["html5", "flash"] -->
<video
<source src="http://your.static.provider.net/path/to/video.m3u8" type="application/x-mpegURL">
<source src="http://your.static.provider.net/path/to/video.mp4" type="video/mp4">
</video>
```
* Safari will play HLS in the html5 tech
* Chrome can't play HLS in the html5 or flash tech, so will play MP4 in the html5 tech.
* IE 10 also can't play HLS in either the html5 or Flash tech and will also play MP4 in the html5 tech.
## Flash Technology
The Flash playback tech is a part of the default `techOrder`. You may notice undesirable playback behavior in browsers that are subject to using this playback tech, in particular when scrubbing and seeking within a video. This behavior is a result of Flash's progressive video playback.
The Flash playback tech was previously included in Video.js core and was included in the default `techOrder`. As of version 6, the Flash tech was moved to a separate [videojs-flash plugin][flash] which you would need to include if you still need to use Flash.
### Enabling Streaming Playback
It's increasingly likely that end users don't have Flash or their browser has either disabled it or puts a click-to-play or other barrier to using it, so it's strongly recommended to use an alternative such as HLS.
### Enabling RTMP Streaming Playback
In order to force the Flash tech to choose streaming playback, you need to provide a valid streaming source **before other valid Flash video sources**. This is necessary because of the source selection algorithm, where playback tech chooses the first possible source object with a valid type. Valid streaming `type` values include `rtmp/mp4` and `rtmp/flv`. The streaming `src` value requires valid connection and stream strings, separated by an `&`. An example of supplying a streaming source through your HTML markup might look like:
@@ -118,3 +131,13 @@ All four RTMP protocols are valid in the `src` (RTMP, RTMPT, RTMPE, and RTMPS).
#### A note on sandboxing and security
In some environments, such as Electron and NW.js apps, stricter policies are enforced, and `.swf` files wont be able to communicate with the outside world out of the box. To stream media, you have to add them to a special manifest of trusted files. [nw-flash-trust](https://github.com/szwacz/nw-flash-trust) makes this job easy.
Browsers also prevent the Flash tech from working when you load a page from the filesystem (with the `file:` protocol) and also in sandboxed iframes.
[flash]: https://github.com/videojs/videojs-flash
[hls]: https://github.com/videojs/videojs-contrib-hls
[mse]: https://en.wikipedia.org/wiki/Media_Source_Extensions
[youtube]: https://github.com/videojs/videojs-youtube
+2 -2
Ver Arquivo
@@ -91,7 +91,7 @@ The boolean `default` attribute can be used to indicate that a track's mode shou
The valid [BCP 47](https://tools.ietf.org/html/bcp47) code for the language of the text track, e.g. `"en"` for English or `"es"` for Spanish.
For supported language translations, please see the [languages folder (/lang)](https://github.com/videojs/video.js/tree/master/lang) folder located in the Video.js root and refer to the [languages guide](./languages.md) for more information on languages in Video.js.
For supported language translations, please see the [languages folder (/lang)](https://github.com/videojs/video.js/tree/master/lang) folder located in the Video.js root and refer to the [languages guide](/docs/guides/languages.md) for more information on languages in Video.js.
### Text Tracks from Another Domain
@@ -214,7 +214,7 @@ In general, `"descriptions"` tracks are of lower precedence than `"captions"` an
## API
For more complete information, refer to the [Video.js API docs](http://docs.videojs.com/docs/api/index.html).
For more complete information, refer to the [Video.js API docs](http://docs.videojs.com/).
### Remote Text Tracks
+3 -3
Ver Arquivo
@@ -8,14 +8,14 @@ There are currently three types of tracks:
* [Video Tracks](#video-tracks)
* [Text Tracks](#text-tracks)
## [Audio Tracks](./audio-tracks.md)
## [Audio Tracks](/docs/guides/audio-tracks.md)
Audio tracks allow the selection of alternate audio for a video.
## [Video Tracks](./video-tracks.md)
## [Video Tracks](/docs/guides/video-tracks.md)
Video tracks allow the selection of alternate video content.
## [Text Tracks](./text-tracks.md)
## [Text Tracks](/docs/guides/text-tracks.md)
Text tracks are used to display subtitles and captions and add a menu for navigating between chapters in a video.
@@ -91,7 +91,7 @@ To fix this issue please make sure that all event listeners are cleaned up on di
[hosting-media]: #problems-when-hosting-media
[text-tracks]: text-tracks.md
[text-tracks]: /docs/guides/text-tracks.md
[hls]: https://github.com/videojs/videojs-contrib-hls
+2 -2
Ver Arquivo
@@ -83,7 +83,7 @@ player.videoTracks().removeTrack(track);
## API
For more complete information, refer to the [Video.js API docs](http://docs.videojs.com/docs/api/index.html), specifically:
For more complete information, refer to the [Video.js API docs](http://docs.videojs.com/), specifically:
* `Player#videoTracks`
* `VideoTrackList`
@@ -127,7 +127,7 @@ The label for the track that will be shown to the user. For example, in a menu t
The valid [BCP 47](https://tools.ietf.org/html/bcp47) code for the language of the video track, e.g. `"en"` for English or `"es"` for Spanish.
For supported language translations, please see the [languages folder (/lang)](https://github.com/videojs/video.js/tree/master/lang) folder located in the Video.js root and refer to the [languages guide](./languages.md) for more information on languages in Video.js.
For supported language translations, please see the [languages folder (/lang)](https://github.com/videojs/video.js/tree/master/lang) folder located in the Video.js root and refer to the [languages guide](/docs/guides/languages.md) for more information on languages in Video.js.
#### `selected`
+10 -10
Ver Arquivo
@@ -5,14 +5,14 @@
* [videojs()](#videojs)
* [options](#options)
* [getComponent()](#getcomponent)
* [registerComponent](#registercomponent)
* [registerComponent()](#registercomponent)
* [getTech()](#gettech)
* [registerTech](#registertech)
* [registerTech()](#registertech)
* [extend()](#extend)
* [mergeOptions()](#mergeoptions)
* [bind()](#bind)
* [plugin()](#plugin)
* [xhr](#xhr)
* [registerPlugin()](#plugin)
* [xhr()](#xhr)
## `videojs()`
@@ -43,9 +43,9 @@ var VjsButton = videojs.getComponent('Button');
// Subclass the component (see 'extend' doc for more info)
var MySpecialButton = videojs.extend(VjsButton, {});
// Register the new component
VjsButton.registerComponent('MySepcialButton', MySepcialButton);
videojs.registerComponent('MySpecialButton', MySpecialButton);
// (optionally) add the new component as a default player child
myPlayer.addChild('MySepcialButton');
myPlayer.addChild('MySpecialButton');
```
## `getTech()`
@@ -63,7 +63,7 @@ var html5 = new Html5(options);
var Html5 = videojs.getTech('Html5');
var MyTech = videojs.extend(Html5, {});
// Register the new Tech
VjsButton.registerTech('Tech', MyTech);
videojs.registerTech('MyTech', MyTech);
var player = videojs('myplayer', {
techOrder: ['myTech', 'html5']
});
@@ -126,13 +126,13 @@ videojs.bind(someObj, function() {
});
```
## `plugin()`
## `registerPlugin()`
**See the [plugin guide](plugins.md) in the docs for a more detailed example**
**See the [plugin guide](/docs/guides/plugins.md) in the docs for a more detailed example**
```js
// Make a plugin that alerts when the player plays
videojs.plugin('myPlugin', function(myPluginOptions) {
videojs.registerPlugin('myPlugin', function(myPluginOptions) {
myPluginOptions = myPluginOptions || {};
var player = this;
+37
Ver Arquivo
@@ -0,0 +1,37 @@
# Using Webpack with Video.js
Video.js, and the playback technologies such as videojs-contrib-hls all work in a Webpack based build environment. Here are several configuration changes specific to Webpack that will get you up and running.
## Video.js CSS:
To add the CSS that the player requires, simply add
`require('!style-loader!css-loader!video.js/dist/video-js.css')` to the file where the player is also included or initialized.
## Handling .eot files in Webpack
In addition to this, you may run into a problem where Webpack does not know how to load .eot files required for IE8 support by default. This can be solved by installing the file-loader and url-loader packages. Install them by running:
`npm install --save-dev file-loader url-loader`
With both packages installed, simply add the following to you webpack.config file in the 'loaders' section:
```
{
loader: 'url-loader?limit=100000',
test: /\.(png|woff|woff2|eot|ttf|svg)$/
}
```
## Using Webpack with videojs-contrib-hls
Import the HLS library with a line such as:
`import * as HLS from 'videojs-contrib-hls';`
In order to use the tech, we must also introduce webworkers with the package 'webworkify-webpack-dropin', run:
`npm install --save-dev webworkify-webpack-dropin`
To utilize this in your page, simply create an alias in your webpack.config.js file with:
```
resolve: {
alias: {
webworkify: 'webworkify-webpack-dropin'
}
}
```
Source maps that use the 'eval' tag are not compatible with webworkify, so this may need to be changed also. Source maps such as 'cheap-eval-module-source-map' should be changed to 'cheap-source-map' or anything else that fits your build without using 'eval' source maps.
+19 -19
Ver Arquivo
@@ -1,6 +1,6 @@
# [Video.js][vjs-website] Documentation
There are two categories of docs: [Guides](guides) and [API docs][api].
There are two categories of docs: [Guides](/docs/guides/) and [API docs][api].
Guides explain general topics and use cases (e.g. setup). API docs are automatically generated from the codebase and give specific details about functions, properties, and events.
@@ -26,57 +26,57 @@ Guides explain general topics and use cases (e.g. setup). API docs are automatic
## Resolving Issues
### [FAQ](guides/faq.md)
### [FAQ](/docs/guides/faq.md)
The frequently asked questions for video.js.
The frequently asked questions for Video.js.
### [Troubleshooting](guides/troubleshooting.md)
### [Troubleshooting](/docs/guides/troubleshooting.md)
Troubleshooting help for video.js.
Troubleshooting help for Video.js.
## [Guides](guides)
## [Guides](/docs/guides/)
### Getting Started
#### [Setup](guides/setup.md)
#### [Setup](/docs/guides/setup.md)
The setup guide covers all methods of setting up Video.js players.
#### [Player Workflows](guides/player-workflows.md)
#### [Player Workflows](/docs/guides/player-workflows.md)
After mastering the basics of setup move over to this guide for some more advanced player workflows.
#### [Options](guides/options.md)
#### [Options](/docs/guides/options.md)
There are a number of options that can be used to change how the player behaves, starting with the HTML5 media options like autoplay and preload, and expanding to Video.js specific options.
#### [Tracks](guides/tracks.md)
#### [Tracks](/docs/guides/tracks.md)
Tracks are used for displaying text information over a video, selecting different audio tracks for a video, or selecting different video tracks.
### Customizing
#### [Skins](guides/skins.md)
#### [Skins](/docs/guides/skins.md)
You can change the look of the player across playback technologies just by editing a CSS file. The skins documentation gives you a intro to how the HTML and CSS of the default skin is put together. For a list of skins you can check the [video.js wiki][skins-list].
You can change the look of the player across playback technologies just by editing a CSS file. The skins documentation gives you a intro to how the HTML and CSS of the default skin is put together. For a list of skins you can check the [Video.js wiki][skins-list].
#### [Plugins](guides/plugins.md)
#### [Plugins](/docs/guides/plugins.md)
You can package up interesting Video.js customizations and reuse them elsewhere. Find out how to build your own plugin or [use one created by someone else][plugins-list].
#### [Components](guides/components.md)
#### [Components](/docs/guides/components.md)
Video.js is built around a collection of components. These are the building blocks of the player UI.
#### [Tech](guides/tech.md)
#### [Tech](/docs/guides/tech.md)
A "tech" is the shorthand we're using to describe any video playback technology - be it HTML5 video, Flash, . Basically anything that has a unique API to audio or video. Additional playback technologies can be added relatively easily.
#### [Languages](guides/languages.md)
#### [Languages](/docs/guides/languages.md)
Video.js has multi-language support! Follow this guide to see how you can contribute to and use languages.
#### [Hooks](guides/hooks.md)
#### [Hooks](/docs/guides/hooks.md)
A "hook" is functionality that wants to do when videojs creates a player. Right now only `beforesetup` and `setup` are supported. See the guide for more information on that.
@@ -88,8 +88,8 @@ You can refer to the [full list of API docs][api], but the most relevant API doc
[skins-list]: https://github.com/videojs/video.js/wiki/Skins
[api]: http://docs.videojs.com/docs/api/index.html
[api]: http://docs.videojs.com/
[api-player]: http://docs.videojs.com/docs/api/player.html
[api-player]: http://docs.videojs.com/Player.html
[vjs-website]: http://videojs.com
Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff
+7 -7
Ver Arquivo
@@ -1,27 +1,27 @@
{
"Play": "تشغيل",
"Pause": "ايقاف",
"Pause": "إيقاف",
"Current Time": "الوقت الحالي",
"Duration Time": "Dauer",
"Duration Time": "مدة",
"Remaining Time": "الوقت المتبقي",
"Stream Type": "نوع التيار",
"LIVE": "مباشر",
"Loaded": "تم التحميل",
"Progress": "التقدم",
"Fullscreen": "ملء الشاشة",
"Non-Fullscreen": "غير ملء الشاشة",
"Non-Fullscreen": "تعطيل ملء الشاشة",
"Mute": "صامت",
"Unmute": "غير الصامت",
"Playback Rate": "معدل التشغيل",
"Subtitles": "الترجمة",
"subtitles off": "ايقاف الترجمة",
"subtitles off": "إيقاف الترجمة",
"Captions": "التعليقات",
"captions off": "ايقاف التعليقات",
"captions off": "إيقاف التعليقات",
"Chapters": "فصول",
"You aborted the media playback": "لقد ألغيت تشغيل الفيديو",
"A network error caused the media download to fail part-way.": "تسبب خطأ في الشبكة بفشل تحميل الفيديو بالكامل.",
"The media could not be loaded, either because the server or network failed or because the format is not supported.": "لا يمكن تحميل الفيديو بسبب فشل في الخادم أو الشبكة ، أو فشل بسبب عدم امكانية قراءة تنسيق الفيديو.",
"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "تم ايقاف تشغيل الفيديو بسبب مشكلة فساد أو لأن الفيديو المستخدم يستخدم ميزات غير مدعومة من متصفحك.",
"The media could not be loaded, either because the server or network failed or because the format is not supported.": "لا يمكن تحميل الفيديو بسبب فشل في الخادوم أو الشبكة ، أو فشل بسبب عدم إمكانية قراءة تنسيق الفيديو.",
"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "تم إيقاف تشغيل الفيديو بسبب مشكلة فساد أو لأن الفيديو المستخدم يستخدم ميزات غير مدعومة من متصفحك.",
"No compatible source was found for this media.": "فشل العثور على أي مصدر متوافق مع هذا الفيديو.",
"Play Video": "تشغيل الفيديو",
"Close": "أغلق",
+45 -1
Ver Arquivo
@@ -1,6 +1,7 @@
{
"Play": "Wiedergabe",
"Pause": "Pause",
"Replay": "Erneut abspielen",
"Current Time": "Aktueller Zeitpunkt",
"Duration Time": "Dauer",
"Remaining Time": "Verbleibende Zeit",
@@ -31,10 +32,53 @@
", opens captions settings dialog": ", öffnet Einstellungen für Untertitel",
", opens subtitles settings dialog": ", öffnet Einstellungen für Untertitel",
", selected": ", ausgewählt",
"captions settings": "Untertiteleinstellungen",
"subtitles settings": "Untertiteleinstellungen",
"descriptions settings": "Einstellungen für Beschreibungen",
"Close Modal Dialog": "Modales Fenster schließen",
"Descriptions": "Beschreibungen",
"descriptions off": "Beschreibungen aus",
"The media is encrypted and we do not have the keys to decrypt it.": "Die Entschlüsselungsschlüssel für den verschlüsselten Medieninhalt sind nicht verfügbar.",
", opens descriptions settings dialog": ", öffnet Einstellungen für Beschreibungen",
"Audio Track": "Tonspur"
"Audio Track": "Tonspur",
"Text": "Schrift",
"White": "Weiß",
"Black": "Schwarz",
"Red": "Rot",
"Green": "Grün",
"Blue": "Blau",
"Yellow": "Gelb",
"Magenta": "Magenta",
"Cyan": "Türkis",
"Background": "Hintergrund",
"Window": "Fenster",
"Transparent": "Durchsichtig",
"Semi-Transparent": "Halbdurchsichtig",
"Opaque": "Undurchsictig",
"Font Size": "Schriftgröße",
"Text Edge Style": "Textkantenstil",
"None": "Kein",
"Raised": "Erhoben",
"Depressed": "Gedrückt",
"Uniform": "Uniform",
"Dropshadow": "Schlagschatten",
"Font Family": "Schristfamilie",
"Proportional Sans-Serif": "Proportionale Sans-Serif",
"Monospace Sans-Serif": "Monospace Sans-Serif",
"Proportional Serif": "Proportionale Serif",
"Monospace Serif": "Monospace Serif",
"Casual": "Zwanglos",
"Script": "Schreibeschrift",
"Small Caps": "Small-Caps",
"Reset": "Zurücksetzen",
"restore all settings to the default values": "Alle Einstellungen auf die Standardwerte zurücksetzen",
"Done": "Fertig",
"Caption Settings Dialog": "Einstellungsdialog für Untertitel",
"Beginning of dialog window. Escape will cancel and close the window.": "Anfang des Dialogfensters. Esc bricht ab und schließt das Fenster.",
"End of dialog window.": "Ende des Dialogfensters.",
"Audio Player": "Audio-Player",
"Video Player": "Video-Player",
"Progress Bar": "Forschrittsbalken",
"progress bar timing: currentTime={1} duration={2}": "{1} von {2}",
"Volume Level": "Lautstärkestufe"
}
+46 -2
Ver Arquivo
@@ -1,6 +1,9 @@
{
"Audio Player": "Audio Player",
"Video Player": "Video Player",
"Play": "Play",
"Pause": "Pause",
"Replay": "Replay",
"Current Time": "Current Time",
"Duration Time": "Duration Time",
"Remaining Time": "Remaining Time",
@@ -8,6 +11,8 @@
"LIVE": "LIVE",
"Loaded": "Loaded",
"Progress": "Progress",
"Progress Bar": "Progress Bar",
"progress bar timing: currentTime={1} duration={2}": "{1} of {2}",
"Fullscreen": "Fullscreen",
"Non-Fullscreen": "Non-Fullscreen",
"Mute": "Mute",
@@ -18,10 +23,10 @@
"Captions": "Captions",
"captions off": "captions off",
"Chapters": "Chapters",
"Close Modal Dialog": "Close Modal Dialog",
"Descriptions": "Descriptions",
"descriptions off": "descriptions off",
"Audio Track": "Audio Track",
"Volume Level": "Volume Level",
"You aborted the media playback": "You aborted the media playback",
"A network error caused the media download to fail part-way.": "A network error caused the media download to fail part-way.",
"The media could not be loaded, either because the server or network failed or because the format is not supported.": "The media could not be loaded, either because the server or network failed or because the format is not supported.",
@@ -30,11 +35,50 @@
"The media is encrypted and we do not have the keys to decrypt it.": "The media is encrypted and we do not have the keys to decrypt it.",
"Play Video": "Play Video",
"Close": "Close",
"Close Modal Dialog": "Close Modal Dialog",
"Modal Window": "Modal Window",
"This is a modal window": "This is a modal window",
"This modal can be closed by pressing the Escape key or activating the close button.": "This modal can be closed by pressing the Escape key or activating the close button.",
", opens captions settings dialog": ", opens captions settings dialog",
", opens subtitles settings dialog": ", opens subtitles settings dialog",
", opens descriptions settings dialog": ", opens descriptions settings dialog",
", selected": ", selected"
", selected": ", selected",
"captions settings": "captions settings",
"subtitles settings": "subititles settings",
"descriptions settings": "descriptions settings",
"Text": "Text",
"White": "White",
"Black": "Black",
"Red": "Red",
"Green": "Green",
"Blue": "Blue",
"Yellow": "Yellow",
"Magenta": "Magenta",
"Cyan": "Cyan",
"Background": "Background",
"Window": "Window",
"Transparent": "Transparent",
"Semi-Transparent": "Semi-Transparent",
"Opaque": "Opaque",
"Font Size": "Font Size",
"Text Edge Style": "Text Edge Style",
"None": "None",
"Raised": "Raised",
"Depressed": "Depressed",
"Uniform": "Uniform",
"Dropshadow": "Dropshadow",
"Font Family": "Font Family",
"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": "Reset",
"restore all settings to the default values": "restore all settings to the default values",
"Done": "Done",
"Caption Settings Dialog": "Caption Settings Dialog",
"Beginning of dialog window. Escape will cancel and close the window.": "Beginning of dialog window. Escape will cancel and close the window.",
"End of dialog window.": "End of dialog window."
}
+1
Ver Arquivo
@@ -1,5 +1,6 @@
{
"Play": "Reproducción",
"Play Video": "Reproducción Vídeo",
"Pause": "Pausa",
"Current Time": "Tiempo reproducido",
"Duration Time": "Duración total",
+46 -2
Ver Arquivo
@@ -1,6 +1,9 @@
{
"Audio Player": "Lecteur audio",
"Video Player": "Lecteur vidéo",
"Play": "Lecture",
"Pause": "Pause",
"Replay": "Revoir",
"Current Time": "Temps actuel",
"Duration Time": "Durée",
"Remaining Time": "Temps restant",
@@ -8,6 +11,8 @@
"LIVE": "EN DIRECT",
"Loaded": "Chargé",
"Progress": "Progression",
"Progress Bar": "Barre de progression",
"progress bar timing: currentTime={1} duration={2}": "{1} de {2}",
"Fullscreen": "Plein écran",
"Non-Fullscreen": "Fenêtré",
"Mute": "Sourdine",
@@ -18,10 +23,10 @@
"Captions": "Sous-titres transcrits",
"captions off": "Sous-titres transcrits désactivés",
"Chapters": "Chapitres",
"Close Modal Dialog": "Fermer la boîte de dialogue modale",
"Descriptions": "Descriptions",
"descriptions off": "descriptions désactivées",
"Audio Track": "Piste audio",
"Volume Level": "Niveau de volume",
"You aborted the media playback": "Vous avez interrompu la lecture de la vidéo.",
"A network error caused the media download to fail part-way.": "Une erreur de réseau a interrompu le téléchargement de la vidéo.",
"The media could not be loaded, either because the server or network failed or because the format is not supported.": "Cette vidéo n'a pas pu être chargée, soit parce que le serveur ou le réseau a échoué ou parce que le format n'est pas reconnu.",
@@ -30,11 +35,50 @@
"The media is encrypted and we do not have the keys to decrypt it.": "Le média est chiffré et nous n'avons pas les clés pour le déchiffrer.",
"Play Video": "Lire la vidéo",
"Close": "Fermer",
"Close Modal Dialog": "Fermer la boîte de dialogue modale",
"Modal Window": "Fenêtre modale",
"This is a modal window": "Ceci est une fenêtre modale",
"This modal can be closed by pressing the Escape key or activating the close button.": "Ce modal peut être fermé en appuyant sur la touche Échap ou activer le bouton de fermeture.",
", opens captions settings dialog": ", ouvrir les paramètres des sous-titres transcrits",
", opens subtitles settings dialog": ", ouvrir les paramètres des sous-titres",
", opens descriptions settings dialog": ", ouvrir les paramètres des descriptions",
", selected": ", sélectionné"
", selected": ", sélectionné",
"captions settings": "Paramètres des sous-titres transcrits",
"subtitles settings": "Paramètres des sous-titres",
"descriptions settings": "Paramètres des descriptions",
"Text": "Texte",
"White": "Blanc",
"Black": "Noir",
"Red": "Rouge",
"Green": "Vert",
"Blue": "Bleu",
"Yellow": "Jaune",
"Magenta": "Magenta",
"Cyan": "Cyan",
"Background": "Arrière-plan",
"Window": "Fenêtre",
"Transparent": "Transparent",
"Semi-Transparent": "Semi-transparent",
"Opaque": "Opaque",
"Font Size": "Taille des caractères",
"Text Edge Style": "Style des contours du texte",
"None": "Aucun",
"Raised": "Élevé",
"Depressed": "Enfoncé",
"Uniform": "Uniforme",
"Dropshadow": "Ombre portée",
"Font Family": "Famille de polices",
"Proportional Sans-Serif": "Polices à chasse variable sans empattement (Proportional Sans-Serif)",
"Monospace Sans-Serif": "Polices à chasse fixe sans empattement (Monospace Sans-Serif)",
"Proportional Serif": "Polices à chasse variable avec empattement (Proportional Serif)",
"Monospace Serif": "Polices à chasse fixe avec empattement (Monospace Serif)",
"Casual": "Manuscrite",
"Script": "Scripte",
"Small Caps": "Petites capitales",
"Reset": "Réinitialiser",
"restore all settings to the default values": "Restaurer tous les paramètres aux valeurs par défaut",
"Done": "Terminé",
"Caption Settings Dialog": "Boîte de dialogue des paramètres des sous-titres transcrits",
"Beginning of dialog window. Escape will cancel and close the window.": "Début de la fenêtre de dialogue. La touche d'échappement annulera et fermera la fenêtre.",
"End of dialog window.": "Fin de la fenêtre de dialogue."
}
+27
Ver Arquivo
@@ -0,0 +1,27 @@
{
"Play": "Reprodución",
"Play Video": "Reprodución Vídeo",
"Pause": "Pausa",
"Current Time": "Tempo reproducido",
"Duration Time": "Duración total",
"Remaining Time": "Tempo restante",
"Stream Type": "Tipo de secuencia",
"LIVE": "DIRECTO",
"Loaded": "Cargado",
"Progress": "Progreso",
"Fullscreen": "Pantalla completa",
"Non-Fullscreen": "Pantalla non completa",
"Mute": "Silenciar",
"Unmute": "Non silenciado",
"Playback Rate": "Velocidade de reprodución",
"Subtitles": "Subtítulos",
"subtitles off": "Subtítulos desactivados",
"Captions": "Subtítulos con lenda",
"captions off": "Subtítulos con lenda desactivados",
"Chapters": "Capítulos",
"You aborted the media playback": "Interrompeches a reprodución do vídeo.",
"A network error caused the media download to fail part-way.": "Un erro de rede interrompeu a descarga do vídeo.",
"The media could not be loaded, either because the server or network failed or because the format is not supported.": "Non se puido cargar o vídeo debido a un fallo de rede ou do servidor ou porque o formato é incompatible.",
"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "A reproducción de vídeo interrompeuse por un problema de corrupción de datos ou porque o vídeo precisa funcións que o teu navegador non ofrece.",
"No compatible source was found for this media.": "Non se atopou ningunha fonte compatible con este vídeo."
}
+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."
}
+41
Ver Arquivo
@@ -0,0 +1,41 @@
{
"Play": "Reproduzir",
"Pause": "Parar",
"Replay": "Reiniciar",
"Current Time": "Tempo Atual",
"Duration Time": "Duração",
"Remaining Time": "Tempo Restante",
"Stream Type": "Tipo de Stream",
"LIVE": "EM DIRETO",
"Loaded": "Carregado",
"Progress": "Progresso",
"Fullscreen": "Ecrã inteiro",
"Non-Fullscreen": "Ecrã normal",
"Mute": "Desativar som",
"Unmute": "Ativar som",
"Playback Rate": "Velocidade de reprodução",
"Subtitles": "Legendas",
"subtitles off": "desativar legendas",
"Captions": "Anotações",
"captions off": "desativar anotações",
"Chapters": "Capítulos",
"Close Modal Dialog": "Fechar Janela Modal",
"Descriptions": "Descrições",
"descriptions off": "desativar descrições",
"Audio Track": "Faixa Áudio",
"You aborted the media playback": "Parou a reprodução do vídeo.",
"A network error caused the media download to fail part-way.": "Um erro na rede fez o vídeo falhar parcialmente.",
"The media could not be loaded, either because the server or network failed or because the format is not supported.": "O vídeo não pode ser carregado, ou porque houve um problema na rede ou no servidor, ou porque formato do vídeo não é compatível.",
"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "A reprodução foi interrompida por um problema com o vídeo ou porque o formato não é compatível com o seu navegador.",
"No compatible source was found for this media.": "Não foi encontrada uma fonte de vídeo compatível.",
"The media is encrypted and we do not have the keys to decrypt it.": "O vídeo está encriptado e não há uma chave para o desencriptar.",
"Play Video": "Reproduzir Vídeo",
"Close": "Fechar",
"Modal Window": "Janela Modal",
"This is a modal window": "Isto é uma janela modal",
"This modal can be closed by pressing the Escape key or activating the close button.": "Esta modal pode ser fechada pressionando a tecla ESC ou ativando o botão de fechar.",
", opens captions settings dialog": ", abre janela com definições de legendas",
", opens subtitles settings dialog": ", abre janela com definições de legendas",
", opens descriptions settings dialog": ", abre janela com definições de descrições",
", selected": ", seleccionado"
}
+84
Ver Arquivo
@@ -0,0 +1,84 @@
{
"Audio Player": "Zvukový prehrávač",
"Video Player": "Video prehrávač",
"Play": "Prehrať",
"Pause": "Pozastaviť",
"Replay": "Prehrať znova",
"Current Time": "Aktuálny čas",
"Duration Time": "Čas trvania",
"Remaining Time": "Zostávajúci čas",
"Stream Type": "Typ stopy",
"LIVE": "NAŽIVO",
"Loaded": "Načítané",
"Progress": "Priebeh",
"Progress Bar": "Ukazovateľ priebehu",
"progress bar timing: currentTime={1} duration={2}": "časovanie ukazovateľa priebehu: currentTime={1} duration={2}",
"Fullscreen": "Režim celej obrazovky",
"Non-Fullscreen": "Režim normálnej obrazovky",
"Mute": "Stlmiť",
"Unmute": "Zrušiť stlmenie",
"Playback Rate": "Rýchlosť prehrávania",
"Subtitles": "Titulky",
"subtitles off": "titulky vypnuté",
"Captions": "Popisky",
"captions off": "popisky vypnuté",
"Chapters": "Kapitoly",
"Descriptions": "Opisy",
"descriptions off": "opisy vypnuté",
"Audio Track": "Zvuková stopa",
"Volume Level": "Úroveň hlasitosti",
"You aborted the media playback": "Prerušili ste prehrávanie",
"A network error caused the media download to fail part-way.": "Sťahovanie súboru bolo zrušené pre chybu na sieti.",
"The media could not be loaded, either because the server or network failed or because the format is not supported.": "Súbor sa nepodarilo načítať pre chybu servera, sieťového pripojenia, alebo je formát súboru nepodporovaný.",
"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "Prehrávanie súboru bolo prerušené pre poškodené dáta, alebo súbor používa vlastnosti, ktoré váš prehliadač nepodporuje.",
"No compatible source was found for this media.": "Nebol nájdený žiaden kompatibilný zdroj pre tento súbor.",
"The media is encrypted and we do not have the keys to decrypt it.": "Súbor je zašifrovaný a nie je k dispozícii kľúč na rozšifrovanie.",
"Play Video": "Prehrať video",
"Close": "Zatvoriť",
"Close Modal Dialog": "Zatvoriť modálne okno",
"Modal Window": "Modálne okno",
"This is a modal window": "Toto je modálne okno",
"This modal can be closed by pressing the Escape key or activating the close button.": "Toto modálne okno je možné zatvoriť stlačením klávesy Escape, alebo aktivovaním tlačidla na zatvorenie.",
", opens captions settings dialog": ", otvorí okno nastavení popiskov",
", opens subtitles settings dialog": ", otvorí okno nastavení titulkov",
", opens descriptions settings dialog": ", otvorí okno nastavení opisov",
", selected": ", označené",
"captions settings": "nastavenia popiskov",
"subtitles settings": "nastavenia titulkov",
"descriptions settings": "nastavenia opisov",
"Text": "Text",
"White": "Biela",
"Black": "Čierna",
"Red": "Červená",
"Green": "Zelená",
"Blue": "Modrá",
"Yellow": "Žltá",
"Magenta": "Ružová",
"Cyan": "Tyrkysová",
"Background": "Pozadie",
"Window": "Okno",
"Transparent": "Priesvitné",
"Semi-Transparent": "Polopriesvitné",
"Opaque": "Plné",
"Font Size": "Veľkosť písma",
"Text Edge Style": "Typ okrajov písma",
"None": "Žiadne",
"Raised": "Zvýšené",
"Depressed": "Znížené",
"Uniform": "Pravidelné",
"Dropshadow": "S tieňom",
"Font Family": "Typ písma",
"Proportional Sans-Serif": "Proporčné bezpätkové",
"Monospace Sans-Serif": "Pravidelné, bezpätkové",
"Proportional Serif": "Proporčné pätkové",
"Monospace Serif": "Pravidelné pätkové",
"Casual": "Bežné",
"Script": "Písané",
"Small Caps": "Malé kapitálky",
"Reset": "Resetovať",
"restore all settings to the default values": "všetky nastavenia na základné hodnoty",
"Done": "Hotovo",
"Caption Settings Dialog": "Okno nastavení popiskov",
"Beginning of dialog window. Escape will cancel and close the window.": "Začiatok okna. Klávesa Escape zruší a zavrie okno.",
"End of dialog window.": "Koniec okna."
}
+46 -4
Ver Arquivo
@@ -1,6 +1,7 @@
{
"Play": "Oynat",
"Pause": "Duraklat",
"Replay": "Yeniden Oynat",
"Current Time": "Süre",
"Duration Time": "Toplam Süre",
"Remaining Time": "Kalan Süre",
@@ -15,20 +16,61 @@
"Playback Rate": "Oynatma Hızı",
"Subtitles": "Altyazı",
"subtitles off": "Altyazı Kapalı",
"Captions": "Ek Açıklamalar",
"captions off": "Ek Açıklamalar Kapalı",
"Captions": "Altyazı",
"captions off": "Altyazı Kapalı",
"Chapters": "Bölümler",
"Close Modal Dialog": "Dialogu Kapat",
"Descriptions": "Açıklamalar",
"descriptions off": "Açıklamalar kapalı",
"Audio Track": "Ses Dosyası",
"You aborted the media playback": "Video oynatmayı iptal ettiniz",
"A network error caused the media download to fail part-way.": "Video indirilirken bağlantı sorunu oluştu.",
"The media could not be loaded, either because the server or network failed or because the format is not supported.": "Video oynatılamadı, ağ ya da sunucu hatası veya belirtilen format desteklenmiyor.",
"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "Tarayıcınız desteklemediği için videoda hata oluştu.",
"No compatible source was found for this media.": "Video için kaynak bulunamadı.",
"The media is encrypted and we do not have the keys to decrypt it.": "Video, şifrelenmiş bir kaynaktan geliyor ve oynatmak için gerekli anahtar bulunamadı.",
"Play Video": "Videoyu Oynat",
"Close": "Kapat",
"Modal Window": "Modal Penceresi",
"This is a modal window": "Bu bir modal penceresidir",
"This modal can be closed by pressing the Escape key or activating the close button.": "Bu modal ESC tuşuna basarak ya da kapata tıklanarak kapatılabilir.",
", opens captions settings dialog": ", ek açıklama ayarları menüsünü açar",
", opens captions settings dialog": ", altyazı ayarları menüsünü açar",
", opens subtitles settings dialog": ", altyazı ayarları menüsünü açar",
", selected": ", seçildi"
", opens descriptions settings dialog": ", açıklama ayarları menüsünü açar",
", selected": ", seçildi",
"captions settings": "altyazı ayarları",
"subtitles settings": "altyazı ayarları",
"descriptions settings": "açıklama ayarları",
"Text": "Yazı",
"White": "Beyaz",
"Black": "Siyah",
"Red": "Kırmızı",
"Green": "Yeşil",
"Blue": "Mavi",
"Yellow": "Sarı",
"Magenta": "Macenta",
"Cyan": "Açık Mavi (Camgöbeği)",
"Background": "Arka plan",
"Window": "Pencere",
"Transparent": "Saydam",
"Semi-Transparent": "Yarı-Saydam",
"Opaque": "Mat",
"Font Size": "Yazı Boyutu",
"Text Edge Style": "Yazı Kenarlıkları",
"None": "Hiçbiri",
"Raised": "Kabartılmış",
"Depressed": "Yassı",
"Uniform": "Düz",
"Dropshadow": "Gölgeli",
"Font Family": "Yazı Tipi",
"Proportional Sans-Serif": "Orantılı Sans-Serif",
"Monospace Sans-Serif": "Eşaralıklı Sans-Serif",
"Proportional Serif": "Orantılı Serif",
"Monospace Serif": "Eşaralıklı Serif",
"Casual": "Gündelik",
"Script": "El Yazısı",
"Small Caps": "Küçük Boyutlu Büyük Harfli",
"Done": "Tamam",
"Caption Settings Dialog": "Altyazı Ayarları Menüsü",
"Beginning of dialog window. Escape will cancel and close the window.": "Diyalog penceresinin başlangıcı. ESC tuşu işlemi iptal edip pencereyi kapatacaktır."
}
+63 -5
Ver Arquivo
@@ -1,6 +1,9 @@
{
"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",
"Current Time": "Thời gian hiện tại",
"Duration Time": "Độ dài",
"Remaining Time": "Thời gian còn lại",
@@ -8,19 +11,74 @@
"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",
"Unmute": "Bật âm thanh",
"Playback Rate": "Tốc độ phát",
"Playback Rate": "Tỉ lệ phát lại",
"Subtitles": "Phụ đề",
"subtitles off": "Tắt phụ đề",
"subtitles off": "tắt phụ đề",
"Captions": "Chú thích",
"captions off": "Tắt chú thích",
"captions off": "tắt chú thích",
"Chapters": "Chương",
"You aborted the media playback": "Bạn đã hủy việc phát media.",
"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."
"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 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ể 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."
}
+17 -4
Ver Arquivo
@@ -12,16 +12,29 @@
"Non-Fullscreen": "退出全屏",
"Mute": "静音",
"Unmute": "取消静音",
"Playback Rate": "播放码率",
"Playback Rate": "播放速度",
"Subtitles": "字幕",
"subtitles off": "字幕关闭",
"subtitles off": "关闭字幕",
"Captions": "内嵌字幕",
"captions off": "内嵌字幕关闭",
"captions off": "关闭内嵌字幕",
"Chapters": "节目段落",
"Close Modal Dialog": "关闭弹窗",
"Descriptions": "描述",
"descriptions off": "关闭描述",
"Audio Track": "音轨",
"You aborted the media playback": "视频播放被终止",
"A network error caused the media download to fail part-way.": "网络错误导致视频下载中途失败。",
"The media could not be loaded, either because the server or network failed or because the format is not supported.": "视频因格式不支持或者服务器或网络的问题无法加载。",
"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "由于视频文件损坏或是该视频使用了你的浏览器不支持的功能,播放终止。",
"No compatible source was found for this media.": "无法找到此视频兼容的源。",
"The media is encrypted and we do not have the keys to decrypt it.": "视频已加密,无法解密。"
"The media is encrypted and we do not have the keys to decrypt it.": "视频已加密,无法解密。",
"Play Video": "播放视频",
"Close": "关闭",
"Modal Window": "弹窗",
"This is a modal window": "这是一个弹窗",
"This modal can be closed by pressing the Escape key or activating the close button.": "可以按ESC按键或启用关闭按钮来关闭此弹窗。",
", opens captions settings dialog": ", 开启标题设置弹窗",
", opens subtitles settings dialog": ", 开启字幕设置弹窗",
", opens descriptions settings dialog": ", 开启描述设置弹窗",
", selected": ", 选择"
}
+14150
Ver Arquivo
Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff
+66 -26
Ver Arquivo
@@ -1,8 +1,8 @@
{
"name": "video.js",
"description": "An HTML5 and Flash video player with a common API and skin for both.",
"version": "5.16.0",
"main": "./es5/video.js",
"version": "6.3.3",
"main": "./dist/video.cjs.js",
"style": "./dist/video-js.css",
"copyright": "Copyright Brightcove, Inc. <https://www.brightcove.com/>",
"license": "Apache-2.0",
@@ -18,6 +18,12 @@
"scripts": {
"changelog": "conventional-changelog -p videojs -i CHANGELOG.md -s",
"build": "grunt dist",
"rollup-all": "npm run rollup && npm run rollup-minify",
"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",
"grunt": "grunt",
@@ -25,10 +31,17 @@
"start": "grunt dev",
"test": "grunt test",
"docs": "npm run docs:lint && npm run docs:api",
"docs:api": "jsdoc -r src/js -d docs/api -c .jsdoc.json",
"jsdoc": "jsdoc",
"predocs:api": "node -e \"var s=require('shelljs'),d=['docs/api'];s.rm('-rf',d);\"",
"docs:api": "jsdoc -c .jsdoc.json",
"postdocs:api": "node ./build/fix-api-docs.js",
"docs:lint": "remark -- './**/*.md'",
"docs:fix": "remark --output -- './**/*.md'",
"babel": "babel src/js -d es5"
"babel": "babel src/js -d es5",
"prepublish": "not-in-install && run-p docs:api build || in-install",
"publish": "node build/gh-release.js",
"prepush": "npm run lint -- --errors",
"version": "node build/version.js && git add CHANGELOG.md"
},
"repository": {
"type": "git",
@@ -36,48 +49,49 @@
},
"dependencies": {
"babel-runtime": "^6.9.2",
"global": "4.3.0",
"global": "4.3.2",
"safe-json-parse": "4.0.0",
"tsml": "1.0.1",
"videojs-font": "2.0.0",
"videojs-ie8": "1.1.2",
"videojs-swf": "5.1.0",
"videojs-vtt.js": "0.12.1",
"xhr": "2.2.2"
"videojs-vtt.js": "0.12.4",
"xhr": "2.4.0"
},
"devDependencies": {
"aliasify": "^2.1.0",
"babel-cli": "^6.11.4",
"babel-plugin-inline-json": "^1.1.1",
"babel-plugin-transform-es3-member-expression-literals": "^6.8.0",
"babel-plugin-transform-es3-property-literals": "^6.8.0",
"babel-plugin-external-helpers": "^6.22.0",
"babel-plugin-transform-runtime": "^6.9.0",
"babel-preset-es2015": "^6.14.0",
"babel-preset-es3": "^1.0.1",
"babel-register": "^6.9.0",
"babelify": "^7.3.0",
"blanket": "^1.1.6",
"bluebird": "^3.5.0",
"browserify-derequire": "^0.9.4",
"browserify-istanbul": "^2.0.0",
"browserify-versionify": "^1.0.4",
"bundle-collapser": "^1.2.1",
"chg": "^0.3.2",
"cli-table": "^0.3.1",
"conventional-changelog-cli": "^1.2.0",
"conventional-changelog-videojs": "^3.0.0",
"es5-shim": "^4.1.3",
"es6-shim": "^0.35.1",
"ghooks": "^1.3.2",
"filesize": "^3.5.6",
"gh-release": "^3.0.0",
"grunt": "^0.4.5",
"grunt-accessibility": "^5.0.0",
"grunt-babel": "^6.0.0",
"grunt-babel": "^7.0.0",
"grunt-banner": "^0.6.0",
"grunt-browserify": "5.0.0",
"grunt-browserify": "5.2.0",
"grunt-cli": "~1.2.0",
"grunt-concurrent": "^2.3.1",
"grunt-contrib-clean": "^1.0.0",
"grunt-contrib-concat": "^1.0.1",
"grunt-contrib-connect": "~1.0.2",
"grunt-contrib-copy": "^1.0.0",
"grunt-contrib-cssmin": "~1.0.2",
"grunt-contrib-cssmin": "~2.2.0",
"grunt-contrib-uglify": "^2.0.0",
"grunt-contrib-watch": "~1.0.0",
"grunt-coveralls": "^1.0.0",
@@ -89,9 +103,12 @@
"grunt-version": "~1.1.1",
"grunt-videojs-languages": "0.0.4",
"grunt-zip": "0.17.1",
"humanize-duration": "^3.10.0",
"husky": "^0.14.1",
"in-publish": "^2.0.0",
"istanbul": "^0.4.5",
"jsdoc": "^3.4.2",
"karma": "^1.2.0",
"karma": "1.3.0",
"karma-browserify": "^5.1.0",
"karma-browserstack-launcher": "^1.0.1",
"karma-chrome-launcher": "^2.0.0",
@@ -103,29 +120,49 @@
"karma-qunit": "^1.2.0",
"karma-safari-launcher": "^1.0.0",
"karma-sinon": "^1.0.5",
"klaw-sync": "^3.0.0",
"load-grunt-tasks": "^3.1.0",
"lodash": "^4.16.6",
"markdown-table": "^1.0.0",
"minimist": "^1.2.0",
"npm-run": "^4.1.0",
"npm-run-all": "^4.0.2",
"proxyquireify": "^3.0.0",
"qunitjs": "1.23.1",
"remark-cli": "^2.1.0",
"remark-lint": "^5.2.0",
"remark-toc": "^3.1.0",
"remark-validate-links": "^5.0.0",
"remark-cli": "^4.0.0",
"remark-lint": "^6.0.0",
"remark-parse": "^4.0.0",
"remark-stringify": "^4.0.0",
"remark-toc": "^4.0.0",
"remark-validate-links": "^7.0.0",
"replace": "^0.3.0",
"rollup": "^0.47.5",
"rollup-plugin-babel": "^2.7.1",
"rollup-plugin-commonjs": "^8.0.2",
"rollup-plugin-filesize": "^1.2.1",
"rollup-plugin-ignore": "^1.0.3",
"rollup-plugin-json": "^2.1.1",
"rollup-plugin-node-resolve": "^3.0.0",
"rollup-plugin-progress": "^0.2.1",
"rollup-plugin-uglify": "^1.0.2",
"rollup-watch": "^4.0.0",
"shelljs": "^0.7.5",
"sinon": "^1.16.1",
"time-grunt": "^1.1.1",
"uglify-js": "~2.7.3",
"tui-jsdoc-template": "^1.1.0",
"uglify-js": "~2.8.8",
"unified": "^6.1.5",
"videojs-doc-generator": "0.0.1",
"videojs-flash": "^2.0.0",
"videojs-standard": "^6.0.1",
"webpack": "^1.13.2"
"webpack": "^1.15.0"
},
"vjsstandard": {
"ignore": [
"**/Gruntfile.js",
"**/es5/**",
"**/build/**",
"!build/rollup.js",
"**/dist/**",
"**/docs/**",
"**/lang/**",
@@ -135,9 +172,12 @@
"**/test/karma.conf.js"
]
},
"config": {
"ghooks": {
"pre-push": "npm run lint -- --errors"
}
"greenkeeper": {
"ignore": [
"qunitjs",
"sinon",
"webpack",
"uglify-js"
]
}
}
+68
Ver Arquivo
@@ -0,0 +1,68 @@
<!DOCTYPE html>
<html lang="en-GB">
<head>
<meta charset="utf-8" />
<title>Video.js Sandbox</title>
<!-- Add ES5 shim and sham for IE8 -->
<script src="../dist/ie8/videojs-ie8.js"></script>
<!-- Load the source files -->
<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>
<!-- Set the location of the flash SWF -->
<script>
videojs.options.flash.swf = '../node_modules/videojs-flash/node_modules/videojs-swf/dist/video-js.swf';
</script>
</head>
<body>
<div style="background-color:#eee; border: 1px solid #777; padding: 10px; margin-bottom: 20px; font-size: .8em; line-height: 1.5em; font-family: Verdana, sans-serif;">
<p>You can use /sandbox/ for writing and testing your own code. Nothing in /sandbox/ will get checked into the repo, except files that end in .example (so don't edit or add those files). To get started make a copy of index.html.example and rename it to index.html.</p>
<pre>cp sandbox/index.html.example sandbox/index.html</pre>
<pre>npm run start</pre>
<pre>open http://localhost:9999/sandbox/index.html</pre>
</div>
<video id="vid1" class="video-js vjs-default-skin" lang="en" controls preload="auto" width="640" height="360" poster="//d2zihajmogu5jn.cloudfront.net/elephantsdream/poster.png">
<source src="//d2zihajmogu5jn.cloudfront.net/elephantsdream/ed_hd.mp4" type="video/mp4">
<source src="//d2zihajmogu5jn.cloudfront.net/elephantsdream/ed_hd.ogg" type="video/ogg">
<track kind="captions" src="//d2zihajmogu5jn.cloudfront.net/elephantsdream/captions.en.vtt" srclang="en" label="English"></track><!-- Tracks need an ending tag thanks to IE9 -->
<track kind="subtitles" src="//d2zihajmogu5jn.cloudfront.net/elephantsdream/captions.ar.vtt" srclang="ar" label="Arabic"></track><!-- Tracks need an ending tag thanks to IE9 -->
<track kind="subtitles" src="//d2zihajmogu5jn.cloudfront.net/elephantsdream/captions.sv.vtt" srclang="sv" label="Swedish"></track><!-- Tracks need an ending tag thanks to IE9 -->
<track kind="subtitles" src="//d2zihajmogu5jn.cloudfront.net/elephantsdream/captions.ru.vtt" srclang="ru" label="Russian"></track><!-- Tracks need an ending tag thanks to IE9 -->
<track kind="subtitles" src="//d2zihajmogu5jn.cloudfront.net/elephantsdream/captions.ja.vtt" srclang="ja" label="Japanese"></track><!-- Tracks need an ending tag thanks to IE9 -->
<p class="vjs-no-js">To view this video please enable JavaScript, and consider upgrading to a web browser that <a href="http://videojs.com/html5-video-support/" target="_blank">supports HTML5 video</a></p>
</video>
<p>This player has the captions-only captionsButton, the subtiles-only subtitlesButton and the subsCapsButton which shows both kinds. Typically you'll use either just the subsCapsButton alone, or one or both of the captionsButton and subtitlesButton.</p>
<script>
var vid = document.getElementById("vid1");
var player = videojs(vid, {
controlBar: {
children: [
'playToggle',
'volumePanel',
'currentTimeDisplay',
'timeDivider',
'durationDisplay',
'progressControl',
'liveDisplay',
'remainingTimeDisplay',
'customControlSpacer',
'playbackRateMenuButton',
'chaptersButton',
'descriptionsButton',
'subtitlesButton',
'captionsButton',
'subsCapsButton',
'audioTrackButton',
'fullscreenToggle'
]
}
});
console.log(player.language());
</script>
</body>
</html>
+12 -7
Ver Arquivo
@@ -5,27 +5,31 @@
<title>Video.js Text Descriptions, Chapters &amp; Captions Example</title>
<!-- Add ES5 shim and sham for IE8 -->
<script src="../build/temp/ie8/videojs-ie8.js"></script>
<script src="../dist/ie8/videojs-ie8.js"></script>
<!-- Load the source files -->
<link href="../build/temp/video-js.css" rel="stylesheet" type="text/css">
<script src="../build/temp/video.js"></script>
<script src="../dist/video.js"></script>
<!-- Set the location of the flash SWF -->
<script>
videojs.options.flash.swf = '../build/temp/video-js.swf';
videojs.options.flash.swf = '../node_modules/videojs-flash/node_modules/videojs-swf/dist/video-js.swf';
</script>
</head>
<body>
<!-- NOTE: we have to disable native Text Track support for the HTML5 tech,
since even HTML5 video players with native Text Track support
don't currently support 'description' text tracks in any
useful way! -->
useful way! Currently this means that iOS will not display
ANY text tracks -->
<video id="example_video_1" class="video-js vjs-default-skin" controls preload="none" width="640" height="360"
data-setup='{ "html5" : { "nativeTextTracks" : false } }'>
<source src="https://archive.org/download/ElephantsDream/ed_hd.mp4" type="video/mp4">
<source src="https://archive.org/download/ElephantsDream/ed_hd.ogv" type="video/ogv">
data-setup='{ "html5" : { "nativeTextTracks" : false } }'
poster="http://d2zihajmogu5jn.cloudfront.net/elephantsdream/poster.png">
<source src="//d2zihajmogu5jn.cloudfront.net/elephantsdream/ed_hd.mp4" type="video/mp4">
<source src="//d2zihajmogu5jn.cloudfront.net/elephantsdream/ed_hd.ogg" type="video/ogg">
<track kind="captions" src="../docs/examples/elephantsdream/captions.en.vtt" srclang="en" label="English" default></track><!-- Tracks need an ending tag thanks to IE9 -->
<track kind="captions" src="../docs/examples/elephantsdream/captions.sv.vtt" srclang="sv" label="Swedish"></track>
@@ -39,5 +43,6 @@
<p class="vjs-no-js">To view this video please enable JavaScript, and consider upgrading to a web browser that <a href="http://videojs.com/html5-video-support/" target="_blank">supports HTML5 video</a></p>
</video>
</body>
</html>
+45
Ver Arquivo
@@ -0,0 +1,45 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Video.js Sandbox</title>
<!-- Add ES5 shim and sham for IE8 -->
<script src="../dist/ie8/videojs-ie8.js"></script>
<!-- Load the source files -->
<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>
<!-- Set the location of the flash SWF -->
<script>
videojs.options.flash.swf = '../node_modules/videojs-flash/node_modules/videojs-swf/dist/video-js.swf';
</script>
</head>
<body>
<div style="background-color:#eee; border: 1px solid #777; padding: 10px; margin-bottom: 20px; font-size: .8em; line-height: 1.5em; font-family: Verdana, sans-serif;">
<p>You can use /sandbox/ for writing and testing your own code. Nothing in /sandbox/ will get checked into the repo, except files that end in .example (so don't edit or add those files). To get started make a copy of index.html.example and rename it to index.html.</p>
<pre>cp sandbox/flash.html.example sandbox/flash.html</pre>
<pre>npm run start</pre>
<pre>open http://localhost:9999/sandbox/flash.html</pre>
</div>
<video id="vid1" class="video-js vjs-default-skin" controls preload="auto" width="640" height="264"
poster="http://vjs.zencdn.net/v/oceans.png"
data-setup=''>
<source src="http://vjs.zencdn.net/v/oceans.mp4" type="video/mp4">
<source src="http://vjs.zencdn.net/v/oceans.webm" type="video/webm">
<source src="http://vjs.zencdn.net/v/oceans.ogv" type="video/ogg">
<track kind="captions" src="../docs/examples/shared/example-captions.vtt" srclang="en" label="English"></track><!-- Tracks need an ending tag thanks to IE9 -->
<p class="vjs-no-js">To view this video please enable JavaScript, and consider upgrading to a web browser that <a href="http://videojs.com/html5-video-support/" target="_blank">supports HTML5 video</a></p>
</video>
<script>
var vid = document.getElementById("vid1");
var player = videojs(vid, {techOrder: ['flash', 'html5']});
</script>
</body>
</html>
+7 -5
Ver Arquivo
@@ -5,15 +5,16 @@
<title>Video.js Sandbox</title>
<!-- Add ES5 shim and sham for IE8 -->
<script src="../build/temp/ie8/videojs-ie8.js"></script>
<script src="../dist/ie8/videojs-ie8.js"></script>
<!-- Load the source files -->
<link href="../build/temp/video-js.css" rel="stylesheet" type="text/css">
<script src="../build/temp/video.js"></script>
<script src="../dist/video.js"></script>
<script src="../node_modules/videojs-flash/dist/videojs-flash.js"></script>
<!-- Set the location of the flash SWF -->
<script>
videojs.options.flash.swf = '../build/temp/video-js.swf';
videojs.options.flash.swf = '../node_modules/videojs-flash/node_modules/videojs-swf/dist/video-js.swf';
</script>
</head>
@@ -21,8 +22,7 @@
<div style="background-color:#eee; border: 1px solid #777; padding: 10px; margin-bottom: 20px; font-size: .8em; line-height: 1.5em; font-family: Verdana, sans-serif;">
<p>You can use /sandbox/ for writing and testing your own code. Nothing in /sandbox/ will get checked into the repo, except files that end in .example (so don't edit or add those files). To get started make a copy of index.html.example and rename it to index.html.</p>
<pre>cp sandbox/index.html.example sandbox/index.html</pre>
<pre>grunt watch</pre>
<pre>grunt connect</pre>
<pre>npm run start</pre>
<pre>open http://localhost:9999/sandbox/index.html</pre>
</div>
@@ -38,6 +38,8 @@
<script>
var vid = document.getElementById("vid1");
var player = videojs(vid);
</script>
</body>
+3 -3
Ver Arquivo
@@ -6,15 +6,15 @@
<title>VideoJS Languages Demo</title>
<!-- Add ES5 shim and sham for IE8 -->
<script src="../build/temp/ie8/videojs-ie8.js"></script>
<script src="../dist/ie8/videojs-ie8.js"></script>
<!-- Load the source files -->
<link href="../build/temp/video-js.css" rel="stylesheet" type="text/css">
<script src="../build/temp/video.js"></script>
<script src="../dist/video.js"></script>
<!-- Set the location of the flash SWF -->
<script>
videojs.options.flash.swf = '../build/temp/video-js.swf';
videojs.options.flash.swf = '../node_modules/videojs-flash/node_modules/videojs-swf/dist/video-js.swf';
</script>
<!-- Add support for Spanish 'es' -->
+3 -3
Ver Arquivo
@@ -5,15 +5,15 @@
<title>Video.js Plugin Example</title>
<!-- Add ES5 shim and sham for IE8 -->
<script src="../build/temp/ie8/videojs-ie8.js"></script>
<script src="../dist/ie8/videojs-ie8.js"></script>
<!-- Load the source files -->
<link href="../build/temp/video-js.css" rel="stylesheet" type="text/css">
<script src="../build/temp/video.js"></script>
<script src="../dist/video.js"></script>
<!-- Set the location of the flash SWF -->
<script>
videojs.options.flash.swf = '../build/temp/video-js.swf';
videojs.options.flash.swf = '../node_modules/videojs-flash/node_modules/videojs-swf/dist/video-js.swf';
</script>
</head>
+1 -1
Ver Arquivo
@@ -16,6 +16,7 @@
@mixin transition($string: $transition--default) {
-webkit-transition: $string;
-moz-transition: $string;
-ms-transition: $string;
-o-transition: $string;
transition: $string;
}
@@ -24,7 +25,6 @@
border: 0;
clip: rect(0 0 0 0);
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute;
+2 -2
Ver Arquivo
@@ -7,7 +7,7 @@
.vjs-current-time, .vjs-time-divider, .vjs-duration, .vjs-remaining-time,
.vjs-playback-rate, .vjs-progress-control,
.vjs-mute-control, .vjs-volume-control, .vjs-volume-menu-button,
.vjs-mute-control, .vjs-volume-control,
.vjs-chapters-button, .vjs-descriptions-button, .vjs-captions-button,
.vjs-subtitles-button, .vjs-audio-button { display: none; }
}
@@ -19,7 +19,7 @@
.video-js.vjs-layout-x-small:not(.vjs-fullscreen) {
.vjs-current-time, .vjs-time-divider, .vjs-duration, .vjs-remaining-time,
.vjs-playback-rate,
.vjs-mute-control, .vjs-volume-control, .vjs-volume-menu-button,
.vjs-mute-control, .vjs-volume-control,
.vjs-chapters-button, .vjs-descriptions-button, .vjs-captions-button,
.vjs-subtitles-button, .vjs-audio-button { display: none; }
}
+1 -1
Ver Arquivo
@@ -1,3 +1,3 @@
.video-js .vjs-audio-button {
.video-js .vjs-audio-button .vjs-icon-placeholder {
@extend .vjs-icon-audio;
}
+3 -4
Ver Arquivo
@@ -17,11 +17,11 @@
@include border-radius(0.3em);
@include transition(all 0.4s);
@extend .vjs-icon-play;
// Since the big play button doesn't inherit from vjs-control, we need to specify a bit more than
// other buttons for the icon.
&:before {
& .vjs-icon-placeholder:before {
@extend .vjs-icon-play;
@extend %icon-default;
}
}
@@ -36,7 +36,6 @@
.video-js:hover .vjs-big-play-button,
.video-js .vjs-big-play-button:focus {
outline: 0;
border-color: $primary-foreground-color;
@include background-color-with-alpha($secondary-background-color, $secondary-background-transparency);
+5
Ver Arquivo
@@ -15,3 +15,8 @@
-moz-appearance: none;
appearance: none;
}
.vjs-control .vjs-button {
width: 100%;
height: 100%;
}
+45 -63
Ver Arquivo
@@ -1,86 +1,50 @@
.vjs-caption-settings {
position: relative;
top: 1em;
.vjs-modal-dialog.vjs-text-track-settings {
background-color: $primary-background-color;
background-color: rgba($primary-background-color, 0.75);
color: $primary-foreground-color;
margin: 0 auto;
padding: 0.5em;
height: 16em;
font-size: 12px;
width: 40em;
height: 70%;
}
.vjs-caption-settings .vjs-tracksettings {
top: 0;
bottom: 1em;
left: 0;
right: 0;
position: absolute;
overflow: auto;
// Layout divs
.vjs-text-track-settings .vjs-modal-dialog-content {
display: table;
}
.vjs-caption-settings .vjs-tracksettings-colors,
.vjs-caption-settings .vjs-tracksettings-font {
float: left;
}
.vjs-caption-settings .vjs-tracksettings-colors:after,
.vjs-caption-settings .vjs-tracksettings-font:after,
.vjs-caption-settings .vjs-tracksettings-controls:after {
clear: both;
.vjs-text-track-settings .vjs-track-settings-colors,
.vjs-text-track-settings .vjs-track-settings-font,
.vjs-text-track-settings .vjs-track-settings-controls {
display: table-cell;
}
.vjs-caption-settings .vjs-tracksettings-controls {
position: absolute;
bottom: 1em;
right: 1em;
.vjs-text-track-settings .vjs-track-settings-controls {
text-align: right;
vertical-align: bottom;
}
.vjs-caption-settings .vjs-tracksetting {
// Form elements
.vjs-text-track-settings fieldset {
margin: 5px;
padding: 3px;
min-height: 40px;
border: none;
}
.vjs-caption-settings .vjs-tracksetting label,
.vjs-caption-settings .vjs-tracksetting legend {
display: block;
width: 100px;
margin-bottom: 5px;
}
.vjs-caption-settings .vjs-tracksetting span {
display: inline;
.vjs-text-track-settings fieldset span {
display: inline-block;
margin-left: 5px;
vertical-align: top;
float: right;
}
.vjs-caption-settings .vjs-tracksetting > div {
margin-bottom: 5px;
min-height: 20px;
.vjs-text-track-settings legend {
color: $primary-foreground-color;
margin: 0 0 5px 0;
}
.vjs-caption-settings .vjs-tracksetting > div:last-child {
margin-bottom: 0;
padding-bottom: 0;
min-height: 0;
}
.vjs-caption-settings label > input {
margin-right: 10px;
}
.vjs-caption-settings fieldset {
margin-top: 1em;
margin-left: .5em;
}
// Hide labels within fieldsets, so they are only for screen reader users
.vjs-caption-settings fieldset .vjs-label {
// Hide labels, so they are only for screen reader users
.vjs-text-track-settings .vjs-label {
position: absolute;
clip: rect(1px 1px 1px 1px); /* for Internet Explorer */
clip: rect(1px 1px 1px 1px); // for Internet Explorer
clip: rect(1px, 1px, 1px, 1px);
display: block;
margin: 0 0 5px 0;
padding: 0;
border: 0;
height: 1px;
@@ -88,7 +52,25 @@
overflow: hidden;
}
.vjs-caption-settings input[type="button"] {
width: 40px;
height: 40px;
.vjs-track-settings-controls button:focus,
.vjs-track-settings-controls button:active {
outline-style: solid;
outline-width: medium;
background-image: linear-gradient(0deg, $primary-foreground-color 88%, $secondary-background-color 100%);
}
.vjs-track-settings-controls button:hover {
color: rgba(#2B333F, 0.75);
}
.vjs-track-settings-controls button {
background-color: $primary-foreground-color;
background-image: linear-gradient(-180deg, $primary-foreground-color 88%, $secondary-background-color 100%);
color: #2B333F;
cursor: pointer;
border-radius: 2px;
}
.vjs-track-settings-controls .vjs-default-button {
margin-right: 1em;
}
+1 -1
Ver Arquivo
@@ -1,3 +1,3 @@
.video-js .vjs-captions-button {
.video-js .vjs-captions-button .vjs-icon-placeholder {
@extend .vjs-icon-captions;
}
+1 -1
Ver Arquivo
@@ -1,4 +1,4 @@
.video-js .vjs-chapters-button {
.video-js .vjs-chapters-button .vjs-icon-placeholder {
@extend .vjs-icon-chapters;
}
+4 -1
Ver Arquivo
@@ -1,5 +1,8 @@
.video-js .vjs-control.vjs-close-button {
@extend .vjs-icon-cancel;
& .vjs-icon-placeholder {
@extend .vjs-icon-cancel;
}
cursor: pointer;
height: 3em;
position: absolute;
+5 -6
Ver Arquivo
@@ -2,7 +2,6 @@
// It's used on both real buttons (play button)
// and div buttons (menu buttons)
.video-js .vjs-control {
outline: none;
position: relative;
text-align: center;
margin: 0;
@@ -11,12 +10,12 @@
width: 4em;
@include flex(none);
&:before {
font-size: 1.8em;
line-height: 1.67;
}
.vjs-button > .vjs-icon-placeholder:before {
font-size: 1.8em;
line-height: 1.67;
@extend %icon-default;
}
@extend %icon-default;
}
// Replacement for focus outline
+1 -1
Ver Arquivo
@@ -1,3 +1,3 @@
.video-js .vjs-descriptions-button {
.video-js .vjs-descriptions-button .vjs-icon-placeholder {
@extend .vjs-icon-audio-description;
}
+5 -2
Ver Arquivo
@@ -1,9 +1,12 @@
.video-js .vjs-fullscreen-control {
cursor: pointer;
@include flex(none);
@extend .vjs-icon-fullscreen-enter;
& .vjs-icon-placeholder {
@extend .vjs-icon-fullscreen-enter;
}
}
// Switch to the exit icon when the player is in fullscreen
.video-js.vjs-fullscreen .vjs-fullscreen-control {
.video-js.vjs-fullscreen .vjs-fullscreen-control .vjs-icon-placeholder {
@extend .vjs-icon-fullscreen-exit;
}
+4 -2
Ver Arquivo
@@ -21,8 +21,6 @@
// Avoiding helvetica: issue #376
font-family: $text-font-family;
@include user-select(none);
// Fix for Firefox 9 fullscreen (only if it is enabled). Not needed when
// checking fullScreenEnabled.
&:-moz-full-screen { position: absolute; }
@@ -33,6 +31,10 @@
}
}
.video-js[tabindex="-1"] {
outline: none;
}
// All elements inherit border-box sizing
.video-js *,
.video-js *:before,
+12
Ver Arquivo
@@ -1,6 +1,18 @@
.video-js .vjs-modal-dialog {
@extend %fill-parent;
@include linear-gradient(180deg, rgba(0, 0, 0, 0.8), rgba(255, 255, 255, 0));
// This allows scrolling of content if need be.
overflow: auto;
// When combined with `overflow: auto;`, this fixes gaps left by
// scrollbars in older IE versions.
box-sizing: content-box;
}
// Reset box-sizing inside the modal dialog.
.video-js .vjs-modal-dialog > * {
box-sizing: border-box;
}
.vjs-modal-dialog .vjs-modal-dialog-content {
+5 -2
Ver Arquivo
@@ -1,8 +1,11 @@
.video-js .vjs-play-control {
.video-js .vjs-play-control .vjs-icon-placeholder {
cursor: pointer;
@include flex(none);
@extend .vjs-icon-play;
}
.video-js .vjs-play-control.vjs-playing {
.video-js .vjs-play-control.vjs-playing .vjs-icon-placeholder {
@extend .vjs-icon-pause;
}
.video-js .vjs-play-control.vjs-ended .vjs-icon-placeholder {
@extend .vjs-icon-replay;
}
+7 -2
Ver Arquivo
@@ -1,12 +1,17 @@
// TODO: I feel like this should be a generic menu. Research later.
.vjs-playback-rate > .vjs-menu-button,
.vjs-playback-rate .vjs-playback-rate-value {
font-size: 1.5em;
line-height: 2;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.vjs-playback-rate .vjs-playback-rate-value {
pointer-events: none;
font-size: 1.5em;
line-height: 2;
text-align: center;
}
+86 -91
Ver Arquivo
@@ -1,18 +1,8 @@
// .vjs-progress-control / ProgressControl
//
// Let's talk pixel math!
// Start with a base font size of 10px (assuming that hasn't changed)
// No Hover:
// - Progress holder is 3px
// - Progress handle is 9px
// - Progress handle is pulled up 3px to center it.
//
// Hover:
// - Progress holder becomes 5px
// - Progress handle becomes 15px
// - Progress handle is pulled up 5px to center it
//
// This is the container for all progress bar-related components/elements.
.video-js .vjs-progress-control {
cursor: pointer;
@include flex(auto);
@include display-flex(center);
min-width: 4em;
@@ -22,39 +12,45 @@
display: none;
}
// Box containing play and load progresses. Also acts as seek scrubber.
.vjs-no-flex .vjs-progress-control {
width: auto;
}
// .vjs-progress-holder / SeekBar
//
// Box containing play and load progress bars. It also acts as seek scrubber.
.video-js .vjs-progress-holder {
@include flex(auto);
@include transition(all 0.2s);
height: 0.3em;
}
// We need an increased hit area on hover
.video-js .vjs-progress-control .vjs-progress-holder {
// This is one of the rare cases where we are using a pixel dimension. The
// reason is that the progress holder font-size changes on hover. With the
// default em-based margins, this means it gets narrower and causes issues
// with mouseover behaviors/math.
margin: 0 10px;
}
// This increases the size of the progress holder so there is an increased
// hit area for clicks/touches.
.video-js .vjs-progress-control:hover .vjs-progress-holder {
font-size: 1.666666666666666666em;
}
/* If we let the font size grow as much as everything else, the current time tooltip ends up
ginormous. If you'd like to enable the current time tooltip all the time, this should be disabled
to avoid a weird hitch when you roll off the hover. */
// Also show the current time tooltip
.video-js .vjs-progress-control:hover .vjs-time-tooltip,
.video-js .vjs-progress-control:hover .vjs-mouse-display:after,
.video-js .vjs-progress-control:hover .vjs-play-progress:after {
font-family: $text-font-family;
visibility: visible;
font-size: 0.6em;
}
// Progress Bars
// .vjs-play-progress / PlayProgressBar and .vjs-load-progress / LoadProgressBar
//
// These are bars that appear within the progress control to communicate the
// amount of media that has played back and the amount of media that has
// loaded, respectively.
.video-js .vjs-progress-holder .vjs-play-progress,
.video-js .vjs-progress-holder .vjs-load-progress,
.video-js .vjs-progress-holder .vjs-tooltip-progress-bar,
.video-js .vjs-progress-holder .vjs-load-progress div {
position: absolute;
display: block;
height: 0.3em;
height: 100%;
margin: 0;
padding: 0;
// updated by javascript during playback
@@ -64,86 +60,83 @@
top: 0;
}
.video-js .vjs-mouse-display {
@extend .vjs-icon-circle;
&:before {
display: none;
}
}
.video-js .vjs-play-progress {
background-color: $primary-foreground-color;
@extend .vjs-icon-circle;
// Progress handle
&:before {
position: absolute;
top: -0.333333333333333em;
right: -0.5em;
font-size: 0.9em;
position: absolute;
right: -0.5em;
top: -0.333333333333333em;
z-index: 1;
}
}
// Current Time "tooltip"
// By default this is hidden and only shown when hovering over the progress control
.video-js .vjs-time-tooltip,
.video-js .vjs-mouse-display:after,
.video-js .vjs-play-progress:after {
visibility: hidden;
pointer-events: none;
position: absolute;
top: -3.4em;
right: -1.9em;
font-size: 0.9em;
color: #000;
content: attr(data-current-time);
padding: 6px 8px 8px 8px;
@include background-color-with-alpha(#fff, 0.8);
@include border-radius(0.3em);
}
.video-js .vjs-time-tooltip,
.video-js .vjs-play-progress:before,
.video-js .vjs-play-progress:after {
z-index: 1;
}
.video-js .vjs-progress-control .vjs-keep-tooltips-inside:after {
display: none;
}
.video-js .vjs-load-progress {
// For IE8 we'll lighten the color
// For IE8, we'll lighten the color
background: lighten($secondary-background-color, 25%);
// Otherwise we'll rely on stacked opacities
// Otherwise, we'll rely on stacked opacities
background: rgba($secondary-background-color, $secondary-background-transparency);
}
// there are child elements of the load progress bar that represent the
// specific time ranges that have been buffered
// There are child elements of the load progress bar that represent the
// specific time ranges that have been buffered.
.video-js .vjs-load-progress div {
// For IE8 we'll lighten the color
// For IE8, we'll lighten the color
background: lighten($secondary-background-color, 50%);
// Otherwise we'll rely on stacked opacities
// Otherwise, we'll rely on stacked opacities
background: rgba($secondary-background-color, 0.75);
}
.video-js.vjs-no-flex .vjs-progress-control {
width: auto;
}
// .vjs-time-tooltip
//
// These elements are displayed above the progress bar.
//
// By default, they are hidden and only shown when hovering over the progress
// control.
.video-js .vjs-time-tooltip {
display: inline-block;
height: 2.4em;
position: relative;
@include background-color-with-alpha(#fff, 0.8);
@include border-radius(0.3em);
color: #000;
// By floating the tooltips to the right, their right edge becomes aligned
// with the right edge of their parent element. However, in order to have them
// centered, they must be pulled further to the right via positioning (e.g.
// `right: -10px;`. This part is left to JavaScript.
float: right;
right: -1.9em;
}
font-family: $text-font-family;
.vjs-tooltip-progress-bar {
// The font-size should translate to a consistent 10px for time tooltips in
// all states. This is tricky because the .vjs-progress-holder element
// changes its font-size when the .vjs-progress-control is hovered.
font-size: 1em;
padding: 6px 8px 8px 8px;
pointer-events: none;
position: relative;
top: -3.4em;
visibility: hidden;
z-index: 1;
}
.video-js .vjs-progress-holder:focus .vjs-time-tooltip {
display: none;
}
.video-js .vjs-progress-control:hover .vjs-time-tooltip,
.video-js .vjs-progress-control:hover .vjs-progress-holder:focus .vjs-time-tooltip {
display: block;
// Ensure that we maintain a font-size of ~10px.
font-size: 0.6em;
visibility: visible;
}
// .vjs-mouse-display / MouseTimeDisplay
//
// This element tracks the mouse position along the progress control and
// includes a tooltip, which displays the time at that point in the media.
.video-js .vjs-progress-control .vjs-mouse-display {
display: none;
position: absolute;
@@ -152,25 +145,27 @@
background-color: #000;
z-index: 1;
}
.vjs-no-flex .vjs-progress-control .vjs-mouse-display {
z-index: 0;
}
.video-js .vjs-progress-control:hover .vjs-mouse-display {
display: block;
}
.video-js.vjs-user-inactive .vjs-progress-control .vjs-mouse-display,
.video-js.vjs-user-inactive .vjs-progress-control .vjs-mouse-display:after {
.video-js.vjs-user-inactive .vjs-progress-control .vjs-mouse-display {
visibility: hidden;
opacity: 0;
$trans: visibility 1.0s, opacity 1.0s;
@include transition($trans);
}
.video-js.vjs-user-inactive.vjs-no-flex .vjs-progress-control .vjs-mouse-display,
.video-js.vjs-user-inactive.vjs-no-flex .vjs-progress-control .vjs-mouse-display:after {
.video-js.vjs-user-inactive.vjs-no-flex .vjs-progress-control .vjs-mouse-display {
display: none;
}
.vjs-mouse-display .vjs-time-tooltip,
.video-js .vjs-progress-control .vjs-mouse-display:after {
.vjs-mouse-display .vjs-time-tooltip {
color: #fff;
@include background-color-with-alpha(#000, 0.8);
}
+2 -1
Ver Arquivo
@@ -1,10 +1,11 @@
.video-js .vjs-slider {
outline: 0;
position: relative;
cursor: pointer;
padding: 0;
margin: 0 0.45em 0 0.45em;
@include user-select(none);
@include background-color-with-alpha($secondary-background-color, $secondary-background-transparency);
}
+25
Ver Arquivo
@@ -0,0 +1,25 @@
// North America uses 'CC' icon
.video-js:lang(en) .vjs-subs-caps-button .vjs-icon-placeholder,
.video-js:lang(fr-CA) .vjs-subs-caps-button .vjs-icon-placeholder {
@extend .vjs-icon-captions;
}
// ROW uses 'subtitles'
// Double selector because @extend puts these rules above the captions icon
.video-js .vjs-subs-caps-button .vjs-icon-placeholder,
.video-js.video-js:lang(en-GB) .vjs-subs-caps-button .vjs-icon-placeholder,
.video-js.video-js:lang(en-IE) .vjs-subs-caps-button .vjs-icon-placeholder,
.video-js.video-js:lang(en-AU) .vjs-subs-caps-button .vjs-icon-placeholder,
.video-js.video-js:lang(en-NZ) .vjs-subs-caps-button .vjs-icon-placeholder {
@extend .vjs-icon-subtitles;
}
.video-js .vjs-subs-caps-button + .vjs-menu .vjs-captions-menu-item .vjs-menu-item-text .vjs-icon-placeholder {
position: absolute;
}
.video-js .vjs-subs-caps-button + .vjs-menu .vjs-captions-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before {
font-family: VideoJS;
content: "\f10d";
font-size: 1.5em;
line-height: inherit;
}
+1 -1
Ver Arquivo
@@ -1,3 +1,3 @@
.video-js .vjs-subtitles-button {
.video-js .vjs-subtitles-button .vjs-icon-placeholder {
@extend .vjs-icon-subtitles;
}
+6
Ver Arquivo
@@ -18,6 +18,12 @@
display: none;
}
// IE 8 + IE 9 width: auto container fix
.vjs-no-flex .vjs-remaining-time.vjs-time-control.vjs-control {
width: 0px !important;
white-space: nowrap;
}
.video-js .vjs-duration,
.vjs-no-flex .vjs-duration {
display: none;
+126 -57
Ver Arquivo
@@ -1,27 +1,131 @@
.video-js .vjs-mute-control,
.video-js .vjs-volume-menu-button {
.video-js .vjs-mute-control {
cursor: pointer;
@include flex(none);
@extend .vjs-icon-volume-high;
// padding here is for IE < 9, it doesn't do width: auto from
// another style correctly
padding-left: 2em;
padding-right: 2em;
padding-bottom: 3em;
& .vjs-icon-placeholder {
@extend .vjs-icon-volume-high;
}
}
.video-js .vjs-mute-control.vjs-vol-0,
.video-js .vjs-volume-menu-button.vjs-vol-0 {
.video-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder {
@extend .vjs-icon-volume-mute;
}
.video-js .vjs-mute-control.vjs-vol-1,
.video-js .vjs-volume-menu-button.vjs-vol-1 {
.video-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder {
@extend .vjs-icon-volume-low;
}
.video-js .vjs-mute-control.vjs-vol-2,
.video-js .vjs-volume-menu-button.vjs-vol-2 {
.video-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder {
@extend .vjs-icon-volume-mid;
}
.video-js .vjs-volume-control {
cursor: pointer;
margin-right: 1em;
@include display-flex;
}
.video-js .vjs-volume-control.vjs-volume-horizontal {
width: 5em;
@include flex(none);
@include display-flex(center);
}
.video-js .vjs-volume-panel .vjs-volume-control {
visibility: visible;
opacity: 0;
width: 1px;
height: 1px;
margin-left: -1px;
}
.vjs-no-flex .vjs-volume-panel .vjs-volume-control.vjs-volume-vertical {
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
& .vjs-volume-bar,
& .vjs-volume-level {
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
}
}
.video-js .vjs-volume-panel {
&:hover .vjs-volume-control,
&:active .vjs-volume-control,
&:focus .vjs-volume-control,
& .vjs-volume-control:hover ,
& .vjs-volume-control:active ,
& .vjs-volume-control:focus ,
& .vjs-mute-control:hover ~ .vjs-volume-control,
& .vjs-mute-control:active ~ .vjs-volume-control,
& .vjs-mute-control:focus ~ .vjs-volume-control,
& .vjs-volume-control.vjs-slider-active {
&.vjs-volume-horizontal {
width: 5em;
height: 3em;
}
visibility: visible;
opacity: 1;
position: relative;
&.vjs-volume-vertical {
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
& .vjs-volume-bar,
& .vjs-volume-level {
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
}
}
$transition-property: visibility 0.1s, opacity 0.1s, height 0.1s, width 0.1s, left 0s, top 0s;
@include transition($transition-property);
}
&.vjs-volume-panel-horizontal {
&:hover,
&:focus,
&:active,
&.vjs-slider-active {
width: 9em;
@include transition(width 0.1s);
}
}
@include transition(width 1s);
}
.video-js .vjs-volume-panel .vjs-volume-control.vjs-volume-vertical {
height: 8em;
width: 3em;
left: -3.5em;
$transition-property: visibility 1s, opacity 1s, height 1s 1s, width 1s 1s, left 1s 1s, top 1s 1s;
@include transition($transition-property)
}
.video-js .vjs-volume-panel .vjs-volume-control.vjs-volume-horizontal {
$transition-property: visibility 1s, opacity 1s, height 1s 1s, width 1s, left 1s 1s, top 1s 1s;
@include transition($transition-property)
}
.video-js.vjs-no-flex .vjs-volume-panel .vjs-volume-control.vjs-volume-horizontal {
width: 5em;
height: 3em;
visibility: visible;
opacity: 1;
position: relative;
@include transition(none);
}
.video-js.vjs-no-flex .vjs-volume-control.vjs-volume-vertical,
.video-js.vjs-no-flex .vjs-volume-panel .vjs-volume-control.vjs-volume-vertical {
position: absolute;
bottom: 3em;
left: 0.5em;
}
.video-js .vjs-volume-panel {
@include display-flex;
}
.video-js .vjs-volume-bar {
@@ -74,6 +178,10 @@
}
}
.video-js .vjs-volume-panel.vjs-volume-panel-vertical {
width: 4em;
}
// Assumes volume starts at 1.0.
.vjs-volume-bar.vjs-slider-vertical .vjs-volume-level {
height: 100%;
@@ -83,53 +191,14 @@
width: 100%;
}
// The volume menu button is like menu buttons (captions/subtitles) but works
// a little differently. It needs to be possible to tab to the volume slider
// without hitting space bar on the menu button. To do this we're not using
// display:none to hide the slider menu by default, and instead setting the
// width and height to zero.
.vjs-menu-button-popup.vjs-volume-menu-button .vjs-menu {
display: block;
width: 0;
height: 0;
border-top-color: transparent;
.video-js .vjs-volume-vertical {
width: 3em;
height: 8em;
bottom: 8em;
@include background-color-with-alpha($primary-background-color, $primary-background-transparency);
}
.vjs-menu-button-popup.vjs-volume-menu-button-vertical .vjs-menu {
left: 0.5em;
height: 8em;
}
.vjs-menu-button-popup.vjs-volume-menu-button-horizontal .vjs-menu {
.video-js .vjs-volume-horizontal .vjs-menu {
left: -2em;
}
.vjs-menu-button-popup.vjs-volume-menu-button .vjs-menu-content {
height: 0;
width: 0;
// Avoids unnecessary scrollbars in the menu content. Primarily noticed in Chrome on Linux.
overflow-x: hidden;
overflow-y: hidden;
}
.vjs-volume-menu-button-vertical:hover .vjs-menu-content,
.vjs-volume-menu-button-vertical:focus .vjs-menu-content,
.vjs-volume-menu-button-vertical.vjs-slider-active .vjs-menu-content,
.vjs-volume-menu-button-vertical .vjs-lock-showing .vjs-menu-content {
height: 8em;
width: 2.9em;
}
.vjs-volume-menu-button-horizontal:hover .vjs-menu-content,
.vjs-volume-menu-button-horizontal:focus .vjs-menu-content,
.vjs-volume-menu-button-horizontal .vjs-slider-active .vjs-menu-content,
.vjs-volume-menu-button-horizontal .vjs-lock-showing .vjs-menu-content {
height: 2.9em;
width: 8em;
}
.vjs-volume-menu-button.vjs-menu-button-inline .vjs-menu-content {
// An inline volume should never have a menu background color.
// This protects it from external changes to background colors.
background-color: transparent !important;
}
-5
Ver Arquivo
@@ -18,11 +18,6 @@
// This width is currently specific to the inline volume bar.
width: 12em;
}
// Don't transition when tabbing in reverse to the volume menu
// because it looks weird
.video-js .vjs-menu-button-inline.vjs-slider-active {
@include transition(none);
}
.vjs-menu-button-inline .vjs-menu {
opacity: 0;
+12 -2
Ver Arquivo
@@ -16,8 +16,19 @@
display: block;
padding: 0;
margin: 0;
overflow: auto;
font-family: $text-font-family;
// This allows scrolling of content if need be.
overflow: auto;
// When combined with `overflow: auto;`, this fixes gaps left by
// scrollbars in older IE versions.
box-sizing: content-box;
}
// Reset box-sizing inside the menu.
.vjs-menu .vjs-menu-content > * {
box-sizing: border-box;
}
// prevent menus from opening while scrubbing (FF, IE)
@@ -37,7 +48,6 @@
.vjs-menu li.vjs-menu-item:focus,
.vjs-menu li.vjs-menu-item:hover {
outline: 0;
@include background-color-with-alpha($secondary-background-color, $secondary-background-transparency);
}
+2 -1
Ver Arquivo
@@ -8,6 +8,7 @@
@import "components/big-play";
@import "components/button";
@import "components/close-button";
@import "components/modal-dialog";
@import "components/menu/menu";
@import "components/menu/menu-popup";
@@ -35,9 +36,9 @@
@import "components/chapters";
@import "components/descriptions";
@import "components/subtitles";
@import "components/subs-caps";
@import "components/audio";
@import "components/adaptive";
@import "components/captions-settings";
@import "components/modal-dialog";
@import "print";
+41 -1
Ver Arquivo
@@ -11,6 +11,13 @@ import Component from './component.js';
* @extends Button
*/
class BigPlayButton extends Button {
constructor(player, options) {
super(player, options);
this.mouseused_ = false;
this.on('mousedown', this.handleMouseDown);
}
/**
* Builds the default DOM `className`.
@@ -34,7 +41,40 @@ class BigPlayButton extends Button {
* @listens click
*/
handleClick(event) {
this.player_.play();
const playPromise = this.player_.play();
// exit early if clicked via the mouse
if (this.mouseused_ && event.clientX && event.clientY) {
return;
}
const cb = this.player_.getChild('controlBar');
const playToggle = cb && cb.getChild('playToggle');
if (!playToggle) {
this.player_.focus();
return;
}
const playFocus = () => playToggle.focus();
if (playPromise && playPromise.then) {
const ignoreRejectedPlayPromise = () => {};
playPromise.then(playFocus, ignoreRejectedPlayPromise);
} else {
this.setTimeout(playFocus, 1);
}
}
handleKeyPress(event) {
this.mouseused_ = false;
super.handleKeyPress(event);
}
handleMouseDown(event) {
this.mouseused_ = true;
}
}
+7 -17
Ver Arquivo
@@ -16,8 +16,9 @@ class Button extends ClickableComponent {
/**
* Create the `Button`s DOM element.
*
* @param {string} [tag=button]
* Element's node type. e.g. 'button'
* @param {string} [tag="button"]
* The element's node type. This argument is IGNORED: no matter what
* is passed, it will always create a `button` element.
*
* @param {Object} [props={}]
* An object of properties that should be set on the element.
@@ -28,25 +29,14 @@ class Button extends ClickableComponent {
* @return {Element}
* The element that gets created.
*/
createEl(tag = 'button', props = {}, attributes = {}) {
createEl(tag, props = {}, attributes = {}) {
tag = 'button';
props = assign({
innerHTML: '<span aria-hidden="true" class="vjs-icon-placeholder"></span>',
className: this.buildCSSClass()
}, props);
if (tag !== 'button') {
log.warn(`Creating a Button with an HTML element of ${tag} is deprecated; use ClickableComponent instead.`);
// Add properties for clickable element which is not a native HTML button
props = assign({
tabIndex: 0
}, props);
// Add ARIA attributes for clickable element which is not a native HTML button
attributes = assign({
role: 'button'
}, attributes);
}
// Add attributes for button element
attributes = assign({
+20 -25
Ver Arquivo
@@ -51,6 +51,7 @@ class ClickableComponent extends Component {
*/
createEl(tag = 'div', props = {}, attributes = {}) {
props = assign({
innerHTML: '<span aria-hidden="true" class="vjs-icon-placeholder"></span>',
className: this.buildCSSClass(),
tabIndex: 0
}, props);
@@ -108,9 +109,8 @@ class ClickableComponent extends Component {
* @param {Element} [el=this.el()]
* Element to set the title on.
*
* @return {string|ClickableComponent}
* @return {string}
* - The control text when getting
* - Returns itself when setting; method can be chained.
*/
controlText(text, el = this.el()) {
if (!text) {
@@ -120,10 +120,11 @@ class ClickableComponent extends Component {
const localizedText = this.localize(text);
this.controlText_ = text;
this.controlTextEl_.innerHTML = localizedText;
el.setAttribute('title', localizedText);
return this;
Dom.textContent(this.controlTextEl_, localizedText);
if (!this.nonIconControl) {
// Set title attribute if only an icon is shown
el.setAttribute('title', localizedText);
}
}
/**
@@ -138,40 +139,34 @@ class ClickableComponent extends Component {
/**
* Enable this `Component`s element.
*
* @return {ClickableComponent}
* Returns itself; method can be chained.
*/
enable() {
this.removeClass('vjs-disabled');
this.el_.setAttribute('aria-disabled', 'false');
if (typeof this.tabIndex_ !== 'undefined') {
this.el_.setAttribute('tabIndex', this.tabIndex_);
if (!this.enabled_) {
this.enabled_ = true;
this.removeClass('vjs-disabled');
this.el_.setAttribute('aria-disabled', 'false');
if (typeof this.tabIndex_ !== 'undefined') {
this.el_.setAttribute('tabIndex', this.tabIndex_);
}
this.on(['tap', 'click'], this.handleClick);
this.on('focus', this.handleFocus);
this.on('blur', this.handleBlur);
}
this.on('tap', this.handleClick);
this.on('click', this.handleClick);
this.on('focus', this.handleFocus);
this.on('blur', this.handleBlur);
return this;
}
/**
* Disable this `Component`s element.
*
* @return {ClickableComponent}
* Returns itself; method can be chained.
*/
disable() {
this.enabled_ = false;
this.addClass('vjs-disabled');
this.el_.setAttribute('aria-disabled', 'true');
if (typeof this.tabIndex_ !== 'undefined') {
this.el_.removeAttribute('tabIndex');
}
this.off('tap', this.handleClick);
this.off('click', this.handleClick);
this.off(['tap', 'click'], this.handleClick);
this.off('focus', this.handleFocus);
this.off('blur', this.handleBlur);
return this;
}
/**
@@ -226,7 +221,7 @@ class ClickableComponent extends Component {
// Support Space (32) or Enter (13) key operation to fire a click event
if (event.which === 32 || event.which === 13) {
event.preventDefault();
this.handleClick(event);
this.trigger('click');
} else if (super.handleKeyPress) {
// Pass keypress handling up for unsupported keys
+224 -359
Ver Arquivo
@@ -4,10 +4,12 @@
* @file component.js
*/
import window from 'global/window';
import evented from './mixins/evented';
import stateful from './mixins/stateful';
import * as Dom from './utils/dom.js';
import * as DomData from './utils/dom-data';
import * as Fn from './utils/fn.js';
import * as Guid from './utils/guid.js';
import * as Events from './utils/events.js';
import log from './utils/log.js';
import toTitleCase from './utils/to-title-case.js';
import mergeOptions from './utils/merge-options.js';
@@ -38,7 +40,7 @@ class Component {
*
* @param {Object} [options]
* The key/value store of player options.
#
*
* @param {Object[]} [options.children]
* An array of children objects to intialize this component with. Children objects have
* a name property that will be used if more than one component of the same type needs to be
@@ -82,6 +84,10 @@ class Component {
this.el_ = this.createEl();
}
// Make this an evented object and use `el_`, if available, as its event bus
evented(this, {eventBusKey: this.el_ ? 'el_' : null});
stateful(this, this.constructor.defaultState);
this.children_ = [];
this.childIndex_ = {};
this.childNameIndex_ = {};
@@ -133,16 +139,15 @@ class Component {
this.childIndex_ = null;
this.childNameIndex_ = null;
// Remove all event listeners.
this.off();
if (this.el_) {
// Remove element from DOM
if (this.el_.parentNode) {
this.el_.parentNode.removeChild(this.el_);
}
// Remove element from DOM
if (this.el_.parentNode) {
this.el_.parentNode.removeChild(this.el_);
DomData.removeData(this.el_);
this.el_ = null;
}
Dom.removeElData(this.el_);
this.el_ = null;
}
/**
@@ -211,34 +216,70 @@ class Component {
/**
* Localize a string given the string in english.
*
* If tokens are provided, it'll try and run a simple token replacement on the provided string.
* The tokens it loooks for look like `{1}` with the index being 1-indexed into the tokens array.
*
* If a `defaultValue` is provided, it'll use that over `string`,
* if a value isn't found in provided language files.
* This is useful if you want to have a descriptive key for token replacement
* but have a succinct localized string and not require `en.json` to be included.
*
* Currently, it is used for the progress bar timing.
* ```js
* {
* "progress bar timing: currentTime={1} duration={2}": "{1} of {2}"
* }
* ```
* It is then used like so:
* ```js
* this.localize('progress bar timing: currentTime={1} duration{2}',
* [this.player_.currentTime(), this.player_.duration()],
* '{1} of {2}');
* ```
*
* Which outputs something like: `01:23 of 24:56`.
*
*
* @param {string} string
* The string to localize.
* The string to localize and the key to lookup in the language files.
* @param {string[]} [tokens]
* If the current item has token replacements, provide the tokens here.
* @param {string} [defaultValue]
* Defaults to `string`. Can be a default value to use for token replacement
* if the lookup key is needed to be separate.
*
* @return {string}
* The localized string or if no localization exists the english string.
*/
localize(string) {
localize(string, tokens, defaultValue = string) {
const code = this.player_.language && this.player_.language();
const languages = this.player_.languages && this.player_.languages();
const language = languages && languages[code];
const primaryCode = code && code.split('-')[0];
const primaryLang = languages && languages[primaryCode];
if (!code || !languages) {
return string;
}
const language = languages[code];
let localizedString = defaultValue;
if (language && language[string]) {
return language[string];
localizedString = language[string];
} else if (primaryLang && primaryLang[string]) {
localizedString = primaryLang[string];
}
const primaryCode = code.split('-')[0];
const primaryLang = languages[primaryCode];
if (tokens) {
localizedString = localizedString.replace(/\{(\d+)\}/g, function(match, index) {
const value = tokens[index - 1];
let ret = value;
if (primaryLang && primaryLang[string]) {
return primaryLang[string];
if (typeof value === 'undefined') {
ret = match;
}
return ret;
});
}
return string;
return localizedString;
}
/**
@@ -341,21 +382,6 @@ class Component {
if (typeof child === 'string') {
componentName = toTitleCase(child);
// Options can also be specified as a boolean,
// so convert to an empty object if false.
if (!options) {
options = {};
}
// Same as above, but true is deprecated so show a warning.
if (options === true) {
log.warn('Initializing a child component with `true` is deprecated.' +
'Children should be defined in an array when possible, ' +
'but if necessary use an object instead of `true`.'
);
options = {};
}
const componentClassName = options.componentClass || componentName;
// Set name through options
@@ -392,7 +418,7 @@ class Component {
// If a name wasn't used to create the component, check if we can use the
// name function of the component
componentName = componentName || (component.name && component.name());
componentName = componentName || (component.name && toTitleCase(component.name()));
if (componentName) {
this.childNameIndex_[componentName] = component;
@@ -564,188 +590,9 @@ class Component {
}
/**
* Add an `event listener` to this `Component`s element.
*
* The benefit of using this over the following:
* - `VjsEvents.on(otherElement, 'eventName', myFunc)`
* - `otherComponent.on('eventName', myFunc)`
*
* 1. Is that the listeners will get cleaned up when either component gets disposed.
* 1. It will also bind `myComponent` as the context of `myFunc`.
* > NOTE: If you remove the element from the DOM that has used `on` you need to
* clean up references using: `myComponent.trigger(el, 'dispose')`
* This will also allow the browser to garbage collect it. In special
* cases such as with `window` and `document`, which are both permanent,
* this is not necessary.
*
* @param {string|Component|string[]} [first]
* The event name, and array of event names, or another `Component`.
*
* @param {EventTarget~EventListener|string|string[]} [second]
* The listener function, an event name, or an Array of events names.
*
* @param {EventTarget~EventListener} [third]
* The event handler if `first` is a `Component` and `second` is an event name
* or an Array of event names.
*
* @return {Component}
* Returns itself; method can be chained.
*
* @listens Component#dispose
*/
on(first, second, third) {
if (typeof first === 'string' || Array.isArray(first)) {
Events.on(this.el_, first, Fn.bind(this, second));
// Targeting another component or element
} else {
const target = first;
const type = second;
const fn = Fn.bind(this, third);
// When this component is disposed, remove the listener from the other component
const removeOnDispose = () => this.off(target, type, fn);
// Use the same function ID so we can remove it later it using the ID
// of the original listener
removeOnDispose.guid = fn.guid;
this.on('dispose', removeOnDispose);
// If the other component is disposed first we need to clean the reference
// to the other component in this component's removeOnDispose listener
// Otherwise we create a memory leak.
const cleanRemover = () => this.off('dispose', removeOnDispose);
// Add the same function ID so we can easily remove it later
cleanRemover.guid = fn.guid;
// Check if this is a DOM node
if (first.nodeName) {
// Add the listener to the other element
Events.on(target, type, fn);
Events.on(target, 'dispose', cleanRemover);
// Should be a component
// Not using `instanceof Component` because it makes mock players difficult
} else if (typeof first.on === 'function') {
// Add the listener to the other component
target.on(type, fn);
target.on('dispose', cleanRemover);
}
}
return this;
}
/**
* Remove an event listener from this `Component`s element. If the second argument is
* exluded all listeners for the type passed in as the first argument will be removed.
*
* @param {string|Component|string[]} [first]
* The event name, and array of event names, or another `Component`.
*
* @param {EventTarget~EventListener|string|string[]} [second]
* The listener function, an event name, or an Array of events names.
*
* @param {EventTarget~EventListener} [third]
* The event handler if `first` is a `Component` and `second` is an event name
* or an Array of event names.
*
* @return {Component}
* Returns itself; method can be chained.
*/
off(first, second, third) {
if (!first || typeof first === 'string' || Array.isArray(first)) {
Events.off(this.el_, first, second);
} else {
const target = first;
const type = second;
// Ensure there's at least a guid, even if the function hasn't been used
const fn = Fn.bind(this, third);
// Remove the dispose listener on this component,
// which was given the same guid as the event listener
this.off('dispose', fn);
if (first.nodeName) {
// Remove the listener
Events.off(target, type, fn);
// Remove the listener for cleaning the dispose listener
Events.off(target, 'dispose', fn);
} else {
target.off(type, fn);
target.off('dispose', fn);
}
}
return this;
}
/**
* Add an event listener that gets triggered only once and then gets removed.
*
* @param {string|Component|string[]} [first]
* The event name, and array of event names, or another `Component`.
*
* @param {EventTarget~EventListener|string|string[]} [second]
* The listener function, an event name, or an Array of events names.
*
* @param {EventTarget~EventListener} [third]
* The event handler if `first` is a `Component` and `second` is an event name
* or an Array of event names.
*
* @return {Component}
* Returns itself; method can be chained.
*/
one(first, second, third) {
if (typeof first === 'string' || Array.isArray(first)) {
Events.one(this.el_, first, Fn.bind(this, second));
} else {
const target = first;
const type = second;
const fn = Fn.bind(this, third);
const newFunc = () => {
this.off(target, type, newFunc);
fn.apply(null, arguments);
};
// Keep the same function ID so we can remove it later
newFunc.guid = fn.guid;
this.on(target, type, newFunc);
}
return this;
}
/**
* Trigger an event on an element.
*
* @param {EventTarget~Event|Object|string} event
* The event name, and Event, or an event-like object with a type attribute
* set to the event name.
*
* @param {Object} [hash]
* Data hash to pass along with the event
*
* @return {Component}
* Returns itself; method can be chained.
*/
trigger(event, hash) {
Events.trigger(this.el_, event, hash);
return this;
}
/**
* Bind a listener to the component's ready state. If the ready event has already
* happened it will trigger the function immediately.
*
* @param {Component~ReadyCallback} fn
* A function to call when ready is triggered.
*
* @param {boolean} [sync=false]
* Execute the listener synchronously if `Component` is ready.
* Bind a listener to the component's ready state.
* Different from event listeners in that if the ready event has already happened
* it will trigger the function immediately.
*
* @return {Component}
* Returns itself; method can be chained.
@@ -764,7 +611,6 @@ class Component {
this.readyQueue_.push(fn);
}
}
return this;
}
/**
@@ -854,7 +700,7 @@ class Component {
* - False if the `Component` does not have the class`
*/
hasClass(classToCheck) {
return Dom.hasElClass(this.el_, classToCheck);
return Dom.hasClass(this.el_, classToCheck);
}
/**
@@ -862,13 +708,9 @@ class Component {
*
* @param {string} classToAdd
* CSS class name to add
*
* @return {Component}
* Returns itself; method can be chained.
*/
addClass(classToAdd) {
Dom.addElClass(this.el_, classToAdd);
return this;
Dom.addClass(this.el_, classToAdd);
}
/**
@@ -876,13 +718,9 @@ class Component {
*
* @param {string} classToRemove
* CSS class name to remove
*
* @return {Component}
* Returns itself; method can be chained.
*/
removeClass(classToRemove) {
Dom.removeElClass(this.el_, classToRemove);
return this;
Dom.removeClass(this.el_, classToRemove);
}
/**
@@ -895,65 +733,45 @@ class Component {
*
* @param {boolean|Dom~predicate} [predicate]
* An {@link Dom~predicate} function or a boolean
*
* @return {Component}
* Returns itself; method can be chained.
*/
toggleClass(classToToggle, predicate) {
Dom.toggleElClass(this.el_, classToToggle, predicate);
return this;
Dom.toggleClass(this.el_, classToToggle, predicate);
}
/**
* Show the `Component`s element if it is hidden by removing the
* 'vjs-hidden' class name from it.
*
* @return {Component}
* Returns itself; method can be chained.
*/
show() {
this.removeClass('vjs-hidden');
return this;
}
/**
* Hide the `Component`s element if it is currently showing by adding the
* 'vjs-hidden` class name to it.
*
* @return {Component}
* Returns itself; method can be chained.
*/
hide() {
this.addClass('vjs-hidden');
return this;
}
/**
* Lock a `Component`s element in its visible state by adding the 'vjs-lock-showing'
* class name to it. Used during fadeIn/fadeOut.
*
* @return {Component}
* Returns itself; method can be chained.
*
* @private
*/
lockShowing() {
this.addClass('vjs-lock-showing');
return this;
}
/**
* Unlock a `Component`s element from its visible state by removing the 'vjs-lock-showing'
* class name from it. Used during fadeIn/fadeOut.
*
* @return {Component}
* Returns itself; method can be chained.
*
* @private
*/
unlockShowing() {
this.removeClass('vjs-lock-showing');
return this;
}
/**
@@ -984,14 +802,10 @@ class Component {
* @param {string} value
* Value to set the attribute to.
*
* @return {Component}
* Returns itself; method can be chained.
*
* @see [DOM API]{@link https://developer.mozilla.org/en-US/docs/Web/API/Element/setAttribute}
*/
setAttribute(attribute, value) {
Dom.setAttribute(this.el_, attribute, value);
return this;
}
/**
@@ -1000,14 +814,10 @@ class Component {
* @param {string} attribute
* Name of the attribute to remove.
*
* @return {Component}
* Returns itself; method can be chained.
*
* @see [DOM API]{@link https://developer.mozilla.org/en-US/docs/Web/API/Element/removeAttribute}
*/
removeAttribute(attribute) {
Dom.removeAttribute(this.el_, attribute);
return this;
}
/**
@@ -1018,12 +828,11 @@ class Component {
* The width that you want to set postfixed with '%', 'px' or nothing.
*
* @param {boolean} [skipListeners]
* Skip the resize event trigger
* Skip the componentresize event trigger
*
* @return {Component|number|string}
* - The width when getting, zero if there is no width. Can be a string
* @return {number|string}
* The width when getting, zero if there is no width. Can be a string
* postpixed with '%' or 'px'.
* - Returns itself when setting; method can be chained.
*/
width(num, skipListeners) {
return this.dimension('width', num, skipListeners);
@@ -1037,12 +846,11 @@ class Component {
* The height that you want to set postfixed with '%', 'px' or nothing.
*
* @param {boolean} [skipListeners]
* Skip the resize event trigger
* Skip the componentresize event trigger
*
* @return {Component|number|string}
* - The width when getting, zero if there is no width. Can be a string
* postpixed with '%' or 'px'.
* - Returns itself when setting; method can be chained.
* @return {number|string}
* The width when getting, zero if there is no width. Can be a string
* postpixed with '%' or 'px'.
*/
height(num, skipListeners) {
return this.dimension('height', num, skipListeners);
@@ -1056,13 +864,11 @@ class Component {
*
* @param {number|string} height
* Height to set the `Component`s element to.
*
* @return {Component}
* Returns itself; method can be chained.
*/
dimensions(width, height) {
// Skip resize listeners on width for optimization
return this.width(width, true).height(height);
// Skip componentresize listeners on width for optimization
this.width(width, true);
this.height(height);
}
/**
@@ -1079,7 +885,7 @@ class Component {
* - If you want the computed style of the component, use {@link Component#currentWidth}
* and {@link {Component#currentHeight}
*
* @fires Component#resize
* @fires Component#componentresize
*
* @param {string} widthOrHeight
8 'width' or 'height'
@@ -1088,11 +894,10 @@ class Component {
8 New dimension
*
* @param {boolean} [skipListeners]
* Skip resize event trigger
* Skip componentresize event trigger
*
* @return {Component}
* - the dimension when getting or 0 if unset
* - Returns itself when setting; method can be chained.
* @return {number}
* The dimension when getting or 0 if unset
*/
dimension(widthOrHeight, num, skipListeners) {
if (num !== undefined) {
@@ -1115,14 +920,13 @@ class Component {
/**
* Triggered when a component is resized.
*
* @event Component#resize
* @event Component#componentresize
* @type {EventTarget~Event}
*/
this.trigger('resize');
this.trigger('componentresize');
}
// Return component
return this;
return;
}
// Not setting a value, so getting it
@@ -1232,6 +1036,20 @@ class Component {
return this.currentDimension('height');
}
/**
* Set the focus to this component
*/
focus() {
this.el_.focus();
}
/**
* Remove the focus from this component
*/
blur() {
this.el_.blur();
}
/**
* Emit a 'tap' events when touch event support gets detected. This gets used to
* support toggling the controls through a tap on the video. They get enabled
@@ -1522,6 +1340,81 @@ class Component {
return intervalId;
}
/**
* Queues up a callback to be passed to requestAnimationFrame (rAF), but
* with a few extra bonuses:
*
* - Supports browsers that do not support rAF by falling back to
* {@link Component#setTimeout}.
*
* - The callback is turned into a {@link Component~GenericCallback} (i.e.
* bound to the component).
*
* - Automatic cancellation of the rAF callback is handled if the component
* is disposed before it is called.
*
* @param {Component~GenericCallback} fn
* A function that will be bound to this component and executed just
* before the browser's next repaint.
*
* @return {number}
* Returns an rAF ID that gets used to identify the timeout. It can
* also be used in {@link Component#cancelAnimationFrame} to cancel
* the animation frame callback.
*
* @listens Component#dispose
* @see [Similar to]{@link https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame}
*/
requestAnimationFrame(fn) {
if (this.supportsRaf_) {
fn = Fn.bind(this, fn);
const id = window.requestAnimationFrame(fn);
const disposeFn = () => this.cancelAnimationFrame(id);
disposeFn.guid = `vjs-raf-${id}`;
this.on('dispose', disposeFn);
return id;
}
// Fall back to using a timer.
return this.setTimeout(fn, 1000 / 60);
}
/**
* Cancels a queued callback passed to {@link Component#requestAnimationFrame}
* (rAF).
*
* If you queue an rAF callback via {@link Component#requestAnimationFrame},
* use this function instead of `window.cancelAnimationFrame`. If you don't,
* your dispose listener will not get cleaned up until {@link Component#dispose}!
*
* @param {number} id
* The rAF ID to clear. The return value of {@link Component#requestAnimationFrame}.
*
* @return {number}
* Returns the rAF ID that was cleared.
*
* @see [Similar to]{@link https://developer.mozilla.org/en-US/docs/Web/API/window/cancelAnimationFrame}
*/
cancelAnimationFrame(id) {
if (this.supportsRaf_) {
window.cancelAnimationFrame(id);
const disposeFn = function() {};
disposeFn.guid = `vjs-raf-${id}`;
this.off('dispose', disposeFn);
return id;
}
// Fall back to using a timer.
return this.clearTimeout(id);
}
/**
* Register a `Component` with `videojs` given the name and the component.
*
@@ -1535,15 +1428,34 @@ class Component {
* @param {string} name
* The name of the `Component` to register.
*
* @param {Component} comp
* @param {Component} ComponentToRegister
* The `Component` class to register.
*
* @return {Component}
* The `Component` that was registered.
*/
static registerComponent(name, comp) {
if (!name) {
return;
static registerComponent(name, ComponentToRegister) {
if (typeof name !== 'string' || !name) {
throw new Error(`Illegal component name, "${name}"; must be a non-empty string.`);
}
const Tech = Component.getComponent('Tech');
// We need to make sure this check is only done if Tech has been registered.
const isTech = Tech && Tech.isTech(ComponentToRegister);
const isComp = Component === ComponentToRegister ||
Component.prototype.isPrototypeOf(ComponentToRegister.prototype);
if (isTech || !isComp) {
let reason;
if (isTech) {
reason = 'techs must be registered using Tech.registerTech()';
} else {
reason = 'must be a Component subclass';
}
throw new Error(`Illegal component, "${name}"; ${reason}.`);
}
name = toTitleCase(name);
@@ -1552,23 +1464,26 @@ class Component {
Component.components_ = {};
}
if (name === 'Player' && Component.components_[name]) {
const Player = Component.components_[name];
const Player = Component.getComponent('Player');
if (name === 'Player' && Player && Player.players) {
const players = Player.players;
const playerNames = Object.keys(players);
// If we have players that were disposed, then their name will still be
// in Players.players. So, we must loop through and verify that the value
// for each item is not null. This allows registration of the Player component
// after all players have been disposed or before any were created.
if (Player.players &&
Object.keys(Player.players).length > 0 &&
Object.keys(Player.players).map((playerName) => Player.players[playerName]).every(Boolean)) {
throw new Error('Can not register Player component after player has been created');
if (players &&
playerNames.length > 0 &&
playerNames.map((pname) => players[pname]).every(Boolean)) {
throw new Error('Can not register Player component after player has been created.');
}
}
Component.components_[name] = comp;
Component.components_[name] = ComponentToRegister;
return comp;
return ComponentToRegister;
}
/**
@@ -1595,70 +1510,20 @@ class Component {
if (Component.components_ && Component.components_[name]) {
return Component.components_[name];
}
if (window && window.videojs && window.videojs[name]) {
log.warn(`The ${name} component was added to the videojs object when it should be registered using videojs.registerComponent(name, component)`);
return window.videojs[name];
}
}
/**
* Sets up the constructor using the supplied init method or uses the init of the
* parent object.
*
* @param {Object} [props={}]
* An object of properties.
*
* @return {Object}
* the extended object.
*
* @deprecated since version 5
*/
static extend(props) {
props = props || {};
log.warn('Component.extend({}) has been deprecated, ' +
' use videojs.extend(Component, {}) instead'
);
// Set up the constructor using the supplied init method
// or using the init of the parent object
// Make sure to check the unobfuscated version for external libs
const init = props.init || props.init || this.prototype.init ||
this.prototype.init || function() {};
// In Resig's simple class inheritance (previously used) the constructor
// is a function that calls `this.init.apply(arguments)`
// However that would prevent us from using `ParentObject.call(this);`
// in a Child constructor because the `this` in `this.init`
// would still refer to the Child and cause an infinite loop.
// We would instead have to do
// `ParentObject.prototype.init.apply(this, arguments);`
// Bleh. We're not creating a _super() function, so it's good to keep
// the parent constructor reference simple.
const subObj = function() {
init.apply(this, arguments);
};
// Inherit from this object's prototype
subObj.prototype = Object.create(this.prototype);
// Reset the constructor property for subObj otherwise
// instances of subObj would have the constructor of the parent Object
subObj.prototype.constructor = subObj;
// Make the class extendable
subObj.extend = Component.extend;
// Extend subObj's prototype with functions and other properties from props
for (const name in props) {
if (props.hasOwnProperty(name)) {
subObj.prototype[name] = props[name];
}
}
return subObj;
}
}
/**
* Whether or not this component supports `requestAnimationFrame`.
*
* This is exposed primarily for testing purposes.
*
* @private
* @type {Boolean}
*/
Component.prototype.supportsRaf_ = typeof window.requestAnimationFrame === 'function' &&
typeof window.cancelAnimationFrame === 'function';
Component.registerComponent('Component', Component);
export default Component;
@@ -22,11 +22,9 @@ class AudioTrackButton extends TrackButton {
* The key/value store of player options.
*/
constructor(player, options = {}) {
options.tracks = player.audioTracks && player.audioTracks();
options.tracks = player.audioTracks();
super(player, options);
this.el_.setAttribute('aria-label', 'Audio Menu');
}
/**
@@ -39,6 +37,10 @@ class AudioTrackButton extends TrackButton {
return `vjs-audio-button ${super.buildCSSClass()}`;
}
buildWrapperCSSClass() {
return `vjs-audio-button ${super.buildWrapperCSSClass()}`;
}
/**
* Create a menu item for each audio track
*
@@ -49,11 +51,10 @@ class AudioTrackButton extends TrackButton {
* An array of menu items
*/
createItems(items = []) {
const tracks = this.player_.audioTracks && this.player_.audioTracks();
// if there's only one audio track, there no point in showing it
this.hideThreshold_ = 1;
if (!tracks) {
return items;
}
const tracks = this.player_.audioTracks();
for (let i = 0; i < tracks.length; i++) {
const track = tracks[i];
@@ -33,14 +33,12 @@ class AudioTrackMenuItem extends MenuItem {
this.track = track;
if (tracks) {
const changeHandler = Fn.bind(this, this.handleTracksChange);
const changeHandler = Fn.bind(this, this.handleTracksChange);
tracks.addEventListener('change', changeHandler);
this.on('dispose', () => {
tracks.removeEventListener('change', changeHandler);
});
}
tracks.addEventListener('change', changeHandler);
this.on('dispose', () => {
tracks.removeEventListener('change', changeHandler);
});
}
/**
@@ -59,10 +57,6 @@ class AudioTrackMenuItem extends MenuItem {
super.handleClick(event);
if (!tracks) {
return;
}
for (let i = 0; i < tracks.length; i++) {
const track = tracks[i];
+6 -7
Ver Arquivo
@@ -12,13 +12,12 @@ import './time-controls/remaining-time-display.js';
import './live-display.js';
import './progress-control/progress-control.js';
import './fullscreen-toggle.js';
import './volume-control/volume-control.js';
import './volume-menu-button.js';
import './mute-toggle.js';
import './volume-panel.js';
import './text-track-controls/chapters-button.js';
import './text-track-controls/descriptions-button.js';
import './text-track-controls/subtitles-button.js';
import './text-track-controls/captions-button.js';
import './text-track-controls/subs-caps-button.js';
import './audio-track-controls/audio-track-button.js';
import './playback-rate-menu/playback-rate-menu-button.js';
import './spacer-controls/custom-control-spacer.js';
@@ -41,7 +40,8 @@ class ControlBar extends Component {
className: 'vjs-control-bar',
dir: 'ltr'
}, {
// The control bar is a group, so it can contain menuitems
// The control bar is a group, but we don't aria-label it to avoid
// over-announcing by JAWS
role: 'group'
});
}
@@ -56,7 +56,7 @@ class ControlBar extends Component {
ControlBar.prototype.options_ = {
children: [
'playToggle',
'volumeMenuButton',
'volumePanel',
'currentTimeDisplay',
'timeDivider',
'durationDisplay',
@@ -67,8 +67,7 @@ ControlBar.prototype.options_ = {
'playbackRateMenuButton',
'chaptersButton',
'descriptionsButton',
'subtitlesButton',
'captionsButton',
'subsCapsButton',
'audioTrackButton',
'fullscreenToggle'
]

Alguns arquivos não foram exibidos porque demasiados arquivos foram alterados neste diff Mostrar Mais