Comparar commits

..

135 Commits

Autor SHA1 Mensagem Data
Gary Katsevman 9289d47860 v5.13.2 dist 2016-11-14 16:13:48 -05:00
Gary Katsevman 406c203f17 v5.13.2 2016-11-14 16:13:07 -05:00
Gary Katsevman eb5e78bb88 revert: perf: Cache currentTime and buffered from Flash (#3705) (#3778)
This reverts commit 45ffa810fb.
2016-11-14 16:09:54 -05:00
ldayananda 430be94e7f fix(HtmlTrackElementList): allow to reference by index via bracket notation (#3776)
Previously, HtmlTrackElementList did not actually let you access HtmlTrackElements via bracket notation (`list[0]`) unlike TextTrackList. This adds that feature.
2016-11-14 15:32:30 -05:00
Brandon Casey 72fcb6c659 chore(pr_template): add checkbox to verify changes in a browser (#3775) 2016-11-14 15:28:01 -05:00
Gary Katsevman 252bcee959 fix(html5): exit early on emulated tracks in html5 (#3772)
addRemoteTextTrack and removeRemoteTextTrack in Html5 tech assumed that
they are always called for native text tracks. However, Html5 tech can
have emulated text tracks. For those, we just exit early after the super
methods are called.
2016-11-11 14:35:04 -05:00
Greenkeeper 6b477bb737 chore(package): update karma-detect-browsers to version 2.2.3 (#3770)
https://greenkeeper.io/
2016-11-10 11:52:11 -05:00
Gary Katsevman 23f0fa05cb chore: fix CHANGELOG 5.13.1 header 2016-11-09 16:44:54 -05:00
Gary Katsevman 2a05633159 chore: fixup CHANGELOG for 5.13.1 release 2016-11-09 16:43:02 -05:00
Gary Katsevman 3fc9b83958 v5.13.1 2016-11-09 16:33:43 -05:00
Gary Katsevman 50f8ad214c 5.13.0 dummy commit 2016-11-09 16:32:57 -05:00
Jon-Carlos Rivera f05a9271b8 feat: option to have remoteTextTracks automatically 'garbage-collected' when sources change (#3736)
Tech#addRemoteTextTrack now accepts a second parameter - a boolean named manualCleanup which defaults to true preserving backwards compatibility. When that value is set to false the text track will be removed from the video element whenever a source change occurs.
2016-11-09 16:07:59 -05:00
Gary Katsevman 996507744f test(dom): fix removeElClass test in Safari 10. (#3768)
Safari 10 automatically dedupes duplicate class names in an element. So,
our test was failing because we had an extra "foo" in the check. This is
an unlikely scenario that has browser variations, so, better to just
remove it.
2016-11-09 16:06:38 -05:00
Greenkeeper b6d521f472 chore(package): update grunt-accessibility to version 5.0.0 (#3747)
https://greenkeeper.io/
2016-11-09 11:42:42 -05:00
Gary Katsevman 4859bb9e3d chore: pin karma-detect-browsers to 2.1.0 (#3764)
See https://github.com/litixsoft/karma-detect-browsers/issues/17
2016-11-09 11:40:21 -05:00
David LaPalomento 45ffa810fb perf: Cache currentTime and buffered from Flash (#3705)
Calling into the SWF too often is expensive. Current time and buffered don't actually change that often but it's very common to call them a couple times in the handling of a single event. Cache their return values for 100ms so the performance penalty of going through ExternalInterface is limited.
2016-11-04 18:03:44 -04:00
Brandon Casey e9e5b5f782 test(hooks): fix hooks unit test in ie8 (#3745) 2016-11-04 16:43:27 -04:00
Gary Katsevman 8d51235b30 docs(collaborator_guide): add collaborator guide (#3724)
This adds a collaborator guide that describes how to reply to issues and PRs and how to accept changes to the project.
2016-11-04 14:27:27 -04:00
Brandon Casey 77357b1cd2 feat: implement player lifecycle hooks and trigger beforesetup/setup hooks (#3639)
Allows you to hook into `beforesetup` and `setup` hooks for all players that are created by videojs.
2016-11-04 14:25:32 -04:00
Gary Katsevman 11a096d60f docs(contributing.md): update CONTRIBUTING.md with latest info (#3722)
Update CONTRIBUTING.md with inspiration and dev certificate of origin from node's CONTRIBUTING.md.
Add grunt and doctoc npm scripts.
2016-11-04 14:21:05 -04:00
Pat O'Neill 5f42130b82 perf: Use ES6 rest operator and allow V8 to optimize mergeOptions (#3743)
The current implementation causes the `mergeOptions` function to be
de-optimized. This change improves readability by switching to ES6
syntax AND it results in a roughly 75% improvement in the performance
of this function by transpiling to a `for` loop instead of
`slice.call`.
2016-11-04 14:19:50 -04:00
Brandon Casey 6889e925b4 refactor: remove un-needed contructor and function overrides (#3721) 2016-11-04 14:18:30 -04:00
Garrett b2c5b2a412 docs: Change registerSourceHandler param doc from first to index (#3737) 2016-11-04 14:18:10 -04:00
Pat O'Neill fb74c71ba6 refactor(texttracksettings): DRYer code and remove massive HTML blob (#3679)
* DRYer code while keeping tests passing
* Replace massive HTML blob with DOM methods
* Create obj util and implement it
2016-11-04 13:45:51 -04:00
Gary Katsevman 74cddcad73 fix: currentDimension can return 0 for fluid player on IE (#3738)
This is because IE returns 0 for both getComputedStyle and currentStyle.
However, offsetHeight and offsetWidth do contain the correct values we
want. So, if before returning in currentDimension the return value is
still zero, check the offset values.
2016-11-03 18:41:27 -04:00
mister-ben 2e720afb65 fix: allow rounded value for fluid player ratio test (#3739) 2016-11-03 18:40:14 -04:00
Gary Katsevman 8f7eb121bb feat(lang): update uk.json (#3675) 2016-11-03 16:07:49 -04:00
Gary Katsevman d11fd50a63 feat(lang): update ru.json (#3654) 2016-11-03 16:05:33 -04:00
doraeric 726367abc5 feat(lang): Complete work translated into traditional Chinese (#3718) 2016-11-03 16:00:29 -04:00
Gary Katsevman 9702618c02 feat: add a safe computedStyle to videojs. (#3664)
This is used internally in the seek bar and mouse time display.
In firefox, in an iframe that is hidden with "display: none",
getComputedStyle() returns "null" which can break things.
See https://bugzilla.mozilla.org/show_bug.cgi?id=548397 for more
details.
2016-11-03 15:59:34 -04:00
Owen Edwards 685404d018 fix: aria-live="assertive" only for descriptions
This changes aria-live on the text track display so it's off unless a
descriptions track is enabled.

Fixes #3554
2016-11-03 15:56:03 -04:00
Owen Edwards 202da2d468 feat(component): attribute get/set/remove methods
This adds getter and setter and remover methods for attributes on
components.
2016-11-03 15:54:53 -04:00
Carey Hinoki 028559ccb0 feat: add ability to get current source object and all source objects (#2678)
Adds `currentSource` and `currentSources` methods to the player that return the current source object, containing `currentSrc()` and `currentType()`, and all source objects that were given to the player.

Fixes #2443
2016-11-03 15:50:55 -04:00
mister-ben de1b363470 feat(clickable-component): Disable interaction with disabled clickable components (#3525)
enable() and disable() on clickable components is only cosmetic. "Disabled" implies the control should not be functional.

* Remove event listeners on disable() and add back on enable().
* Move adding listeners from constructor to enable
* Remove tabindex from disabled components and add disabled attribute to disabled buttons to prevent keyboard access.
2016-11-03 15:43:15 -04:00
Carey Hinoki 9d77268f76 feat: Components are now accessible via camelCase and UpperCamelCase (#3439)
This means that you can `getChild` and `addChild` with both `myComponent` and `MyComponent`.

Fixes #3436.
2016-11-03 15:40:35 -04:00
mister-ben ed59531f78 fix: Suppress Infinity duration on Android Chrome before playback (#3476)
HTML5 tech will return NaN instead of Infinity if playback has not started. Fires a durationupdate event once the reported duration can be believed if the duration is still Infinity, so controls can update.

Fixes #3079.
2016-11-03 15:39:09 -04:00
mister-ben 2988f6ae53 feat(fluid): use default aspect ratio for fluid players if width unknown (#3614)
If a player is fluid and does not have a width set, and preload is set to none, the height of the player is zero. This includes where preload is forced to none by mobile Chrome as in #3606.

* If the player has the .vjs-fluid class when initialised, fluid is set to true, so adding the class behaves the same as {fluid: true} in the setup options.
* The fluid(bool) setter calls player.updateStyleEl_(). Otherwise it won't be triggered in createEl() if an aspect ratio is not also set.
* Corrects the test for a set videoWidth() in updateStyleEl_() - videoWidth() returns 0 if the width is unknown. This allows the default 16:9 to kick in rather than using 0:0.
2016-11-03 15:37:30 -04:00
David LaPalomento f599ef4c51 Dispatch Flash events asynchronously (#3700)
Flash blocks until the javascript side of ExternalInterface callbacks complete and swallows any exceptions generated during that process. To avoid performance issues and missed exceptions, trigger events from Flash asynchronously.
2016-10-25 22:37:58 -04:00
Gary Katsevman 254683b5cd chore(changelog.md): update 5.12.6 and 5.12.3 (#3715)
5.12.6's changelog accidentally included all the 5.12.x changes and the
link to the comparison was from 5.10.7 to 5.12.6.

The comparison link in 5.12.3 was also updated to properly refer to
5.12.2 as the previous change.
2016-10-25 14:57:18 -04:00
Gary Katsevman 9e20386a94 v5.12.6 2016-10-25 14:49:25 -04:00
Gary Katsevman fe760a44d7 fix: remove unnecessary comments from video.min.js (#3709)
This involves updating to latest version of uglify and setting
"screwIE8" to false since that is a default in 2.7. However, this makes
"preserveComments" "some" work as it is supposed to work.

Fixes #3707. This also comes from the stable branch after the 5.11.9
release.
2016-10-25 14:31:05 -04:00
Gary Katsevman 49e29bac85 fix: make sure that document.createElement exists before using (#3706)
If you try and require videojs in an environment that doesn't implement `document.createElement` properly -- like in Node.js -- you could potentially get an error. This checks that `window.document && window.document.createElement` is available before calling `createElement`.
We specifically check `window.document` so that `global` module won't cause issues with it's shimming of `document.createElement` in `global/document.

Fixes #3665
2016-10-25 14:20:49 -04:00
Gary Katsevman ac0329f875 v5.12.5 2016-10-19 18:28:16 -04:00
Matthew Neil 7b9574bb19 fix: move html5 source handler incantation to bottom (#3695)
`Tech.withSourceHandlers(Html5);` expects the prototype getter/setters to exist. Moving these functions after the getters/setters allows them to function properly.
2016-10-19 18:20:30 -04:00
Gary Katsevman c51f22680f v5.12.4 2016-10-18 16:32:28 -04:00
Hein Haraldson Berg 66922a818e docs(tech.md): Add a note on Flash permissions in sandboxed environments (#3684) 2016-10-18 14:45:15 -04:00
Curtis Gibby 16c855931b docs(options.md): Remove Bad Apostrophe (#3677)
A possessive belonging to an "it" doesn't need an apostrophe. Don't believe me? Ask [the Oatmeal](http://theoatmeal.com/comics/apostrophe) (look for the velociraptor)!
2016-10-18 14:43:25 -04:00
Pat O'Neill 8845bd36c1 chore(grunt): fix getting changelog by switching to npm-run (#3687)
shelljs-nodecli is having trouble getting the conventional-changelog package because the package name and binary name are different.

Fixes #3683
2016-10-18 14:42:10 -04:00
Pat O'Neill e932061024 fix: logging failing on browsers that don't always have console (#3686)
In browsers like IE9, `console` isn't always available. This, we need to apply `console` to our console functions but bail out early if `window.console` isn't defined.
2016-10-18 12:02:28 -04:00
Gary Katsevman 44ec0e4e75 fix: Restore timeupdate/loadedmetadata listeners for duration display (#3682)
There was a potential breakage that was caused by #3349. This restores the timeupdate and loadedmetadata listeners in the duration display that were removed. As part of 6.0, they could be removed as durationchange should be the correct and only listener we need.
2016-10-18 11:51:31 -04:00
Gary Katsevman d6e49a4095 v5.12.3 2016-10-06 14:19:26 -04:00
Gary Katsevman d4e89d2adc chore: update CHANGELOG automation to use conventional-changelog (#3669)
This updates our changelog automation to use conventinoal changelog. Ultimately, it will make it easier to merge PRs because it won't require the use of the contrib tool.
It uses https://github.com/videojs/conventional-changelog-videojs/blob/master/convention.md
2016-10-06 14:09:48 -04:00
floorish 920c54a65c fix(html5): disable manual timeupdate events on html5 tech (#3656) 2016-09-30 16:57:16 -04:00
Owen Edwards 7d85f27a8e test(a11y): add basic accessibility testing using grunt-accessibility 2016-09-30 15:18:57 -04:00
Brandon Casey ae3e27788d chore: refactor redundant or verbose code in player.js (#3597)
* removing duplicate constructor docs
fixing doc block (should not have ended in ?)

* adding back event doc comments
2016-09-29 18:05:46 -04:00
Gary Katsevman e479f8c34c fix: proxy ios webkit events into fullscreenchange (#3644)
iOS still doesn't have native fullscreen API access. The video element uses the old webkit fullscreen events `webkitbeginfullscreen` and `webkitendfullscreen`. This makes it so both of those trigger `fullscreenchange` on the player always as opposed to only when `requestFullscreen` was called on the player.
2016-09-29 14:35:31 -04:00
Brandon Casey 6878c21c68 chore: refactor redundant code in html5 tech (#3593)
Some of the code in the html5 tech is a bit redundant and can be written another way to reduce the file size. Also, we made sure that all functions can still be documented properly.
2016-09-29 14:26:37 -04:00
Marco dd2aff00a8 fix: disable HLS hack on Firefox for Android (#3586)
* Disable HLS hack on Firefox for Android

* Fix canPlayType patching tests

* Add test to ensure that canPlayType is not patched in Firefox for Android

* Fix assertion message in Firefox for Android test
2016-09-29 14:14:42 -04:00
Gary Katsevman c545acdaea chore(package): remove es2015-loose since it's an option for es2015 (#3629)
babel-preset-es2015-loose is deprecated as it's now available as an option to the es2015 preset.
2016-09-29 13:44:55 -04:00
Greenkeeper 54e3db5d34 chore(package): update grunt-contrib-cssmin to version 1.0.2 (#3595)
https://greenkeeper.io/
2016-09-29 12:22:21 -04:00
Greenkeeper 2032b17943 chore(package): update grunt-shell to version 2.0.0 (#3642)
https://greenkeeper.io/
2016-09-29 12:03:27 -04:00
Mattias Buelens ca022981e0 fix(controls): fix load progress bar never highlighting first buffered time range
The control text element was being counted as the first buffered region but it didn't have the correct styling to be shown.
Instead, we keep the buffered region elements in a separate element rather than relying on el.children to be correct.
2016-09-29 12:00:43 -04:00
Brandon Casey 816291e7b5 chore(deps): add the bundle-collapser browserify plugin
This plugin makes browserify output numbers instead of the bundle paths to save some bytes in the output.
2016-09-29 11:58:37 -04:00
almcd 4063f96bb5 docs: fix broken links in docs index.md 2016-09-28 18:25:33 -04:00
Lionel 280ecd49d7 feat(lang): add missing translations in fr.json 2016-09-28 18:21:15 -04:00
Aris eb0efd499c feat(lang): add missing translations to el.json 2016-09-28 18:20:40 -04:00
Jordan Harband 08c7f4e1d4 chore: update object.assign to ^4.0.4
Updates `object.assign` to the latest, and uses a semver range so that consumers can `npm dedupe`.
2016-09-28 18:18:39 -04:00
Piotr 86f0830502 chore: move metadata to hidden folder and update references
ISSUE_TEMPLATE and PULL_REQUEST_TEMPLATE were both moved to a .github/ folder to clean up the root of the project a bit. CONTRIBUTING.md was kept at the top level because it is generic enough and contains useful information.
2016-09-28 18:17:18 -04:00
Gary Katsevman 5fdcd4602b fix(css): remove commented out css
Fixes #3587. Some commented out css was removed as it is no longer necessary and potentially causes issues.
2016-09-28 18:15:50 -04:00
Gary Katsevman 5f95e413e3 v5.12.2 2016-09-28 17:47:55 -04:00
Gary Katsevman 057588f6c7 Update CHANGELOG.md 2016-09-28 17:45:48 -04:00
Gary Katsevman 7cf2de30ac Merge branch 'stable' 2016-09-28 16:28:21 -04:00
Gary d520d29fd6 v5.11.7 2016-09-28 18:40:33 +00:00
Gary Katsevman 3a927523c3 @gkatsev set playerId on new el created for movingMediaElementInDOM. Fixes #3283. closes #3648 2016-09-28 13:59:21 -04:00
Pat O'Neill ecc95331a7 @misteroneill pinned grunt-contrib-uglify to ~0.11 to pin uglify to ~2.6. closes #3634 2016-09-28 13:54:41 -04:00
Gary Katsevman 282bda7e34 @gkatsev checked throwIfWhitespace first in hasElClass. closes #3640 2016-09-28 13:18:02 -04:00
Gary Katsevman 3a859f97d0 v5.12.1 2016-08-25 19:47:31 -04:00
Gary Katsevman 0d0ff90ca1 5.12.0 2016-08-25 19:47:02 -04:00
Gary Katsevman b4265a8468 v5.13.0 2016-08-25 19:34:46 -04:00
Gary Katsevman fac52046f3 Merge branch 'stable' 2016-08-25 19:34:07 -04:00
Jon-Carlos a17de688f3 v5.11.6 2016-08-25 23:17:28 +00:00
Jon-Carlos Rivera fdd8550307 @imbcmdth Added exception handling to event dispatcher. closes #3580
* Guard against exceptions in an event handler to stop them from breaking further processing of event handlers

* Added a test for try/catch behavior for exceptions originating in event handlers
2016-08-25 19:08:56 -04:00
Gary Katsevman 83b372c0d4 v5.12.0 2016-08-25 16:44:58 -04:00
Gary Katsevman daab267736 @gkatsev added webpack to test build. closes #3579 2016-08-25 16:24:31 -04:00
Gary Katsevman 8beab2791a @gkatsev updated the translation-needed doc. closes #3578 2016-08-25 16:01:10 -04:00
Lionel 2d9d6b9e46 @lionel-m updated french translations. closes #3576 2016-08-25 15:51:54 -04:00
mister-ben 94f22bb995 @mister-ben added task to maintain translations. closes #3572 2016-08-25 15:49:40 -04:00
Gary Katsevman 0b10b69775 @gkatsev added es2015 babel preset as a dependency. closes #3577 2016-08-25 14:46:38 -04:00
Gary Katsevman f37383784d Merge branch 'stable' 2016-08-25 12:19:03 -04:00
Justin eff1cf34db v5.11.5 2016-08-25 15:49:03 +00:00
Justin Barabander a2167a6b95 @jbarabander updated Audio to Audio Track and added to en.json. closes #3574 2016-08-25 11:01:13 -04:00
Richard L. Chung af6beb21c3 @rlchung fixed tests that weren't disposing players when they finished. closes 3524 2016-08-25 10:58:42 -04:00
brandonocasey ebf7718f1b @BrandonOCasey linted the sass files. closes #3559 2016-08-24 16:46:27 -04:00
Pat O'Neill 80851ea7ca @misteroneill added npm scripts for standard actions to match plugin generator. closes #3563 2016-08-24 16:44:58 -04:00
Gary Katsevman c154518df4 @gkatsev added tests for webpack and browserify bundling and node.js requiring. closes #3558 2016-08-24 16:32:05 -04:00
Pat O'Neill 1d2d08584e @misteroneill fixed IE8 media error test failure. closes #3568 2016-08-24 13:48:39 -04:00
Justin Barabander 46d713589b @jbarabander added title attribute to audio button. Fixes #3528. closes #3565 2016-08-24 11:30:37 -04:00
David Snyder 23d1fcd882 @snyderizer fixed switching between audio tracks. Fixes #3510. closes #3538 2016-08-24 11:24:55 -04:00
Pat O'Neill b56ed61523 @misteroneill fixed wrapping native and emulated MediaErrors. closes #3562 2016-08-24 11:00:21 -04:00
Greenkeeper b90f04fc3b Update karma-chrome-launcher to version 2.0.0 🚀 (#3553)
* chore(package): update karma-chrome-launcher to version 2.0.0

https://greenkeeper.io/

* update CHANGELOG
2016-08-22 17:56:10 -04:00
Gary Katsevman 141ecf221b @gkatsev made videojs requirable in node. closes #3540 2016-08-22 14:20:23 -04:00
Yanglin Zhao c859d8e104 @yanglinz enabled local coverage reporting with 'npm test --coverage'. closes #3539 2016-08-17 18:32:48 -04:00
Greenkeeper f787cbad18 Update grunt-concurrent to version 2.3.1 🚀 (#3532)
* chore(package): update grunt-concurrent to version 2.3.1

https://greenkeeper.io/

* update CHANGELOG
2016-08-17 18:08:24 -04:00
Greenkeeper 46058ddb0f Update uglify-js to version 2.7.3 🚀 (#3547)
* chore(package): update uglify-js to version 2.7.3

https://greenkeeper.io/

* update CHANGELOG
2016-08-17 17:53:46 -04:00
Gary Katsevman 955185379f @gkatsev updated build system to open es5 folder for bundles and dist folder other users. closes #3445 2016-08-17 17:16:41 -04:00
Gary Katsevman d58be409a6 Merge branch 'stable' 2016-08-16 14:28:25 -04:00
Gary Katsevman 13d16c1d76 v5.11.4 2016-08-16 14:27:22 -04:00
Gary Katsevman 773b5ab1c1 Merge branch 'stable' 2016-08-15 18:20:47 -04:00
Gary Katsevman 5178c122a5 v5.11.3 2016-08-15 18:11:54 -04:00
Gary Katsevman db0e821f38 Add DOMException to jshint to appease it 2016-08-15 18:02:41 -04:00
mister-ben fa1c6430f4 @mister-ben silenced chrome's play() request was interrupted by pause() error. closes #3518 2016-08-15 17:49:52 -04:00
Matthew Boles bf2eabf82d @mboles updated duration() method documentation. closes #3515 2016-08-15 17:46:59 -04:00
mister-ben 2f5a0ca48b @mister-ben fixed android treating swipe as a tap. closes #3514 2016-08-15 17:45:38 -04:00
Vineet 2c84f45ff3 @vdeshpande fixed control text for fullscreen button. closes #3485 2016-08-15 17:44:01 -04:00
Gary Katsevman 6385d1d429 @gkatsev reverted back to qunitjs 1.x to unbreak IE8. Added es5-shim to tests. closes #3533 2016-08-12 23:53:08 -04:00
Gary Katsevman 4ae370c1a2 @gkatsev added slack badge to README. closes #3527 2016-08-12 23:39:18 -04:00
Pat O'Neill 72c44daaf3 @misteroneill updated tests to qunit 2.0. closes #3509 2016-08-12 13:51:31 -04:00
Pat O'Neill b3e4e95f9c @misteroneill enabled and updated videojs-standard and fixed an issue with linting. closes #3508 2016-08-11 18:33:34 -04:00
Gary Katsevman ab82bf0008 @gkatsev removed unused dependencies. closes #3516 2016-08-11 18:13:37 -04:00
brandonocasey 1bb40b8d14 @BrandonOCasey updated language docs to link to IANA language registry. closes #3493 2016-08-11 18:09:48 -04:00
Greenkeeper f2a21d4aa2 Update karma to version 1.2.0 🚀 (#3523) - update karma plugins
* chore(package): update karma to version 1.2.0

https://greenkeeper.io/

* update all karma packages

* update CHANGELOG
2016-08-11 18:03:19 -04:00
Gary Katsevman c15d64adf5 Merge branch 'stable' 2016-08-09 11:24:23 -04:00
Gary Katsevman a0e9318862 Merge branch 'stable' 2016-08-08 18:23:27 -04:00
Gary Katsevman 56fc3356dc Merge branch 'stable' 2016-08-08 15:29:30 -04:00
Gary Katsevman f947ed7791 @gkatsev added null checks around navigator.userAgent. closes #3502 2016-08-05 14:38:42 -04:00
Gary Katsevman 1ff9f381a2 @gkatsev modified ie8.css build process 2016-08-05 14:23:15 -04:00
Erik Yuzwa d86d4b2222 @erikyuzwa reworked build to separate out IE8-specific CSS 2016-08-05 14:17:51 -04:00
brandonocasey 052c2ce1a9 @BrandonOCasey removed unused base-styles.js file. closes #3486 2016-08-05 11:52:10 -04:00
Gary Katsevman 4f6cb03add Update CHANGELOG for linter changes. Closes #3459 2016-08-05 11:41:53 -04:00
Pat O'Neill 485524882e @misteroneill added ghooks to run linter on git push 2016-08-05 11:39:21 -04:00
Priti Agarwal 945711855a @pagarwal123 updated some test code to pass linter 2016-08-05 11:38:08 -04:00
Pat O'Neill 272d5eed83 @misteroneill updated source code for linter v5 2016-08-05 11:37:22 -04:00
Brandon Casey 86068a5b45 @BrandonOCasey updates tests to pass linter 2016-08-05 11:37:12 -04:00
Pat O'Neill e85c1c0391 @misteroneill updated source code to pass linter 2016-08-05 11:35:54 -04:00
Brandon Casey c89b75699e first half of the test/unit/tracks directory (#3483) 2016-08-03 15:27:47 -04:00
205 arquivos alterados com 51536 adições e 46865 exclusões
+4
Ver Arquivo
@@ -0,0 +1,4 @@
{
"presets": [ ["es2015", {"loose": true}] ],
"plugins": ["transform-es3-property-literals", "transform-es3-member-expression-literals", "inline-json"]
}
@@ -10,6 +10,7 @@ Please list the specific changes involved in this pull request.
## Requirements Checklist
- [ ] Feature implemented / Bug fixed
- [ ] If necessary, more likely in a feature request than a bug fix
- [ ] Change has been verified in an actual browser (Chome, Firefox, IE)
- [ ] Unit Tests updated or fixed
- [ ] Docs/guides updated
- [ ] Example created ([starter template on JSBin](http://jsbin.com/axedog/edit?html,output))
+1
Ver Arquivo
@@ -28,5 +28,6 @@ test/coverage/*
.sass-cache
dist/*
es5/*
.idea/
-47
Ver Arquivo
@@ -1,47 +0,0 @@
{
"evil" : true,
"validthis": true,
"node" : true,
"debug" : true,
"boss" : true,
"expr" : true,
"eqnull" : true,
"quotmark" : "single",
"sub" : true,
"trailing" : true,
"undef" : true,
"laxbreak" : true,
"esnext" : true,
"eqeqeq" : true,
"predef" : [
"_V_",
"goog",
"console",
"require",
"define",
"module",
"exports",
"process",
"q",
"asyncTest",
"deepEqual",
"equal",
"expect",
"module",
"notDeepEqual",
"notEqual",
"notStrictEqual",
"ok",
"throws",
"QUnit",
"raises",
"start",
"stop",
"strictEqual",
"test",
"throws",
"sinon"
]
}
+1
Ver Arquivo
@@ -1,4 +1,5 @@
# Exclude everything but the contents of the dist directory.
**/*
!dist/**
!es5/**
!src/css/**
+1 -1
Ver Arquivo
@@ -1,6 +1,6 @@
language: node_js
node_js:
- 0.12
- 4.4
before_install:
- export CHROME_BIN=chromium-browser
- export DISPLAY=:99.0
+190 -4
Ver Arquivo
@@ -1,10 +1,196 @@
CHANGELOG
=========
<a name="5.13.2"></a>
## [5.13.2](https://github.com/videojs/video.js/compare/v5.13.1...v5.13.2) (2016-11-14)
## HEAD (Unreleased)
### Bug Fixes
* **html5:** exit early on emulated tracks in html5 ([#3772](https://github.com/videojs/video.js/issues/3772)) ([252bcee](https://github.com/videojs/video.js/commit/252bcee))
* **HtmlTrackElementList:** allow to reference by index via bracket notation ([#3776](https://github.com/videojs/video.js/issues/3776)) ([430be94](https://github.com/videojs/video.js/commit/430be94))
### Chores
* fix CHANGELOG 5.13.1 header ([23f0fa0](https://github.com/videojs/video.js/commit/23f0fa0))
* fixup CHANGELOG for 5.13.1 release ([2a05633](https://github.com/videojs/video.js/commit/2a05633))
* **package:** update karma-detect-browsers to version 2.2.3 ([#3770](https://github.com/videojs/video.js/issues/3770)) ([6b477bb](https://github.com/videojs/video.js/commit/6b477bb))
* **pr_template:** add checkbox to verify changes in a browser ([#3775](https://github.com/videojs/video.js/issues/3775)) ([72fcb6c](https://github.com/videojs/video.js/commit/72fcb6c))
<a name="5.13.1"></a>
# [5.13.1](https://github.com/videojs/video.js/compare/v5.12.6...v5.13.1) (2016-11-09)
### Features
* **clickable-component:** Disable interaction with disabled clickable components ([#3525](https://github.com/videojs/video.js/issues/3525)) ([de1b363](https://github.com/videojs/video.js/commit/de1b363))
* **component:** attribute get/set/remove methods ([202da2d](https://github.com/videojs/video.js/commit/202da2d))
* **fluid:** use default aspect ratio for fluid players if width unknown ([#3614](https://github.com/videojs/video.js/issues/3614)) ([2988f6a](https://github.com/videojs/video.js/commit/2988f6a))
* add a safe computedStyle to videojs. ([#3664](https://github.com/videojs/video.js/issues/3664)) ([9702618](https://github.com/videojs/video.js/commit/9702618))
* add ability to get current source object and all source objects ([#2678](https://github.com/videojs/video.js/issues/2678)) ([028559c](https://github.com/videojs/video.js/commit/028559c)), closes [#2443](https://github.com/videojs/video.js/issues/2443)
* Components are now accessible via `camelCase` and `UpperCamelCase` ([#3439](https://github.com/videojs/video.js/issues/3439)) ([9d77268](https://github.com/videojs/video.js/commit/9d77268)), closes [#3436](https://github.com/videojs/video.js/issues/3436)
* **lang:** update ru.json ([#3654](https://github.com/videojs/video.js/issues/3654)) ([d11fd50](https://github.com/videojs/video.js/commit/d11fd50))
* **lang:** update uk.json ([#3675](https://github.com/videojs/video.js/issues/3675)) ([8f7eb12](https://github.com/videojs/video.js/commit/8f7eb12))
* implement player lifecycle hooks and trigger beforesetup/setup hooks ([#3639](https://github.com/videojs/video.js/issues/3639)) ([77357b1](https://github.com/videojs/video.js/commit/77357b1))
* option to have remoteTextTracks automatically 'garbage-collected' when sources change ([#3736](https://github.com/videojs/video.js/issues/3736)) ([f05a927](https://github.com/videojs/video.js/commit/f05a927))
### Bug Fixes
* allow rounded value for fluid player ratio test ([#3739](https://github.com/videojs/video.js/issues/3739)) ([2e720af](https://github.com/videojs/video.js/commit/2e720af))
* aria-live="assertive" only for descriptions ([685404d](https://github.com/videojs/video.js/commit/685404d)), closes [#3554](https://github.com/videojs/video.js/issues/3554)
* currentDimension can return 0 for fluid player on IE ([#3738](https://github.com/videojs/video.js/issues/3738)) ([74cddca](https://github.com/videojs/video.js/commit/74cddca))
* Suppress Infinity duration on Android Chrome before playback ([#3476](https://github.com/videojs/video.js/issues/3476)) ([ed59531](https://github.com/videojs/video.js/commit/ed59531)), closes [#3079](https://github.com/videojs/video.js/issues/3079)
### Chores
* **changelog.md:** update 5.12.6 and 5.12.3 ([#3715](https://github.com/videojs/video.js/issues/3715)) ([254683b](https://github.com/videojs/video.js/commit/254683b))
* pin karma-detect-browsers to 2.1.0 ([#3764](https://github.com/videojs/video.js/issues/3764)) ([4859bb9](https://github.com/videojs/video.js/commit/4859bb9))
* **package:** update grunt-accessibility to version 5.0.0 ([#3747](https://github.com/videojs/video.js/issues/3747)) ([b6d521f](https://github.com/videojs/video.js/commit/b6d521f))
### Code Refactoring
* **texttracksettings:** DRYer code and remove massive HTML blob ([#3679](https://github.com/videojs/video.js/issues/3679)) ([fb74c71](https://github.com/videojs/video.js/commit/fb74c71))
* remove un-needed contructor and function overrides ([#3721](https://github.com/videojs/video.js/issues/3721)) ([6889e92](https://github.com/videojs/video.js/commit/6889e92))
### Documentation
* Change registerSourceHandler param doc from first to index ([#3737](https://github.com/videojs/video.js/issues/3737)) ([b2c5b2a](https://github.com/videojs/video.js/commit/b2c5b2a))
* **collaborator_guide:** add collaborator guide ([#3724](https://github.com/videojs/video.js/issues/3724)) ([8d51235](https://github.com/videojs/video.js/commit/8d51235))
* **contributing.md:** update CONTRIBUTING.md with latest info ([#3722](https://github.com/videojs/video.js/issues/3722)) ([11a096d](https://github.com/videojs/video.js/commit/11a096d))
### Performance Improvements
* Dispatch Flash events asynchronously ([#3700](https://github.com/videojs/video.js/pull/3700))
* Cache currentTime and buffered from Flash ([#3705](https://github.com/videojs/video.js/issues/3705)) ([45ffa81](https://github.com/videojs/video.js/commit/45ffa81))
* Use ES6 rest operator and allow V8 to optimize mergeOptions ([#3743](https://github.com/videojs/video.js/issues/3743)) ([5f42130](https://github.com/videojs/video.js/commit/5f42130))
### Tests
* **dom:** fix removeElClass test in Safari 10. ([#3768](https://github.com/videojs/video.js/issues/3768)) ([9965077](https://github.com/videojs/video.js/commit/9965077))
* **hooks:** fix hooks unit test in ie8 ([#3745](https://github.com/videojs/video.js/issues/3745)) ([e9e5b5f](https://github.com/videojs/video.js/commit/e9e5b5f))
<a name="5.12.6"></a>
## [5.12.6](https://github.com/videojs/video.js/compare/v5.12.5...v5.12.6) (2016-10-25)
### Bug Fixes
* make sure that document.createElement exists before using ([#3706](https://github.com/videojs/video.js/issues/3706)) ([49e29ba](https://github.com/videojs/video.js/commit/49e29ba)), closes [#3665](https://github.com/videojs/video.js/issues/3665)
* remove unnecessary comments from video.min.js ([#3709](https://github.com/videojs/video.js/issues/3709)) ([fe760a4](https://github.com/videojs/video.js/commit/fe760a4)), closes [#3707](https://github.com/videojs/video.js/issues/3707)
<a name="5.12.5"></a>
## [5.12.5](https://github.com/videojs/video.js/compare/v5.12.4...v5.12.5) (2016-10-19)
### Bug Fixes
* move html5 source handler incantation to bottom ([#3695](https://github.com/videojs/video.js/issues/3695)) ([7b9574b](https://github.com/videojs/video.js/commit/7b9574b))
<a name="5.12.4"></a>
## [5.12.4](https://github.com/videojs/video.js/compare/v5.12.3...v5.12.4) (2016-10-18)
### Bug Fixes
* logging failing on browsers that don't always have console ([#3686](https://github.com/videojs/video.js/issues/3686)) ([e932061](https://github.com/videojs/video.js/commit/e932061))
* Restore timeupdate/loadedmetadata listeners for duration display ([#3682](https://github.com/videojs/video.js/issues/3682)) ([44ec0e4](https://github.com/videojs/video.js/commit/44ec0e4))
### Chores
* **grunt:** fix getting changelog by switching to npm-run ([#3687](https://github.com/videojs/video.js/issues/3687)) ([8845bd3](https://github.com/videojs/video.js/commit/8845bd3)), closes [#3683](https://github.com/videojs/video.js/issues/3683)
### Documentation
* **options.md:** Remove Bad Apostrophe ([#3677](https://github.com/videojs/video.js/issues/3677)) ([16c8559](https://github.com/videojs/video.js/commit/16c8559))
* **tech.md:** Add a note on Flash permissions in sandboxed environments ([#3684](https://github.com/videojs/video.js/issues/3684)) ([66922a8](https://github.com/videojs/video.js/commit/66922a8))
<a name="5.12.3"></a>
## [5.12.3](https://github.com/videojs/video.js/compare/v5.12.2...v5.12.3) (2016-10-06)
### Features
* **lang:** add missing translations in fr.json ([280ecd4](https://github.com/videojs/video.js/commit/280ecd4))
* **lang:** add missing translations to el.json ([eb0efd4](https://github.com/videojs/video.js/commit/eb0efd4))
### Bug Fixes
* **controls:** fix load progress bar never highlighting first buffered time range ([ca02298](https://github.com/videojs/video.js/commit/ca02298))
* **css:** remove commented out css ([5fdcd46](https://github.com/videojs/video.js/commit/5fdcd46)), closes [#3587](https://github.com/videojs/video.js/issues/3587)
* disable HLS hack on Firefox for Android ([#3586](https://github.com/videojs/video.js/issues/3586)) ([dd2aff0](https://github.com/videojs/video.js/commit/dd2aff0))
* proxy ios webkit events into fullscreenchange ([#3644](https://github.com/videojs/video.js/issues/3644)) ([e479f8c](https://github.com/videojs/video.js/commit/e479f8c))
* **html5:** disable manual timeupdate events on html5 tech ([#3656](https://github.com/videojs/video.js/issues/3656)) ([920c54a](https://github.com/videojs/video.js/commit/920c54a))
### Chores
* move metadata to hidden folder and update references ([86f0830](https://github.com/videojs/video.js/commit/86f0830))
* **deps:** add the bundle-collapser browserify plugin ([816291e](https://github.com/videojs/video.js/commit/816291e))
* **package:** remove es2015-loose since it's an option for es2015 ([#3629](https://github.com/videojs/video.js/issues/3629)) ([c545acd](https://github.com/videojs/video.js/commit/c545acd))
* **package:** update grunt-contrib-cssmin to version 1.0.2 ([#3595](https://github.com/videojs/video.js/issues/3595)) ([54e3db5](https://github.com/videojs/video.js/commit/54e3db5))
* **package:** update grunt-shell to version 2.0.0 ([#3642](https://github.com/videojs/video.js/issues/3642)) ([2032b17](https://github.com/videojs/video.js/commit/2032b17))
* refactor redundant code in html5 tech ([#3593](https://github.com/videojs/video.js/issues/3593)) ([6878c21](https://github.com/videojs/video.js/commit/6878c21))
* refactor redundant or verbose code in player.js ([#3597](https://github.com/videojs/video.js/issues/3597)) ([ae3e277](https://github.com/videojs/video.js/commit/ae3e277))
* update CHANGELOG automation to use conventional-changelog ([#3669](https://github.com/videojs/video.js/issues/3669)) ([d4e89d2](https://github.com/videojs/video.js/commit/d4e89d2))
* update object.assign to ^4.0.4 ([08c7f4e](https://github.com/videojs/video.js/commit/08c7f4e))
### Documentation
* fix broken links in docs index.md ([4063f96](https://github.com/videojs/video.js/commit/4063f96))
### Tests
* **a11y:** add basic accessibility testing using grunt-accessibility ([7d85f27](https://github.com/videojs/video.js/commit/7d85f27))
## 5.12.2 (2016-09-28)
* Changes from 5.11.7 on the 5.12 branch
## 5.12.1 (2016-08-25)
* Changes from 5.11.6 on the 5.12 branch
## 5.13.0 (2016-08-25)
* Ignored release
## 5.12.0 (2016-08-25)
* @misteroneill, @BrandonOCasey, and @pagarwal123 updates all the code to pass the linter ([view](https://github.com/videojs/video.js/pull/3459))
* @misteroneill added ghooks to run linter on git push ([view](https://github.com/videojs/video.js/pull/3459))
* @BrandonOCasey removed unused base-styles.js file ([view](https://github.com/videojs/video.js/pull/3486))
* @erikyuzwa, @gkatsev updated CSS build to inlcude the IE8-specific CSS from a separate file instead of it being inside of sass ([view](https://github.com/videojs/video.js/pull/3380)) ([view2](https://github.com/erikyuzwa/video.js/pull/1))
* @gkatsev added null checks around navigator.userAgent ([view](https://github.com/videojs/video.js/pull/3502))
* greenkeeper updated karma dependencies ([view](https://github.com/videojs/video.js/pull/3523))
* @BrandonOCasey updated language docs to link to IANA language registry ([view](https://github.com/videojs/video.js/pull/3493))
* @gkatsev removed unused dependencies ([view](https://github.com/videojs/video.js/pull/3516))
* @misteroneill enabled and updated videojs-standard and fixed an issue with linting ([view](https://github.com/videojs/video.js/pull/3508))
* @misteroneill updated tests to qunit 2.0 ([view](https://github.com/videojs/video.js/pull/3509))
* @gkatsev added slack badge to README ([view](https://github.com/videojs/video.js/pull/3527))
* @gkatsev reverted back to qunitjs 1.x to unbreak IE8. Added es5-shim to tests ([view](https://github.com/videojs/video.js/pull/3533))
* @gkatsev updated build system to open es5 folder for bundles and dist folder other users ([view](https://github.com/videojs/video.js/pull/3445))
* greenkeeper updated uglify ([view](https://github.com/videojs/video.js/pull/3547))
* greenkeeper updated grunt-concurrent ([view](https://github.com/videojs/video.js/pull/3532))
* greenkeeper updated karma-chrome-launcher ([view](https://github.com/videojs/video.js/pull/3553))
* @gkatsev added tests for webpack and browserify bundling and node.js requiring ([view](https://github.com/videojs/video.js/pull/3558))
* @rlchung fixed tests that weren't disposing players when they finished ([view](https://github.com/videojs/video.js/pull/3524))
## 5.11.9 (2016-10-25)
* greenkeeper updated karma dependencies ([view](https://github.com/videojs/video.js/pull/3523))
* update to latest uglify to fix preserve comments issue. Disable screw ie8 option. ([view](https://github.com/videojs/video.js/pull/3709))
* remove sourcemap generation ([view](https://github.com/videojs/video.js/pull/3710))
## 5.11.8 (2016-10-17)
* @misteroneill restore timeupdate/loadedmetadata listeners for duration display ([view](https://github.com/videojs/video.js/pull/3682))
## 5.11.7 (2016-09-28)
* @gkatsev checked throwIfWhitespace first in hasElClass ([view](https://github.com/videojs/video.js/pull/3640))
* @misteroneill pinned grunt-contrib-uglify to ~0.11 to pin uglify to ~2.6 ([view](https://github.com/videojs/video.js/pull/3634))
* @gkatsev set playerId on new el created for movingMediaElementInDOM. Fixes #3283 ([view](https://github.com/videojs/video.js/pull/3648))
## 5.11.6 (2016-08-25)
* @imbcmdth Added exception handling to event dispatcher ([view](https://github.com/videojs/video.js/pull/3580))
## 5.11.5 (2016-08-25)
* @misteroneill fixed wrapping native and emulated MediaErrors ([view](https://github.com/videojs/video.js/pull/3562))
* @snyderizer fixed switching between audio tracks. Fixes #3510 ([view](https://github.com/videojs/video.js/pull/3538))
* @jbarabander added title attribute to audio button. Fixes #3528 ([view](https://github.com/videojs/video.js/pull/3565))
* @misteroneill fixed IE8 media error test failure ([view](https://github.com/videojs/video.js/pull/3568))
## 5.11.4 (2016-08-16)
_(none)_
--------------------
## 5.11.3 (2016-08-15)
* @vdeshpande fixed control text for fullscreen button ([view](https://github.com/videojs/video.js/pull/3485))
* @mister-ben fixed android treating swipe as a tap ([view](https://github.com/videojs/video.js/pull/3514))
* @mboles updated duration() method documentation ([view](https://github.com/videojs/video.js/pull/3515))
* @mister-ben silenced chrome's play() request was interrupted by pause() error ([view](https://github.com/videojs/video.js/pull/3518))
## 5.11.2 (2016-08-09)
_(none)_
+318
Ver Arquivo
@@ -0,0 +1,318 @@
# Collaborator Guide
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
**Table of Contents**
- [Issues and Pull Requests](#issues-and-pull-requests)
- [Accepting changes](#accepting-changes)
- [Involving the TSC](#involving-the-tsc)
- [Landing a PR](#landing-a-pr)
- [Landing a PR manually](#landing-a-pr-manually)
- [Landing a PR manually with several changes](#landing-a-pr-manually-with-several-changes)
- [I just made a mistake](#i-just-made-a-mistake)
- [I accidentally pushed a broken commit or incorrect commit to master](#i-accidentally-pushed-a-broken-commit-or-incorrect-commit-to-master)
- [I lost changes](#i-lost-changes)
- [I accidentally committed a broken change to master](#i-accidentally-committed-a-broken-change-to-master)
- [video.js releases](#videojs-releases)
- [Getting dependencies](#getting-dependencies)
- [Install contrib](#install-contrib)
- [npm access](#npm-access)
- [GitHub personal access token](#github-personal-access-token)
- [Doing a release](#doing-a-release)
- [Doc credit](#doc-credit)
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
## Issues and Pull Requests
Full courtesey should always be shown in video.js projects.
Collaborators may manage issues they feel qualified to handle, being mindful of our guidelines.
Any issue and PR can be closed if they are not relevant, when in doubt leave it open for more discussion. Issues can always be re-opened if new information is made available.
If issues or PRs are very short and don't contain much information, ask for more by linking to the [issue][issue template] or [PR][pr template] template. There is also a [response guide](https://github.com/videojs/video.js/wiki/New-Issue-Response-Guide) if you're unsure.
## Accepting changes
Any code change in video.js should be happening through Pull Requests on GitHub. This includes core committers.
Before a PR is merged, it must be reviewed by at least two core committers, at least one if it comes from a core committer.
Feel free to @-mention a particular core committer if you know they are experts in the area that is being changed.
If you are unsure about the modification and cannot take responsibility for it, defer to another core committer.
Before merging the change, it should be left open for other core committers to comment on. At least 24 hours during a weekday, and the 48 hours on a weekend. Trivial changes or bug fixes that have been reviewed by multiple committers may be merged without delay.
For non-breaking changes, if there is no disagreeming between the collaborators, the PR may be landed assuming it was reviewed. If there is still disagreement, it may need to be [escalated to the TSC](#involving-the-tsc).
Bug fixes require a test case that fails beforehand and succeeds after. All code changes should contain tests and pass on the CI.
### Involving the TSC
A change or issue can be elevated to the TSC by assing the `tsc-agent` label. This should be done in the following scenarios:
* There will be a major impact on the codebase or project
* The change is inherently controversial
* No agreement was reached between collaborators participating in the discussion
The TSC will be the final arbiter when required.
## Landing a PR
Landing a PR is fairly easy given that we can use the GitHub UI for it.
When using the big green button on GitHub, make sure the "squash and merge" is selected -- it should be the only allowed option. If a PR has two features in it and should be merged as two separate commits, either ask the contributor to break it up into two, or follow the [manual steps](#landing-a-pr-manually).
The commit message should follow our [conventional changelog conventions][conventions]. They are based on the angularjs changelog conventions. The changelog is then generated from these commit messages on release.
The first line of the commit message -- the header and first text box on GitHub -- should be prefixed with a type and optional scope followed by a short description of the commit.
The type is required. Two common ones are `fix` and `feat` for bug fixes and new features. Scope is optional and can be anything.
The body should contain extra information, potentially copied from the original comment of the PR.
The footer should contain things like whether this is a breaking change or what issues were fixed by this PR.
Here's an example:
```
fix(html5): a regression with html5 tech
This is where you'd explain what the regression is.
Fixes #123
```
### Landing a PR manually
_Optional:_ ensure you're not in a weird rebase or merge state:
```sh
$ git am --abort
$ git rebase --abort
```
Checkout and update the master branch:
```sh
$ git checkout master
$ git remote update
$ git rebase upstream/master
```
Check out the PR:
```sh
$ git fetch upstream pull/{{PR Number}}/head:{{name of branch}}
$ git checkout -t {{name of branch}}
```
> For example:
> ```sh
> $ git fetch upstream pull/123/head:gkatsev-html5-fix
> $ git checkout -t gkatsev-html5-fix
> ```
_Optional:_ If necessary, rebase against master. If you have multiple features in the PR, [landing a PR manually with several changes](#landing-a-pr-manually-with-several-changes)
```sh
$ git rebase master
```
Fix up any issues that arise from the rebase, change back to the master branch and squash merge:
```sh
$ git checkout master
$ git merge --squash --no-commit gkatsev-html5-fix
```
The `--no-commit` tells git not to make a commit on your behalf. It does stage everything for you, so, you can instead it:
```sh
$ git diff --cached
```
Now get the author from the original commit:
```sh
$ git log -n 1 --pretty=short gkatsev-html5-fix
```
Which shows:
```
commit 433c58224f5be34480c8e067ca6c5406ba1c1e9c
Author: Gary Katsevman <git@gkatsev.com>
Update TOC
```
Now you can commit the change the change with the author, following our commit guidelines
```sh
$ git commit --author "Gary Katsevman <git@gkatsev.com>"
```
Now that it's committed, push to master
```sh
$ git push upstream master
```
Congratulate yourself for a job well done and the contributor for having his change landed in master.
#### Landing a PR manually with several changes
Follow the same steps as before but when you rebase against master, you want to do an interactive rebase and then squash the changes into just a few commits.
```sh
$ git rebase -i master
```
This will give you an output like the following:
```
pick b4dc15d Update CONTRIBUTING.md with latest info
pick 8592149 Add Dev certificate of origin
pick 259dee6 Add grunt and doctoc npm scripts
pick f12af12 Add conventional-changelog-videojs link
pick ae4613a Update node's CONTRIBUTING.md url
pick 433c582 Update TOC
# Rebase f599ef4..433c582 onto f599ef4 (6 command(s))
#
# Commands:
# p, pick = use commit
# r, reword = use commit, but edit the commit message
# e, edit = use commit, but stop for amending
# s, squash = use commit, but meld into previous commit
# f, fixup = like "squash", but discard this commit's log message
# x, exec = run command (the rest of the line) using shell
# d, drop = remove commit
#
# These lines can be re-ordered; they are executed from top to bottom.
#
# If you remove a line here THAT COMMIT WILL BE LOST.
#
# However, if you remove everything, the rebase will be aborted.
#
# Note that empty commits are commented out
```
Replace `pick` to `fixup` or `edit` depending on how you want the output to look. You can also re-order the commits, if necessary.
> `fixup` will squash the commit it's infront of up into the commit above it
> `edit` will allow you to edit the commit message before continuing
```
edit b4dc15d Update CONTRIBUTING.md with latest info
fixup 8592149 Add Dev certificate of origin
fixup f12af12 Add conventional-changelog-videojs link
fixup ae4613a Update node's CONTRIBUTING.md url
fixup 433c582 Update TOC
edit 259dee6 Add grunt and doctoc npm scripts
```
When you get to the edit commits, git will give more information, but you'd want to run ammend the current commit while following our commit guidelines
```sh
$ git commit --amend
```
After going through and making the commits you want, you want to change back to master and then rebase the branch onto master so we get a clean history
```sh
$ git rebase gkatsev-html5-fix
```
This will put our two commits into master:
```
b4dc15d chore(contributing.md): Update CONTRIBUTING.md with latest info <Gary Katsevman>
259dee6 chore(package.json): Add grunt and doctoc npm scripts <Gary Katsevman>
9e20386 v5.12.6 <Gary Katsevman>
```
Now you're ready to push to master as in the normal instructions.
#### I just made a mistake
While `git` allows you to update the remote branch with a force push (`git push -f`). This is generally frowned upon since you're rewriting public history. However, if you just pushed the change and it's been less than 10 minutes since you've done with, you may force push to update the commit, assuming no one else has already pushed after you.
##### I accidentally pushed a broken commit or incorrect commit to master
Assuming no more than 10 minutes have passed, you may force-push to update or remove the commit. If someone else has already pushed to master or 10 minutes have passed, you should instead use the revert command (`git revert`) to revert the commit and then commit the proper change, or just fix it forward with a followup commit that fixes things.
##### I lost changes
Assuming that the changes were committed, even if you lost the commit in your current history does not mean that it is lost. In a lot of cases you can still recover it from the PR branch or if all else fails look at [git's reflog](https://git-scm.com/docs/git-reflog).
##### I accidentally committed a broken change to master
This is a great time to discover that something is broken. Because it hasn't been pushed to GitHub yet, it's very easy to reset the change as if nothing has happened and try again.
To do so, just reset the branch against master.
```sh
$ 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.
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.
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:
```sh
npm owner ls video.js
```
If you are a core committer, you can request access to npm from one of the current owners.
#### GitHub personal access token
This is used to make a GitHub release on videojs. You can get a token from the [personal access tokens](https://github.com/settings/tokens) page.
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.
### Doing a release
To do a release, check out the master branch
```sh
$ git checkout 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.
```sh
VJS_GITHUB_USER=gkatsev VJS_GITHUB_TOKEN=my-personal-access-token contrib release next patch
```
This makes a patch release, you can also do a `minor` and a `major` release.
After it's done, verify that the GitHub release has the correct changelog output.
## Doc credit
This collaborator guide was heavily inspired by [node.js's guide](https://github.com/nodejs/node/blob/master/COLLABORATOR_GUIDE.md)
[issue template]: /.github/ISSUE_TEMPLATE.md
[pr template]: /.github/PULL_REQUEST_TEMPLATE.md
[conventions]: https://github.com/videojs/conventional-changelog-videojs/blob/master/convention.md
+211 -159
Ver Arquivo
@@ -1,121 +1,125 @@
CONTRIBUTING
============
# CONTRIBUTING
So you want to help out? Great! There's a number of ways you can get involved.
* [File and discuss issues](#filing-issues)
* [Contribute code](#contributing-code)
* [Build and share plugins](docs/guides/plugins.md)
* [Answer questions on Stack Overflow](http://stackoverflow.com/questions/tagged/video.js)
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
**Table of Contents**
- [Other repositories where issues could be filed](#other-repositories-where-issues-could-be-filed)
- [Filing issues](#filing-issues)
- [Reporting a Bug](#reporting-a-bug)
- [Requesting a Feature](#requesting-a-feature)
- [Contributing code](#contributing-code)
- [Building video.js locally](#building-videojs-locally)
- [Forking and cloning the repository](#forking-and-cloning-the-repository)
- [Installing local dependencies](#installing-local-dependencies)
- [Running tests](#running-tests)
- [Building videojs](#building-videojs)
- [Testing Locally](#testing-locally)
- [Sandbox test directory](#sandbox-test-directory)
- [Running a local web server](#running-a-local-web-server)
- [Watching source and test changes](#watching-source-and-test-changes)
- [Making Changes](#making-changes)
- [Step 1: Verify](#step-1-verify)
- [Step 2: Update remote](#step-2-update-remote)
- [Step 3: Branch](#step-3-branch)
- [Step 4: Commit](#step-4-commit)
- [Step 5: Test](#step-5-test)
- [Step 6: Push](#step-6-push)
- [Code Style Guide](#code-style-guide)
- [Developer's Certificate of Origin 1.1](#developers-certificate-of-origin-11)
- [Doc Credit](#doc-credit)
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
## Other repositories where issues could be filed
There's also other Video.js projects where you can help. (check the [video.js org](https://github.com/videojs) for an up-to-date list of projects)
* [Videojs.com](https://github.com/videojs/videojs.com)
* [Video.js flash player](https://github.com/videojs/video-js-swf)
* [Player skin designer](https://github.com/videojs/designer)
* [Contribflow](https://github.com/zencoder/contribflow)
* [Video.js flash player](https://github.com/videojs/videojs-flash)
* [HLS](https://github.com/videojs/videojs-contrib-hls)
* [DASH](https://github.com/videojs/videojs-contrib-dash)
* [Youtube Tech](https://github.com/videojs/videojs-youtube)
* [Vimeo Tech](https://github.com/videojs/videojs-vimeo)
* [Ads](https://github.com/videojs/videojs-contrib-ads)
* [Plugin generator](https://github.com/videojs/generator-videojs-plugin)
* [Linter][linter]
## Filing issues
Filing issues
-------------
[GitHub Issues](https://github.com/videojs/video.js/issues) are used for all discussions around the codebase, including **bugs**, **features**, and other **enhancements**.
When filling out an issue, make sure to fill out the questions in the
### Reporting a Bug
**A bug is a demonstrable problem** that is caused by the code in the repository. Good bug reports are extremely helpful. Thank You!
Guidelines for bug reports:
1. If your issue is with a particular video.js plugin or subproject, please open an issue against that project. See [list of some potential other projects above](#other-repositories-where-issues-could-be-filed)
1. Use the [GitHub issue search](https://github.com/videojs/video.js/issues) &mdash; check if the issue has already been reported.
2. Check if the issue has already been fixed &mdash; try to reproduce it using the latest `master` branch in the repository.
1. Check if the issue has already been fixed &mdash; try to reproduce it using the latest `master` branch in the repository.
1. Isolate the problem &mdash; **create a [reduced test case](https://css-tricks.com/reduced-test-cases/)** with a live example. You can possibly use [this JSBin example](http://jsbin.com/axedog/edit) as a starting point -- don't forget to update it to the videojs version you use.
1. Answer all questions in the [issue template][]. The questions in the issue template are designed to try and provide the maintainers with as much information possible to minimize back-and-forth to get the issue resolved.
3. Isolate the problem &mdash; **create a [reduced test case](https://css-tricks.com/reduced-test-cases/)** with a live example. You can possibly use [this JSBin example](http://jsbin.com/axedog/7/edit) as a starting point.
A good bug report should be as detailed as possible, so that others won't have to follow up for the essential details.
Here's an example:
> Short yet concise Bug Summary
>
> Description:
> Happens on Windows 7 and OSX. Seen with IE9, Firefox 19 OSX, Chrome 21, Flash 11.6 and 11.2
>
> 1. This is the first step
> 2. This is the second step
> 3. Further steps, etc.
>
> Expected:
> (describe the expected outcome of the steps above)
>
> Actual:
> (describe what actually happens)
>
> `<url>` (a link to the reduced test case, if it exists)
>
> Any other information you want to share that is relevant to the issue being
> reported. This might include the lines of code that you have identified as
> causing the bug, and potential solutions (and your opinions on their
> merits).
**[File a bug report](https://github.com/videojs/video.js/issues/new)**
### Requesting a Feature
1. [Check the plugin list](https://github.com/videojs/video.js/wiki/Plugins) for any plugins that may already support the feature.
1. [Check the plugin list](http://videojs.com/plugins/) for any plugins that may already support the feature.
2. [Search the issues](https://github.com/videojs/video.js/issues) for any previous requests for the same feature, and give a thumbs up or +1 on existing requests.
2. If no previous requests exist, create a new issue. Please be as clear as possible about why the feautre is needed and the intended use case.
3. Once again, be as details as possible and follow the [issue template][]
**[Request a feature](https://github.com/videojs/video.js/issues/new)**
Contributing code
-----------------
## Contributing code
To contibute code you'll need to be able to build a copy of Video.js and run tests locally. There are a few requirements before getting started.
- Node.js -- Video.js uses Node for build and test automation. Node is available for Windows, Mac OS X, Linux, and SunOS, as well as source code if that doesn't scare you. [Download and install Node.js](http://nodejs.org/download/)
- Node.js
Video.js uses Node for build and test automation. Node is available for Windows, Mac OS X, Linux, and SunOS, as well as source code if that doesn't scare you. [Download and install Node.js](http://nodejs.org/download/)
- grunt-cli -- Install grunt-cli globally so that you will have the correct version of grunt available for any project that needs it.
On Unix-based systems, you'll have to do this as a superuser:
```bash
sudo npm install -g grunt-cli
```
On Windows, you can just run:
```bash
npm install -g grunt-cli
- `grunt-cli`
Optionally, install `grunt-cli` globally to use grunt directly. It can always be run via an npm script:
```sh
$ npm run grunt
```
- Contribflow -- A homegrown git workflow tool for managing feature/hotfix branches and submitting pull requests. If you have your own preferred git workflow, contribflow isn't required, but the following instructions will assume you're using it.
On Unix-based systems, you'll have to do this as a superuser:
```bash
sudo npm install -g contribflow
```sh
$ npm install -g grunt-cli
```
On Windows, you can just run:
Depending on how you have node and npm set up, you may need to run the global install (`-g`) as a superuser by prepending `sudo`.
```bash
npm install -g contribflow
```
### Building video.js locally
### Building your own copy of Video.js
#### Forking and cloning the repository
First, [fork](http://help.github.com/fork-a-repo/) the video.js git repository. At the top of every github page, there is a Fork button. Click it, and the forking process will copy Video.js into your own GitHub account.
First, [fork](http://help.github.com/fork-a-repo/) the video.js git repository. At the top of every GitHub page, there is a Fork button. Click it, and the forking process will copy Video.js into your own GitHub account.
Clone your fork of the repo into your code directory
```bash
git clone https://github.com/<your-username>/video.js.git
```sh
$ git clone https://github.com/<your-username>/video.js.git
```
Navigate to the newly cloned directory
```bash
cd video.js
```sh
$ cd video.js
```
Assign the original repo to a remote called "upstream"
@@ -124,152 +128,200 @@ Assign the original repo to a remote called "upstream"
git remote add upstream https://github.com/videojs/video.js.git
```
>In the future, if you want to pull in updates to video.js that happened after you cloned the main repo, you can run:
> In the future, if you want to pull in updates to video.js that happened after you cloned the main repo, you can run:
>
> ```bash
> git checkout master
> git pull upstream master
> ```sh
> $ git remote update
> $ git checkout master
> $ git pull upstream master
> ```
#### Installing local dependencies
Install the required node.js modules using node package manager
```bash
npm install
```sh
$ npm install
```
> A note to Windows developers: If you run npm commands, and you find that your command prompt colors have suddenly reversed, you can configure npm to set color to false to prevent this from happening.
> `npm config set color false`
> Note that this change takes effect when a new command prompt window is opened; the current window will not be affected.
Build a local copy of video.js and run tests
#### Running tests
```bash
grunt dist
grunt test
To run the tests all you need to do is run
```sh
$ npm test
```
Video.js is also configured to run tests with Karma. Karma is installed as a grunt plugin to run QUnit tests in real browsers, as opposed to simply running the tests in phantomjs, a headless browser. To run the tests with Karma:
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.
```bash
grunt karma:dev
#### Building videojs
To build video.js, simply run
```sh
$ npm run build
```
At this point you should have a built copy of video.js in a directory named `dist`, and all tests should be passing.
This outputs an `es5/` and `dist/` folder. The `es5/` folder is used by bundling tools like browserify and webpack to package video.js into projects. The `dist/` folder has pre-compiled versions of video.js, including a minified version and the CSS file. This file can be included in page via a `<script></script>` tag.
#### Testing Locally
Besides running automated tests, you often want to run video.js manually and play around with things as you're developing. A few things are provided to make it easier.
#### Sandbox test directory
There's a sandbox directory where you can add any file and it won't get tracked in git. To start you can copy the example index file.
```sh
$ cp sandbox/index.html.example sandbox/index.html
```
See [the following section](#running-a-local-web-server) for how to open the page in a browser.
#### Running a local web server
This ties in nicely with the sandbox directory. You can always open the `sandbox/index.html` file directly but in some cases it may not work properly.
> Flash files (`.swf`) that are local and loaded into a locally accessed page (file:///) will NOT run.
> To get around this you must use a local web server.
To run the local webserver, you can run it in a couple of ways.
```sh
$ grunt connect
$ open http://localhost:9999/sandbox/index.html
```
or
```sh
$ npm start
```
The latter does some extra work which will be described in the [next section]
#### Watching source and test changes
As you're developing, you want the build to re-run and update itself, and potentially re-run the tests. In addition, you want to launch a local web-server that you can open the `sandbox` directory in.
To do so, you just need to run
```sh
$ npm start
```
This sets up the local webserver using connect and then watches source files, test files, and CSS files for you and rebuilds things as they happen.
### Making Changes
#### Step 1: Verify
Whether you're adding something new, making something better, or fixing a bug, you'll first want to search the [GitHub issues](https://github.com/videojs/video.js/issues) and [plugins list](https://github.com/videojs/video.js/wiki/Plugins) to make sure you're aware of any previous discussion or work. If an unclaimed issue exists, claim it via a comment. If no issue exists for your change, submit one, follwing the [issue filing guidelines](#filing-issues).
There are two categories of changes in video.js land, features and hotfixes (Video.js follows a branching model similar to [gitflow](http://nvie.com/posts/a-successful-git-branching-model/)). Hotfixes are for urgent fixes that need to be released immediately as a patch. Features are for everything else (including non-urgent fixes). If you think you have a hotfix scenario, verify that (via comment) before starting the work. We'll focus on features here, but you can swap `hotfix` for `feature` in any command.
#### Step 2: Update remote
Start a new development branch
Before starting work, you want to update your local repository to have all the latest changes.
```bash
contrib feature start
```sh
$ git remote update
$ git checkout master
$ git rebase upstream/master
```
You'll be prompted to name the branch. After that, contrib will create the branch locally, and use git to push it up to your origin, and track it. You're now ready to start building your feature or fixing that bug! Be sure to read the [Code Style Guide](#code-style-guide).
#### Step 3: Branch
While you're developing, you can ensure your changes are working by writing tests (in the `test` directory) and running `grunt test`.
You want to do your work in a separate branch.
There's also a sandbox directory where you can add any file and it won't get tracked as a change. To start you can copy the example index file and see a working version of a player (using the local source code) by loading it in a browser.
```bash
cp sandbox/index.html.example sandbox/index.html
open sandbox/index.html
```sh
$ git checkout -b my-branch
```
#### Step 4: Commit
Commit changes as you go. Write thorough descriptions of your changes in your commit messages.
For more information see our [conventional changelog guidelines for video.js](https://github.com/videojs/conventional-changelog-videojs/blob/master/convention.md)
Follow these guidelines:
### Testing Locally
A simple Connect server is available via the Grunt plugin. The commands below will allow you to setup a test sandbox and begin development.
1. The first line should be less than 50 characters and contain a short description of the commit.
1. The body should contain a more detailed description. It can contain things like reasoning for the change and specifics of what changed.
1. A footer can be added if this fixes a particular issue on GitHub.
```bash
cp sandbox/index.html.example sandbox/index.html
grunt connect
open http://localhost:9999/sandbox/index.html
```sh
$ git add src/js/player.js
$ git commit
```
> NOTES regarding local testing in Chrome 21+ (as of 2013/01/01)
> Flash files that are local and loaded into a locally accessed page (file:///) will NOT run.
> To get around this you can do either of the following:
An example commit message:
```
fix: one line commit explanation
In the body of the commit message, we can talk about why we made the change. What the change entails.
Any testing considerations or things to think about when looking at the commit.
Fixes #123. The footer can contain Fixes messages.
```
> Make sure that git knows your name and email:
>
> 1. Do your development and testing using a local HTTP server. See Grunt commands above.
>
> 2. [Disable the version of Flash included with Chrome](http://helpx.adobe.com/flash-player/kb/flash-player-google-chrome.html#How_can_I_run_debugger_or_alternate_versions_of_Flash_Player_in_Google_Chrome) and enable a system-wide version of Flash instead.
Commit and push changes as you go (using git directly). Write thorough descriptions of your changes in your commit messages.
```bash
git add .
git commit -av
git push
```
> GitHub allows you to close an issue through your commit message using the [fixes](https://github.com/blog/831-issues-2-0-the-next-generation) keyword.
>
> ```bash
> My commit message. fixes #123
> Testing: (briefly describe any testing here, for example, 'unit tests and cross-browser manual tests around playback and network interruption')
> ```sh
> $ git config --global user.name "Random User"
> $ git config --global user.email "random.user@example.com"
> ```
### Submitting your changes
#### Step 5: Test
First, thoroughly test your feature or fix, including writing tests to make sure your change doesn't get regressed in a future update. If you're fixing a bug, we recommend in addition to testing the fix itself, to do some testing around the areas that your fix has touched. For example, a brief smoketest of the player never hurts.
Any code change should come with corresponding test changes. Especially bug fixes.
Tests attached to bug fixes should fail before the change and succeed with it.
Make sure your changes are pushed to origin
```bash
git push
```sh
$ npm test
```
Use contrib to submit a pull request (make sure you're in your feature branch)
#### Step 6: Push
```bash
contrib feature submit
```sh
$ git push origin my-branch
```
You'll be prompted for title and description for the Pull Request. After that, contrib will use Git to submit your pull request to video.js.
Then go to the [repo page](http://github.com/videojs/video.js) and click the "Pull Request" button and fill out the [pull request template](/.github/PULL_REQUEST_TEMPLATE.md)
You're Done! (except for cleanup.) To clean up your feature or hotfix branch:
### Code Style Guide
First, checkout your feature or issue branch:
Our javascript is linted using [videojs-standard][linter].
```bash
git checkout (branchname)
```
## [Developer's Certificate of Origin 1.1](https://github.com/nodejs/node/blob/master/CONTRIBUTING.md#developers-certificate-of-origin-11)
Run this command to clean up your feature:
By making a contribution to this project, I certify that:
```bash
contrib feature delete
```
* (a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or
Run this command to clean up your bug fix:
* (b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or
```bash
contrib hotfix delete
```
> PLEASE NOTE: THIS WILL DELETE YOUR LOCAL AND REMOTE COPIES OF THE FEATURE.
> This is meant to clean up your local and remote branches, so make sure any changes you don't want to lose have been pulled into the parent project or another branch first.
* (c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.
Code Style Guide
----------------
Please follow [Google's JavaScript Style Guide](http://google-styleguide.googlecode.com/svn/trunk/javascriptguide.xml) to the letter. If your editor supports [.editorconfig](http://editorconfig.org/#download) it will make it easier to manage differences from your own coding style.
* (d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.
### Style examples include:
* Two space indents.
* Delimit strings with single-quotes `'`, not double-quotes `"`.
* No trailing whitespace, except in markdown files where a linebreak must be forced.
* No more than [one assignment](http://benalman.com/news/2012/05/multiple-var-statements-javascript/) per `var` statement.
* Prefer `if` and `else` to ["clever"](http://programmers.stackexchange.com/a/25281) uses of `? :` conditional or `||`, `&&` logical operators.
* **When in doubt, follow the conventions you see used in the source already.**
If you happen to find something in the codebase that does not follow the style guide, that's a good opportunity to make your first contribution!
---
### Doc Credit
## Doc Credit
This doc was inspired by some great contribution guide examples including [contribute.md template](https://github.com/contribute-md/contribute-md-template),
[grunt](https://github.com/gruntjs/grunt/wiki/Contributing),
[html5 boilerplate](https://github.com/h5bp/html5-boilerplate/blob/master/CONTRIBUTING.md),
[jquery](https://github.com/jquery/jquery/blob/master/CONTRIBUTING.md),
and [node.js](https://github.com/joyent/node/wiki/Contributing).
and [node.js](https://github.com/nodejs/node/blob/master/CONTRIBUTING.md).
[issue template]: /.github/ISSUE_TEMPLATE.md
[linter]: https://github.com/videojs/standard
+1 -1
Ver Arquivo
@@ -1,4 +1,4 @@
require('babel/register');
require('babel-register');
// Need to `require` a separate Grunt file so we can use ES6 syntax via
// Babel's require hook.
+4 -2
Ver Arquivo
@@ -3,6 +3,8 @@
# [Video.js - HTML5 Video Player](http://videojs.com)
[![Build Status](https://travis-ci.org/videojs/video.js.svg?branch=master)](https://travis-ci.org/videojs/video.js)
[![Coverage Status](https://coveralls.io/repos/github/videojs/video.js/badge.svg?branch=master)](https://coveralls.io/github/videojs/video.js?branch=master)
[![Slack Status](http://slack.videojs.com/badge.svg)](http://slack.videojs.com)
[![NPM](https://nodei.co/npm/video.js.png?downloads=true&downloadRank=true)](https://nodei.co/npm/video.js/)
@@ -53,11 +55,11 @@ var player = videojs('really-cool-video', { /* Options */ }, function() {
If you're ready to dive in, the [documentation](http://docs.videojs.com) is the first place to go for more information.
## Contributing
Video.js is a free and open source library, and we appreciate any help you're willing to give. Check out the [contributing guide](CONTRIBUTING.md).
Video.js is a free and open source library, and we appreciate any help you're willing to give. Check out the [contributing guide](/CONTRIBUTING.md).
_Video.js uses [BrowserStack](https://browserstack.com) for compatibility testing_
## Building your own Video.js from source
To build your own custom version read the section on [contributing code](CONTRIBUTING.md#contributing-code) and ["Building your own copy"](CONTRIBUTING.md#building-your-own-copy-of-videojs) in the contributing guide.
To build your own custom version read the section on [contributing code](/CONTRIBUTING.md#contributing-code) and ["Building your own copy"](/CONTRIBUTING.md#building-your-own-copy-of-videojs) in the contributing guide.
## License
Video.js is licensed under the Apache License, Version 2.0. [View the license file](LICENSE)
+103 -59
Ver Arquivo
@@ -1,4 +1,7 @@
import {gruntCustomizer, gruntOptionsMaker} from './options-customizer.js';
import chg from 'chg';
import npmRun from 'npm-run';
module.exports = function(grunt) {
require('time-grunt')(grunt);
@@ -16,29 +19,11 @@ module.exports = function(grunt) {
const browserifyGruntDefaults = {
browserifyOptions: {
debug: true,
standalone: 'videojs'
},
plugin: [
['bundle-collapser/plugin'],
['browserify-derequire']
],
transform: [
require('babelify').configure({
sourceMapRelative: './',
loose: ['all']
}),
['browserify-versionify', {
placeholder: '__VERSION__',
version: pkg.version
}],
['browserify-versionify', {
placeholder: '__VERSION_NO_PATCH__',
version: version.majorMinor
}],
['browserify-versionify', {
placeholder: '__SWF_VERSION__',
version: pkg.dependencies['videojs-swf']
}]
]
};
@@ -47,7 +32,10 @@ module.exports = function(grunt) {
release: {
tag_name: 'v'+ version.full,
name: version.full,
body: require('chg').find(version.full).changesRaw
body: npmRun.execSync('conventional-changelog -p videojs', {
silent: true,
encoding: 'utf8'
})
},
},
files: {
@@ -111,23 +99,13 @@ module.exports = function(grunt) {
grunt.initConfig({
pkg,
clean: {
build: ['build/temp/*'],
build: ['build/temp/*', 'es5'],
dist: ['dist/*']
},
jshint: {
src: {
src: ['src/js/**/*.js', 'Gruntfile.js', 'test/unit/**/*.js'],
options: {
jshintrc: '.jshintrc'
}
}
},
uglify: {
options: {
sourceMap: true,
sourceMapIn: 'build/temp/video.js.map',
sourceMapRoot: '../../src/js',
preserveComments: 'some',
screwIE8: false,
mangle: true,
compress: {
sequences: true,
@@ -159,7 +137,11 @@ module.exports = function(grunt) {
},
skin: {
files: ['src/css/**/*'],
tasks: ['sass']
tasks: ['skin']
},
babel: {
files: ['src/js/**/*.js'],
tasks: ['babel:es5']
},
jshint: {
files: ['src/**/*', 'test/unit/**/*.js', 'Gruntfile.js'],
@@ -190,6 +172,7 @@ module.exports = function(grunt) {
swf: { cwd: 'node_modules/videojs-swf/dist/', src: 'video-js.swf', dest: 'build/temp/', expand: true, filter: 'isFile' },
ie8: { cwd: 'node_modules/videojs-ie8/dist/', src: ['**/**'], dest: 'build/temp/ie8/', expand: true, filter: 'isFile' },
dist: { cwd: 'build/temp/', src: ['**/**', '!test*'], dest: 'dist/', expand: true, filter: 'isFile' },
a11y: { src: 'sandbox/descriptions.html.example', dest: 'sandbox/descriptions.test-a11y.html' }, // Can only test a file with a .html or .htm extension
examples: { cwd: 'docs/examples/', src: ['**/**'], dest: 'dist/examples/', expand: true, filter: 'isFile' }
},
cssmin: {
@@ -325,11 +308,21 @@ module.exports = function(grunt) {
}
})
},
babel: {
es5: {
files: [{
expand: true,
cwd: 'src/js/',
src: ['**/*.js', '!base-styles.js'],
dest: 'es5/'
}]
}
},
browserify: {
options: browserifyGruntOptions(),
build: {
files: {
'build/temp/video.js': ['src/js/video.js']
'build/temp/video.js': ['es5/video.js']
}
},
dist: {
@@ -342,7 +335,7 @@ module.exports = function(grunt) {
]
}),
files: {
'build/temp/video.js': ['src/js/video.js']
'build/temp/video.js': ['es5/video.js']
}
},
watch: {
@@ -351,17 +344,18 @@ module.exports = function(grunt) {
keepAlive: true
},
files: {
'build/temp/video.js': ['src/js/video.js']
'build/temp/video.js': ['es5/video.js']
}
},
tests: {
options: {
browserifyOptions: {
debug: true,
standalone: false
verbose: true,
standalone: false,
transform: ['babelify']
},
plugin: [
['proxyquireify/plugin']
['proxyquireify/plugin', 'bundle-collapser/plugin']
],
banner: false,
watch: true,
@@ -375,14 +369,6 @@ module.exports = function(grunt) {
}
}
},
exorcise: {
build: {
options: {},
files: {
'build/temp/video.js.map': ['build/temp/video.js'],
}
}
},
coveralls: {
options: {
// warn instead of failing when coveralls errors
@@ -394,25 +380,30 @@ module.exports = function(grunt) {
}
},
concat: {
options: {
separator: '\n'
},
novtt: {
options: {
separator: '\n'
},
src: ['build/temp/video.js'],
dest: 'build/temp/alt/video.novtt.js'
},
vtt: {
options: {
separator: '\n',
},
src: ['build/temp/video.js', 'node_modules/videojs-vtt.js/dist/vtt.js'],
dest: 'build/temp/video.js',
dest: 'build/temp/video.js'
},
ie8_addition: {
src: ['build/temp/video-js.css', 'src/css/ie8.css'],
dest: 'build/temp/video-js.css'
}
},
concurrent: {
options: {
logConcurrentOutput: true
},
tests: [
'watch:babel',
'browserify:tests'
],
// Run multiple watch tasks in parallel
// Needed so watchify can cache intelligently
watchAll: [
@@ -443,6 +434,50 @@ module.exports = function(grunt) {
src: ['build/temp/video.js']
}
}
},
shell: {
lint: {
command: 'npm run lint',
options: {
preferLocal: true
}
},
noderequire: {
command: 'node test/require/node.js',
options: {
failOnError: true
}
},
browserify: {
command: 'browserify test/require/browserify.js -o build/temp/browserify.js',
options: {
preferLocal: true
}
},
webpack: {
command: 'webpack test/require/webpack.js build/temp/webpack.js',
options: {
preferLocal: true
}
}
},
accessibility: {
options: {
accessibilityLevel: 'WCAG2AA',
reportLevels: {
notice: false,
warning: true,
error: true
},
ignore: [
// Ignore the warning about needing <optgroup> elements
'WCAG2AA.Principle1.Guideline1_3.1_3_1.H85.2'
]
},
test: {
src: ['sandbox/descriptions.test-a11y.html']
}
}
});
@@ -451,20 +486,21 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('videojs-doc-generator');
grunt.loadNpmTasks('chg');
grunt.loadNpmTasks('gkatsev-grunt-sass');
grunt.loadNpmTasks('grunt-accessibility');
const buildDependents = [
'shell:lint',
'clean:build',
'jshint',
'babel:es5',
'browserify:build',
'exorcise:build',
'concat:novtt',
'concat:vtt',
'usebanner:novtt',
'usebanner:vtt',
'uglify',
'sass',
'skin',
'version:css',
'cssmin',
@@ -489,19 +525,27 @@ module.exports = function(grunt) {
'zip:dist'
]);
grunt.registerTask('skin', ['sass']);
grunt.registerTask('skin', ['sass', 'concat:ie8_addition']);
// Default task - build and test
grunt.registerTask('default', ['test']);
// The test script includes coveralls only when the TRAVIS env var is set.
grunt.registerTask('test', ['build', 'karma:defaults'].concat(process.env.TRAVIS && 'coveralls').filter(Boolean));
grunt.registerTask('test', [
'build',
'shell:noderequire',
'shell:browserify',
'shell:webpack',
'karma:defaults',
'test-a11y'].concat(process.env.TRAVIS && 'coveralls').filter(Boolean));
// Run while developing
grunt.registerTask('dev', ['build', 'connect:dev', 'concurrent:watchSandbox']);
grunt.registerTask('watchAll', ['build', 'connect:dev', 'concurrent:watchAll']);
grunt.registerTask('test-a11y', ['copy:a11y', 'accessibility']);
// Pick your testing, or run both in different terminals
grunt.registerTask('test-ui', ['browserify:tests']);
grunt.registerTask('test-cli', ['karma:watch']);
+1 -1
Ver Arquivo
@@ -1,7 +1,7 @@
module.exports = function(grunt) {
grunt.registerTask('cdn-links', 'Update the version of CDN links in docs', function(){
let doc = grunt.file.read('docs/guides/setup.md');
let version = require('../package.json').version;
let version = require('../../package.json').version;
// remove the patch version to point to the latest patch
version = version.replace(/(\d+\.\d+)\.\d+/, '$1');
+35
Ver Arquivo
@@ -0,0 +1,35 @@
module.exports = function(grunt) {
grunt.registerTask('check-translations', 'Check that translations are up to date', function(){
const source = require('../../lang/en.json');
const table = require('markdown-table');
let doc = grunt.file.read('docs/translations-needed.md');
const tableRegex = /(<!-- START langtable -->)(.|\n)*(<!-- END langtable -->)/;
let tableData = [['Language file', 'Missing translations']];
grunt.file.recurse('lang', (abspath, rootdir, subdir, filename) => {
if (filename === 'en.json') {
return;
}
const target = require(`../../${abspath}`);
let missing = [];
for (const string in source) {
if (!target[string]) {
grunt.log.writeln(`${filename} missing "${string}"`);
missing.push(string);
}
}
if (missing.length > 0) {
grunt.log.error(`${filename} is missing ${missing.length} translations.`);
tableData.push([`${filename} (missing ${missing.length})`, missing[0]]);
for (var i = 1; i < missing.length; i++) {
tableData.push(['', missing[i]]);
}
} else {
grunt.log.ok(`${filename} is up to date.`);
tableData.push([`${filename} (Complete)`, '']);
}
});
doc = doc.replace(tableRegex, `$1\n` + table(tableData) + `\n$3`);
grunt.file.write('docs/translations-needed.md', doc);
});
};
-24
Ver Arquivo
@@ -1,24 +0,0 @@
module.exports = function(grunt) {
grunt.registerTask('saucelabs', function() {
const exec = require('child_process').exec;
const done = this.async();
if (this.args[0] == 'connect') {
exec('curl https://gist.githubusercontent.com/santiycr/5139565/raw/sauce_connect_setup.sh | bash',
function(error, stdout, stderr) {
if (error) {
grunt.log.error(error);
return done();
}
grunt.verbose.error(stderr.toString());
grunt.verbose.writeln(stdout.toString());
grunt.task.run(['karma:saucelabs']);
done();
});
} else {
grunt.task.run(['karma:saucelabs']);
done();
}
});
}
+1 -1
Ver Arquivo
@@ -1,7 +1,7 @@
{
"name": "video.js",
"description": "An HTML5 and Flash video player with a common API and skin for both.",
"version": "5.11.2",
"version": "5.13.2",
"keywords": [
"videojs",
"html5",
+2 -2
Ver Arquivo
@@ -280,7 +280,7 @@
[ "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" ],
[ "grunt chg-release:{{version}}", "Update the changelog with the new release" ],
[ "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" ],
@@ -306,7 +306,7 @@
[ "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" ],
[ "grunt chg-release:{{version}}", "Update the changelog with the new release" ],
[ "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" ],
-7
Ver Arquivo
@@ -585,9 +585,6 @@ body.vjs-full-window {
-moz-transition: visibility 1s, opacity 1s;
-o-transition: visibility 1s, opacity 1s;
transition: visibility 1s, opacity 1s; }
@media \0screen {
.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar {
visibility: hidden; } }
.vjs-controls-disabled .vjs-control-bar,
.vjs-using-native-controls .vjs-control-bar,
@@ -598,10 +595,6 @@ body.vjs-full-window {
opacity: 1;
visibility: visible; }
@media \0screen {
.vjs-user-inactive.vjs-playing .vjs-control-bar :before {
content: ""; } }
.vjs-has-started.vjs-no-flex .vjs-control-bar {
display: table; }
+1 -1
Ver Arquivo
Diff do arquivo suprimido porque uma ou mais linhas são muito longas
+20966 -20006
Ver Arquivo
Diff do arquivo suprimido porque uma ou mais linhas são muito longas
+9 -15
Ver Arquivo
Diff do arquivo suprimido porque uma ou mais linhas são muito longas
Diff do arquivo suprimido porque uma ou mais linhas são muito longas
+7 -1
Ver Arquivo
@@ -30,5 +30,11 @@ videojs.addLanguage("de",{
"This modal can be closed by pressing the Escape key or activating the close button.": "Durch Drücken der Esc-Taste bzw. Betätigung der Schaltfläche \"Schließen\" wird dieses modale Fenster geschlossen.",
", opens captions settings dialog": ", öffnet Einstellungen für Untertitel",
", opens subtitles settings dialog": ", öffnet Einstellungen für Untertitel",
", selected": " (ausgewählt)"
", selected": ", ausgewählt",
"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"
});
+7 -1
Ver Arquivo
@@ -18,17 +18,23 @@ videojs.addLanguage("el",{
"Captions": "Λεζάντες",
"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.": "Δεν βρέθηκε συμβατή πηγή αναπαραγωγής για το συγκεκριμένο αρχείο.",
"Play video": "Αναπαραγωγή βίντεο",
"The media is encrypted and we do not have the keys to decrypt it.": "Το αρχείο προς αναπαραγωγή είναι κρυπτογραφημένo και δεν υπάρχουν τα απαραίτητα κλειδιά αποκρυπτογράφησης.",
"Play Video": "Αναπαραγωγή βίντεο",
"Close": "Κλείσιμο",
"Modal Window": "Aναδυόμενο παράθυρο",
"This is a modal window": "Το παρών είναι ένα αναδυόμενο παράθυρο",
"This modal can be closed by pressing the Escape key or activating the close button.": "Αυτό το παράθυρο μπορεί να εξαφανιστεί πατώντας το πλήκτρο Escape ή πατώντας το κουμπί κλεισίματος.",
", opens captions settings dialog": ", εμφανίζει τις ρυθμίσεις για τις λεζάντες",
", opens subtitles settings dialog": ", εμφανίζει τις ρυθμίσεις για τους υπότιτλους",
", opens descriptions settings dialog": ", εμφανίζει τις ρυθμίσεις για τις περιγραφές",
", selected": ", επιλεγμένο"
});
+2
Ver Arquivo
@@ -21,11 +21,13 @@ videojs.addLanguage("en",{
"Close Modal Dialog": "Close Modal Dialog",
"Descriptions": "Descriptions",
"descriptions off": "descriptions off",
"Audio Track": "Audio Track",
"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.",
"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "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.": "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": "Play Video",
"Close": "Close",
"Modal Window": "Modal Window",
+17 -3
Ver Arquivo
@@ -15,12 +15,26 @@ videojs.addLanguage("fr",{
"Playback Rate": "Vitesse de lecture",
"Subtitles": "Sous-titres",
"subtitles off": "Sous-titres désactivés",
"Captions": "Sous-titres",
"captions off": "Sous-titres désactivés",
"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",
"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.",
"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "La lecture de la vidéo a été interrompue à cause d'un problème de corruption ou parce que la vidéo utilise des fonctionnalités non prises en charge par votre navigateur.",
"No compatible source was found for this media.": "Aucune source compatible n'a été trouvée pour cette vidéo."
"No compatible source was found for this media.": "Aucune source compatible n'a été trouvée pour cette vidéo.",
"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",
"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é"
});
+15 -1
Ver Arquivo
@@ -18,9 +18,23 @@ videojs.addLanguage("ru",{
"Captions": "Подписи",
"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.": "Совместимые источники для этого видео отсутствуют."
"No compatible source was found for this media.": "Совместимые источники для этого видео отсутствуют.",
"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": ", выбрано"
});
+15 -1
Ver Arquivo
@@ -18,9 +18,23 @@ videojs.addLanguage("uk",{
"Captions": "Підписи",
"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.": "Сумісні джерела для цього відео відсутні."
"No compatible source was found for this media.": "Сумісні джерела для цього відео відсутні.",
"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": ", обраний"
});
+14 -1
Ver Arquivo
@@ -18,10 +18,23 @@ videojs.addLanguage("zh-TW",{
"Captions": "內嵌字幕",
"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": ", 選擇"
});
BIN
Ver Arquivo
Arquivo binário não exibido.
BIN
Ver Arquivo
Arquivo binário não exibido.
+12 -7
Ver Arquivo
@@ -585,9 +585,6 @@ body.vjs-full-window {
-moz-transition: visibility 1s, opacity 1s;
-o-transition: visibility 1s, opacity 1s;
transition: visibility 1s, opacity 1s; }
@media \0screen {
.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar {
visibility: hidden; } }
.vjs-controls-disabled .vjs-control-bar,
.vjs-using-native-controls .vjs-control-bar,
@@ -598,10 +595,6 @@ body.vjs-full-window {
opacity: 1;
visibility: visible; }
@media \0screen {
.vjs-user-inactive.vjs-playing .vjs-control-bar :before {
content: ""; } }
.vjs-has-started.vjs-no-flex .vjs-control-bar {
display: table; }
@@ -1300,3 +1293,15 @@ video::-webkit-media-text-track-display {
@media print {
.video-js > *:not(.vjs-tech):not(.vjs-poster) {
visibility: hidden; } }
@media \0screen {
.vjs-user-inactive.vjs-playing .vjs-control-bar :before {
content: "";
}
}
@media \0screen {
.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar {
visibility: hidden;
}
}
+1 -1
Ver Arquivo
Diff do arquivo suprimido porque uma ou mais linhas são muito longas
BIN
Ver Arquivo
Arquivo binário não exibido.
+20965 -20005
Ver Arquivo
Diff do arquivo suprimido porque uma ou mais linhas são muito longas
-319
Ver Arquivo
Diff do arquivo suprimido porque uma ou mais linhas são muito longas
+10 -15
Ver Arquivo
Diff do arquivo suprimido porque uma ou mais linhas são muito longas
-1
Ver Arquivo
Diff do arquivo suprimido porque uma ou mais linhas são muito longas
+120
Ver Arquivo
@@ -0,0 +1,120 @@
# Hooks
Hooks exist so that users can "hook" on to certain video.js player lifecycle
## Current Hooks
Currently, the following hooks are avialable:
### 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 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
2. 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
// was created with
videoEl.className += ' some-super-class';
// autoplay will be true here, since we passed in as such
(options.autoplay) {
options.autoplay = false
}
// options that are returned here will be merged with old options
// in this example options will now be
// {autoplay: false, controls: true}
return options;
};
videojs.hook('beforesetup', beforeSetup);
videojs('some-id', {autoplay: true, controls: true});
```
### setup
`setup` is called just after the player is created. This allows:
* plugin or custom functionalify to intialize on the player
* changes to the player object itself
`setup` hook functions:
* Take one argument
* player: the player that video.js created
* Don't have to return anything
Example: adding setup hook
```js
var setup = function(player) {
// initialize the foo plugin
player.foo();
};
var foo = function() {};
videojs.plugin('foo', foo);
videojs.hook('setup', setup);
var player = videojs('some-id', {autoplay: true, controls: true});
```
## Usage
### 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.
Example: adding hooks
```js
videojs.hook('beforesetup', function(videoEl, options) {
// videoEl will be the element with id=vid1
// options will contain {autoplay: false}
});
videojs.hook('setup', function(player) {
// player will be the same player that is defined below
// as `var 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.
### 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.
Example: getting all hooks attached to video.js
```js
var beforeSetupHooks = videojs.hooks('beforesetup');
var setupHooks = videojs.hooks('setup');
```
### Removing
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
```js
var beforeSetup = function(videoEl, options) {};
// add the hook
videojs.hook('beforesetup', beforeSetup);
// remove that same hook
videojs.removeHook('beforesetup', beforeSetup);
```
You can also use `videojs.hooks` in conjunction with `videojs.removeHook` but it may have unexpected results if used during an asynchronous callbacks as other plugins/functionality may have added hooks.
Example: using `videojs.hooks` and `videojs.removeHook` to remove a hook
```js
// add the hook
videojs.hook('setup', function(videoEl, options) {});
var setupHooks = videojs.hooks('setup');
// remove the hook you just added
videojs.removeHook('setup', setupHooks[setupHooks.length - 1]);
```
+6 -154
Ver Arquivo
@@ -110,6 +110,10 @@ NOTE: These need to be added after the core Video.js script.
Notes:
- This will add your language key/values to the Video.js player instances individually. If these values already exist in the global dictionary via the process above, those will be overridden for the player instance in question.
Updating default translations
-----------------------------
A list of the current translations and any strings that need translation are at [docs/translations-needed.md](../translations-needed.md). After updating the language files in /lang/ running `grunt check-languages` will update that list.
Setting Default Language in a Video.js Player
---------------------------------------------
@@ -157,159 +161,7 @@ var details = '<div class="vjs-errors-details">' + player.localize('Technical de
Language Codes
--------------
The following is a list of official language codes.
A list of languages codes can be found [here](http://www.iana.org/assignments/language-subtag-registry/language-subtag-registry)
**NOTE:** For supported language translations, please see the [Languages Folder (/lang)](https://github.com/videojs/video.js/tree/master/lang) folder located in the project root.
For supported language translations, please see the [Languages Folder (/lang)](https://github.com/videojs/video.js/tree/master/lang) folder located in the project root.
<table border="0" cellspacing="5" cellpadding="5">
<tr>
<table>
<tr><th>ab<th><td>Abkhazian</td></tr>
<tr><th>aa<th><td>Afar</td></tr>
<tr><th>af<th><td>Afrikaans</td></tr>
<tr><th>sq<th><td>Albanian</td></tr>
<tr><th>am<th><td>Amharic</td></tr>
<tr><th>ar<th><td>Arabic</td></tr>
<tr><th>an<th><td>Aragonese</td></tr>
<tr><th>hy<th><td>Armenian</td></tr>
<tr><th>as<th><td>Assamese</td></tr>
<tr><th>ay<th><td>Aymara</td></tr>
<tr><th>az<th><td>Azerbaijani</td></tr>
<tr><th>ba<th><td>Bashkir</td></tr>
<tr><th>eu<th><td>Basque</td></tr>
<tr><th>bn<th><td>Bengali (Bangla)</td></tr>
<tr><th>dz<th><td>Bhutani</td></tr>
<tr><th>bh<th><td>Bihari</td></tr>
<tr><th>bi<th><td>Bislama</td></tr>
<tr><th>br<th><td>Breton</td></tr>
<tr><th>bg<th><td>Bulgarian</td></tr>
<tr><th>my<th><td>Burmese</td></tr>
<tr><th>be<th><td>Byelorussian (Belarusian)</td></tr>
<tr><th>km<th><td>Cambodian</td></tr>
<tr><th>ca<th><td>Catalan</td></tr>
<tr><th>zh<th><td>Chinese (Simplified)</td></tr>
<tr><th>zh<th><td>Chinese (Traditional)</td></tr>
<tr><th>co<th><td>Corsican</td></tr>
<tr><th>hr<th><td>Croatian</td></tr>
<tr><th>cs<th><td>Czech</td></tr>
<tr><th>da<th><td>Danish</td></tr>
<tr><th>nl<th><td>Dutch</td></tr>
<tr><th>en<th><td>English</td></tr>
<tr><th>eo<th><td>Esperanto</td></tr>
<tr><th>et<th><td>Estonian</td></tr>
<tr><th>fo<th><td>Faeroese</td></tr>
<tr><th>fa<th><td>Farsi</td></tr>
<tr><th>fj<th><td>Fiji</td></tr>
<tr><th>fi<th><td>Finnish</td></tr>
<tr><th>fr<th><td>French</td></tr>
<tr><th>fy<th><td>Frisian</td></tr>
<tr><th>gl<th><td>Galician</td></tr>
<tr><th>gd<th><td>Gaelic (Scottish)</td></tr>
<tr><th>gv<th><td>Gaelic (Manx)</td></tr>
<tr><th>ka<th><td>Georgian</td></tr>
<tr><th>de<th><td>German</td></tr>
<tr><th>el<th><td>Greek</td></tr>
<tr><th>kl<th><td>Greenlandic</td></tr>
<tr><th>gn<th><td>Guarani</td></tr>
<tr><th>gu<th><td>Gujarati</td></tr>
<tr><th>ht<th><td>Haitian Creole</td></tr>
<tr><th>ha<th><td>Hausa</td></tr>
<tr><th>he<th><td>Hebrew</td></tr>
<tr><th>hi<th><td>Hindi</td></tr>
<tr><th>hu<th><td>Hungarian</td></tr>
<tr><th>is<th><td>Icelandic</td></tr>
<tr><th>io<th><td>Ido</td></tr>
<tr><th>id<th><td>Indonesian</td></tr>
<tr><th>ia<th><td>Interlingua</td></tr>
<tr><th>ie<th><td>Interlingue</td></tr>
<tr><th>iu<th><td>Inuktitut</td></tr>
<tr><th>ik<th><td>Inupiak</td></tr>
<tr><th>ga<th><td>Irish</td></tr>
<tr><th>it<th><td>Italian</td></tr>
<tr><th>ja<th><td>Japanese</td></tr>
<tr><th>jv<th><td>Javanese</td></tr>
<tr><th>kn<th><td>Kannada</td></tr>
<tr><th>ks<th><td>Kashmiri</td></tr>
<tr><th>kk<th><td>Kazakh</td></tr>
<tr><th>rw<th><td>Kinyarwanda (Ruanda)</td></tr>
<tr><th>ky<th><td>Kirghiz</td></tr>
<tr><th>rn<th><td>Kirundi (Rundi)</td></tr>
<tr><th>ko<th><td>Korean</td></tr>
<tr><th>ku<th><td>Kurdish</td></tr>
<tr><th>lo<th><td>Laothian</td></tr>
<tr><th>la<th><td>Latin</td></tr>
<tr><th>lv<th><td>Latvian (Lettish)</td></tr>
<tr><th>li<th><td>Limburgish ( Limburger)</td></tr>
<tr><th>ln<th><td>Lingala</td></tr>
<tr><th>lt<th><td>Lithuanian</td></tr>
<tr><th>mk<th><td>Macedonian</td></tr>
<tr><th>mg<th><td>Malagasy</td></tr>
<tr><th>ms<th><td>Malay</td></tr>
<tr><th>ml<th><td>Malayalam</td></tr>
<tr><th>mt<th><td>Maltese</td></tr>
<tr><th>mi<th><td>Maori</td></tr>
<tr><th>mr<th><td>Marathi</td></tr>
<tr><th>mo<th><td>Moldavian</td></tr>
<tr><th>mn<th><td>Mongolian</td></tr>
<tr><th>na<th><td>Nauru</td></tr>
<tr><th>ne<th><td>Nepali</td></tr>
<tr><th>no<th><td>Norwegian</td></tr>
<tr><th>oc<th><td>Occitan</td></tr>
<tr><th>or<th><td>Oriya</td></tr>
<tr><th>om<th><td>Oromo (Afan, Galla)</td></tr>
<tr><th>ps<th><td>Pashto (Pushto)</td></tr>
<tr><th>pl<th><td>Polish</td></tr>
<tr><th>pt<th><td>Portuguese</td></tr>
<tr><th>pa<th><td>Punjabi</td></tr>
<tr><th>qu<th><td>Quechua</td></tr>
<tr><th>rm<th><td>Rhaeto-Romance</td></tr>
<tr><th>ro<th><td>Romanian</td></tr>
<tr><th>ru<th><td>Russian</td></tr>
<tr><th>sm<th><td>Samoan</td></tr>
<tr><th>sg<th><td>Sangro</td></tr>
<tr><th>sa<th><td>Sanskrit</td></tr>
<tr><th>sr<th><td>Serbian</td></tr>
<tr><th>sh<th><td>Serbo-Croatian</td></tr>
<tr><th>st<th><td>Sesotho</td></tr>
<tr><th>tn<th><td>Setswana</td></tr>
<tr><th>sn<th><td>Shona</td></tr>
<tr><th>ii<th><td>Sichuan Yi</td></tr>
<tr><th>sd<th><td>Sindhi</td></tr>
<tr><th>si<th><td>Sinhalese</td></tr>
<tr><th>ss<th><td>Siswati</td></tr>
<tr><th>sk<th><td>Slovak</td></tr>
<tr><th>sl<th><td>Slovenian</td></tr>
<tr><th>so<th><td>Somali</td></tr>
<tr><th>es<th><td>Spanish</td></tr>
<tr><th>su<th><td>Sundanese</td></tr>
<tr><th>sw<th><td>Swahili (Kiswahili)</td></tr>
<tr><th>sv<th><td>Swedish</td></tr>
<tr><th>tl<th><td>Tagalog</td></tr>
<tr><th>tg<th><td>Tajik</td></tr>
<tr><th>ta<th><td>Tamil</td></tr>
<tr><th>tt<th><td>Tatar</td></tr>
<tr><th>te<th><td>Telugu</td></tr>
<tr><th>th<th><td>Thai</td></tr>
<tr><th>bo<th><td>Tibetan</td></tr>
<tr><th>ti<th><td>Tigrinya</td></tr>
<tr><th>to<th><td>Tonga</td></tr>
<tr><th>ts<th><td>Tsonga</td></tr>
<tr><th>tr<th><td>Turkish</td></tr>
<tr><th>tk<th><td>Turkmen</td></tr>
<tr><th>tw<th><td>Twi</td></tr>
<tr><th>ug<th><td>Uighur</td></tr>
<tr><th>uk<th><td>Ukrainian</td></tr>
<tr><th>ur<th><td>Urdu</td></tr>
<tr><th>uz<th><td>Uzbek</td></tr>
<tr><th>vi<th><td>Vietnamese</td></tr>
<tr><th>vo<th><td>Volapük</td></tr>
<tr><th>wa<th><td>Wallon</td></tr>
<tr><th>cy<th><td>Welsh</td></tr>
<tr><th>wo<th><td>Wolof</td></tr>
<tr><th>xh<th><td>Xhosa</td></tr>
<tr><th>yi<th><td>Yiddish</td></tr>
<tr><th>yo<th><td>Yoruba</td></tr>
<tr><th>zu<th><td>Zulu</td></tr>
</table>
</tr>
</table>
+1 -1
Ver Arquivo
@@ -54,7 +54,7 @@ or
### autoplay ###
If autoplay is true, the video will start playing as soon as page is loaded (without any interaction from the user).
NOT SUPPORTED BY APPLE iOS DEVICES. Apple blocks the autoplay functionality in an effort to protect it's customers from unwillingly using a lot of their (often expensive) monthly data plans. A user touch/click is required to start the video in this case.
NOT SUPPORTED BY APPLE iOS DEVICES. Apple blocks the autoplay functionality in an effort to protect its customers from unwillingly using a lot of their (often expensive) monthly data plans. A user touch/click is required to start the video in this case.
```html
<video autoplay ...>
or
+1 -1
Ver Arquivo
@@ -121,4 +121,4 @@ videojs(document.getElementsByClassName('awesome_video_class')[0], {}, function(
});
```
\* If you have trouble playing back content you know is in the [correct format](http://blog.zencoder.com/2013/09/13/what-formats-do-i-need-for-html5-video/), your HTTP server might not be delivering the content with the correct [MIME type](http://en.wikipedia.org/wiki/Internet_media_type#Type_video). Please double check your content's headers before opening an [issue](https://github.com/videojs/video.js/blob/master/CONTRIBUTING.md).
\* If you have trouble playing back content you know is in the [correct format](http://blog.zencoder.com/2013/09/13/what-formats-do-i-need-for-html5-video/), your HTTP server might not be delivering the content with the correct [MIME type](http://en.wikipedia.org/wiki/Internet_media_type#Type_video). Please double check your content's headers before opening an [issue](/CONTRIBUTING.md).
+3
Ver Arquivo
@@ -100,3 +100,6 @@ You may optionally use the last `/` as the separator between connection and stre
<source src="rtmp://your.streaming.provider.net/cfx/st/mp4:video.mp4" type="rtmp/mp4">
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.
+2 -2
Ver Arquivo
@@ -33,5 +33,5 @@ There are two categories of docs: [Guides](./guides/) and [API docs](./api/). Gu
* [Removing Players](./guides/removing-players.md) - Helpful for using VideoJS in single page apps.
## API Docs
- The most relevant API doc is the [player API doc](./api/vjs.Player.md).
- [Full list of API Docs](./api/)
- The most relevant API doc is the [player API doc](http://docs.videojs.com/docs/api/player.html)
- [Full list of API Docs](http://docs.videojs.com/docs/api/index.html)
+319
Ver Arquivo
@@ -0,0 +1,319 @@
# Translations needed
The currently available translations are in the lang dir. This table shows the completeness of those translations. Anything not listed does not exist yet, so go ahead and create it by copying `en.json`.
If you add or update a translation run `grunt check-translations` to update the list and include this modified doc in the pull request.
## Status of translations
<!-- START langtable -->
| Language file | Missing translations |
| ----------------------- | ----------------------------------------------------------------------------------- |
| ar.json (missing 6) | Close Modal Dialog |
| | Descriptions |
| | descriptions off |
| | Audio Track |
| | The media is encrypted and we do not have the keys to decrypt it. |
| | , opens descriptions settings dialog |
| ba.json (missing 14) | Close Modal Dialog |
| | Descriptions |
| | descriptions off |
| | Audio Track |
| | 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. |
| | , opens captions settings dialog |
| | , opens subtitles settings dialog |
| | , opens descriptions settings dialog |
| | , selected |
| bg.json (missing 14) | Close Modal Dialog |
| | Descriptions |
| | descriptions off |
| | Audio Track |
| | 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. |
| | , opens captions settings dialog |
| | , opens subtitles settings dialog |
| | , opens descriptions settings dialog |
| | , selected |
| ca.json (missing 14) | Close Modal Dialog |
| | Descriptions |
| | descriptions off |
| | Audio Track |
| | 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. |
| | , opens captions settings dialog |
| | , opens subtitles settings dialog |
| | , opens descriptions settings dialog |
| | , selected |
| cs.json (missing 14) | Close Modal Dialog |
| | Descriptions |
| | descriptions off |
| | Audio Track |
| | 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. |
| | , opens captions settings dialog |
| | , opens subtitles settings dialog |
| | , opens descriptions settings dialog |
| | , selected |
| da.json (missing 14) | Close Modal Dialog |
| | Descriptions |
| | descriptions off |
| | Audio Track |
| | 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. |
| | , opens captions settings dialog |
| | , opens subtitles settings dialog |
| | , opens descriptions settings dialog |
| | , selected |
| de.json (Complete) | |
| el.json (Complete) | |
| es.json (missing 14) | Close Modal Dialog |
| | Descriptions |
| | descriptions off |
| | Audio Track |
| | 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. |
| | , opens captions settings dialog |
| | , opens subtitles settings dialog |
| | , opens descriptions settings dialog |
| | , selected |
| fa.json (missing 14) | Close Modal Dialog |
| | Descriptions |
| | descriptions off |
| | Audio Track |
| | 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. |
| | , opens captions settings dialog |
| | , opens subtitles settings dialog |
| | , opens descriptions settings dialog |
| | , selected |
| fi.json (missing 14) | Close Modal Dialog |
| | Descriptions |
| | descriptions off |
| | Audio Track |
| | 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. |
| | , opens captions settings dialog |
| | , opens subtitles settings dialog |
| | , opens descriptions settings dialog |
| | , selected |
| fr.json (Complete) | |
| hr.json (missing 14) | Close Modal Dialog |
| | Descriptions |
| | descriptions off |
| | Audio Track |
| | 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. |
| | , opens captions settings dialog |
| | , opens subtitles settings dialog |
| | , opens descriptions settings dialog |
| | , selected |
| hu.json (missing 14) | Close Modal Dialog |
| | Descriptions |
| | descriptions off |
| | Audio Track |
| | 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. |
| | , opens captions settings dialog |
| | , opens subtitles settings dialog |
| | , opens descriptions settings dialog |
| | , selected |
| it.json (missing 14) | Close Modal Dialog |
| | Descriptions |
| | descriptions off |
| | Audio Track |
| | 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. |
| | , opens captions settings dialog |
| | , opens subtitles settings dialog |
| | , opens descriptions settings dialog |
| | , selected |
| ja.json (missing 14) | Close Modal Dialog |
| | Descriptions |
| | descriptions off |
| | Audio Track |
| | 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. |
| | , opens captions settings dialog |
| | , opens subtitles settings dialog |
| | , opens descriptions settings dialog |
| | , selected |
| ko.json (missing 14) | Close Modal Dialog |
| | Descriptions |
| | descriptions off |
| | Audio Track |
| | 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. |
| | , opens captions settings dialog |
| | , opens subtitles settings dialog |
| | , opens descriptions settings dialog |
| | , selected |
| nb.json (missing 14) | Close Modal Dialog |
| | Descriptions |
| | descriptions off |
| | Audio Track |
| | 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. |
| | , opens captions settings dialog |
| | , opens subtitles settings dialog |
| | , opens descriptions settings dialog |
| | , selected |
| nl.json (missing 3) | Close Modal Dialog |
| | Audio Track |
| | The media is encrypted and we do not have the keys to decrypt it. |
| nn.json (missing 14) | Close Modal Dialog |
| | Descriptions |
| | descriptions off |
| | Audio Track |
| | 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. |
| | , opens captions settings dialog |
| | , opens subtitles settings dialog |
| | , opens descriptions settings dialog |
| | , selected |
| pl.json (missing 7) | Close Modal Dialog |
| | Descriptions |
| | descriptions off |
| | Audio Track |
| | The media is encrypted and we do not have the keys to decrypt it. |
| | Play Video |
| | , opens descriptions settings dialog |
| pt-BR.json (missing 14) | Close Modal Dialog |
| | Descriptions |
| | descriptions off |
| | Audio Track |
| | 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. |
| | , opens captions settings dialog |
| | , opens subtitles settings dialog |
| | , opens descriptions settings dialog |
| | , selected |
| ru.json (Complete) | |
| sr.json (missing 14) | Close Modal Dialog |
| | Descriptions |
| | descriptions off |
| | Audio Track |
| | 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. |
| | , opens captions settings dialog |
| | , opens subtitles settings dialog |
| | , opens descriptions settings dialog |
| | , selected |
| sv.json (missing 14) | Close Modal Dialog |
| | Descriptions |
| | descriptions off |
| | Audio Track |
| | 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. |
| | , opens captions settings dialog |
| | , opens subtitles settings dialog |
| | , opens descriptions settings dialog |
| | , selected |
| tr.json (missing 6) | Close Modal Dialog |
| | Descriptions |
| | descriptions off |
| | Audio Track |
| | The media is encrypted and we do not have the keys to decrypt it. |
| | , opens descriptions settings dialog |
| uk.json (Complete) | |
| vi.json (missing 14) | Close Modal Dialog |
| | Descriptions |
| | descriptions off |
| | Audio Track |
| | 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. |
| | , opens captions settings dialog |
| | , opens subtitles settings dialog |
| | , opens descriptions settings dialog |
| | , selected |
| zh-CN.json (missing 13) | Close Modal Dialog |
| | Descriptions |
| | descriptions off |
| | Audio Track |
| | 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. |
| | , opens captions settings dialog |
| | , opens subtitles settings dialog |
| | , opens descriptions settings dialog |
| | , selected |
| zh-TW.json (Complete) | |
<!-- END langtable -->
+7 -1
Ver Arquivo
@@ -30,5 +30,11 @@
"This modal can be closed by pressing the Escape key or activating the close button.": "Durch Drücken der Esc-Taste bzw. Betätigung der Schaltfläche \"Schließen\" wird dieses modale Fenster geschlossen.",
", opens captions settings dialog": ", öffnet Einstellungen für Untertitel",
", opens subtitles settings dialog": ", öffnet Einstellungen für Untertitel",
", selected": " (ausgewählt)"
", selected": ", ausgewählt",
"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"
}
+7 -1
Ver Arquivo
@@ -18,17 +18,23 @@
"Captions": "Λεζάντες",
"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.": "Δεν βρέθηκε συμβατή πηγή αναπαραγωγής για το συγκεκριμένο αρχείο.",
"Play video": "Αναπαραγωγή βίντεο",
"The media is encrypted and we do not have the keys to decrypt it.": "Το αρχείο προς αναπαραγωγή είναι κρυπτογραφημένo και δεν υπάρχουν τα απαραίτητα κλειδιά αποκρυπτογράφησης.",
"Play Video": "Αναπαραγωγή βίντεο",
"Close": "Κλείσιμο",
"Modal Window": "Aναδυόμενο παράθυρο",
"This is a modal window": "Το παρών είναι ένα αναδυόμενο παράθυρο",
"This modal can be closed by pressing the Escape key or activating the close button.": "Αυτό το παράθυρο μπορεί να εξαφανιστεί πατώντας το πλήκτρο Escape ή πατώντας το κουμπί κλεισίματος.",
", opens captions settings dialog": ", εμφανίζει τις ρυθμίσεις για τις λεζάντες",
", opens subtitles settings dialog": ", εμφανίζει τις ρυθμίσεις για τους υπότιτλους",
", opens descriptions settings dialog": ", εμφανίζει τις ρυθμίσεις για τις περιγραφές",
", selected": ", επιλεγμένο"
}
+2
Ver Arquivo
@@ -21,11 +21,13 @@
"Close Modal Dialog": "Close Modal Dialog",
"Descriptions": "Descriptions",
"descriptions off": "descriptions off",
"Audio Track": "Audio Track",
"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.",
"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "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.": "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": "Play Video",
"Close": "Close",
"Modal Window": "Modal Window",
+17 -3
Ver Arquivo
@@ -15,12 +15,26 @@
"Playback Rate": "Vitesse de lecture",
"Subtitles": "Sous-titres",
"subtitles off": "Sous-titres désactivés",
"Captions": "Sous-titres",
"captions off": "Sous-titres désactivés",
"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",
"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.",
"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "La lecture de la vidéo a été interrompue à cause d'un problème de corruption ou parce que la vidéo utilise des fonctionnalités non prises en charge par votre navigateur.",
"No compatible source was found for this media.": "Aucune source compatible n'a été trouvée pour cette vidéo."
"No compatible source was found for this media.": "Aucune source compatible n'a été trouvée pour cette vidéo.",
"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",
"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é"
}
+15 -1
Ver Arquivo
@@ -18,9 +18,23 @@
"Captions": "Подписи",
"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.": "Совместимые источники для этого видео отсутствуют."
"No compatible source was found for this media.": "Совместимые источники для этого видео отсутствуют.",
"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": ", выбрано"
}
+15 -1
Ver Arquivo
@@ -18,9 +18,23 @@
"Captions": "Підписи",
"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.": "Сумісні джерела для цього відео відсутні."
"No compatible source was found for this media.": "Сумісні джерела для цього відео відсутні.",
"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": ", обраний"
}
+14 -2
Ver Arquivo
@@ -18,11 +18,23 @@
"Captions": "內嵌字幕",
"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": ", 選擇"
}
+63 -33
Ver Arquivo
@@ -1,7 +1,9 @@
{
"name": "video.js",
"description": "An HTML5 and Flash video player with a common API and skin for both.",
"version": "5.11.2",
"version": "5.13.2",
"main": "./es5/video.js",
"style": "./dist/video-js.css",
"copyright": "Copyright Brightcove, Inc. <https://www.brightcove.com/>",
"license": "Apache-2.0",
"keywords": [
@@ -14,18 +16,25 @@
"homepage": "http://videojs.com",
"author": "Steve Heffernan",
"scripts": {
"test": "grunt test"
"changelog": "conventional-changelog -p videojs -i CHANGELOG.md -s",
"build": "grunt dist",
"change": "grunt chg-add",
"clean": "grunt clean",
"grunt": "grunt",
"lint": "vjsstandard",
"start": "grunt watchAll",
"test": "grunt test",
"toc": "doctoc"
},
"repository": {
"type": "git",
"url": "https://github.com/videojs/video.js.git"
},
"main": "./dist/video.js",
"style": "./dist/video-js.css",
"dependencies": {
"babel-runtime": "^6.9.2",
"global": "4.3.0",
"lodash-compat": "3.10.2",
"object.assign": "4.0.3",
"object.assign": "^4.0.4",
"safe-json-parse": "4.0.0",
"tsml": "1.0.1",
"videojs-font": "2.0.0",
@@ -35,69 +44,90 @@
"xhr": "2.2.0"
},
"devDependencies": {
"babel": "^5.2.2",
"babelify": "^6.0.1",
"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-transform-runtime": "^6.9.0",
"babel-preset-es2015": "^6.14.0",
"babel-register": "^6.9.0",
"babelify": "^7.3.0",
"blanket": "^1.1.6",
"browserify-derequire": "^0.9.4",
"browserify-istanbul": "^0.2.1",
"browserify-versionify": "^1.0.4",
"bundle-collapser": "^1.2.1",
"chg": "^0.3.2",
"css": "^2.2.0",
"conventional-changelog-cli": "^1.2.0",
"conventional-changelog-videojs": "^3.0.0",
"doctoc": "^1.2.0",
"es5-shim": "^4.1.3",
"es6-shim": "^0.35.1",
"ghooks": "^1.3.2",
"gkatsev-grunt-sass": "^1.1.1",
"grunt": "^0.4.4",
"grunt-aws-s3": "^0.12.1",
"grunt-accessibility": "^5.0.0",
"grunt-babel": "^6.0.0",
"grunt-banner": "^0.4.0",
"grunt-browserify": "3.5.1",
"grunt-cli": "~0.1.13",
"grunt-concurrent": "^1.0.0",
"grunt-concurrent": "^2.3.1",
"grunt-contrib-clean": "~0.4.0a",
"grunt-contrib-concat": "^0.5.1",
"grunt-contrib-connect": "~0.7.1",
"grunt-contrib-copy": "^0.8.0",
"grunt-contrib-cssmin": "~0.6.0",
"grunt-contrib-jshint": "~0.11.3",
"grunt-contrib-less": "~0.6.4",
"grunt-contrib-uglify": "^0.8.0",
"grunt-contrib-cssmin": "~1.0.2",
"grunt-contrib-uglify": "^2.0.0",
"grunt-contrib-watch": "~0.1.4",
"grunt-coveralls": "^1.0.0",
"grunt-exorcise": "^1.0.1",
"grunt-fastly": "^0.1.3",
"grunt-github-releaser": "^0.1.17",
"grunt-karma": "^0.8.3",
"grunt-karma": "^2.0.0",
"grunt-shell": "^2.0.0",
"grunt-version": "~0.3.0",
"grunt-videojs-languages": "0.0.4",
"grunt-zip": "0.10.2",
"karma": "^0.12.36",
"karma-browserify": "^4.0.0",
"karma-browserstack-launcher": "^0.1.4",
"karma-chrome-launcher": "^0.1.3",
"karma-coverage": "^0.4.0",
"karma-detect-browsers": "^2.0.2",
"karma-firefox-launcher": "^0.1.3",
"karma-ie-launcher": "^0.1.5",
"karma-opera-launcher": "~0.1.0",
"karma-qunit": "^0.1.2",
"karma-safari-launcher": "^0.1.1",
"karma-sinon": "^1.0.3",
"karma": "^1.2.0",
"karma-browserify": "^5.1.0",
"karma-browserstack-launcher": "^1.0.1",
"karma-chrome-launcher": "^2.0.0",
"karma-coverage": "^1.1.1",
"karma-detect-browsers": "~2.2.3",
"karma-firefox-launcher": "^1.0.0",
"karma-ie-launcher": "^1.0.0",
"karma-opera-launcher": "^1.0.0",
"karma-qunit": "^1.2.0",
"karma-safari-launcher": "^1.0.0",
"karma-sinon": "^1.0.5",
"load-grunt-tasks": "^3.1.0",
"markdown-table": "^1.0.0",
"npm-run": "^4.1.0",
"proxyquireify": "^3.0.0",
"qunitjs": "^1.18.0",
"qunitjs": "^1.23.1",
"sinon": "^1.16.1",
"time-grunt": "^1.1.1",
"uglify-js": "~2.3.6",
"videojs-doc-generator": "0.0.1"
"uglify-js": "~2.7.3",
"videojs-doc-generator": "0.0.1",
"videojs-standard": "^5.2.0",
"webpack": "^1.13.2"
},
"standard": {
"vjsstandard": {
"ignore": [
"**/Gruntfile.js",
"**/es5/**",
"**/build/**",
"**/dist/**",
"**/docs/**",
"**/lang/**",
"**/sandbox/**",
"**/test/**"
"**/test/api/**",
"**/test/coverage/**",
"**/test/karma.conf.js"
]
},
"config": {
"ghooks": {
"pre-push": "npm run lint -- --errors"
}
}
}
+1 -1
Ver Arquivo
@@ -86,7 +86,7 @@
-webkit-user-select: $string;
-moz-user-select: $string;
-ms-user-select: $string;
user-select: $string
user-select: $string;
}
// https://developer.mozilla.org/en-US/docs/Web/CSS/box-shadow
-16
Ver Arquivo
@@ -20,9 +20,6 @@
@include transition($trans);
}
// IE 8 hack for media queries
$ie8screen: "\\0screen";
// Video has started playing AND user is inactive
.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar {
// Remain visible for screen reader and keyboard users
@@ -32,10 +29,6 @@ $ie8screen: "\\0screen";
$trans: visibility 1.0s, opacity 1.0s;
@include transition($trans);
// Make controls hidden in IE8 for now
@media #{$ie8screen} {
visibility: hidden;
}
}
.vjs-controls-disabled .vjs-control-bar,
@@ -51,15 +44,6 @@ $ie8screen: "\\0screen";
visibility: visible;
}
// IE8 is flakey with fonts, and you have to change the actual content to force
// fonts to show/hide properly.
// - "\9" IE8 hack didn't work for this
// Found in XP IE8 from http://modern.ie. Does not show up in "IE8 mode" in IE9
.vjs-user-inactive.vjs-playing .vjs-control-bar :before {
@media #{$ie8screen} { content: ""; }
}
// IE 8 + 9 Support
.vjs-has-started.vjs-no-flex .vjs-control-bar {
display: table;
-2
Ver Arquivo
@@ -1,8 +1,6 @@
.video-js .vjs-fullscreen-control {
cursor: pointer;
@include flex(none);
}
.video-js .vjs-fullscreen-control {
@extend .vjs-icon-fullscreen-enter;
}
// Switch to the exit icon when the player is in fullscreen
-2
Ver Arquivo
@@ -1,8 +1,6 @@
.video-js .vjs-play-control {
cursor: pointer;
@include flex(none);
}
.video-js .vjs-play-control {
@extend .vjs-icon-play;
}
.video-js .vjs-play-control.vjs-playing {
+1 -1
Ver Arquivo
@@ -31,7 +31,7 @@
// We need an increased hit area on hover
.video-js .vjs-progress-control:hover .vjs-progress-holder {
font-size: 1.666666666666666666em
font-size: 1.666666666666666666em;
}
/* If we let the font size grow as much as everything else, the current time tooltip ends up
+2 -1
Ver Arquivo
@@ -14,7 +14,8 @@
.vjs-menu .vjs-menu-content {
display: block;
padding: 0; margin: 0;
padding: 0;
margin: 0;
overflow: auto;
font-family: $text-font-family;
}
+11
Ver Arquivo
@@ -0,0 +1,11 @@
@media \0screen {
.vjs-user-inactive.vjs-playing .vjs-control-bar :before {
content: "";
}
}
@media \0screen {
.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar {
visibility: hidden;
}
}
-18
Ver Arquivo
@@ -1,18 +0,0 @@
/**
* @file base-styles.js
*
* This code injects the required base styles in the head of the document.
*/
import window from 'global/window';
import document from 'global/document';
if (window.VIDEOJS_NO_BASE_THEME) return;
const styles = '{{GENERATED_STYLES}}';
if (styles === '{{GENERATED'+'_STYLES}}');
const styleNode = document.createElement('style');
styleNode.innerHTML = styles;
document.head.insertBefore(styleNode, document.head.firstChild);
-4
Ver Arquivo
@@ -15,10 +15,6 @@ import Component from './component.js';
*/
class BigPlayButton extends Button {
constructor(player, options) {
super(player, options);
}
/**
* Allow sub components to stack CSS class names
*
+38 -16
Ver Arquivo
@@ -3,10 +3,7 @@
*/
import ClickableComponent from './clickable-component.js';
import Component from './component';
import * as Events from './utils/events.js';
import * as Fn from './utils/fn.js';
import log from './utils/log.js';
import document from 'global/document';
import assign from 'object.assign';
/**
@@ -19,10 +16,6 @@ import assign from 'object.assign';
*/
class Button extends ClickableComponent {
constructor(player, options) {
super(player, options);
}
/**
* Create the component's DOM element
*
@@ -32,7 +25,7 @@ class Button extends ClickableComponent {
* @return {Element}
* @method createEl
*/
createEl(tag='button', props={}, attributes={}) {
createEl(tag = 'button', props = {}, attributes = {}) {
props = assign({
className: this.buildCSSClass()
}, props);
@@ -53,11 +46,15 @@ class Button extends ClickableComponent {
// Add attributes for button element
attributes = assign({
type: 'button', // Necessary since the default button type is "submit"
'aria-live': 'polite' // let the screen reader user know that the text of the button may change
// Necessary since the default button type is "submit"
'type': 'button',
// let the screen reader user know that the text of the button may change
'aria-live': 'polite'
}, attributes);
let el = Component.prototype.createEl.call(this, tag, props, attributes);
const el = Component.prototype.createEl.call(this, tag, props, attributes);
this.createControlTextEl(el);
@@ -73,27 +70,52 @@ class Button extends ClickableComponent {
* @deprecated
* @method addChild
*/
addChild(child, options={}) {
let className = this.constructor.name;
addChild(child, options = {}) {
const className = this.constructor.name;
log.warn(`Adding an actionable (user controllable) child to a Button (${className}) is not supported; use a ClickableComponent instead.`);
// Avoid the error message generated by ClickableComponent's addChild method
return Component.prototype.addChild.call(this, child, options);
}
/**
* Enable the button element
*
* @return {Component}
* @method enable
*/
enable() {
super.enable();
this.el_.removeAttribute('disabled');
}
/**
* Disable the button element
*
* @return {Component}
* @method disable
*/
disable() {
super.disable();
this.el_.setAttribute('disabled', 'disabled');
}
/**
* Handle KeyPress (document level) - Extend with specific functionality for button
*
* @method handleKeyPress
*/
handleKeyPress(event) {
// Ignore Space (32) or Enter (13) key operation, which is handled by the browser for a button.
if (event.which === 32 || event.which === 13) {
} else {
super.handleKeyPress(event); // Pass keypress handling up for unsupported keys
return;
}
}
// Pass keypress handling up for unsupported keys
super.handleKeyPress(event);
}
}
Component.registerComponent('Button', Button);
+32 -32
Ver Arquivo
@@ -24,10 +24,7 @@ class ClickableComponent extends Component {
this.emitTapEvents();
this.on('tap', this.handleClick);
this.on('click', this.handleClick);
this.on('focus', this.handleFocus);
this.on('blur', this.handleBlur);
this.enable();
}
/**
@@ -39,7 +36,7 @@ class ClickableComponent extends Component {
* @return {Element}
* @method createEl
*/
createEl(tag='div', props={}, attributes={}) {
createEl(tag = 'div', props = {}, attributes = {}) {
props = assign({
className: this.buildCSSClass(),
tabIndex: 0
@@ -51,11 +48,15 @@ class ClickableComponent extends Component {
// Add ARIA attributes for clickable element which is not a native HTML button
attributes = assign({
role: 'button',
'aria-live': 'polite' // let the screen reader user know that the text of the element may change
'role': 'button',
// let the screen reader user know that the text of the element may change
'aria-live': 'polite'
}, attributes);
let el = super.createEl(tag, props, attributes);
this.tabIndex_ = props.tabIndex;
const el = super.createEl(tag, props, attributes);
this.createControlTextEl(el);
@@ -91,9 +92,11 @@ class ClickableComponent extends Component {
* @return {String}
* @method controlText
*/
controlText(text, el=this.el()) {
if (!text) return this.controlText_ || 'Need Text';
controlText(text, el = this.el()) {
if (!text) {
return this.controlText_ || 'Need Text';
}
const localizedText = this.localize(text);
this.controlText_ = text;
@@ -113,26 +116,6 @@ class ClickableComponent extends Component {
return `vjs-control vjs-button ${super.buildCSSClass()}`;
}
/**
* Adds a child component inside this clickable-component
*
* @param {String|Component} child The class name or instance of a child to add
* @param {Object=} options Options, including options to be passed to children of the child.
* @return {Component} The child component (created by this process if a string was used)
* @method addChild
*/
addChild(child, options={}) {
// TODO: Fix adding an actionable child to a ClickableComponent; currently
// it will cause issues with assistive technology (e.g. screen readers)
// which support ARIA, since an element with role="button" cannot have
// actionable child elements.
//let className = this.constructor.name;
//log.warn(`Adding a child to a ClickableComponent (${className}) can cause issues with assistive technology which supports ARIA, since an element with role="button" cannot have actionable child elements.`);
return super.addChild(child, options);
}
/**
* Enable the component element
*
@@ -142,6 +125,13 @@ class ClickableComponent extends Component {
enable() {
this.removeClass('vjs-disabled');
this.el_.setAttribute('aria-disabled', 'false');
if (typeof this.tabIndex_ !== 'undefined') {
this.el_.setAttribute('tabIndex', this.tabIndex_);
}
this.on('tap', this.handleClick);
this.on('click', this.handleClick);
this.on('focus', this.handleFocus);
this.on('blur', this.handleBlur);
return this;
}
@@ -154,6 +144,13 @@ class ClickableComponent extends Component {
disable() {
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('focus', this.handleFocus);
this.off('blur', this.handleBlur);
return this;
}
@@ -179,12 +176,15 @@ class ClickableComponent extends Component {
* @method handleKeyPress
*/
handleKeyPress(event) {
// 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);
} else if (super.handleKeyPress) {
super.handleKeyPress(event); // Pass keypress handling up for unsupported keys
// Pass keypress handling up for unsupported keys
super.handleKeyPress(event);
}
}
+113 -50
Ver Arquivo
@@ -3,7 +3,6 @@
*
* Player Component - Base class for all UI objects
*/
import window from 'global/window';
import * as Dom from './utils/dom.js';
import * as Fn from './utils/fn.js';
@@ -11,10 +10,8 @@ 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 assign from 'object.assign';
import mergeOptions from './utils/merge-options.js';
/**
* Base UI Component class
* Components are embeddable UI objects that are represented by both a
@@ -32,7 +29,7 @@ import mergeOptions from './utils/merge-options.js';
* ```
* Components are also event targets.
* ```js
* button.on('click', function(){
* button.on('click', function() {
* console.log('Button Clicked!');
* });
* button.trigger('customevent');
@@ -66,7 +63,7 @@ class Component {
// If there was no ID from the options, generate one
if (!this.id_) {
// Don't require the player ID function in the case of mock players
let id = player && player.id && player.id() || 'no_player';
const id = player && player.id && player.id() || 'no_player';
this.id_ = `${id}_component_${Guid.newGUID()}`;
}
@@ -219,21 +216,21 @@ class Component {
}
localize(string) {
let code = this.player_.language && this.player_.language();
let languages = this.player_.languages && this.player_.languages();
const code = this.player_.language && this.player_.language();
const languages = this.player_.languages && this.player_.languages();
if (!code || !languages) {
return string;
}
let language = languages[code];
const language = languages[code];
if (language && language[string]) {
return language[string];
}
let primaryCode = code.split('-')[0];
let primaryLang = languages[primaryCode];
const primaryCode = code.split('-')[0];
const primaryLang = languages[primaryCode];
if (primaryLang && primaryLang[string]) {
return primaryLang[string];
@@ -309,6 +306,12 @@ class Component {
* @method getChild
*/
getChild(name) {
if (!name) {
return;
}
name = toTitleCase(name);
return this.childNameIndex_[name];
}
@@ -340,13 +343,13 @@ class Component {
* @return {Component} The child component (created by this process if a string was used)
* @method addChild
*/
addChild(child, options={}, index=this.children_.length) {
addChild(child, options = {}, index = this.children_.length) {
let component;
let componentName;
// If child is a string, create nt with options
// If child is a string, create component with options
if (typeof child === 'string') {
componentName = child;
componentName = toTitleCase(child);
// Options can also be specified as a boolean, so convert to an empty object if false.
if (!options) {
@@ -359,16 +362,14 @@ class Component {
options = {};
}
// If no componentClass in options, assume componentClass is the name lowercased
// (e.g. playButton)
let componentClassName = options.componentClass || toTitleCase(componentName);
const componentClassName = options.componentClass || componentName;
// Set name through options
options.name = componentName;
// Create a new object & element for this controls set
// If there's no .player_, this is a player
let ComponentClass = Component.getComponent(componentClassName);
const ComponentClass = Component.getComponent(componentClassName);
if (!ComponentClass) {
throw new Error(`Component ${componentClassName} does not exist`);
@@ -406,8 +407,9 @@ class Component {
// Add the UI object's element to the container div (box)
// Having an element is not required
if (typeof component.el === 'function' && component.el()) {
let childNodes = this.contentEl().children;
let refNode = childNodes[index] || null;
const childNodes = this.contentEl().children;
const refNode = childNodes[index] || null;
this.contentEl().insertBefore(component.el(), refNode);
}
@@ -448,7 +450,7 @@ class Component {
this.childIndex_[component.id()] = null;
this.childNameIndex_[component.name()] = null;
let compEl = component.el();
const compEl = component.el();
if (compEl && compEl.parentNode === this.contentEl()) {
this.contentEl().removeChild(component.el());
@@ -502,14 +504,14 @@ class Component {
* @method initChildren
*/
initChildren() {
let children = this.options_.children;
const children = this.options_.children;
if (children) {
// `this` is `parent`
let parentOptions = this.options_;
const parentOptions = this.options_;
let handleAdd = (child) => {
let name = child.name;
const handleAdd = (child) => {
const name = child.name;
let opts = child.opts;
// Allow options for children to be set at the parent options
@@ -539,7 +541,8 @@ class Component {
// Add a direct reference to the child by name on the parent instance.
// If two of the same component are used, different names should be supplied
// for each
let newChild = this.addChild(name, opts);
const newChild = this.addChild(name, opts);
if (newChild) {
this[name] = newChild;
}
@@ -547,7 +550,7 @@ class Component {
// Allow for an array of children details to passed in the options
let workingChildren;
let Tech = Component.getComponent('Tech');
const Tech = Component.getComponent('Tech');
if (Array.isArray(children)) {
workingChildren = children;
@@ -563,13 +566,13 @@ class Component {
return !workingChildren.some(function(wchild) {
if (typeof wchild === 'string') {
return child === wchild;
} else {
return child === wchild.name;
}
return child === wchild.name;
});
}))
.map((child) => {
let name, opts;
let name;
let opts;
if (typeof child === 'string') {
name = child;
@@ -585,8 +588,9 @@ class Component {
// we have to make sure that child.name isn't in the techOrder since
// techs are registerd as Components but can't aren't compatible
// See https://github.com/videojs/video.js/issues/2772
let c = Component.getComponent(child.opts.componentClass ||
const c = Component.getComponent(child.opts.componentClass ||
toTitleCase(child.name));
return c && !Tech.isTech(c);
})
.forEach(handleAdd);
@@ -608,7 +612,7 @@ class Component {
/**
* Add an event listener to this component's element
* ```js
* var myFunc = function(){
* var myFunc = function() {
* var myComponent = this;
* // Do something when the event is fired
* };
@@ -797,7 +801,7 @@ class Component {
* @return {Component}
* @method ready
*/
ready(fn, sync=false) {
ready(fn, sync = false) {
if (fn) {
if (this.isReady_) {
if (sync) {
@@ -824,14 +828,14 @@ class Component {
this.isReady_ = true;
// Ensure ready is triggerd asynchronously
this.setTimeout(function(){
let readyQueue = this.readyQueue_;
this.setTimeout(function() {
const readyQueue = this.readyQueue_;
// Reset Ready Queue
this.readyQueue_ = [];
if (readyQueue && readyQueue.length > 0) {
readyQueue.forEach(function(fn){
readyQueue.forEach(function(fn) {
fn.call(this);
}, this);
}
@@ -981,6 +985,42 @@ class Component {
return this;
}
/**
* Get the value of an attribute on the component's element
*
* @param {String} attribute Attribute to get
* @return {String}
* @method getAttribute
*/
getAttribute(attribute) {
return Dom.getAttribute(this.el_, attribute);
}
/**
* Set the value of an attribute on the component's element
*
* @param {String} attribute Attribute to set
* @param {String} value Value to set the attribute to
* @return {Component}
* @method setAttribute
*/
setAttribute(attribute, value) {
Dom.setAttribute(this.el_, attribute, value);
return this;
}
/**
* Remove an attribute from the component's element
*
* @param {String} attribute Attribute to remove
* @return {Component}
* @method removeAttribute
*/
removeAttribute(attribute) {
Dom.removeAttribute(this.el_, attribute);
return this;
}
/**
* Set or get the width of the component (CSS values)
* Setting the video tag dimension values only works with values in pixels.
@@ -1077,8 +1117,8 @@ class Component {
}
// Get dimension value from style
let val = this.el_.style[widthOrHeight];
let pxIndex = val.indexOf('px');
const val = this.el_.style[widthOrHeight];
const pxIndex = val.indexOf('px');
if (pxIndex !== -1) {
// Return the pixel value with no 'px'
@@ -1106,16 +1146,22 @@ class Component {
if (typeof window.getComputedStyle === 'function') {
const computedStyle = window.getComputedStyle(this.el_);
computedWidthOrHeight = computedStyle.getPropertyValue(widthOrHeight) || computedStyle[widthOrHeight];
} else if (this.el_.currentStyle) {
// ie 8 doesn't support computed style, shim it
// return clientWidth or clientHeight instead for better accuracy
const rule = `offset${toTitleCase(widthOrHeight)}`;
computedWidthOrHeight = this.el_[rule];
}
// remove 'px' from variable and parse as integer
computedWidthOrHeight = parseFloat(computedWidthOrHeight);
// if the computed value is still 0, it's possible that the browser is lying
// and we want to check the offset values.
// This code also runs on IE8 and wherever getComputedStyle doesn't exist.
if (computedWidthOrHeight === 0) {
const rule = `offset${toTitleCase(widthOrHeight)}`;
computedWidthOrHeight = this.el_[rule];
}
return computedWidthOrHeight;
}
@@ -1176,8 +1222,11 @@ class Component {
this.on('touchstart', function(event) {
// If more than one finger, don't consider treating this as a click
if (event.touches.length === 1) {
// Copy the touches object to prevent modifying the original
firstTouch = assign({}, event.touches[0]);
// Copy pageX/pageY from the object
firstTouch = {
pageX: event.touches[0].pageX,
pageY: event.touches[0].pageY
};
// Record start time so we can detect a tap vs. "touch and hold"
touchStart = new Date().getTime();
// Reset couldBeTap tracking
@@ -1194,7 +1243,7 @@ class Component {
// So, if we moved only a small distance, this could still be a tap
const xdiff = event.touches[0].pageX - firstTouch.pageX;
const ydiff = event.touches[0].pageY - firstTouch.pageY;
const touchDistance = Math.sqrt(xdiff * xdiff + ydiff * ydiff);
const touchDistance = Math.sqrt(xdiff * xdiff + ydiff * ydiff);
if (touchDistance > tapMovementThreshold) {
couldBeTap = false;
@@ -1297,7 +1346,7 @@ class Component {
fn = Fn.bind(this, fn);
// window.setTimeout would be preferable here, but due to some bizarre issue with Sinon and/or Phantomjs, we can't.
let timeoutId = window.setTimeout(fn, timeout);
const timeoutId = window.setTimeout(fn, timeout);
const disposeFn = function() {
this.clearTimeout(timeoutId);
@@ -1340,7 +1389,7 @@ class Component {
setInterval(fn, interval) {
fn = Fn.bind(this, fn);
let intervalId = window.setInterval(fn, interval);
const intervalId = window.setInterval(fn, interval);
const disposeFn = function() {
this.clearInterval(intervalId);
@@ -1381,11 +1430,18 @@ class Component {
* @method registerComponent
*/
static registerComponent(name, comp) {
if (!name) {
return;
}
name = toTitleCase(name);
if (!Component.components_) {
Component.components_ = {};
}
Component.components_[name] = comp;
return comp;
}
@@ -1398,12 +1454,19 @@ class Component {
* @method getComponent
*/
static getComponent(name) {
if (!name) {
return;
}
name = toTitleCase(name);
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];
}
}
@@ -1425,7 +1488,7 @@ class Component {
// 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
let init = props.init || props.init || this.prototype.init || this.prototype.init || function() {};
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);`
@@ -1435,7 +1498,7 @@ class Component {
// `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.
let subObj = function() {
const subObj = function() {
init.apply(this, arguments);
};
@@ -1449,7 +1512,7 @@ class Component {
subObj.extend = Component.extend;
// Extend subObj's prototype with functions and other properties from props
for (let name in props) {
for (const name in props) {
if (props.hasOwnProperty(name)) {
subObj.prototype[name] = props[name];
}
@@ -3,7 +3,6 @@
*/
import TrackButton from '../track-button.js';
import Component from '../../component.js';
import * as Fn from '../../utils/fn.js';
import AudioTrackMenuItem from './audio-track-menu-item.js';
/**
@@ -40,25 +39,25 @@ class AudioTrackButton extends TrackButton {
* @method createItems
*/
createItems(items = []) {
let tracks = this.player_.audioTracks && this.player_.audioTracks();
const tracks = this.player_.audioTracks && this.player_.audioTracks();
if (!tracks) {
return items;
}
for (let i = 0; i < tracks.length; i++) {
let track = tracks[i];
const track = tracks[i];
items.push(new AudioTrackMenuItem(this.player_, {
track,
// MenuItem is selectable
'selectable': true,
'track': track
selectable: true
}));
}
return items;
}
}
AudioTrackButton.prototype.controlText_ = 'Audio Track';
Component.registerComponent('AudioTrackButton', AudioTrackButton);
export default AudioTrackButton;
@@ -15,8 +15,8 @@ import * as Fn from '../../utils/fn.js';
*/
class AudioTrackMenuItem extends MenuItem {
constructor(player, options) {
let track = options.track;
let tracks = player.audioTracks();
const track = options.track;
const tracks = player.audioTracks();
// Modify options for parent MenuItem class's init.
options.label = track.label || track.language || 'Unknown';
@@ -27,7 +27,7 @@ class AudioTrackMenuItem extends MenuItem {
this.track = track;
if (tracks) {
let changeHandler = Fn.bind(this, this.handleTracksChange);
const changeHandler = Fn.bind(this, this.handleTracksChange);
tracks.addEventListener('change', changeHandler);
this.on('dispose', () => {
@@ -42,18 +42,18 @@ class AudioTrackMenuItem extends MenuItem {
* @method handleClick
*/
handleClick(event) {
let tracks = this.player_.audioTracks();
const tracks = this.player_.audioTracks();
super.handleClick(event);
if (!tracks) return;
if (!tracks) {
return;
}
for (let i = 0; i < tracks.length; i++) {
let track = tracks[i];
const track = tracks[i];
if (track === this.track) {
track.enabled = true;
}
track.enabled = track === this.track;
}
}
+20 -19
Ver Arquivo
@@ -4,24 +4,24 @@
import Component from '../component.js';
// Required children
import PlayToggle from './play-toggle.js';
import CurrentTimeDisplay from './time-controls/current-time-display.js';
import DurationDisplay from './time-controls/duration-display.js';
import TimeDivider from './time-controls/time-divider.js';
import RemainingTimeDisplay from './time-controls/remaining-time-display.js';
import LiveDisplay from './live-display.js';
import ProgressControl from './progress-control/progress-control.js';
import FullscreenToggle from './fullscreen-toggle.js';
import VolumeControl from './volume-control/volume-control.js';
import VolumeMenuButton from './volume-menu-button.js';
import MuteToggle from './mute-toggle.js';
import ChaptersButton from './text-track-controls/chapters-button.js';
import DescriptionsButton from './text-track-controls/descriptions-button.js';
import SubtitlesButton from './text-track-controls/subtitles-button.js';
import CaptionsButton from './text-track-controls/captions-button.js';
import AudioTrackButton from './audio-track-controls/audio-track-button.js';
import PlaybackRateMenuButton from './playback-rate-menu/playback-rate-menu-button.js';
import CustomControlSpacer from './spacer-controls/custom-control-spacer.js';
import './play-toggle.js';
import './time-controls/current-time-display.js';
import './time-controls/duration-display.js';
import './time-controls/time-divider.js';
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 './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 './audio-track-controls/audio-track-button.js';
import './playback-rate-menu/playback-rate-menu-button.js';
import './spacer-controls/custom-control-spacer.js';
/**
* Container of main controls
@@ -42,7 +42,8 @@ class ControlBar extends Component {
className: 'vjs-control-bar',
dir: 'ltr'
}, {
'role': 'group' // The control bar is a group, so it can contain menuitems
// The control bar is a group, so it can contain menuitems
role: 'group'
});
}
}
+17 -3
Ver Arquivo
@@ -12,6 +12,11 @@ import Component from '../component.js';
*/
class FullscreenToggle extends Button {
constructor(player, options) {
super(player, options);
this.on(player, 'fullscreenchange', this.handleFullscreenChange);
}
/**
* Allow sub components to stack CSS class names
*
@@ -21,7 +26,18 @@ class FullscreenToggle extends Button {
buildCSSClass() {
return `vjs-fullscreen-control ${super.buildCSSClass()}`;
}
/**
* Handles Fullscreenchange on the component and change control text accordingly
*
* @method handleFullscreenChange
*/
handleFullscreenChange() {
if (this.player_.isFullscreen()) {
this.controlText('Non-Fullscreen');
} else {
this.controlText('Fullscreen');
}
}
/**
* Handles click for full screen
*
@@ -30,10 +46,8 @@ class FullscreenToggle extends Button {
handleClick() {
if (!this.player_.isFullscreen()) {
this.player_.requestFullscreen();
this.controlText('Non-Fullscreen');
} else {
this.player_.exitFullscreen();
this.controlText('Fullscreen');
}
}
+1 -1
Ver Arquivo
@@ -27,7 +27,7 @@ class LiveDisplay extends Component {
* @method createEl
*/
createEl() {
var el = super.createEl('div', {
const el = super.createEl('div', {
className: 'vjs-live-control vjs-control'
});
+11 -9
Ver Arquivo
@@ -21,14 +21,15 @@ class MuteToggle extends Button {
this.on(player, 'volumechange', this.update);
// hide mute toggle if the current tech doesn't support volume control
if (player.tech_ && player.tech_['featuresVolumeControl'] === false) {
if (player.tech_ && player.tech_.featuresVolumeControl === false) {
this.addClass('vjs-hidden');
}
this.on(player, 'loadstart', function() {
this.update(); // We need to update the button to account for a default muted state.
// We need to update the button to account for a default muted state.
this.update();
if (player.tech_['featuresVolumeControl'] === false) {
if (player.tech_.featuresVolumeControl === false) {
this.addClass('vjs-hidden');
} else {
this.removeClass('vjs-hidden');
@@ -52,7 +53,7 @@ class MuteToggle extends Button {
* @method handleClick
*/
handleClick() {
this.player_.muted( this.player_.muted() ? false : true );
this.player_.muted(this.player_.muted() ? false : true);
}
/**
@@ -61,8 +62,8 @@ class MuteToggle extends Button {
* @method update
*/
update() {
var vol = this.player_.volume(),
level = 3;
const vol = this.player_.volume();
let level = 3;
if (vol === 0 || this.player_.muted()) {
level = 0;
@@ -75,13 +76,14 @@ class MuteToggle extends Button {
// Don't rewrite the button text if the actual text doesn't change.
// This causes unnecessary and confusing information for screen reader users.
// This check is needed because this function gets called every time the volume level is changed.
let toMute = this.player_.muted() ? 'Unmute' : 'Mute';
const toMute = this.player_.muted() ? 'Unmute' : 'Mute';
if (this.controlText() !== toMute) {
this.controlText(toMute);
}
/* TODO improve muted icon classes */
for (var i = 0; i < 4; i++) {
// TODO improve muted icon classes
for (let i = 0; i < 4; i++) {
Dom.removeElClass(this.el_, `vjs-vol-${i}`);
}
Dom.addElClass(this.el_, `vjs-vol-${level}`);
+5 -3
Ver Arquivo
@@ -14,7 +14,7 @@ import Component from '../component.js';
*/
class PlayToggle extends Button {
constructor(player, options){
constructor(player, options) {
super(player, options);
this.on(player, 'play', this.handlePlay);
@@ -52,7 +52,8 @@ class PlayToggle extends Button {
handlePlay() {
this.removeClass('vjs-paused');
this.addClass('vjs-playing');
this.controlText('Pause'); // change the button text to "Pause"
// change the button text to "Pause"
this.controlText('Pause');
}
/**
@@ -63,7 +64,8 @@ class PlayToggle extends Button {
handlePause() {
this.removeClass('vjs-playing');
this.addClass('vjs-paused');
this.controlText('Play'); // change the button text to "Play"
// change the button text to "Play"
this.controlText('Play');
}
}
@@ -17,7 +17,7 @@ import * as Dom from '../../utils/dom.js';
*/
class PlaybackRateMenuButton extends MenuButton {
constructor(player, options){
constructor(player, options) {
super(player, options);
this.updateVisibility();
@@ -34,7 +34,7 @@ class PlaybackRateMenuButton extends MenuButton {
* @method createEl
*/
createEl() {
let el = super.createEl();
const el = super.createEl();
this.labelEl_ = Dom.createEl('div', {
className: 'vjs-playback-rate-value',
@@ -63,13 +63,13 @@ class PlaybackRateMenuButton extends MenuButton {
* @method createMenu
*/
createMenu() {
let menu = new Menu(this.player());
let rates = this.playbackRates();
const menu = new Menu(this.player());
const rates = this.playbackRates();
if (rates) {
for (let i = rates.length - 1; i >= 0; i--) {
menu.addChild(
new PlaybackRateMenuItem(this.player(), { 'rate': rates[i] + 'x'})
new PlaybackRateMenuItem(this.player(), {rate: rates[i] + 'x'})
);
}
}
@@ -94,12 +94,13 @@ class PlaybackRateMenuButton extends MenuButton {
*/
handleClick() {
// select next rate option
let currentRate = this.player().playbackRate();
let rates = this.playbackRates();
const currentRate = this.player().playbackRate();
const rates = this.playbackRates();
// this will select first one if the last one currently selected
let newRate = rates[0];
for (let i = 0; i < rates.length ; i++) {
for (let i = 0; i < rates.length; i++) {
if (rates[i] > currentRate) {
newRate = rates[i];
break;
@@ -115,7 +116,7 @@ class PlaybackRateMenuButton extends MenuButton {
* @method playbackRates
*/
playbackRates() {
return this.options_['playbackRates'] || (this.options_.playerOptions && this.options_.playerOptions['playbackRates']);
return this.options_.playbackRates || (this.options_.playerOptions && this.options_.playerOptions.playbackRates);
}
/**
@@ -126,10 +127,10 @@ class PlaybackRateMenuButton extends MenuButton {
* @method playbackRateSupported
*/
playbackRateSupported() {
return this.player().tech_
&& this.player().tech_['featuresPlaybackRate']
&& this.playbackRates()
&& this.playbackRates().length > 0
return this.player().tech_ &&
this.player().tech_.featuresPlaybackRate &&
this.playbackRates() &&
this.playbackRates().length > 0
;
}
@@ -14,13 +14,13 @@ import Component from '../../component.js';
*/
class PlaybackRateMenuItem extends MenuItem {
constructor(player, options){
let label = options['rate'];
let rate = parseFloat(label, 10);
constructor(player, options) {
const label = options.rate;
const rate = parseFloat(label, 10);
// Modify options for parent MenuItem class's init.
options['label'] = label;
options['selected'] = rate === 1;
options.label = label;
options.selected = rate === 1;
super(player, options);
this.label = label;
@@ -14,8 +14,9 @@ import * as Dom from '../../utils/dom.js';
*/
class LoadProgressBar extends Component {
constructor(player, options){
constructor(player, options) {
super(player, options);
this.partEls_ = [];
this.on(player, 'progress', this.update);
}
@@ -38,14 +39,16 @@ class LoadProgressBar extends Component {
* @method update
*/
update() {
let buffered = this.player_.buffered();
let duration = this.player_.duration();
let bufferedEnd = this.player_.bufferedEnd();
let children = this.el_.children;
const buffered = this.player_.buffered();
const duration = this.player_.duration();
const bufferedEnd = this.player_.bufferedEnd();
const children = this.partEls_;
// get the percent width of a time compared to the total end
let percentify = function (time, end){
let percent = (time / end) || 0; // no NaN
const percentify = function(time, end) {
// no NaN
const percent = (time / end) || 0;
return ((percent >= 1 ? 1 : percent) * 100) + '%';
};
@@ -54,12 +57,13 @@ class LoadProgressBar extends Component {
// add child elements to represent the individual buffered time ranges
for (let i = 0; i < buffered.length; i++) {
let start = buffered.start(i);
let end = buffered.end(i);
const start = buffered.start(i);
const end = buffered.end(i);
let part = children[i];
if (!part) {
part = this.el_.appendChild(Dom.createEl());
children[i] = part;
}
// set the percent based on the width of the progress bar (bufferedEnd)
@@ -69,8 +73,9 @@ class LoadProgressBar extends Component {
// remove unused buffered range elements
for (let i = children.length; i > buffered.length; i--) {
this.el_.removeChild(children[i-1]);
this.el_.removeChild(children[i - 1]);
}
children.length = buffered.length;
}
}
@@ -1,12 +1,12 @@
/**
* @file mouse-time-display.js
*/
import window from 'global/window';
import Component from '../../component.js';
import * as Dom from '../../utils/dom.js';
import * as Fn from '../../utils/fn.js';
import formatTime from '../../utils/format-time.js';
import throttle from 'lodash-compat/function/throttle';
import computedStyle from '../../utils/computed-style.js';
/**
* The Mouse Time Display component shows the time you will seek to
@@ -55,24 +55,24 @@ class MouseTimeDisplay extends Component {
}
handleMouseMove(event) {
let duration = this.player_.duration();
let newTime = this.calculateDistance(event) * duration;
let position = event.pageX - Dom.findElPosition(this.el().parentNode).left;
const duration = this.player_.duration();
const newTime = this.calculateDistance(event) * duration;
const position = event.pageX - Dom.findElPosition(this.el().parentNode).left;
this.update(newTime, position);
}
update(newTime, position) {
let time = formatTime(newTime, this.player_.duration());
const time = formatTime(newTime, this.player_.duration());
this.el().style.left = position + 'px';
this.el().setAttribute('data-current-time', time);
if (this.keepTooltipsInside) {
let clampedPosition = this.clampPosition_(position);
let difference = position - clampedPosition + 1;
let tooltipWidth = parseFloat(window.getComputedStyle(this.tooltip).width);
let tooltipWidthHalf = tooltipWidth / 2;
const clampedPosition = this.clampPosition_(position);
const difference = position - clampedPosition + 1;
const tooltipWidth = parseFloat(computedStyle(this.tooltip, 'width'));
const tooltipWidthHalf = tooltipWidth / 2;
this.tooltip.innerHTML = time;
this.tooltip.style.right = `-${tooltipWidthHalf - difference}px`;
@@ -98,9 +98,9 @@ class MouseTimeDisplay extends Component {
return position;
}
let playerWidth = parseFloat(window.getComputedStyle(this.player().el()).width);
let tooltipWidth = parseFloat(window.getComputedStyle(this.tooltip).width);
let tooltipWidthHalf = tooltipWidth / 2;
const playerWidth = parseFloat(computedStyle(this.player().el(), 'width'));
const tooltipWidth = parseFloat(computedStyle(this.tooltip, 'width'));
const tooltipWidthHalf = tooltipWidth / 2;
let actualPosition = position;
if (position < tooltipWidthHalf) {
@@ -3,7 +3,6 @@
*/
import Component from '../../component.js';
import * as Fn from '../../utils/fn.js';
import * as Dom from '../../utils/dom.js';
import formatTime from '../../utils/format-time.js';
/**
@@ -16,7 +15,7 @@ import formatTime from '../../utils/format-time.js';
*/
class PlayProgressBar extends Component {
constructor(player, options){
constructor(player, options) {
super(player, options);
this.updateDataAttr();
this.on(player, 'timeupdate', this.updateDataAttr);
@@ -48,7 +47,8 @@ class PlayProgressBar extends Component {
}
updateDataAttr() {
let time = (this.player_.scrubbing()) ? this.player_.getCache().currentTime : this.player_.currentTime();
const time = (this.player_.scrubbing()) ? this.player_.getCache().currentTime : this.player_.currentTime();
this.el_.setAttribute('data-current-time', formatTime(time, this.player_.duration()));
}
@@ -2,8 +2,9 @@
* @file progress-control.js
*/
import Component from '../../component.js';
import SeekBar from './seek-bar.js';
import MouseTimeDisplay from './mouse-time-display.js';
import './seek-bar.js';
import './mouse-time-display.js';
/**
* The Progress Control component contains the seek bar, load progress,
+26 -17
Ver Arquivo
@@ -1,15 +1,15 @@
/**
* @file seek-bar.js
*/
import window from 'global/window';
import Slider from '../../slider/slider.js';
import Component from '../../component.js';
import LoadProgressBar from './load-progress-bar.js';
import PlayProgressBar from './play-progress-bar.js';
import TooltipProgressBar from './tooltip-progress-bar.js';
import * as Fn from '../../utils/fn.js';
import formatTime from '../../utils/format-time.js';
import assign from 'object.assign';
import computedStyle from '../../utils/computed-style.js';
import './load-progress-bar.js';
import './play-progress-bar.js';
import './tooltip-progress-bar.js';
/**
* Seek Bar and holder for the progress bars
@@ -21,7 +21,7 @@ import assign from 'object.assign';
*/
class SeekBar extends Slider {
constructor(player, options){
constructor(player, options) {
super(player, options);
this.on(player, 'timeupdate', this.updateProgress);
this.on(player, 'ended', this.updateProgress);
@@ -65,9 +65,10 @@ class SeekBar extends Slider {
this.updateAriaAttributes(this.tooltipProgressBar.el_);
this.tooltipProgressBar.el_.style.width = this.bar.el_.style.width;
let playerWidth = parseFloat(window.getComputedStyle(this.player().el()).width);
let tooltipWidth = parseFloat(window.getComputedStyle(this.tooltipProgressBar.tooltip).width);
let tooltipStyle = this.tooltipProgressBar.el().style;
const playerWidth = parseFloat(computedStyle(this.player().el(), 'width'));
const tooltipWidth = parseFloat(computedStyle(this.tooltipProgressBar.tooltip, 'width'));
const tooltipStyle = this.tooltipProgressBar.el().style;
tooltipStyle.maxWidth = Math.floor(playerWidth - (tooltipWidth / 2)) + 'px';
tooltipStyle.minWidth = Math.ceil(tooltipWidth / 2) + 'px';
tooltipStyle.right = `-${tooltipWidth / 2}px`;
@@ -76,9 +77,12 @@ class SeekBar extends Slider {
updateAriaAttributes(el) {
// Allows for smooth scrubbing, when player can't keep up.
let time = (this.player_.scrubbing()) ? this.player_.getCache().currentTime : this.player_.currentTime();
el.setAttribute('aria-valuenow', (this.getPercent() * 100).toFixed(2)); // machine readable value of progress bar (percentage complete)
el.setAttribute('aria-valuetext', formatTime(time, this.player_.duration())); // human readable value of progress bar (time complete)
const time = (this.player_.scrubbing()) ? this.player_.getCache().currentTime : this.player_.currentTime();
// machine readable value of progress bar (percentage complete)
el.setAttribute('aria-valuenow', (this.getPercent() * 100).toFixed(2));
// human readable value of progress bar (time complete)
el.setAttribute('aria-valuetext', formatTime(time, this.player_.duration()));
}
/**
@@ -88,7 +92,8 @@ class SeekBar extends Slider {
* @method getPercent
*/
getPercent() {
let percent = this.player_.currentTime() / this.player_.duration();
const percent = this.player_.currentTime() / this.player_.duration();
return percent >= 1 ? 1 : percent;
}
@@ -115,7 +120,9 @@ class SeekBar extends Slider {
let newTime = this.calculateDistance(event) * this.player_.duration();
// Don't let video end while scrubbing.
if (newTime === this.player_.duration()) { newTime = newTime - 0.1; }
if (newTime === this.player_.duration()) {
newTime = newTime - 0.1;
}
// Set new time (tell player to seek to new time)
this.player_.currentTime(newTime);
@@ -141,7 +148,8 @@ class SeekBar extends Slider {
* @method stepForward
*/
stepForward() {
this.player_.currentTime(this.player_.currentTime() + 5); // more quickly fast forward for keyboard-only users
// more quickly fast forward for keyboard-only users
this.player_.currentTime(this.player_.currentTime() + 5);
}
/**
@@ -150,7 +158,8 @@ class SeekBar extends Slider {
* @method stepBack
*/
stepBack() {
this.player_.currentTime(this.player_.currentTime() - 5); // more quickly rewind for keyboard-only users
// more quickly rewind for keyboard-only users
this.player_.currentTime(this.player_.currentTime() - 5);
}
}
@@ -161,7 +170,7 @@ SeekBar.prototype.options_ = {
'mouseTimeDisplay',
'playProgressBar'
],
'barName': 'playProgressBar'
barName: 'playProgressBar'
};
SeekBar.prototype.playerEvent = 'timeupdate';
@@ -3,7 +3,6 @@
*/
import Component from '../../component.js';
import * as Fn from '../../utils/fn.js';
import * as Dom from '../../utils/dom.js';
import formatTime from '../../utils/format-time.js';
/**
@@ -16,7 +15,7 @@ import formatTime from '../../utils/format-time.js';
*/
class TooltipProgressBar extends Component {
constructor(player, options){
constructor(player, options) {
super(player, options);
this.updateDataAttr();
this.on(player, 'timeupdate', this.updateDataAttr);
@@ -30,7 +29,7 @@ class TooltipProgressBar extends Component {
* @method createEl
*/
createEl() {
let el = super.createEl('div', {
const el = super.createEl('div', {
className: 'vjs-tooltip-progress-bar vjs-slider-bar',
innerHTML: `<div class="vjs-time-tooltip"></div>
<span class="vjs-control-text"><span>${this.localize('Progress')}</span>: 0%</span>`
@@ -42,8 +41,9 @@ class TooltipProgressBar extends Component {
}
updateDataAttr() {
let time = (this.player_.scrubbing()) ? this.player_.getCache().currentTime : this.player_.currentTime();
let formattedTime = formatTime(time, this.player_.duration());
const time = (this.player_.scrubbing()) ? this.player_.getCache().currentTime : this.player_.currentTime();
const formattedTime = formatTime(time, this.player_.duration());
this.el_.setAttribute('data-current-time', formattedTime);
this.tooltip.innerHTML = formattedTime;
}
@@ -29,8 +29,8 @@ class CustomControlSpacer extends Spacer {
* @method createEl
*/
createEl() {
let el = super.createEl({
className: this.buildCSSClass(),
const el = super.createEl({
className: this.buildCSSClass()
});
// No-flex/table-cell mode requires there be some content
@@ -12,24 +12,24 @@ import Component from '../../component.js';
* @extends TextTrackMenuItem
* @class CaptionSettingsMenuItem
*/
class CaptionSettingsMenuItem extends TextTrackMenuItem {
class CaptionSettingsMenuItem extends TextTrackMenuItem {
constructor(player, options) {
options['track'] = {
'kind': options['kind'],
'player': player,
'label': options['kind'] + ' settings',
'selectable': false,
'default': false,
options.track = {
player,
kind: options.kind,
label: options.kind + ' settings',
selectable: false,
default: false,
mode: 'disabled'
};
// CaptionSettingsMenuItem has no concept of 'selected'
options['selectable'] = false;
options.selectable = false;
super(player, options);
this.addClass('vjs-texttrack-settings');
this.controlText(', opens ' + options['kind'] + ' settings dialog');
this.controlText(', opens ' + options.kind + ' settings dialog');
}
/**
@@ -16,9 +16,9 @@ import CaptionSettingsMenuItem from './caption-settings-menu-item.js';
*/
class CaptionsButton extends TextTrackButton {
constructor(player, options, ready){
constructor(player, options, ready) {
super(player, options, ready);
this.el_.setAttribute('aria-label','Captions Menu');
this.el_.setAttribute('aria-label', 'Captions Menu');
}
/**
@@ -38,10 +38,11 @@ class CaptionsButton extends TextTrackButton {
*/
update() {
let threshold = 2;
super.update();
// if native, then threshold is 1 because no settings button
if (this.player().tech_ && this.player().tech_['featuresNativeTextTracks']) {
if (this.player().tech_ && this.player().tech_.featuresNativeTextTracks) {
threshold = 1;
}
@@ -59,10 +60,10 @@ class CaptionsButton extends TextTrackButton {
* @method createItems
*/
createItems() {
let items = [];
const items = [];
if (!(this.player().tech_ && this.player().tech_['featuresNativeTextTracks'])) {
items.push(new CaptionSettingsMenuItem(this.player_, { 'kind': this.kind_ }));
if (!(this.player().tech_ && this.player().tech_.featuresNativeTextTracks)) {
items.push(new CaptionSettingsMenuItem(this.player_, {kind: this.kind_}));
}
return super.createItems(items);
@@ -7,9 +7,7 @@ import TextTrackMenuItem from './text-track-menu-item.js';
import ChaptersTrackMenuItem from './chapters-track-menu-item.js';
import Menu from '../../menu/menu.js';
import * as Dom from '../../utils/dom.js';
import * as Fn from '../../utils/fn.js';
import toTitleCase from '../../utils/to-title-case.js';
import window from 'global/window';
/**
* The button component for toggling and selecting chapters
@@ -24,9 +22,9 @@ import window from 'global/window';
*/
class ChaptersButton extends TextTrackButton {
constructor(player, options, ready){
constructor(player, options, ready) {
super(player, options, ready);
this.el_.setAttribute('aria-label','Chapters Menu');
this.el_.setAttribute('aria-label', 'Chapters Menu');
}
/**
@@ -46,20 +44,18 @@ class ChaptersButton extends TextTrackButton {
* @method createItems
*/
createItems() {
let items = [];
let tracks = this.player_.textTracks();
const items = [];
const tracks = this.player_.textTracks();
if (!tracks) {
return items;
}
for (let i = 0; i < tracks.length; i++) {
let track = tracks[i];
if (track['kind'] === this.kind_) {
items.push(new TextTrackMenuItem(this.player_, {
'track': track
}));
const track = tracks[i];
if (track.kind === this.kind_) {
items.push(new TextTrackMenuItem(this.player_, {track}));
}
}
@@ -73,16 +69,16 @@ class ChaptersButton extends TextTrackButton {
* @method createMenu
*/
createMenu() {
let tracks = this.player_.textTracks() || [];
const tracks = this.player_.textTracks() || [];
let chaptersTrack;
let items = this.items || [];
for (let i = tracks.length - 1; i >= 0; i--) {
// We will always choose the last track as our chaptersTrack
let track = tracks[i];
const track = tracks[i];
if (track['kind'] === this.kind_) {
if (track.kind === this.kind_) {
chaptersTrack = track;
break;
@@ -90,27 +86,30 @@ class ChaptersButton extends TextTrackButton {
}
let menu = this.menu;
if (menu === undefined) {
menu = new Menu(this.player_);
let title = Dom.createEl('li', {
const title = Dom.createEl('li', {
className: 'vjs-menu-title',
innerHTML: toTitleCase(this.kind_),
tabIndex: -1
});
menu.children_.unshift(title);
Dom.insertElFirst(title, menu.contentEl());
} else {
// We will empty out the menu children each time because we want a
// fresh new menu child list each time
items.forEach(item => menu.removeChild(item));
// Empty out the ChaptersButton menu items because we no longer need them
items = [];
// We will empty out the menu children each time because we want a
// fresh new menu child list each time
items.forEach(item => menu.removeChild(item));
// Empty out the ChaptersButton menu items because we no longer need them
items = [];
}
if (chaptersTrack && chaptersTrack.cues == null) {
chaptersTrack['mode'] = 'hidden';
if (chaptersTrack && (chaptersTrack.cues === null || chaptersTrack.cues === undefined)) {
chaptersTrack.mode = 'hidden';
let remoteTextTrackEl = this.player_.remoteTextTrackEls().getTrackElementByTrack_(chaptersTrack);
const remoteTextTrackEl = this.player_.remoteTextTrackEls().getTrackElementByTrack_(chaptersTrack);
if (remoteTextTrackEl) {
remoteTextTrackEl.addEventListener('load', (event) => this.update());
@@ -118,14 +117,14 @@ class ChaptersButton extends TextTrackButton {
}
if (chaptersTrack && chaptersTrack.cues && chaptersTrack.cues.length > 0) {
let cues = chaptersTrack['cues'], cue;
const cues = chaptersTrack.cues;
for (let i = 0, l = cues.length; i < l; i++) {
cue = cues[i];
const cue = cues[i];
let mi = new ChaptersTrackMenuItem(this.player_, {
'track': chaptersTrack,
'cue': cue
const mi = new ChaptersTrackMenuItem(this.player_, {
cue,
track: chaptersTrack
});
items.push(mi);
@@ -15,14 +15,14 @@ import * as Fn from '../../utils/fn.js';
*/
class ChaptersTrackMenuItem extends MenuItem {
constructor(player, options){
let track = options['track'];
let cue = options['cue'];
let currentTime = player.currentTime();
constructor(player, options) {
const track = options.track;
const cue = options.cue;
const currentTime = player.currentTime();
// Modify options for parent MenuItem class's init.
options['label'] = cue.text;
options['selected'] = (cue['startTime'] <= currentTime && currentTime < cue['endTime']);
options.label = cue.text;
options.selected = (cue.startTime <= currentTime && currentTime < cue.endTime);
super(player, options);
this.track = track;
@@ -47,11 +47,11 @@ class ChaptersTrackMenuItem extends MenuItem {
* @method update
*/
update() {
let cue = this.cue;
let currentTime = this.player_.currentTime();
const cue = this.cue;
const currentTime = this.player_.currentTime();
// vjs.log(currentTime, cue.startTime);
this.selected(cue['startTime'] <= currentTime && currentTime < cue['endTime']);
this.selected(cue.startTime <= currentTime && currentTime < cue.endTime);
}
}
@@ -16,14 +16,14 @@ import * as Fn from '../../utils/fn.js';
*/
class DescriptionsButton extends TextTrackButton {
constructor(player, options, ready){
constructor(player, options, ready) {
super(player, options, ready);
this.el_.setAttribute('aria-label', 'Descriptions Menu');
let tracks = player.textTracks();
const tracks = player.textTracks();
if (tracks) {
let changeHandler = Fn.bind(this, this.handleTracksChange);
const changeHandler = Fn.bind(this, this.handleTracksChange);
tracks.addEventListener('change', changeHandler);
this.on('dispose', function() {
@@ -37,14 +37,15 @@ class DescriptionsButton extends TextTrackButton {
*
* @method handleTracksChange
*/
handleTracksChange(event){
let tracks = this.player().textTracks();
handleTracksChange(event) {
const tracks = this.player().textTracks();
let disabled = false;
// Check whether a track of a different kind is showing
for (let i = 0, l = tracks.length; i < l; i++) {
let track = tracks[i];
if (track['kind'] !== this.kind_ && track['mode'] === 'showing') {
const track = tracks[i];
if (track.kind !== this.kind_ && track.mode === 'showing') {
disabled = true;
break;
}
@@ -14,19 +14,19 @@ import Component from '../../component.js';
*/
class OffTextTrackMenuItem extends TextTrackMenuItem {
constructor(player, options){
constructor(player, options) {
// Create pseudo track info
// Requires options['kind']
options['track'] = {
'kind': options['kind'],
'player': player,
'label': options['kind'] + ' off',
'default': false,
'mode': 'disabled'
options.track = {
player,
kind: options.kind,
label: options.kind + ' off',
default: false,
mode: 'disabled'
};
// MenuItem is selectable
options['selectable'] = true;
options.selectable = true;
super(player, options);
this.selected(true);
@@ -38,13 +38,14 @@ class OffTextTrackMenuItem extends TextTrackMenuItem {
* @param {Object} event Event object
* @method handleTracksChange
*/
handleTracksChange(event){
let tracks = this.player().textTracks();
handleTracksChange(event) {
const tracks = this.player().textTracks();
let selected = true;
for (let i = 0, l = tracks.length; i < l; i++) {
let track = tracks[i];
if (track['kind'] === this.track['kind'] && track['mode'] === 'showing') {
const track = tracks[i];
if (track.kind === this.track.kind && track.mode === 'showing') {
selected = false;
break;
}
@@ -15,9 +15,9 @@ import Component from '../../component.js';
*/
class SubtitlesButton extends TextTrackButton {
constructor(player, options, ready){
constructor(player, options, ready) {
super(player, options, ready);
this.el_.setAttribute('aria-label','Subtitles Menu');
this.el_.setAttribute('aria-label', 'Subtitles Menu');
}
/**
@@ -3,7 +3,6 @@
*/
import TrackButton from '../track-button.js';
import Component from '../../component.js';
import * as Fn from '../../utils/fn.js';
import TextTrackMenuItem from './text-track-menu-item.js';
import OffTextTrackMenuItem from './off-text-track-menu-item.js';
@@ -17,7 +16,7 @@ import OffTextTrackMenuItem from './off-text-track-menu-item.js';
*/
class TextTrackButton extends TrackButton {
constructor(player, options = {}){
constructor(player, options = {}) {
options.tracks = player.textTracks();
super(player, options);
@@ -29,25 +28,25 @@ class TextTrackButton extends TrackButton {
* @return {Array} Array of menu items
* @method createItems
*/
createItems(items=[]) {
createItems(items = []) {
// Add an OFF menu item to turn all tracks off
items.push(new OffTextTrackMenuItem(this.player_, { 'kind': this.kind_ }));
items.push(new OffTextTrackMenuItem(this.player_, {kind: this.kind_}));
let tracks = this.player_.textTracks();
const tracks = this.player_.textTracks();
if (!tracks) {
return items;
}
for (let i = 0; i < tracks.length; i++) {
let track = tracks[i];
const track = tracks[i];
// only add tracks that are of the appropriate kind and have a label
if (track['kind'] === this.kind_) {
if (track.kind === this.kind_) {
items.push(new TextTrackMenuItem(this.player_, {
track,
// MenuItem is selectable
'selectable': true,
'track': track
selectable: true
}));
}
}
@@ -17,20 +17,20 @@ import document from 'global/document';
*/
class TextTrackMenuItem extends MenuItem {
constructor(player, options){
let track = options['track'];
let tracks = player.textTracks();
constructor(player, options) {
const track = options.track;
const tracks = player.textTracks();
// Modify options for parent MenuItem class's init.
options['label'] = track['label'] || track['language'] || 'Unknown';
options['selected'] = track['default'] || track['mode'] === 'showing';
options.label = track.label || track.language || 'Unknown';
options.selected = track.default || track.mode === 'showing';
super(player, options);
this.track = track;
if (tracks) {
let changeHandler = Fn.bind(this, this.handleTracksChange);
const changeHandler = Fn.bind(this, this.handleTracksChange);
tracks.addEventListener('change', changeHandler);
this.on('dispose', function() {
@@ -52,7 +52,9 @@ class TextTrackMenuItem extends MenuItem {
// Android 2.3 throws an Illegal Constructor error for window.Event
try {
event = new window.Event('change');
} catch(err){}
} catch (err) {
// continue regardless of error
}
}
if (!event) {
@@ -71,24 +73,26 @@ class TextTrackMenuItem extends MenuItem {
* @method handleClick
*/
handleClick(event) {
let kind = this.track['kind'];
let tracks = this.player_.textTracks();
const kind = this.track.kind;
const tracks = this.player_.textTracks();
super.handleClick(event);
if (!tracks) return;
if (!tracks) {
return;
}
for (let i = 0; i < tracks.length; i++) {
let track = tracks[i];
const track = tracks[i];
if (track['kind'] !== kind) {
if (track.kind !== kind) {
continue;
}
if (track === this.track) {
track['mode'] = 'showing';
track.mode = 'showing';
} else {
track['mode'] = 'disabled';
track.mode = 'disabled';
}
}
}
@@ -98,8 +102,8 @@ class TextTrackMenuItem extends MenuItem {
*
* @method handleTracksChange
*/
handleTracksChange(event){
this.selected(this.track['mode'] === 'showing');
handleTracksChange(event) {
this.selected(this.track.mode === 'showing');
}
}
@@ -15,7 +15,7 @@ import formatTime from '../../utils/format-time.js';
*/
class CurrentTimeDisplay extends Component {
constructor(player, options){
constructor(player, options) {
super(player, options);
this.on(player, 'timeupdate', this.updateContent);
@@ -28,14 +28,14 @@ class CurrentTimeDisplay extends Component {
* @method createEl
*/
createEl() {
let el = super.createEl('div', {
const el = super.createEl('div', {
className: 'vjs-current-time vjs-time-control vjs-control'
});
this.contentEl_ = Dom.createEl('div', {
className: 'vjs-current-time-display',
// label the current time for screen reader users
innerHTML: '<span class="vjs-control-text">Current Time </span>' + '0:00',
innerHTML: '<span class="vjs-control-text">Current Time </span>' + '0:00'
}, {
// tell screen readers not to automatically read the time as it changes
'aria-live': 'off'
@@ -52,9 +52,10 @@ class CurrentTimeDisplay extends Component {
*/
updateContent() {
// Allows for smooth scrubbing, when player can't keep up.
let time = (this.player_.scrubbing()) ? this.player_.getCache().currentTime : this.player_.currentTime();
let localizedText = this.localize('Current Time');
let formattedTime = formatTime(time, this.player_.duration());
const time = (this.player_.scrubbing()) ? this.player_.getCache().currentTime : this.player_.currentTime();
const localizedText = this.localize('Current Time');
const formattedTime = formatTime(time, this.player_.duration());
if (formattedTime !== this.formattedTime_) {
this.formattedTime_ = formattedTime;
this.contentEl_.innerHTML = `<span class="vjs-control-text">${localizedText}</span> ${formattedTime}`;
@@ -15,10 +15,16 @@ import formatTime from '../../utils/format-time.js';
*/
class DurationDisplay extends Component {
constructor(player, options){
constructor(player, options) {
super(player, options);
this.on(player, 'durationchange', this.updateContent);
// Also listen for timeupdate and loadedmetadata because removing those
// listeners could have broken dependent applications/libraries. These
// can likely be removed for 6.0.
this.on(player, 'timeupdate', this.updateContent);
this.on(player, 'loadedmetadata', this.updateContent);
}
/**
@@ -28,7 +34,7 @@ class DurationDisplay extends Component {
* @method createEl
*/
createEl() {
let el = super.createEl('div', {
const el = super.createEl('div', {
className: 'vjs-duration vjs-time-control vjs-control'
});
@@ -51,12 +57,15 @@ class DurationDisplay extends Component {
* @method updateContent
*/
updateContent() {
let duration = this.player_.duration();
const duration = this.player_.duration();
if (duration && this.duration_ !== duration) {
this.duration_ = duration;
let localizedText = this.localize('Duration Time');
let formattedTime = formatTime(duration);
this.contentEl_.innerHTML = `<span class="vjs-control-text">${localizedText}</span> ${formattedTime}`; // label the duration time for screen reader users
const localizedText = this.localize('Duration Time');
const formattedTime = formatTime(duration);
// label the duration time for screen reader users
this.contentEl_.innerHTML = `<span class="vjs-control-text">${localizedText}</span> ${formattedTime}`;
}
}
@@ -15,7 +15,7 @@ import formatTime from '../../utils/format-time.js';
*/
class RemainingTimeDisplay extends Component {
constructor(player, options){
constructor(player, options) {
super(player, options);
this.on(player, 'timeupdate', this.updateContent);
@@ -29,14 +29,14 @@ class RemainingTimeDisplay extends Component {
* @method createEl
*/
createEl() {
let el = super.createEl('div', {
const el = super.createEl('div', {
className: 'vjs-remaining-time vjs-time-control vjs-control'
});
this.contentEl_ = Dom.createEl('div', {
className: 'vjs-remaining-time-display',
// label the remaining time for screen reader users
innerHTML: `<span class="vjs-control-text">${this.localize('Remaining Time')}</span> -0:00`,
innerHTML: `<span class="vjs-control-text">${this.localize('Remaining Time')}</span> -0:00`
}, {
// tell screen readers not to automatically read the time as it changes
'aria-live': 'off'
@@ -55,6 +55,7 @@ class RemainingTimeDisplay extends Component {
if (this.player_.duration()) {
const localizedText = this.localize('Remaining Time');
const formattedTime = formatTime(this.player_.remainingTime());
if (formattedTime !== this.formattedTime_) {
this.formattedTime_ = formattedTime;
this.contentEl_.innerHTML = `<span class="vjs-control-text">${localizedText}</span> -${formattedTime}`;
+4 -3
Ver Arquivo
@@ -15,8 +15,8 @@ import * as Fn from '../utils/fn.js';
*/
class TrackButton extends MenuButton {
constructor(player, options){
let tracks = options.tracks;
constructor(player, options) {
const tracks = options.tracks;
super(player, options);
@@ -28,7 +28,8 @@ class TrackButton extends MenuButton {
return;
}
let updateHandler = Fn.bind(this, this.update);
const updateHandler = Fn.bind(this, this.update);
tracks.addEventListener('removetrack', updateHandler);
tracks.addEventListener('addtrack', updateHandler);
+6 -6
Ver Arquivo
@@ -6,7 +6,7 @@ import Component from '../../component.js';
import * as Fn from '../../utils/fn.js';
// Required children
import VolumeLevel from './volume-level.js';
import './volume-level.js';
/**
* The bar that contains the volume level and can be clicked on to adjust the level
@@ -18,7 +18,7 @@ import VolumeLevel from './volume-level.js';
*/
class VolumeBar extends Slider {
constructor(player, options){
constructor(player, options) {
super(player, options);
this.on(player, 'volumechange', this.updateARIAAttributes);
player.ready(Fn.bind(this, this.updateARIAAttributes));
@@ -63,9 +63,8 @@ class VolumeBar extends Slider {
getPercent() {
if (this.player_.muted()) {
return 0;
} else {
return this.player_.volume();
}
return this.player_.volume();
}
/**
@@ -95,7 +94,8 @@ class VolumeBar extends Slider {
*/
updateARIAAttributes() {
// Current value of volume bar as a percentage
let volume = (this.player_.volume() * 100).toFixed(2);
const volume = (this.player_.volume() * 100).toFixed(2);
this.el_.setAttribute('aria-valuenow', volume);
this.el_.setAttribute('aria-valuetext', volume + '%');
}
@@ -106,7 +106,7 @@ VolumeBar.prototype.options_ = {
children: [
'volumeLevel'
],
'barName': 'volumeLevel'
barName: 'volumeLevel'
};
VolumeBar.prototype.playerEvent = 'volumechange';
@@ -4,7 +4,7 @@
import Component from '../../component.js';
// Required children
import VolumeBar from './volume-bar.js';
import './volume-bar.js';
/**
* The component for controlling the volume level
@@ -16,15 +16,15 @@ import VolumeBar from './volume-bar.js';
*/
class VolumeControl extends Component {
constructor(player, options){
constructor(player, options) {
super(player, options);
// hide volume controls when they're not supported by the current tech
if (player.tech_ && player.tech_['featuresVolumeControl'] === false) {
if (player.tech_ && player.tech_.featuresVolumeControl === false) {
this.addClass('vjs-hidden');
}
this.on(player, 'loadstart', function(){
if (player.tech_['featuresVolumeControl'] === false) {
this.on(player, 'loadstart', function() {
if (player.tech_.featuresVolumeControl === false) {
this.addClass('vjs-hidden');
} else {
this.removeClass('vjs-hidden');
+10 -9
Ver Arquivo
@@ -18,7 +18,7 @@ import VolumeBar from './volume-control/volume-bar.js';
*/
class VolumeMenuButton extends PopupButton {
constructor(player, options={}){
constructor(player, options = {}) {
// Default to inline
if (options.inline === undefined) {
options.inline = true;
@@ -48,7 +48,7 @@ class VolumeMenuButton extends PopupButton {
// hide mute toggle if the current tech doesn't support volume control
function updateVisibility() {
if (player.tech_ && player.tech_['featuresVolumeControl'] === false) {
if (player.tech_ && player.tech_.featuresVolumeControl === false) {
this.addClass('vjs-hidden');
} else {
this.removeClass('vjs-hidden');
@@ -58,19 +58,19 @@ class VolumeMenuButton extends PopupButton {
updateVisibility.call(this);
this.on(player, 'loadstart', updateVisibility);
this.on(this.volumeBar, ['slideractive', 'focus'], function(){
this.on(this.volumeBar, ['slideractive', 'focus'], function() {
this.addClass('vjs-slider-active');
});
this.on(this.volumeBar, ['sliderinactive', 'blur'], function(){
this.on(this.volumeBar, ['sliderinactive', 'blur'], function() {
this.removeClass('vjs-slider-active');
});
this.on(this.volumeBar, ['focus'], function(){
this.on(this.volumeBar, ['focus'], function() {
this.addClass('vjs-lock-showing');
});
this.on(this.volumeBar, ['blur'], function(){
this.on(this.volumeBar, ['blur'], function() {
this.removeClass('vjs-lock-showing');
});
}
@@ -83,7 +83,8 @@ class VolumeMenuButton extends PopupButton {
*/
buildCSSClass() {
let orientationClass = '';
if (!!this.options_.vertical) {
if (this.options_.vertical) {
orientationClass = 'vjs-volume-menu-button-vertical';
} else {
orientationClass = 'vjs-volume-menu-button-horizontal';
@@ -99,11 +100,11 @@ class VolumeMenuButton extends PopupButton {
* @method createPopup
*/
createPopup() {
let popup = new Popup(this.player_, {
const popup = new Popup(this.player_, {
contentElType: 'div'
});
let vb = new VolumeBar(this.player_, this.options_.volumeBar);
const vb = new VolumeBar(this.player_, this.options_.volumeBar);
popup.addChild(vb);
+2 -3
Ver Arquivo
@@ -3,8 +3,6 @@
*/
import Component from './component';
import ModalDialog from './modal-dialog';
import * as Dom from './utils/dom';
import mergeOptions from './utils/merge-options';
/**
@@ -45,7 +43,8 @@ class ErrorDisplay extends ModalDialog {
* @return {String|Null}
*/
content() {
let error = this.player().error();
const error = this.player().error();
return error ? this.localize(error.message) : '';
}
}
+10 -7
Ver Arquivo
@@ -3,41 +3,43 @@
*/
import * as Events from './utils/events.js';
var EventTarget = function() {};
const EventTarget = function() {};
EventTarget.prototype.allowedEvents_ = {};
EventTarget.prototype.on = function(type, fn) {
// Remove the addEventListener alias before calling Events.on
// so we don't get into an infinite type loop
let ael = this.addEventListener;
const ael = this.addEventListener;
this.addEventListener = () => {};
Events.on(this, type, fn);
this.addEventListener = ael;
};
EventTarget.prototype.addEventListener = EventTarget.prototype.on;
EventTarget.prototype.off = function(type, fn) {
Events.off(this, type, fn);
};
EventTarget.prototype.removeEventListener = EventTarget.prototype.off;
EventTarget.prototype.one = function(type, fn) {
// Remove the addEventListener alias before calling Events.on
// so we don't get into an infinite type loop
let ael = this.addEventListener;
const ael = this.addEventListener;
this.addEventListener = () => {};
Events.one(this, type, fn);
this.addEventListener = ael;
};
EventTarget.prototype.trigger = function(event) {
let type = event.type || event;
const type = event.type || event;
if (typeof event === 'string') {
event = {
type: type
};
event = {type};
}
event = Events.fixEvent(event);
@@ -47,6 +49,7 @@ EventTarget.prototype.trigger = function(event) {
Events.trigger(this, event);
};
// The standard DOM EventTarget.dispatchEvent() is aliased to trigger()
EventTarget.prototype.dispatchEvent = EventTarget.prototype.trigger;

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