1
0
mirror of https://github.com/videojs/video.js.git synced 2024-12-12 11:15:04 +02:00
Commit Graph

443 Commits

Author SHA1 Message Date
Garrett
483e5a2ca5 feat: Add getVideoPlaybackQuality API (#4338)
Provides a tech getter for getVideoPlaybackQuality as specified by the W3C's Media Playback Quality API: https://wicg.github.io/media-playback-quality/.
2017-05-12 15:22:02 -04:00
mister-ben
03bab83dde fix: prevent dupe events on enabled ClickableComponents (#4316)
Prevent ClickableComponents re-adding event listeners each time enabled() is called.

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

Fixes #4312
2017-05-11 17:32:20 -04:00
mister-ben
ae423df4f5 feat: Add a version class to the player (#4320)
Adds `vjs-v6` class so you can target that version of Video.js.
2017-05-11 17:15:12 -04:00
Pat O'Neill
0a19cf0d6a feat: Add 'beforepluginsetup' event and named plugin setup events (e.g. 'pluginsetup:foo') (#4255)
This adds a beforepluginsetup event as well as beforepluginsetup:$name and pluginsetup:$name events.

The drive behind this is improving the ability for people to make cross-plugin dependencies in a more robust manner.
2017-05-11 17:13:22 -04:00
mister-ben
da0f1ee681 feat: remove playbackRate blacklist for recent Android Chrome (#4321)
Android Chrome now supports playbackRate properly, so removes the blacklist added in #3246 for newer Chrome versions.
Adds `browser.CHROME_VERSION` as a necessary evil.
No longer blacklists for Chrome 58+ -- this could possibly be fixed since 52, but 58 is all I've been able to test on and most users should keep Chrome up to date.
2017-05-11 16:59:22 -04:00
Gary Katsevman
92e5d9fb5a fix: techOrder names can be camelCased. (#4277)
In the new middleware work, the way that new sources were loaded was refactored. We also recently made techs and components work either TitleCased or camelcased. There was one comparison that didn't do the proper check and cause the tech to be reloaded, even if the two techs were the same.
2017-04-12 17:17:33 -04:00
Kevin Litchfield
46dd0aac11 test: fix IE9 rounding issue with lastvolume test (#4230)
#4227 caused an error in IE9 because it returns back a bad float number.
Instead, we toFixed(1) the response
2017-03-24 18:26:28 -04:00
Kevin Litchfield
16c1e0adc0 fix: keep minimum volume after unmuting above 0.1 (#4227)
If, when unmuting, the last volume is below 0.1, force it to be 0.1.

Fixes #4054.
2017-03-24 15:14:41 -04:00
Brandon Casey
f2b5a057fe fix: removeCue should work with native passed in cue (#4208) 2017-03-23 14:31:41 -04:00
Brandon Casey
90030d5e99 feat: Make pause on open optional for ModalDialog via options (#4186)
* The new option is called pauseOnOpen, and defaults to true
* default pauseOnOpen to false in the `ErrorDisplay`
2017-03-13 11:26:33 -04:00
Pat O'Neill
05e64948c5 chore(test): silence plugin warning from test (#4173) 2017-03-07 14:13:19 -05:00
mister-ben
74eb5d4772 feat: Combine captions and subtitles tracks control (#4028) 2017-03-02 15:23:41 -05:00
Gary Katsevman
f95815bcd0 chore(tests): make tests not print out errors (#4141) 2017-03-02 15:22:59 -05:00
Brandon Casey
a2b1a33606 fix: cues at startTime 0 do not fire (#4152)
Previously timeupdate would fire before the video was playing, and the tech was not ready. This caused issues when preload was set to auto, because cuechange would fire before the video was even started for cues with a startTime of 0.

Wait for tech to be ready before watching for timeupdate
update unit tests to use TechFaker
Add a unit test to verify that we wait for Tech to be ready.
2017-03-02 14:35:45 -05:00
Pat O'Neill
326398d312 feat: don't throw when re-registering a plugin unless it's a player method (#4140) 2017-03-02 11:17:42 -05:00
Gary Katsevman
0f57341e38 fix(cues): only copy cue props that don't exist (#4145) 2017-03-02 11:16:12 -05:00
Gary Katsevman
6874fa2824 chore: increase browserstack/karma timeouts, dispose player in tests (#4135)
Increase timeout because IE8 can take more than 5 minutes to run.
Increase browser disconnect timeout so that browsers that succeed but don't report back to karma don't fail the build.
Make webpack more quiet.
Dispose players created in hooks tests which also increase stability.
2017-02-28 15:02:18 -05:00
Gary Katsevman
576ac19214 fix: addChild instance names should be toTitleCased (#4116) 2017-02-22 14:00:15 -05:00
Gary Katsevman
0d0dea4da8 feat: fix accessibility of the captions setting dialog (#4050)
This fixes a lot of the issues from #2746 by making the dialog inherit from our actual ModalDialog which now has tab focus trapping.

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

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

Fixes #4064.
2017-02-21 15:53:56 -05:00
Brandon Casey
127cd7827e fix: copy basic plugin properties onto the wrapper (#4100)
Copy basic plugin properties to prevent breaking older basic plugins.
2017-02-21 15:49:42 -05:00
mister-ben
405b29b8f1 fix: remove redundant Html5#play()
play() is defined twice in Html5. The promise handling in the earlier one was moved into Player#play().
2017-02-21 15:48:45 -05:00
forbesjo
0da93249d3 fix: make mergeOptions behave the same across browsers (#4088)
* Make an object util function `keys` return an empty array for non objects
* Use that function in object utils instead of `Object.assign`
2017-02-16 16:55:54 -05:00
mister-ben
17143fd9fe fix: Add lang attribute to player el, so that css :lang() is correct (#4046) 2017-02-15 15:22:10 -05:00
Gary Katsevman
0ac126935a fix: localize aria-labels (#4027)
Fixes #2728.
2017-02-08 17:29:32 -05:00
Gary Katsevman
eddc1d71a3 feat: modal dialog accessibility updates (#4025)
If the modal dialog was opened and the focus was preset inside the
player, move the focus to the modal dialog.
When the modal dialog is closed, move the focus back to the previously
active element.
When focus is inside the dialog, trap tab focus. This was inspired by https://github.com/gdkraus/accessible-modal-dialog and ally.js.
2017-02-08 17:29:05 -05:00
Owen Edwards
1b1ba04271 fix: fix the structure of elements in menus to comply with ARIA requirements (#4034)
Fix the structure of elements in menus so that actionable elements are not children of actionable elements, as required by ARIA.
Remove unnecessary aria-labels on menus.
2017-02-08 01:24:30 -05:00
Brandon Casey
6541467ad8 fix: support empty src in Player#src (#4030)
Remove some unnecessary code. Filter the input to remove empty objects and what not.
2017-02-06 15:48:38 -05:00
Brandon Casey
a8f2e43274 feat: videojs.getTech works with TitleCase or camelCase names (#4010)
* Fixes #3986 
* update `techOptions` to look for `TitleCase`/`camelCase` user tech options
* remove deprecated usage of Tech as Component
* add a unit test to verify that registerTech works
* change defaultTech_ to defaultTechOrder_
2017-02-02 14:34:33 -05:00
Brandon Casey
fcb5aa8383 test: add tests for obj.assign util (#4014) 2017-02-02 11:26:45 -05:00
Gary Katsevman
5bde16a1bc test(ie8): only run mute toggle tests in html5 env (#4003)
IE8 can't run the html5 tech and the mute toggle tests rely on a working
volume and mute functionality which tech faker does not have. Instead of
implementing it in tech faker, skip it on non-html5 environments.
2017-01-31 17:15:56 -05:00
Kevin Litchfield
cb42fcfb02 feat: unmute goes back to previously selected volume (#3942)
If a user changed the volume to zero either via the mouse or keyboard, clicking unmute will now restore the volume back to this last position. Previously, the mute and volume values were completely not linked.

Fixes #3909.
2017-01-31 15:29:07 -05:00
Gary Katsevman
03529163b6 feat: Update MW to require a factory, add *-mw (#3969)
Middleware registration now only accept a factory method which takes a player reference and returns some object that represents the middleware with the various methods on it.
Also, add a use to register a middleware for all types.
2017-01-27 15:09:27 -05:00
Pat O'Neill
d7d7cfeb9f feat: Stateful Components (#3960)
Advanced plugins introduced the concept of mixins and added two: evented and stateful.
This provides Components with the benefits of the stateful mixin
2017-01-26 22:04:34 -05:00
Pat O'Neill
4c3b60c3b6 refactor: Evented Components (#3959)
Advanced plugins introduced the concept of mixins and added two: evented and stateful.
This refactors Component to use the evented mixin, granting it event broadcast/handling capabilities.
2017-01-26 20:53:53 -05:00
Gary Katsevman
34aab3f357 feat: middleware (#3788)
Add middleware support. Middleware can function as go-between between the player and the tech. For example, it can modify the duration that the tech returns to the player. In addition, middleware allow for supporting custom video sources and types.

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

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

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

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

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

BREAKING CHANGE: remove flash tech from core.
2017-01-19 16:01:56 -05:00
Pat O'Neill
1ba1f5aabd feat: Time Tooltips (#3836)
Switch to `keepTooltipsInside` by default and simplify DOM structure around the time tooltips and progress control.

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

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

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

BREAKING CHANGE: player methods no longer return a player instance when called. Fixes #3704.
2017-01-18 01:50:22 -05:00
Brandon Casey
091bdf9261 feat: Return the native Promise from play() (#3907)
Return the native Promise from `play()` if it exists. `undefined` is returned otherwise.
This comes in as part of the greater effort to remove method chaining.

BREAKING CHANGE: `play()` no longer returns the player object but instead the native Promise or nothing.
2017-01-18 00:53:11 -05:00
Pat O'Neill
57af15ce8b refactor: Make registerComponent only work with Components (#3802)
Prevent techs (and others) from being registered via registerComponent.
* `registerComponent` now throws if given an object that is not a subclass of Component (or Component itself).
* `registerComponent` now throws if given a non-empty string as its name argument.

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

BREAKING CHANGE: remove the double loadstart handlers that dispose the tech/source handlers if a secondary loadstart event is heard.
2017-01-18 00:38:31 -05:00
Pat O'Neill
844e4f0107 feat: Log Levels (#3853)
Add a log levels and history api: `videojs.log.level()` and `videojs.log.history()`.
`.level()` will return the current level and you can also set it to be one of: `all`, `error`, `off`, or `warn`.
`.history()` will return a list of all things logged since videojs loaded. It can be disabled via `videojs.log.history.disable()` (and re-enabled with `enable()`) as well as cleared with `videojs.log.history.clear()`.
2017-01-18 00:35:42 -05:00
Pat O'Neill
e12bedbb45 refactor: Remove TimeRanges without an index deprecation warning (#3827)
This aligns the methods with the spec.

BREAKING CHANGE: removing ability to use TimeRange methods without an index.
2017-01-18 00:29:27 -05:00
Garrett
b7c384eb5b fix: extra warn logs on already initialized player references (#3888) 2016-12-23 11:29:23 -05:00