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

4118 Commits

Author SHA1 Message Date
Carlos Javier Villaseñor Castillo
daf40bd4aa
fix(spatial-navigation): focus lost in error modal (#8817)
## Description
The spatial-navigation is unable to focus certain elements of the error
modal when this appears, this PR will fix that

## Specific Changes proposed
Allow the spatial-navigation to focus certain non-component elements in
the error modal

## Requirements Checklist
- [x] Feature implemented / Bug fixed
- [ ] If necessary, more likely in a feature request than a bug fix
- [ ] Change has been verified in an actual browser (Chrome, Firefox,
IE)
  - [ ] Unit Tests updated or fixed
  - [ ] Docs/guides updated
- [ ] Example created ([starter template on
JSBin](https://codepen.io/gkatsev/pen/GwZegv?editors=1000#0))
- [ ] Has no DOM changes which impact accessiblilty or trigger warnings
(e.g. Chrome issues tab)
  - [ ] Has no changes to JSDoc which cause `npm run docs:api` to error
- [ ] Reviewed by Two Core Contributors
2024-07-29 12:11:58 -06:00
Carlos Javier Villaseñor Castillo
76e99b7bea
fix(spatial-navigation): keep navigation going when player has an error (#8805)
## Description
The bug:
 Focus is lost when playback error is displayed.

This small PR will update the spatial-navigation logic so when the error
modal is shown the spatial-navigation will try to focus the components
present in the error modal, in most cases this will be the vjs close
button.

## Specific Changes proposed
Keep navigation working when player shows the error modal by focusing a
component in that modal.

## Requirements Checklist
- [x] Feature implemented / Bug fixed
- [ ] If necessary, more likely in a feature request than a bug fix
- [ ] Change has been verified in an actual browser (Chrome, Firefox,
IE)
  - [ ] Unit Tests updated or fixed
  - [ ] Docs/guides updated
- [ ] Example created ([starter template on
JSBin](https://codepen.io/gkatsev/pen/GwZegv?editors=1000#0))
- [ ] Has no DOM changes which impact accessiblilty or trigger warnings
(e.g. Chrome issues tab)
  - [ ] Has no changes to JSDoc which cause `npm run docs:api` to error
- [ ] Reviewed by Two Core Contributors
2024-07-22 16:43:20 -06:00
mister-ben
86d29cdc66
fix: Listen to taps on track controls (#8809)
## Description
The refactored text track controls aren't listening for tap events.

## Specific Changes proposed
Add tap handler to done and reset buttons.
Fixes #8808

## Requirements Checklist
- [x] Feature implemented / Bug fixed
- [ ] If necessary, more likely in a feature request than a bug fix
- [x] Change has been verified in an actual browser (Chrome, Firefox,
IE)
  - [ ] Unit Tests updated or fixed
  - [ ] Docs/guides updated
- [ ] Example created ([starter template on
JSBin](https://codepen.io/gkatsev/pen/GwZegv?editors=1000#0))
- [x] Has no DOM changes which impact accessiblilty or trigger warnings
(e.g. Chrome issues tab)
  - [x] Has no changes to JSDoc which cause `npm run docs:api` to error
- [ ] Reviewed by Two Core Contributors
2024-07-22 22:20:34 +02:00
mister-ben
a7c9f26c8f
fix: Refactor evented to make mincompatable with Chrome 53 (#8810)
## Description
Chrome 53 doesn't like the minified output. Specifically, it throws
`Uncaught SyntaxError: Unexpected token (` on the ternary in the
minified version of `normalizeListenArgs()`

e78bcc7b2d/src/js/mixins/evented.js (L165-L195)

Line breaks added for clarify

```js
Tt = (e, t, s) => {
  var i = t.length < 3 || t[0] === e || t[0] === e.eventBusEl_;
  let r, n, a;
  return i ? (r = e.eventBusEl_, 3 <= t.length && t.shift(), [n, a] = t) : [r, n, a] = t, ft(r, e, s), yt(n, e, s), bt(a, e, s), a = _(e, a), {
    isTargetingSelf: I,
    target: r,
    type: n,
    listener: a
  }
},
```

Chrome would be happy with this if `[r, n, a] = t` were `([r, n, a] =
t)`.

## Specific Changes proposed
Refactor `normalizeListenArgs()` slightly to use multiple statements to
coerce uglify-js to include parentheses.
Also updates uglify-js, but that in itself isn't the fix.

Fixes #8783

## Requirements Checklist
- [x] Feature implemented / Bug fixed
- [ ] If necessary, more likely in a feature request than a bug fix
- [x] Change has been verified in an actual browser - Browserstack
Chrome 53
  - [ ] Unit Tests updated or fixed
  - [ ] Docs/guides updated
- [ ] Example created ([starter template on
JSBin](https://codepen.io/gkatsev/pen/GwZegv?editors=1000#0))
- [x] Has no DOM changes which impact accessiblilty or trigger warnings
(e.g. Chrome issues tab)
  - [x] Has no changes to JSDoc which cause `npm run docs:api` to error
- [ ] Reviewed by Two Core Contributors

---------

Co-authored-by: Gary Katsevman <git@gkatsev.com>
2024-07-22 22:16:17 +02:00
Dzianis Dashkevich
798647b7ea 8.17.2 2024-07-22 14:37:00 -04:00
Dzianis Dashkevich
49151eea90
chore: update vhs version 3.13.2 (#8812)
## Description
Update vhs version (v3.13.2)

## Specific Changes proposed
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 (Chrome, Firefox,
IE)
  - [ ] Unit Tests updated or fixed
  - [ ] Docs/guides updated
- [ ] Example created ([starter template on
JSBin](https://codepen.io/gkatsev/pen/GwZegv?editors=1000#0))
- [ ] Has no DOM changes which impact accessiblilty or trigger warnings
(e.g. Chrome issues tab)
  - [ ] Has no changes to JSDoc which cause `npm run docs:api` to error
- [ ] Reviewed by Two Core Contributors

Co-authored-by: Dzianis Dashkevich <ddashkevich@brightcove.com>
2024-07-22 14:35:43 -04:00
mister-ben
e78bcc7b2d 8.17.1 2024-07-15 10:40:39 +02:00
mister-ben
0a836e1006
fix: ensure transient button event listeners are removed on dispose (#8796)
## Description
Transient button sets an event listener on the player directly instead
of on itself, which doesn't get cleaned up when disposed.
Fixes #8795

## Specific Changes proposed
Call `on` on the component with player as the first arg, instead of
calling `on` on the player directly.

## Requirements Checklist
- [x] Feature implemented / Bug fixed
- [ ] If necessary, more likely in a feature request than a bug fix
- [x] Change has been verified in an actual browser (Chrome, Firefox,
IE)
  - [ ] Unit Tests updated or fixed
  - [ ] Docs/guides updated
- [ ] Example created ([starter template on
JSBin](https://codepen.io/gkatsev/pen/GwZegv?editors=1000#0))
- [x] Has no DOM changes which impact accessiblilty or trigger warnings
(e.g. Chrome issues tab)
  - [x] Has no changes to JSDoc which cause `npm run docs:api` to error
- [ ] Reviewed by Two Core Contributors
2024-07-14 18:15:38 +02:00
mister-ben
51b4670f69 8.17.0 2024-07-10 11:43:18 +02:00
mister-ben
970faa8fb1
fix(types): fix and improve component ready callback definition (#8766)
- Removes erroneous `@return {Component}` from `ReadyCallback` in
Component
- Remove `@this {Component}` from `ReadyCallback` in Component, because
this is not accurate for classes that extend Component
- Adds `@returns {void}` to `ReadyCallback` in Component
  - Produces a more accurate typedef
- Isn't strictly accurate in jsdoc/javascript but does this matter since
it's well understood. Absence of `@return` is interpreted by tsc as
returning `{any}`, `@returns {undefined}` would require an explicit
`return undefined` in ts.
- Adds a `{PlayerReadyCallback}` in Player with `@this {Player}` used in
the `new Player()` and `videos()` constructors.
  - Are we ok adding this new typedef
- Is inconsistent with `player.ready()` which uses `ReadyCallback`
without `@this` - but this can't be changed without adding an otherwise
unnecessary override just to pander to tsc.

## Requirements Checklist
- [x] Feature implemented / Bug fixed
- [ ] If necessary, more likely in a feature request than a bug fix
- [x] Change has been verified in an actual browser (Chrome, Firefox,
IE)
  - [ ] Unit Tests updated or fixed
  - [ ] Docs/guides updated
- [ ] Example created ([starter template on
JSBin](https://codepen.io/gkatsev/pen/GwZegv?editors=1000#0))
- [x] Has no DOM changes which impact accessiblilty or trigger warnings
(e.g. Chrome issues tab)
  - [x] Has no changes to JSDoc which cause `npm run docs:api` to error
- [ ] Reviewed by Two Core Contributors
2024-07-06 08:31:15 +01:00
BrainCrumbz
6221a8f078
fix(middleware): cache grows even if no middleware created (#8674)
## Description
See issue #8653 

## Specific Changes proposed
When in `middleware.js` the function `clearCacheForPlayer` runs, before
setting a value to null in middlware caches, it checks if the key exists
in the first place.

## Requirements Checklist
- [x] Feature implemented / Bug fixed
- [x] If necessary, more likely in a feature request than a bug fix
- [x] Change has been verified in an actual browser (Chrome, Firefox,
IE)
  - [ ] Unit Tests updated or fixed
  - [ ] Docs/guides updated
- [x] Example created ([starter template on
JSBin](https://codepen.io/gkatsev/pen/GwZegv?editors=1000#0))
- [ ] Reviewed by Two Core Contributors

---------

Co-authored-by: Giuseppe Piscopo <g.piscopo@braincrumbz.com>
Co-authored-by: mister-ben <git@misterben.me>
2024-07-06 07:44:37 +01:00
mister-ben
1afe5049e6
feat: Adds a transient button component (#8629)
## Description
Adds a `TransientButton` component for the types of button that are
shown on top of the video briefly during playback and reappear when
there is user activity. e.g. Unmute buttons, skip intro. It aims is to
be a generic button type to be extended. Some basic styles are provided
but kept light to not complicate customisation.
It's important to insert a transient button before the control bar for
the tab order to make sense.

_Optionally_ takes focus when shown.

## Specific Changes proposed
Adds `TransientButton` component.

## Requirements Checklist
- [x] Feature implemented / Bug fixed
- [ ] If necessary, more likely in a feature request than a bug fix
- [x] Change has been verified in an actual browser (Chrome, Firefox,
IE)
  - [x] Unit Tests updated or fixed
  - [ ] Docs/guides updated
- [x] Example:
https://deploy-preview-8629--videojs-preview.netlify.app/sandbox/transient-button.html
- [x] Has no DOM changes which impact accessiblilty or trigger warnings
(e.g. Chrome issues tab)
  - [x] Has no changes to JSDoc which cause `npm run docs:api` to error
- [ ] Reviewed by Two Core Contributors
2024-07-06 07:40:31 +01:00
David HM Morgan
f701102fe9
fix: apply correct styles to audio descriptions track menu items (#8770)
## Description
Fix #8769 for mismatched track kind should be plural descriptions
according to definition of `AudioTrackKind`
https://github.com/videojs/video.js/issues/8769

## Specific Changes proposed
Corrects `description` to `descriptions`
2024-06-25 20:19:38 +02:00
uomar
2b3ffd489e 8.16.1 2024-06-24 11:43:31 +01:00
Usman Omar
04b9bb27bb
fix: enable keyboard controls on menu items (#8777)
## Description

This fix addresses an issue that was introduced in this
[refactor](35de64ceb0 (diff-9fd94576fe3b609171a426feb961b0954d70c8c14e598024d49ae9c8836a71ca)).
At the moment, all key down events that are supposed to interact with
the `menu-item` component are now being ignored, meaning you are unable
to interact with most of the menu items in the control bar (e.g.
captions settings). This PR fixes that by only ignoring key down events
that are normally ignored by the `menu-item`.

## Requirements Checklist
- [x] Feature implemented / Bug fixed
- [ ] If necessary, more likely in a feature request than a bug fix
- [ ] Change has been verified in an actual browser (Chrome, Firefox,
IE)
  - [ ] Unit Tests updated or fixed
  - [ ] Docs/guides updated
- [ ] Example created ([starter template on
JSBin](https://codepen.io/gkatsev/pen/GwZegv?editors=1000#0))
- [ ] Has no DOM changes which impact accessiblilty or trigger warnings
(e.g. Chrome issues tab)
  - [ ] Has no changes to JSDoc which cause `npm run docs:api` to error
- [ ] Reviewed by Two Core Contributors
2024-06-24 11:19:59 +01:00
mister-ben
fa9c41c866
chore: Update typescript to 5.5.2 (#8776)
## Description
Update to release of Typescript 5.5 (5.5.2) from rc (5.5.1). Diff shows
no changes in types output.
2024-06-23 14:19:13 +02:00
Adam Waldron
6b468dd2a9 8.16.0 2024-06-12 10:20:57 -07:00
Adam Waldron
864074d74d
fix: update to VHS v3.13.1 (#8765) 2024-06-12 07:46:44 -07:00
mister-ben
86ff6123f5
fix: improve ts output for create logger (#8763)
## Description
Typescript =< 5.2 generated better types for `log` than >= 5.3. We're on
5.5 as that has the better import syntax.
Changing createLogger to use `function log()` rather than `const log =
function()` outputs as before.

Also updates typescript to 5.5.1 (rc) from 5.5.0 (beta).

5.2, or 5.5 with this change
```
export default log;
declare const log: {
    (...args: any[]): void;
    createLogger(subName: string, subDelimiter?: string, subStyles?: string): any;
    createNewLogger(newName: string, newDelimiter?: string, newStyles?: string): any;
    levels: any;
    level(lvl?: "info" | "error" | "all" | "debug" | "warn" | "off"): string;
    history: {
        (): any[];
        filter(fname: string): any[];
        clear(): void;
        disable(): void;
        enable(): void;
    };
    error(...args: any[]): any;
    warn(...args: any[]): any;
    debug(...args: any[]): any;
};
export const createLogger: (subName: string, subDelimiter?: string, subStyles?: string) => any;
//# sourceMappingURL=log.d.ts.map%
```

5.3+, without this change
```
export default log;
declare function log(...args: any[]): void;
declare namespace log { }
export const createLogger: (subName: string, subDelimiter?: string, subStyles?: string) => any;
//# sourceMappingURL=log.d.ts.map%
```

## Requirements Checklist
- [x] Feature implemented / Bug fixed
- [ ] If necessary, more likely in a feature request than a bug fix
- [x] Change has been verified in an actual browser (Chrome, Firefox,
IE)
  - [ ] Unit Tests updated or fixed
  - [ ] Docs/guides updated
- [ ] Example created ([starter template on
JSBin](https://codepen.io/gkatsev/pen/GwZegv?editors=1000#0))
- [x] Has no DOM changes which impact accessiblilty or trigger warnings
(e.g. Chrome issues tab)
  - [x] Has no changes to JSDoc which cause `npm run docs:api` to error
- [ ] Reviewed by Two Core Contributors
2024-06-12 05:13:27 +02:00
Borut Zizmond
b58b4c5879
feat(icons): update Twitter X logo (#8764)
## Specific Changes proposed
- update font version to 4.2.0 to use updated Twitter icon
- update to Twitter X icon in SVG


## Requirements Checklist
- [x] Feature implemented / Bug fixed
- [ ] If necessary, more likely in a feature request than a bug fix
- [ ] Change has been verified in an actual browser (Chrome, Firefox,
IE)
  - [ ] Unit Tests updated or fixed
  - [ ] Docs/guides updated
- [ ] Example created ([starter template on
JSBin](https://codepen.io/gkatsev/pen/GwZegv?editors=1000#0))
- [ ] Has no DOM changes which impact accessiblilty or trigger warnings
(e.g. Chrome issues tab)
  - [ ] Has no changes to JSDoc which cause `npm run docs:api` to error
- [ ] Reviewed by Two Core Contributors
2024-06-11 12:58:29 -04:00
mister-ben
f4186a0024
fix: use guid to ensure uniqueness of track setting options (#8762)
The fix for the previous issue with the new text track settings
introduced that ids would be re-used across players as there was no
prefix for the settings that don't have a `<label>` for their
`<select>`.

This change uses a generated guid for items without that label.
Fixes #8761

## Requirements Checklist
- [x] Feature implemented / Bug fixed
- [ ] If necessary, more likely in a feature request than a bug fix
- [x] Change has been verified in an actual browser (Chrome, Firefox,
IE)
  - [ ] Unit Tests updated or fixed
  - [ ] Docs/guides updated
- [ ] Example created ([starter template on
JSBin](https://codepen.io/gkatsev/pen/GwZegv?editors=1000#0))
- [x] Has no DOM changes which impact accessiblilty or trigger warnings
(e.g. Chrome issues tab)
  - [x] Has no changes to JSDoc which cause `npm run docs:api` to error
- [ ] Reviewed by Two Core Contributors
2024-06-10 15:11:26 +02:00
Dzianis Dashkevich
fc1f7a6f82 8.15.0 2024-06-06 19:04:03 -04:00
Dzianis Dashkevich
8cfd6c4ca0
feat: update xhr (#8757)
update xhr to 2.7.0

Co-authored-by: Dzianis Dashkevich <ddashkevich@brightcove.com>
2024-06-06 19:03:30 -04:00
mister-ben
a10d25861d
fix: removes duplicate id in text track settings (#8755)
## Description
Prevents a duplicate id in text track settings.
Fixes #8754

## Specific Changes proposed
The text edge settings were erroneously duplicating the id generated for
the background colour. Changes to a unique name.
Adds a general test for duplicate ids.

## Requirements Checklist
- [x] Feature implemented / Bug fixed
- [ ] If necessary, more likely in a feature request than a bug fix
- [x] Change has been verified in an actual browser (Chrome, Firefox,
IE)
  - [x] Unit Tests updated or fixed
  - [ ] Docs/guides updated
- [ ] Example created ([starter template on
JSBin](https://codepen.io/gkatsev/pen/GwZegv?editors=1000#0))
- [x] Has no DOM changes which impact accessiblilty or trigger warnings
(e.g. Chrome issues tab)
  - [x] Has no changes to JSDoc which cause `npm run docs:api` to error
- [ ] Reviewed by Two Core Contributors
2024-06-01 23:11:52 +02:00
Adam Waldron
8729e31d60 8.14.1 2024-05-30 12:50:12 -07:00
Adam Waldron
38198f661e
fix: lockfile for vhs v3.13.0 (#8751) 2024-05-30 12:46:17 -07:00
Pat O'Neill
91e5e2dc8d
add browser.IS_CHROMECAST_RECEIVER and class name for CSS targeting on a Chromecast receiver where Video.js is used (#8703) 2024-05-30 12:16:43 -07:00
Mohammad Mansour
ad357b5f61
fix(lang): Arabic translation grammar, spelling and vocabulary errors (#8724)
* Fix Arabic translation grammar and vocabulary errors

* Added missing Arabic translation "Playing in Picture-in-Picture"
2024-05-30 12:15:54 -07:00
Mohammad Mansour
85b47ceee6
Added missing Arabic translation, but forgot to remove that from this file (#8725) 2024-05-30 12:15:33 -07:00
mister-ben
084af2ffb5
fix: Remove Firefox warnings about deprecated event props (#8736) 2024-05-30 12:15:09 -07:00
mister-ben
42e167c4d2
chore: Update karma dependenciess (#8743) 2024-05-30 12:14:52 -07:00
mister-ben
c5f548be09
chore: Update PR template (#8750)
Adds reminders to check impact of JSDoc and DOM changes.
2024-05-28 19:44:56 +02:00
mister-ben
4de09e4335
fix(docs): Add workaround for ErrorMetadata typedef (#8737) 2024-05-23 19:04:25 +02:00
mister-ben
35de64ceb0
refactor: Replace keycode dependency with event.key (#8735)
refactor: Replace keycode dependency with event.key
2024-05-23 18:50:23 +02:00
Adam Waldron
978731eddf
chore: update VHS to v3.13.0 (#8742) 2024-05-21 16:19:42 -07:00
mister-ben
f05769d116
Update typescript and jsdoc, use @import (#8723) 2024-05-15 15:02:01 +02:00
Adam Waldron
7b0aede1c3 8.14.0 2024-05-06 10:13:17 -07:00
Emil Broll
b5357588de
Updated translations for nb (#8650)
Co-authored-by: mister-ben <git@misterben.me>
2024-05-06 10:04:41 -07:00
mister-ben
ad3be357d5
fix: Ensure aria-labelledby values in track settings are valid (#8711) 2024-05-06 09:58:47 -07:00
Christian Ebert
3df0e9b7f4
chore(css): fix typo in postcss-config browserslist and update list (#8578)
- s/last 3 major version/last 3 major versions/
- sync with current browserslistrc, babelrc, rollup_config
2024-05-06 09:58:15 -07:00
Adam Waldron
4dfea6193a
feat: refactor error consts (#8719)
* feat: refactor error consts

* fix: add failed
2024-05-06 09:36:05 -07:00
weiz18
9946a197eb
fix(dom): handle slotted parent transform position (#8158)
* fix(dom): handle slotted parent transform position

* fix(test): add test to cover getPointerPosition

* run all tests

---------

Co-authored-by: mister-ben <git@misterben.me>
2024-05-03 14:23:30 +02:00
André M
8050466bcc
fix(player): adapt player height to control bar height in audioOnly mode (#8579)
Adapts the `player.height` to the `controlBar.currentHeight` when the
`audioOnlyMode` is `enabled`. This ensures that the player height and control
bar height are always in sync when the player is resized.

- add `updatePlayerHeightOnAudioOnlyMode_` function that will update the player
height according to the control bar height when the player is resized
- modify `enableAudioOnlyUI_`
  - add a `controlBarHeight` to `audioOnlyCache_` to keep track of the control
  bar height changes when the player is resized
  - add a `playerresize` listener
- modify `disableAudioOnlyUI_` to remove the `playerresize` listener
2024-05-03 14:15:01 +02:00
Josep Boix
31b037891b
fix: prevent error for root shadow elements when restorEl is enabled (#8679)
Addresses an issue where activating the `restoreEl` option for an element at the root of a shadow DOM threw a "TypeError: el.parentNode.hasAttribute is not a function". The bug was due to the `parentNode` being a shadow root, which does not have the `hasAttribute` method.

The fix implemented checks for the existence of the `hasAttribute` method on `parentNode`.
2024-05-03 14:11:03 +02:00
mister-ben
992af3b3ee
refactor: use URL API (#8716)
* refactor: use URL API

* add relative test

* remove old jsdoc comment

* Corrected test description
2024-05-03 14:06:05 +02:00
Grzegorz Blaszczyk
3e697e942f
fix: progress bar sometimes is not filled on 100% (#8633)
* fix: the seek bar shouldn't throttle the update function on the ended event.

* test: add unit test
2024-05-03 13:57:32 +02:00
mister-ben
cb76a24bd5
fix: Support MacOS trackpad with tap-to-click (#8700) 2024-04-25 18:38:05 +02:00
Walter Seymour
466fa9761c
chore: remove plugin errors from error const (#8706) 2024-04-23 16:47:06 -05:00
Dzianis Dashkevich
c2c7f96030 8.13.0 2024-04-22 15:40:52 -04:00
Dzianis Dashkevich
8699deb58d
fix: update vhs version (#8704)
Co-authored-by: Dzianis Dashkevich <ddashkevich@brightcove.com>
2024-04-22 15:39:24 -04:00