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

528 Commits

Author SHA1 Message Date
Gary Katsevman
d8aadd5bee
feat: allow embeds via <video-js> element (#4640)
Add the ability to initialize Video.js with an element named video-js. This is because sometimes, seeing the native element is undesirable, plus, it's cool to have our own element.
Can be used just like the video embed.
IE9 is supported but only with dynamic sources as the source element can only be used inside of the video element.
2017-11-13 14:20:05 -05:00
Brandon Casey
acf4153963 feat: add a version method to all advanced plugin instances (#4714) 2017-11-07 15:48:24 -05:00
Ilya Piatrenka
c213737f7a test: warning, if the element is not in the DOM (#4723)
Add test to #4698
2017-11-07 15:44:16 -05:00
Joe Forbes
9acbcd8410 fix: player.src() should return empty string if no source is set (#4711)
player.src() returns undefined for a new player but it should return '' like player.currentSrc() does and as the video element itself does.
2017-11-01 11:12:48 -04:00
Gary Katsevman
45a6b3010d
test: fix modal dialog test for showing controls (#4707)
Also, add a test that verifies the behavior for the PR (#4690).

Fixes #4706.
2017-10-31 11:35:01 -04:00
Pat O'Neill
85fe685696 feat: Add videojs.hookOnce method to allow single-run hooks. (#4672) 2017-10-30 17:56:21 -04:00
Brandon Casey
983a573928 test: get rid of redundant test logging (#4682) 2017-10-23 18:26:18 +00:00
Alex Barstow
1e80e59614 test: add unit tests for player.duration() (#4459)
Unit tests for https://github.com/videojs/video.js/pull/4443
2017-07-14 14:20:37 -04:00
Gary Katsevman
687aae50ff chore: switch to using chrome for testing PRs on travis (#4462) 2017-07-05 09:44:43 +10:00
Gary Katsevman
82c8b80548 fix: auto-removal remote text tracks being removed when not supposed to (#4450)
We added a feature so that remote text tracks can auto-removed when a source changes. However, in 6.x we changed the source behavior to be asynchronous meaning that some text tracks were accidentally being removed when they weren't supposed to be.
For example:
```js
var player = videojs('my-player');
player.src({src: 'video.mp4', type: 'video/mp4'});
 // set second arg to false so that they get auto-removed on source change
player.addRemoteTextTrack({kind: 'captions', src: 'text.vtt', srclang: 'en'}, false);
```
Now when the player loads, this captions track is actually missing because it was removed.

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


Fixes #4403 and #4315.
2017-06-28 16:38:29 +10:00
Gary Katsevman
c31836c30c feat: Use Rollup to generate dist files (#4301) 2017-05-25 19:40:35 -04:00
ldayananda
eade52e174 test(TextTrackDisplay): Removing incorrect test techOrder (#4379) 2017-05-25 18:05:45 -04:00
ldayananda
188ead1c81 feat: Persist caption/description choice over source changes in emulated tracks (#4295) 2017-05-25 14:09:00 -04:00
Alex Barstow
8d80a5846e feat: add 'playsinline' player option (#4348)
Video.js players can accept a number of standard <video> element options (autoplay, muted, loop, etc), but not currently playsinline, which is now part of the [HTML spec](https://html.spec.whatwg.org/multipage/embedded-content.html#attr-video-playsinline). We should add it to the list of <video> attributes that can be provided to the player as options.
2017-05-12 16:39:37 -04:00
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