Add a `Player#version()` method which returns an object with the Video.js version under the `video.js` property name, to match the package name.
This could then be extended to support adding plugin, tech, and source handler versions as part of the version call.
Fixes#8538
* refactor(player): decrease the indentation level in the currentTime method
* fix(player): cache_.currentTime is not updated when the current time is set
Updating cache_.currentTime as soon as the currentTime is set avoids having to wait for the timeupdate event, which results in:
- making cache_.currentTime more reliable
- updating the progress bar on mouse up after dragging when the media is paused.
See also: #6232, #6234, #6370, #6372
* feat: add an option to handle smooth seeking
Adds a player option called enableSmoothSeeking, which is false by default,
to provide a smoother seeking experience on mobile and desktop devices.
Usage:
```javascript
// Enables the smooth seeking
const player = videojs('player', {enableSmoothSeeking: true});
// Disable the smooth seeking
player.options({enableSmoothSeeking: false});
```
- **player.js** add an `option` called `enableSmoothSeeking`
- **time-display.js** add a listener to the `seeking` event if `enableSmoothSeeking` is `true` allowing to update the `CurrentTimeDisplay` and `RemainingTimeDisplay` in real time
- **seek-bar.js** `update` the seek bar on `mousemove` event if `enableSmoothSeeking` is `true`
- add test cases
Allows to change the border size of the `loading-spinner` component without having to reflect the border size in the pseudo-element margin.
- uses display `flex` to facilitate centering of pseudo-elements
- deletes the pseudo-elements `margin`
* fix(i18n): new italian labels
Fix Italian labels according to ones used by Bootstrap Italia (Italian government official library)
* fix(i18n): replace "filmato" with "contenuto multimediale"
* Create np.json
Language support for Nepali language
* Updated half of the fields
* Final changes for nepali language
* uniform is literllay translated to cloth, rather is should be Consistent
* typo
* final typo fix
---------
Co-authored-by: Dzianis Dashkevich <98566601+dzianis-dashkevich@users.noreply.github.com>
Allows CSS classes to be reset when `player.reset` is called,
so that the player is close to its initial state.
- remove `vjs-playing`
- add `vjs-paused`
When `player.reset` is called the `titleBar` component is not reset.
- Sets the properties `title` and `description` to `undefined` when `player.titleBar.update` is called so that the component is properly reset.
This issue occurs when the `player` has the class `vjs-show-big-play-button-on-pause`
and playback has started and then been set to `pause` and an `error` occurs.
- Avoids displaying `big-play-button` on error
When `player.reset` is called, the `errorDisplay` component is not reset, and neither is `player.error`.
- Sets `player.error` to `null`, so that the `player.errorDisplay` and `player.error` are correctly reset.
- Adds an `error` function to the `testPlayer` stub to prevent tests from failing.
This issue happen when the `player` has the class `vjs-show-big-play-button-on-pause` and a `seek` occurs,
resulting in the `loadingSpinner` being hidden behind the `bigPlayButton`.
- Avoids displaying `bigPlayButton` while `seeking`
When consecutive errors occur, the `ErrorDisplay` component is not updated with the new error message.
This results in an inconsistent state between the `player.error` and `player.errorDisplay.contentEl().textContent`.
| | player.error() | player.errorDisplay.content() | player.errorDisplay.contentEl().textContent |
| ----------------------- | -------------- | ----------------------------- | ------------------------------------------- |
| player.error('Error 1') | Error 1 ✔️ | Error 1 ✔️ | Error 1 ✔️ |
| player.error('Error 2') | Error 2 ✔️ | Error 2 ✔️ | Error 1 ❌ |
An example of a use case where updating the error message is useful is :
- user tries to play media 1 but the media doestn't exist
- user tries to play media 2 but the media is not compatible
- call the `close` function before each call to the `open` function.
- if errorDisplay is not **open**, the `close` function does nothing
- if errorDisplay is **open**, the `close` function executes and triggers the close events, then the open function executes and triggers the open events, ensuring that the content is updated.
The control bar is not displayed correctly when the display is locked because `.vjs-lock-showing` uses `display` `block` instead of `flex`.
- use `display` `flex` instead of `display` `block` when the control bar has `.vjs-lock-showing` class
- ensure that the control bar is not displayed if the `player` has classes:
- `.vjs-controls-disabled`
- `.vjs-using-native-controls`
- `.vjs-error`