1
0
mirror of https://github.com/videojs/video.js.git synced 2025-01-06 06:50:51 +02:00
Commit Graph

1434 Commits

Author SHA1 Message Date
David GG
62ff3f66a5 feat: add mimetype type to source object when possible (#4469) (#4947)
File mimetype is filled when the file extension is known and type is not provided.

Fixes #4469, improves #4851.
2018-03-07 14:34:16 -05:00
Michael Vogel
8706941573 feat: Allow techs to change poster if player option techCanOverridePoster is set (#4921)
The option for the player techCanOverridePoster is introduced in this commit. It allows techs to update the post whenever they like. isPosterFromTech_ is introduced as a private player field in order to track when a poster was set by a tech. This allows us to clear the poster whenever the tech is disposed of by the player.

Additionally, attempting to set the same poster more than once will have no effect / no changes will be made, since the poster is the same. This was done in order to stop triggering multiple posterchange events when calling player.poster(aPoster) with techCanOverridePoster set to true.

When a tech is disposed and a poster was set by it, unset the poster.

Pass a `canOverridePoster` option to techs to know whether techCanOverridePoster was set.

Fixes #4910.
2018-03-07 14:31:50 -05:00
Brandon Casey
df96a74f6b feat: sourceset event (#4660)
Trigger a sourceset event whenever the source is set in the Html5 tech, including initial source. We override the video element's src and setAttribute methods so that we can trigger the sourceset event when people change the src with both the video element and our API methods.
The event object for sourceset will contain the src string that was provided at the time the sourceset was triggered. This is mostly important if a source is being set while a tech is changing.
A Tech has a featuresSourceset option that it can set to for sourceset handling. It can then call the helper triggerSourceset(src) to trigger the sourceset.
2018-03-07 14:28:37 -05:00
ookami125
7facc44893 fix(text-tracks): keep showing captions even if the text track settings were disabled (#4974)
If a user disabled the text track setting component, trying to play emulated captions would crash. Add a null check before applying the text track settings.

Fixes #4964.
2018-03-05 17:11:51 -05:00
Gary Katsevman
9c4ded8899
fix(events): triggering with an object had incorrect target property on event object (#4993)
Currently, trigger an event with an object rather than a string will have the document as a target on the event object rather than the element.
2018-03-05 16:42:06 -05:00
Pat O'Neill
5b5cc50608 fix: Fix an issue where disabling the progress control would throw an error. (#4986) 2018-03-05 14:44:34 -05:00
Pat O'Neill
50831e3381 fix: Add alternate text to the loading spinner. (#4916)
This is a first in a few changes related to #4902. This just adds a text alternative to the loading spinner. In future PRs, we would make it alert to screen readers and potentially have a generic alerting mechanism.
2018-02-22 16:19:35 -05:00
Gary Katsevman
0ace2a5449
fix: regression for getting a player via the tech's id (#4969)
As part of https://github.com/videojs/video.js/pull/4836, this piece of code was removed because it was thought it was not needed as everything else covers it. Turns out it's needed.

f6eaa5e2ae/src/js/video.js (L103-L107)
2018-02-22 14:22:12 -05:00
Ivan Čerjan
de9069fc5d fix(text-track-settings): fix track settings font class name (#4956)
Changed  className: 'vjs-track-settings-font">' to className: 'vjs-track-settings-font'

Fixes #4950, fixes #4879.
2018-02-14 13:41:15 -05:00
Ku Lok Sun
a1cef809b3 fix(progress control): Fix the video continuing to play when the user scrubs outside of seekbar (#4918)
Scrubbing inside the seekbar paused the player properly but scrubbing inside the progress control outside the seekbar, the player never paused. This meant that when you scrubbed, if you kept the mouse down but lingered for a moment, the player would continue playing until the mouse moved again.

This fixes it so that the seekbar mousedown and mouseup handlers are called when the progress control mousedown and mouseup handlers are triggered.
2018-02-12 17:34:44 -05:00
Gary Katsevman
29a8ee1d60
fix: cache middleware instances per player (#4939)
Middleware factories currently get run each time a source is set. Because middleware are assocated with a player, the factories should only run once per player.

This PR fixes it so that we associate a middleware instance with a middleware factory per player.
Each time a player is disposed, we will clear the cache of the middleware instances for that player.

Fixes #4677.
2018-02-12 17:30:27 -05:00
Alex Barstow
6189baac3c fix: Only select TextTrackMenuItem if unselected (#4920)
These changes address an issue where screen readers may repeatedly and redundantly read TextTrackMenuItem's control text on every texttrackchange event in some browsers.

The source of the problem is in the handleTracksChange() method of TextTrackMenuItem and its subclass OffTextTrackMenuItem, in which this.selected(true/false) gets called even if the selected state has not changed since its previous invocation.
2018-02-09 14:54:47 -05:00
Gary Katsevman
7670db63cd
fix(middleware): do a null check in mediator methods (#4913) 2018-01-31 10:46:58 -05:00
Gary Katsevman
9ceb4e4fe0
feat: playerresize event in all cases (#4864)
Use ResizeObserver when available for better and more performant resizing information, otherwise, fall back to a throttled resize event on an iframe that's the size of the player.
Allows a video.js user to disable this by setting resizeManager: false as an option since the component will not be initialized.

Add a debounce util.

This reverts #4800 (e0ed0b5) because we end up getting two playerresize events with the dimension methods now.
2018-01-30 13:26:21 -05:00
Pat O'Neill
6a0057716b feat: Add videojs.getAllPlayers to get an array of players. (#4842) 2018-01-30 11:43:47 -05:00
ldayananda
bf3eb45a37 feat: add mediator middleware type for play() (#4868)
This will allow middleware to interact with calls to play() from the tech. This will require a method of indicating to middleware previously run that a middleware down the chain has terminated or stopped execution.

* Adds middleware mediator method that runs middleware from the player to the tech and a second time back up to the player. This category was created because play is both a setter(changes the playback state) and a getter(gets a native play promise if available). This also has the ability to tell whether a middleware has terminated before reaching the tech.
* Adds a middleware.TERMINATOR sentinel value that is available on the videojs object
* Adds play to the allowedMediators
* Adds paused to the allowedGetters
* Adds a sandbox example of a play mediator middleware
2018-01-30 11:30:42 -05:00
mister-ben
f03ac5e9b5 fix: do not patch canplaytype on android chrome (#4885)
Patching canPlayType on Android shouldn't be necessary on Android Chrome since it reports its ability to player HLS correctly.
2018-01-30 11:20:33 -05:00
Pat O'Neill
a15e616a45 feat: Add getPlayer method to Video.js. (#4836) 2018-01-30 11:19:06 -05:00
mrdtron
e628ccd555 fix: hide volume slider when the slider is not active and mute toggle button is in focus (#4866) 2018-01-24 13:51:44 -05:00
ldayananda
673c231684
docs: add middleware guide (#4877)
* adding guide content

* fix link

* CR comments

* fixing a typo

* fixing example
2018-01-23 15:36:49 -05:00
Thijs Triemstra
83880b0f0b docs: fix some typos (#4880) 2018-01-22 17:07:05 -05:00
Calvin Correli
baf0982515 fix: silence unhandled promise rejection in Safari when seeking (#4860)
Fix #4853.
2018-01-05 15:29:34 -05:00
Rishabh Singh
98212c4af0 fix: progress bar time tooltips bug by adding word-break css reset (#4859)
Fixes #2964.
2018-01-05 14:44:40 -05:00
Joe Forbes
4eb0047ad1 fix: wrap audio change handler rather than bind so a player dispose doesn't affect other players (#4847) 2018-01-03 16:58:23 -05:00
Pat O'Neill
a6f444443c fix: Fix an issue where hookOnce failed for the 'beforesetup' hook. (#4841) 2018-01-03 16:57:17 -05:00
cotne nazarashvili
98fe49feac fix: replace   with \u00a0 (#4825)
Fixes #4309
2018-01-03 16:52:05 -05:00
Anton Gorbylev
f47a083d70 feat(css): add a delay before showing loading spinner (#4806) 2017-12-14 17:33:59 -05:00
sivapalan
e0ed0b5cd7 feat: playerresize event on Player dimension API calls (#4800)
Trigger a `playerresize` event when `width()`, `height()`, or `dimensions()` is called.

First part of #4629.
2017-12-14 17:33:29 -05:00
Garrett Singer
ba0f20ec35 feat: add support for debug logging (#4780)
Adds support for `debug` as an available logging method under `videojs.log`
Changes the default log level from `all` to `info`
2017-12-14 17:31:51 -05:00
Michael Fairchild
51ed400d7c fix: use correct logic for menu focus (#4823)
This was resulting in the menu not being focused for all browsers/devices (if the player was in a frame), but it should target only IOS.

Fixes #4821
2017-12-14 13:32:43 -05:00
Gary Katsevman
6fe7a9a3dd
fix: force autoplay in Chrome (#4804)
Chrome has started pausing autoplaying video elements when they are
moved in the DOM. Here we need to make sure that if the video started
autoplaying, after we move the element in the DOM we call play again.

Fixes #4720.
2017-12-14 11:24:48 -05:00
Gary Katsevman
409a13e1f6
fix(html5): loop video el attributes in order (#4805)
Due to historical issues, we loops the settings attributes like muted
and autoplay in reverse order but we want to loop them in order.
2017-12-13 14:49:02 -05:00
Gary Katsevman
295889b36b
chore: remove unused popup classes (#4792)
In v6, we moved away from popup due to accessibility reasons. It was
only used in the old VolumeMenuButton.

Fixes #4725.
2017-12-11 16:28:24 -05:00
Charlie Ryan
1a588f71cf fix: Seek to 0 if attempt is made to seek to negative value (#4799)
Fixes #4501
2017-12-11 16:25:41 -05:00
Lorenzo Cinque
e582c3c843 fix: Remove listener used to test if passive listeners are supported (#4787)
Once you have successfully tested that passive listeners are supported you should remove the test listeners :)
2017-12-04 17:43:37 -05:00
Chuong
2337c1bf43 fix: cannot drag on progress bar in IE9 (#4783)
fix #4773
2017-12-04 17:43:21 -05:00
Brandon Casey
904989de62 fix: off text tracks should be set based on current state (#4775) 2017-12-04 17:42:23 -05:00
emkayy
0f1b2606a0 fix: null check closest.getAttribute (#4763)
If the HTML element doesn't have a lang attribute, Edge throws an exception when calling closest.getAttribute because tag.closest('[lang]') returns an empty object (which will be coerced to true) instead of null.
2017-12-04 17:41:29 -05:00
Chuong
7a776eeeea fix: being able to toggle playback with middle click (#4756)
Uses the new Dom.isSingleLeftClick method to do the check we were doing previously.
Also, refactor the player.handleTechClick_() method to follow the new style of code.

Fixes #4689
2017-11-17 15:09:45 -05:00
shahlabs
1fcd5ae4b1 fix: trigger timeupdate during seek (#4754)
If the player is paused, when we seek, the time displays don't update. So, we trigger a timeupdate manually to let components know that the time has updated.
2017-11-17 12:01:29 -05:00
Brandon Casey
bbea5cc7cb fix: only print element not in DOM warning on player creation (#4755) 2017-11-16 18:12:37 -05:00
Pat O'Neill
26b0d2cadd fix(Player#play): Wait for loadstart in play() when changing sources instead of just ready. (#4743)
The core goal here is to make sure the following works in light of some middleware process that makes setting the source more async than next tick:

```js
player.src('...');
player.ready(() => player.play());
```

In fact, given this change, we should even be able to do:

```js
player.src('...');
player.play();
```

Unlike #4665, which would have clarified/changed the meaning of "ready", it remains a reflection of the tech's state and we make better use of the ability to queue things on that state and on the middleware `setSource` process.
2017-11-16 16:41:01 -05:00
Chuong
6cbe3edae4 refactor: player.userActive() (#4716) 2017-11-16 11:49:54 -05:00
Chuong
eb909f0b34 refactor: player.usingNativeControls() (#4749) 2017-11-16 11:49:40 -05:00
Chuong
79b4355856 fix: only allow left click dragging on progress bar and volume control (#4613)
Previously, any mouse button interaction with the bars would cause a reaction but that's unexpected for right and middle mouse clicks. This PR makes it so right and middle mouse clicks are ignored for dragging and clicking.
2017-11-16 11:48:59 -05:00
Martin Bachwerk
dc588dd6c5 fix: Avoid empty but shown title attribute with menu items and clickable components (#4746) 2017-11-16 11:27:19 -05:00
Chuong
d447e9fe11 refactor: player.controls() (#4731) 2017-11-16 11:25:49 -05:00
Chuong
c16fedf26d refactor: player.listenForUserActivity_() (#4719) 2017-11-16 11:24:32 -05:00
Gary Katsevman
2da7af1137
perf: null out els on dispose to minimize detached els (#4745)
A we retained a lot of references to DOM elements in various components. Here we clear it up. Also, make sure that we remove unused listeners as they can retain objects as well.
Update evented mixin to null out the eventBusEl_ after the component is disposed.
Add a feature for components, to tell it not to auto-initialize the evented mixin.
Re-enable the tests that were removed in #4640.
2017-11-16 11:19:47 -05:00
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
Vinay
acc641a8a2 fix: make the progress bar progress smoothly (#4591)
Update the position of the seek bar in a 30ms interval and then redraw inside of a requestAnimationFrame.
2017-11-07 15:43:50 -05:00
Ilya Piatrenka
6f713ca713 feat: add warning if the element given to Video.js is not in the DOM (#4698)
Addresses #4697.
2017-11-01 14:20:21 -04:00
Chuong
ad1b47bf84 refactor: player.dimension() (#4704) 2017-11-01 13:15:38 -04: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
Brandon Casey
9cf98006d5 fix: don't throttle duration change updates (#4635)
Right now the durationchange event is throttled with the other two events, timeupdate and loadedmetadata. This means that only one of those events will trigger an update if they all occur within 25ms of each other.

This functionality makes sense for timeupdate or loadedmetadata as those should not indicate a time update (even though they often do).

For durationchange however it will always indicate a change in the duration, and we want to always update the display when it happens. Here is a scenario of how we could show duration incorrectly right now:

User is playing a video that has a postroll ad at the end. After the postroll ad their will be a timeupdate, and then a durationchange to signify that we are back in content. Then ended will fire, and no more events will happen.

The player will still show the duration of the ad, as the durationchange was eaten by the timeupdate that happened at nearly the same time.

Also, fix a potential issue where if the page was translated using google translate, the time displays stopped updating.
2017-10-31 15:24:01 -04:00
Bo Link
855adf35a1 fix: aria-labelledby attribute has an extra space (#4708)
The aria-labelledby attribute on the fontPercent, edgeStyle, and
fontFamily select options inlcudes an extra space since there is
no ledgendId variable being set on the createElFont_() method. This
fix adds a check to see if the legendId value is set or not inside
the createElSelect_() method. This should keep the extra space
from appearing on the select tags created by the createElFont_()
method.

Fixes #4688
2017-10-31 15:20:15 -04:00
Brandon Casey
a3c254eeb8 feat: allow progress controls to be disabled (#4649)
Add `enable` and `disable` methods to the progress control. This disabled things like the mouse time display and the progress control continues updating for current time and loading but the user will not be able to interact with the control anymore.
2017-10-31 14:50:31 -04:00
Marc A. Modrow
bebca9ce0b fix: make parseUrl helper always have a protocl (#4673)
Fixes #3100.
2017-10-31 14:48:12 -04:00
Chuong
b40858bc49 refactor: component.ready() (#4693) 2017-10-31 12:04:07 -04:00
Chuong
a1748aa590 refactor: player.techGet_() (#4687) 2017-10-31 12:03:49 -04:00
Chuong
cde83351fb refactor: player.hasStarted() (#4680) 2017-10-31 12:03:33 -04:00
Brandon Casey
5e9655f4a0 feat: set the play progress seek bar to 100% on ended (#4648) 2017-10-31 12:02:53 -04:00
Marc A. Modrow
79639138ba fix: Events#off threw if Object.prototype had extra enumerable properties, don't remove all events if off receives a falsey value (#4669)
If Object.prototype was modified to have extra properties, the `off` method crashed because `data.handlers` would've been removed before getting to the extra property.

Also, this fixes an issue where if a falsey value was passed to off, the events system would remove all the events, i.e. `player.off('')`. Instead, we make sure that only if it is called as `player.off()` will they be removed.
2017-10-30 18:06:41 -04:00
Nicolas Levy
afea980174 fix: Don't enable player controls if they where disabled when ModalDialog closes. (#4690) 2017-10-30 18:00:14 -04:00
Chuong
43ddc72c80 fix(css): update user-select none (#4678) 2017-10-30 17:59:28 -04:00
Chuong
cb638d0ea7 chore: add comment about avoiding helvetica font (#4679)
See issue #376 for more information.
2017-10-30 17:57:11 -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
Pat O'Neill
0287f6e076 fix: Make sure we remove vjs-ended from the play toggle in all appropriate cases. (#4661) 2017-10-13 13:46:51 -04:00
Brandon Casey
b1de506b43 fix: a possible breaking change caused by the use of remainingTimeDisplay (#4655) 2017-10-10 11:35:46 -04:00
Pat O'Neill
4658c7bad6 fix: Fix a typo in current time display component. (#4647) 2017-10-04 10:31:10 -04:00
Pat O'Neill
20f7fe991f fix: Make sure time displays use correctly-formatted time. (#4643) 2017-10-03 12:52:58 -04:00
Brandon Casey
445eb26722 feat: Add remainingTimeDisplay method to Player (#4620) 2017-10-02 16:29:40 -04:00
Alex Barstow
1ac8065ea6 feat: Do not set focus in sub-menus to prevent undesirable scrolling behavior in iOS (#4607) 2017-10-02 15:29:34 -04:00
Brandon Casey
f51d36b053 feat: display currentTime as duration and remainingTime as 0 on ended (#4634) 2017-10-02 11:19:29 -04:00
Brandon Casey
fa6f884409 refactor: Create a base time display class, and use it (#4633) 2017-10-02 10:58:30 -04:00
Brandon Casey
335bcded98 fix: reset to a play/pause button when seeking after ended (#4614) 2017-09-20 13:45:47 -04:00
Matthew Boles
006fb3b705 docs: update to width and height doc comments (#4592) 2017-09-01 13:31:48 -04:00
Gary Katsevman
95c4ae0404 fix: rely on browser or tech to handle autoplay (#4582)
When setting the source, we were calling `play` if `autoplay` was set. We shouldn't do that and instead we should rely on the browser or tech (like Flash) to handle it properly.
2017-08-30 14:29:08 -04:00
Gary Katsevman
fe63992bd1 fix: use typeof for checking preload option (#4574) 2017-08-17 17:48:17 -04:00
Gary Katsevman
d668c4976b fix: make boolean attributes set and check both the associated property and the attribute (#4562)
Make boolean attributes like muted set the property video.muted = {{boolean}} and the attribute video.setAttribute('muted', 'muted') when changing the value.
Also, in html5's createEl, we were setting/updating attributes for various properties but we were only setting the attributes and not also the properties but also autoplay was happening first rather than last which caused autoplay to fail because muted and playsinline weren't necessary set by that time.

Fix #4351.
2017-08-15 17:02:07 -04:00
Rafael Gaspar
a6b8425f6b fix: playback rate default text (#4558)
Previously, the default text only said `1` now it says `1x` which matches the look after changing the playback rate.
2017-08-14 17:59:41 -04:00
Alex Barstow
0c337b3d67 Fix: issue where tracks are disabled and cuepoints are cleared in iOS native player (#4496)
In the HTML5 tech, when we go fullscreen to the native player, listen for change events and restore previous mode state for the metadata text tracks.
2017-08-14 16:36:36 -04:00
Kishan
cd2f5106ca fix: set width and height for vjs-button like the SubsCaps button (#4548)
Add a width and height property of 100% to `.vjs-control .vjs-button` selector.

Fixes #4547.
2017-08-10 15:19:59 -04:00
Gary Katsevman
ee014e2e04 fix: only change focus from BPB if not a mouse click (#4497) 2017-07-26 16:09:31 -04:00
Pat O'Neill
7579fc1800 docs: Fix Player#src API documentation. (#4454) 2017-07-14 14:20:00 -04:00
Gary Katsevman
4f43616160 fix(playback rate menu): cycling rates via click (#4486)
In 6.0, we changed the way that Menu Buttons were being created by
wrapping an actual button with a menu sibling in a container. The
playback rate menu also had a rate value display. In 6.x, this rate
value display ended up coming on top of the button itself and capturing
it's clicks. So, we want to remove pointer-events from the rate-value
display and resize the actual button to be the size of the control.
2017-07-14 14:18:23 -04:00
Gary Katsevman
82c8b80548 fix: auto-removal remote text tracks being removed when not supposed to (#4450)
We added a feature so that remote text tracks can auto-removed when a source changes. However, in 6.x we changed the source behavior to be asynchronous meaning that some text tracks were accidentally being removed when they weren't supposed to be.
For example:
```js
var player = videojs('my-player');
player.src({src: 'video.mp4', type: 'video/mp4'});
 // set second arg to false so that they get auto-removed on source change
player.addRemoteTextTrack({kind: 'captions', src: 'text.vtt', srclang: 'en'}, false);
```
Now when the player loads, this captions track is actually missing because it was removed.

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


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

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

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

* Use textContent instead of innerHTML for text content.
* Construct TextTrackSettings content with HTML strings where possible because it's a bit faster than manual DOM construction.
* Do minimal DOM updates to time controls. This reduces our timeupdate footprint from ~2-2.5ms to ~1ms!
2017-06-28 16:32:58 +10:00
Jet Fontanilla
7f7ea70cb7 fix: IE10 issue for disableOthers when property access results in "permission denied" (#4395)
Fixes #4378
2017-06-28 16:32:04 +10:00
Pat O'Neill
cc6e82442f docs: Fix links in API docs for several Player events. (#4427) 2017-06-27 09:53:08 +10:00
ldayananda
9329e3ef8e docs: Fixing player.remoteTextTracks jsdoc (#4417)
Fixes the sidebar link on the docs site for remoteTextTracks.
2017-06-19 16:01:01 -04:00
Gary Katsevman
c31836c30c feat: Use Rollup to generate dist files (#4301) 2017-05-25 19:40:35 -04:00
ldayananda
188ead1c81 feat: Persist caption/description choice over source changes in emulated tracks (#4295) 2017-05-25 14:09:00 -04:00
Gary Katsevman
cb6005eca4 fix: only disable user-selection on sliders (#4354) 2017-05-15 12:04:42 -04:00
Alex Barstow
8d80a5846e feat: add 'playsinline' player option (#4348)
Video.js players can accept a number of standard <video> element options (autoplay, muted, loop, etc), but not currently playsinline, which is now part of the [HTML spec](https://html.spec.whatwg.org/multipage/embedded-content.html#attr-video-playsinline). We should add it to the list of <video> attributes that can be provided to the player as options.
2017-05-12 16:39:37 -04:00
Gary Katsevman
35df35143f feat: deprecate firstplay event (#4353) 2017-05-12 16:38:48 -04:00
Martin Bachwerk
3087830ed7 fix: Only update text track mode if changed (#4298) 2017-05-12 16:35:39 -04:00
Garrett
483e5a2ca5 feat: Add getVideoPlaybackQuality API (#4338)
Provides a tech getter for getVideoPlaybackQuality as specified by the W3C's Media Playback Quality API: https://wicg.github.io/media-playback-quality/.
2017-05-12 15:22:02 -04:00
Gary Katsevman
3dcfa9568a fix: TextTrackButton on Safari and iOS (#4350)
On Safari and iOS, we use native text tracks, so, during text track
button creation, textTracks() is populated. However, `this.kinds_` isn't
necessarily set and ends up throwing.

Instead, we want to move the fallback for `this.kinds_` from the
constructor and right above the usage of `this.kinds_`.
2017-05-12 14:51:12 -04:00
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
Stéphane Roucheray
da1d8613d7 chore: typo soruce -> source (#4307) 2017-05-11 17:00:59 -04:00
mister-ben
da0f1ee681 feat: remove playbackRate blacklist for recent Android Chrome (#4321)
Android Chrome now supports playbackRate properly, so removes the blacklist added in #3246 for newer Chrome versions.
Adds `browser.CHROME_VERSION` as a necessary evil.
No longer blacklists for Chrome 58+ -- this could possibly be fixed since 52, but 58 is all I've been able to test on and most users should keep Chrome up to date.
2017-05-11 16:59:22 -04:00
Brandon Casey
561d5ddf76 fix a comment typo (#4293) 2017-04-19 23:56:07 -04:00
Matthew Neil
1ea00419c9 fix: set IE_VERSION correctly for IE11 (#4281)
videojs.browser.IE_VERSION is null in IE11 because IE11 uses a different user agent string than other IE versions

Fixes #4278
2017-04-13 11:28:03 -04:00
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
Gary Katsevman
e98c65d7a6 fix: remove focus ring from player itself (#4237) 2017-03-30 13:46:52 -04:00
Gary Katsevman
0908d914ac fix: silence play promise error (#4247) 2017-03-30 13:46:31 -04:00
Gary Katsevman
9274457e4c feat: Make text tracks settings more responsive (#4236) 2017-03-30 11:09:00 -04:00
Kevin Litchfield
16c1e0adc0 fix: keep minimum volume after unmuting above 0.1 (#4227)
If, when unmuting, the last volume is below 0.1, force it to be 0.1.

Fixes #4054.
2017-03-24 15:14:41 -04:00
greenkeeper[bot]
7d12c9ea85 chore(package): update videojs-vtt.js to version 0.12.3 (#4221) 2017-03-24 14:38:06 -04:00
Brandon Casey
f2b5a057fe fix: removeCue should work with native passed in cue (#4208) 2017-03-23 14:31:41 -04:00
Brandon Casey
dbfba28a10 fix: not showing default text tracks over video (#4216)
This allows default tracks or tracks with a `mode`of `showing` to be seen
when they are added (as we would expect). Rather than only being seen
after the first `modechange` event (aka a selection from the menu). This is done by watching for `loadstart` on Player.
2017-03-23 14:03:15 -04:00
Brandon Casey
61e20786a9 docs: fix links in generated docs (#4200) 2017-03-21 17:13:06 -04:00
Gary Katsevman
0fd7aad850 fix: make sure audio track hides with one item (#4202) 2017-03-15 11:27:52 -04:00
Alex Barstow
d79b8a7013 feat: time tooltips will not be added to a player on mobile devices (#4185)
Currently, the behavior of time tooltips is inconsistent across iOS and Android devices so we want to hide the tooltips on mobile devices for the time being.
2017-03-13 11:54:29 -04:00
Gary Katsevman
424fa51c28 fix: make load progress buffered regions height 100% (#4190) 2017-03-13 11:53:04 -04:00
Brandon Casey
90030d5e99 feat: Make pause on open optional for ModalDialog via options (#4186)
* The new option is called pauseOnOpen, and defaults to true
* default pauseOnOpen to false in the `ErrorDisplay`
2017-03-13 11:26:33 -04:00
Gary Katsevman
ddde644c78 fix(vttjs): wait till tech el in DOM before loading vttjs (#4177)
The issue is that in Flash, Flash.embed wraps the object element in a div but that object element is what is referenced by this.el(), so, parentNode isn't null but we aren't actually in the DOM. Instead, just check to see whether the tech element is in the DOM or not via node.contains().
2017-03-08 11:27:59 -05:00
Gary Katsevman
cb890a965c fix(ie8): various minor ie8 fixes (#4175)
This fixes a logging in the console regarding timetooltips which don't exist. Also, makes sure not to focus the menu button when the captions settings menu item is clicked since the caption settings is getting focused instead. In addition, it makes sure the legend text in the track settings is the foreground color.
2017-03-07 15:44:08 -05:00
Gary Katsevman
1770f00018 fix(icon-placeholder): align icons on ie8 properly (#4174)
Make sure that the button inside the menu button element isn't a
vjs-control but make sure that the icon-placeholder is sized properly.
2017-03-07 15:43:44 -05:00
Gary Katsevman
67634cf216 fix(tracks): allow forcing native text tracks on or off (#4172)
In addition, the track buttons need to update on the ready event because when the tech loads, it could run with support native captions, so, it needs to know whether to include the captions settings menu.
And all tracks should always be included in player.textTracks() and not just player.remoteTextTracks().
2017-03-07 13:53:57 -05:00
Gary Katsevman
88ee6af431 fix(subs-caps-button): add hide threshold to subs-caps button (#4171)
This is a followup from #4157 but for the subs-caps button.
2017-03-07 13:52:51 -05:00
Justin Anastos
c611f9f358 fix(MenuButton): Unify behavior of showing/hiding (#4157)
Implement a `hideThreshold` property that defaults to 1 so
descendants can override it if necessary. Right now the only
descendant that will override will be `CaptionsButton` because
video.js adds a "captions settings" for emulated text tracks.
2017-03-07 11:28:00 -05:00
Gary Katsevman
2ee133f6f8 fix(subs-caps-button): captions items should hide icon from SR (#4158)
Move the CC icon in the SubsCapsMenuItem into an icon-placeholder span. Also, include that information for the screen reader.
In addition, only apply default sizing to icon-placeholder if they're direct descendants of a vjs-control.
2017-03-07 11:26:09 -05:00
Owen Edwards
d9ec7bc1ba fix(audio-tracks-button): add wrapper CSS builder to audio tracks menu button (#4163) 2017-03-06 12:17:49 -05:00
Gary Katsevman
e5af0a5e21 fix(subs-caps-button): add wrapper CSS builder to subs caps button (#4156) 2017-03-02 17:53:57 -05:00
Gary Katsevman
db901c54d9 fix(text track settings): focus subs-caps button if exists over CC button (#4155) 2017-03-02 17:53:47 -05:00
mister-ben
74eb5d4772 feat: Combine captions and subtitles tracks control (#4028) 2017-03-02 15:23:41 -05:00
Gary Katsevman
61d427c7ee fix: add buildWrapperCSSClass methods to all menu buttons (#4147)
In #4034, we changed the way that menu buttons work slightly by introduction a wrapper element with a separate wrapper css builder. However, this broke, at least the playback-rate menu.
This PR adds a buildWrapperCSSClass to each of our menu buttons.
2017-03-02 15:04:35 -05:00
Gary Katsevman
a9f8fcb2a2 fix(playback rate menu): playback rate menu items should be selectable (#4149) 2017-03-02 14:55:36 -05:00
Brandon Casey
fb88ae2bfc fix(dom): getBoundingClientRect check that el is defined (#4139)
Verify that el is defined so that we don't throw if we get to this function with an undefined el
2017-03-02 14:51:19 -05:00
Brandon Casey
a2b1a33606 fix: cues at startTime 0 do not fire (#4152)
Previously timeupdate would fire before the video was playing, and the tech was not ready. This caused issues when preload was set to auto, because cuechange would fire before the video was even started for cues with a startTime of 0.

Wait for tech to be ready before watching for timeupdate
update unit tests to use TechFaker
Add a unit test to verify that we wait for Tech to be ready.
2017-03-02 14:35:45 -05:00
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
3bbf0199e6 fix: early play should wait for player ready, even if source is available (#4134)
Fixes #4057
2017-03-02 11:15:06 -05:00
Gary Katsevman
96a387f723 feat: update videojs-vtt.js and wrap native cues in TextTrack (#4115)
Update videojs-vtt.js and don't auto-export its versions of VTTCue globally.
When our TextTrack object is given a cue, if it's a native cue, wrap it in our emulated vttjs.VTTCue.

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

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

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

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

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

Fixes #4064.
2017-02-21 15:53:56 -05:00
mister-ben
1cb0a97b0b fix: Do not create element for MediaLoader (#4097)
MediaLoader has a div that's unnecessary. See #4070. Also, make sure that Component#dispose does a null check for the element.
2017-02-21 15:50:52 -05:00
Brandon Casey
127cd7827e fix: copy basic plugin properties onto the wrapper (#4100)
Copy basic plugin properties to prevent breaking older basic plugins.
2017-02-21 15:49:42 -05:00
mister-ben
405b29b8f1 fix: remove redundant Html5#play()
play() is defined twice in Html5. The promise handling in the earlier one was moved into Player#play().
2017-02-21 15:48:45 -05:00
Brandon Casey
e1b48042dd fix: synchronously shim vtt.js when possible (#4083) 2017-02-21 12:03:17 -05:00
Kevin Litchfield
a04f387a72 refactor: MuteToggle#update (#4058) 2017-02-17 12:34:51 -05:00
forbesjo
0da93249d3 fix: make mergeOptions behave the same across browsers (#4088)
* Make an object util function `keys` return an empty array for non objects
* Use that function in object utils instead of `Object.assign`
2017-02-16 16:55:54 -05:00
Brian Wells
caff93fbf0 fix(sass): import path has cwd once again (#4061) 2017-02-15 15:44:00 -05:00
Kevin Litchfield
3c1108c5dc fix: Set MuteButton controlText correctly (#4056) 2017-02-15 15:23:47 -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
Pat O'Neill
be27f2aa6e fix: Progress holder gaps cause tooltips misalignment and time tooltip outlines (#4031)
* Address #3645 by using pixel margins
* Fix outlines

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

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

Fixes #3699
2017-02-02 14:45:39 -05:00
Gary Katsevman
29c6141de9 feat: allow seeking in full height of progress control (#4004) 2017-02-02 14:42:34 -05:00
Brandon Casey
a8f2e43274 feat: videojs.getTech works with TitleCase or camelCase names (#4010)
* Fixes #3986 
* update `techOptions` to look for `TitleCase`/`camelCase` user tech options
* remove deprecated usage of Tech as Component
* add a unit test to verify that registerTech works
* change defaultTech_ to defaultTechOrder_
2017-02-02 14:34:33 -05:00
Gary Katsevman
6ad1e5c97b docs: fixup global jsdoc members (#4015) 2017-02-02 11:07:34 -05:00
Gary Katsevman
24d2e7ba33 fix: hide font-icons from assitive technology (#4006)
Wrap font-icons in a span with aria-hidden=true on it.

Fixes #3982.
2017-02-01 14:53:43 -05:00
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
f87ada1ee0 fix: allow changing volume in full height of volume control (#3987)
* allow changing volume in full height of volume control
* make volume control have pointer cursor
2017-01-31 15:11:26 -05:00
Gary Katsevman
19b429bddc fix(sass): import path no longer has cwd (#4001)
node-sass updated to remove the cwd from import paths.

Fix #3998
2017-01-31 15:10:31 -05:00
Gary Katsevman
22aade1b61 fix: updating time tooltips when player not in DOM (#3991)
If the time tooltips try to update when the player isn't in the DOM,
they error out because the bounding rects for the player will not be available.
This does a null check and exists early.
2017-01-30 11:43:14 -05:00
Gary Katsevman
e34335b012 fix: EventTarget is also evented (#3990)
If you try to delegate an to an EventTarget from an evented component, you'll end up failing because it didn't think that an EventTarget object worked. But it should and does. This adds a check for it in the isEvented function.
2017-01-30 11:41:46 -05:00
Brandon Casey
866a3f37d8 fix: remaining time display width on IE8 and IE9 (#3983)
vjs-no-flex environments like IE8 and IE9 don't work properly with width: auto.
2017-01-27 17:40:03 -05:00
Gary Katsevman
03529163b6 feat: Update MW to require a factory, add *-mw (#3969)
Middleware registration now only accept a factory method which takes a player reference and returns some object that represents the middleware with the various methods on it.
Also, add a use to register a middleware for all types.
2017-01-27 15:09:27 -05:00
Gary Katsevman
2e2ac6f870 refactor: move most volume panel functionality into css state (#3981) 2017-01-27 15:08:20 -05:00
Pat O'Neill
4979ea78d5 fix: Patch a memory leak caused by un-removed track listener(s). (#3976) 2017-01-27 14:56:43 -05:00
Brandon Casey
3585af0fe2 fix: Make Player#techCall_() synchronous again (#3988) 2017-01-27 14:35:00 -05:00
Pat O'Neill
d7d7cfeb9f feat: Stateful Components (#3960)
Advanced plugins introduced the concept of mixins and added two: evented and stateful.
This provides Components with the benefits of the stateful mixin
2017-01-26 22:04:34 -05:00
Pat O'Neill
4c3b60c3b6 refactor: Evented Components (#3959)
Advanced plugins introduced the concept of mixins and added two: evented and stateful.
This refactors Component to use the evented mixin, granting it event broadcast/handling capabilities.
2017-01-26 20:53:53 -05:00
Brandon Casey
c2545ddb6d feat: make registerTech add that tech to the default techOrder (#3985) 2017-01-26 17:13:27 -05:00
mister-ben
8e7d8cc959 feat: localize all strings in captions settings (#3974) 2017-01-25 13:54:21 -05:00
Gary Katsevman
34aab3f357 feat: middleware (#3788)
Add middleware support. Middleware can function as go-between between the player and the tech. For example, it can modify the duration that the tech returns to the player. In addition, middleware allow for supporting custom video sources and types.

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

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

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

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

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

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

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

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

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

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

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

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

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

BREAKING CHANGE: registerComponent now throws if no name or not a component is passed in.
2017-01-18 00:46:43 -05:00
mrocajr
ce6acc832a feat: Replay at ended (#3868)
Made the play button turn into a replay button at the end of the video.
Updated the translations needed docs with "replay".
2017-01-18 00:41:43 -05:00