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

637 Commits

Author SHA1 Message Date
mister-ben
d178d9ae3c
fix: Conditional requestVideoFrameCallback on Safari (#7854)
Safari's requestVideoFrameCallback is (intentionally?) broken when DRM is playing, so in that case use the fallback with requestAnimationFrame instead.
2022-07-28 14:20:46 -04:00
Joe Flateau
b22a08aad0
fix: need to determine featuresVideoFrameCallback before setting source (#7812)
the tech needs to know whether or not the underlying element supports requestVideoFrameCallback before calling setSource

Fixes #7807
2022-06-28 16:01:00 -04:00
mister-ben
27f22efe6b
fix: Don't copy deprecated Event.path (#7782) 2022-05-31 15:51:12 -04:00
mister-ben
a14ace202b
fix: HTML5 tech with audio tag shouldn't use requestVideoFrameCallback (#7778) 2022-05-31 15:50:51 -04:00
Pat O'Neill
50ffd57a8e
test: stop running placeholder el test in IE and Safari to prevent errors (#7769) 2022-05-20 13:21:14 -04:00
mister-ben
3ec2ac7f99
feat: Player can be replaced with original el after dispose() (#7722) 2022-05-18 10:59:17 -04:00
try2beth3b3st
7e2b9ec411
fix: reset() should null check the controlBar (#7692)
Fixes #7689

Co-authored-by: alex <try2betheb3st@gmail.com>
Co-authored-by: Pat O'Neill <pgoneill@gmail.com>
2022-05-04 11:43:52 -04:00
Noemite
b7cb9d06d6
fix(accessibility): fix broken aria menu (#7699)
* fix(accessibility): fix broken aria menu

* Update src/js/menu/menu-button.js

Co-authored-by: mister-ben <git@misterben.me>

* add tests

Co-authored-by: Noémie Macault <noemie.macault@capgemini.com>
Co-authored-by: mister-ben <git@misterben.me>
2022-04-15 12:56:29 -04:00
Pat O'Neill
58a8bd01b2
test(text-track-controls): fix failing test caused by incompatibility between PRs (#7686) 2022-03-21 14:20:18 -04:00
mister-ben
5af81cad2e
fix: generate chapters menu only when needed and don't create orphaned event listeners (#7604) 2022-03-21 13:05:50 -04:00
mister-ben
28bdc7d590
feat: easier configuration of buttons and components via options (#7611) 2022-03-21 12:21:26 -04:00
Harisha Rajam Swaminathan
eeff79c5e8
refactor: Unify audioOnly mode and audioPoster mode (#7678)
Co-authored-by: Alex Barstow <alexander.barstow@gmail.com>
2022-03-17 17:10:33 -04:00
Alex Barstow
ebb2d09d17
fix: async audio only tests (#7673) 2022-03-11 12:24:50 -05:00
Alex Barstow
762e7bc751
feat: Audio Only Mode (#7647)
* audioOnlyMode wip

* fix incorrect logs

* add tests

* minor code changes and add another test

* update docs

* fix formatting

* fix typo

* Consolidate conditions

Co-authored-by: Pat O'Neill <pgoneill@gmail.com>

* Compare objects instead of name string

Co-authored-by: Pat O'Neill <pgoneill@gmail.com>

* code review changes

* remove unnecessary equivalence check

Co-authored-by: Gary Katsevman <git@gkatsev.com>

* replace height() with currentHeight()

Co-authored-by: Gary Katsevman <git@gkatsev.com>

* rewrite for async pip and fs handling

* asyncify tests

* update doc

* add test

Co-authored-by: Pat O'Neill <pgoneill@gmail.com>
Co-authored-by: Gary Katsevman <git@gkatsev.com>
2022-03-10 13:13:49 -05:00
mister-ben
1179826cbc
feat: Greater text track precision using requestVideoFrameCallback (#7633) 2022-03-02 10:34:13 -05:00
Harisha Rajam Swaminathan
64e55f5492
feat: Add audioPosterMode option (#7629) 2022-03-01 15:50:46 -05:00
Bruce Rodrigues
50fe5f659b
fix: Fix playback rate iteration if rates are not in the ascending order (#7618) 2022-02-23 12:28:14 -05:00
mister-ben
f16d73b528
fix: Guard against Safari adding native controls after fullscreen (#7634) 2022-02-23 12:17:49 -05:00
mister-ben
67e6ed6fd6
feat: make negative sign on remaining time optional (#7571)
Add a new `displayNegative` option on the remaining time display to not show a negative sign in front of the time.
The default value is true to maintain current behavior.

Closes #7565
2021-12-20 15:37:33 -05:00
Gary Katsevman
df927de320
fix: don't always use fastSeek when available. (#7527)
We were always setting `scrubbing(true)` on mouse down. This means, that
we'd use `fastSeek` even when seeking while clicking, rather than only
when scrubbing.

The main fix involves knowing in `handleMouseMove` whether we were
called directly as a `mousemove` handler or whether it was called from
`handleMouseDown`. This means that when `handleMouseMove` is called via
`handleMouseDown` we can skip setting `scrubbing(true)` and only do it
when we are scrubbing directly.
2021-11-17 15:59:01 -05:00
Gary Katsevman
6c67c3084b
fix: improve enabling liveui when switching sources (#7510)
We try and enable the liveui on canplay, however, we only do it the first time after the LiveTracker is enabled. This means that if you change sources, we may not catch that the liveui should be enabled. This is particularly important for browsers where native playback is used, like Safari, as the metadata may not be available until canplay.

This is a follow-up from #7114 which enabled listening to canplay but didn't account for switching videos in the same player.
2021-11-10 22:21:11 -05:00
Gary Katsevman
8abe438b08
test: add tests for the click user action (#7507)
Follow up on #7495
2021-11-10 14:17:19 -05:00
Gary Katsevman
e9e894ffa0
fix: enable liveui on more livestreams (#7502)
Some live streams with a 30s live window can actually fluctuate between below and above the 30s threshold we have. Instead, we should have a slightly lower default to have those streams get the liveui.
2021-11-09 10:13:51 -05:00
Owen Edwards
f326cf3449
fix: set the 'lang' attribute on text track display elements, if the language of the track is known (#7493)
Fixes #7487

Co-authored-by: Gary Katsevman <git@gkatsev.com>
2021-11-02 15:59:03 -04:00
Brandon Casey
ada25c4c76
fix: evented should cleanup dom data (#7350) 2021-07-28 15:55:35 -04:00
Gary Katsevman
774f9e7f45
feat(hooks): Error hooks (#7349)
Adding beforeerror and error hooks that make it easier to know when errors occurred on all players and allows intercepting and modifying errors.
2021-07-28 13:32:38 -04:00
Gary Katsevman
ad9546cad8
feat(time-ranges): make TimeRanges iteratable if Symbol.iterator exists (#7330) 2021-07-27 12:33:45 -04:00
Gary Katsevman
b3acf66364
fix: remove IE8 url parsing workaround (#7334) 2021-07-22 13:14:26 -04:00
Gary Katsevman
3921b7febf
fix: properly return promise from requestFullscreen and exitFullscreen (#7299)
Mapping the promise returned from the helpers to the executor's resolve, and reject
methods. We also need to catch the error in the promise chain that's
created inside exitFullscreenHelper_.

Fixes #7298.
2021-07-06 14:56:02 -04:00
Roman Pougatchev
f9fb1d3f51
fix: throw error on muted resolution rejection during autoplay (#7293)
Previously, when autoplay was set to any or muted, we would accidentally swallow the autoplay rejection when we reset the muted state back to what it was. Instead, we want to re-throw the error.
To get it working, we also had to update our tests to try/catch in our fake promise.
2021-06-30 12:28:41 -04:00
mister-ben
b86f083a88
feat: Add option to use full window mode instead of using tech's fullscreen (#7218)
iPhone's native fullscreen isn't always desirable as you can't overlay controls or anything else. Adds an option to prefer "full window" mode over the video el's fullscreen.

If the preferFullWindow option is set to true, on a browser that does not support the proper fullscreen API but does support fullscreen on the video element (i.e. iPhone), then requestFullscreenHelper_() should call enterFullWindow() instead of fullscreen on the tech.
2021-06-08 11:54:33 -04:00
Alex Barstow
b4ad93a10e
feat: Add normalizeAutoplay option to treat autoplay: true as autoplay: "play" (#7190)
This PR adds a new option to treat autoplay: true the same as autoplay: 'play'. In general we want video.js to handle as much of the autoplay logic itself as possible, since the browser's treatment of the video element's autoplay attribute is less predictable. For now the default option value is false, but it may be made the default behavior in a future major version.
2021-06-08 11:03:51 -04:00
Gary Katsevman
6259ef79e9
feat(player): Add playbackRates() method (#7228)
Adds a new playbackRates() method that takes an Array of numbers
representing the rates that are wanted to show up in the playback rates
menu. When new rates are given, a playbackrateschange event will trigger, which
will be used by the PlaybackRatesMenuButton to update itself.

An empty array will hide the menu. No value will return the currently
set playback rates. Other values will be ignored.

Fixes #7198
2021-06-08 11:01:56 -04:00
FredTsang
41d5eb3b52
fix(player): accept data for fullscreenchange and error events from the tech (#7254) 2021-06-02 15:49:23 -04:00
FredTsang
e9953e59fa
fix: exit full window mode with Esc key (#7224) 2021-05-11 12:54:15 -04:00
Brandon Casey
39485fc4c9
fix: user and programmatic seeks with live streams (#7210) 2021-05-10 18:42:17 -04:00
mister-ben
d4a08deb10
fix: Don't hide menus with one item and a title (#7215)
Menus with one item are hidden if they have a title, because adding the title increments the hide threshold, but the title is not counted as an item. e.g. the chapters menu if there is a single chapter.
2021-05-10 18:28:31 -04:00
Alex Barstow
22e9843942
feat: retry on error (#7038)
Add a `retryOnError` option. When set, during source selection, if a source fails to load, we will retry the next item in the sources list. In the future, we may enable this by default.

A source that fails during playback will *not* trigger this behavior.

Fixes #1805.
2021-03-23 17:50:12 -04:00
Isabelle Ingato
b76e816044
fix: do not preload default text track if preloadTextTracks is false (#7021)
When preloadTextTracks option is set to false, it still preloads the default text track. This leads to duplicate tracks once the mode changes to showing and the track is loaded a second time. This includes the default text track in the behavior defined by the preloadTextTracks option.

Fixes #7019
2021-03-09 15:07:38 -05:00
Gary Katsevman
fbf34e3429
test: a couple of minor fixes, tweak CI config, swap rollup replace plugin (#7128) 2021-03-09 11:41:01 -05:00
Gary Katsevman
85575dbaba
fix(evented): log an error on invalid type (#7067)
Follow up from #6982. We previously threw an error, but we've seen it
happen unexpectedly. Instead, we should log an error.
We will still throw an error if the event is undefined or null.

Here, if we have a `log` object on the current object, we should use it,
otherwise, we use a default `log` object.
2021-01-26 13:56:41 -05:00
Brandon Casey
db46578ac6
fix: prevent dispose error and text track duplicate listeners (#6984) 2021-01-21 17:02:15 -05:00
Brandon Casey
ffb690af6f
fix: better evented validation and error messages (#6982) 2021-01-21 17:00:12 -05:00
Brandon Casey
330c82c88f
fix: set liveWindow to 0 liveCurrentTime is Infinity (#7034)
Fixes an issue in native Safari and Android HLS playback where liveCurrentTime returns Infinity (as we don't have a seekableEnd or seekableEnd is actually Infinity). Which causes the new live ui to show up when we don't really have a live window.

Instead of returning Infinity when liveCurrentTime is Infinity, return 0. So that everything knows that we do not have a seekable window of live playback.
2021-01-11 17:24:53 -05:00
mister-ben
661962cb3a
fix(player): Ensure fluid works when dimensions not initially known (#7023)
The video dimensions aren't necessarily known at loadedmetadata particularly with native playback on iOS. In fluid mode, the player defaults to 16:9 and does not update once the dimensions are known.

- Updates player styles on resize events.
- Fixes arguments passed to addEventedCallback so the callbacks are executed.

Fixes #6939
2021-01-06 12:49:57 -05:00
mister-ben
503141c75f
docs: Remove Flash (#6994) 2020-12-22 14:10:53 -05:00
Brandon Casey
11d37e28fd
fix: clear readyQueue with dispose (#6967) 2020-12-11 16:04:09 -05:00
claudiah12
ee0637c078
feat(track): make label property mutable and fire a labelchange event when the label is changed (#6928)
Allows the editing of a track's label after its creation. Menu buttons will listen for the labelchange event and update their content accordingly.

This is technically divergent from the spec, which says it's readonly, but it can be useful for Video.js users.

Co-authored-by: Claudia Hinkle <chinkle@chinkle-mn1.linkedin.biz>
2020-11-10 18:11:53 -05:00
Marco Del Toro Barragan
a0d09c107a
feat: trigger languagechange event on a language change (#6891) 2020-11-10 18:09:37 -05:00
Tim Gates
f22ead10f0
docs: Fix simple typo, intial -> initial (#6851)
There is a small typo in src/js/player.js, src/js/tech/html5.js, test/unit/sourceset.test.js.

Should read `initial` rather than `intial`.
2020-09-22 14:38:19 -04:00