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

1777 Commits

Author SHA1 Message Date
Grzegorz Blaszczyk
54195f0b28 feat: add support for a list of quality levels (#7897)
This brings the videojs-contrib-quality-levels plugin into Video.js as a feature.
2022-11-23 09:49:32 -05:00
Alex Barstow
1299daf16c refactor: remove extend() and tests (#7950)
BREAKING CHANGE: This removes the videojs.extend() method, please use ES6 classes instead.
2022-11-23 09:49:30 -05:00
mister-ben
f2aa0d7d13 feat: Use picture el for poster (#7865)
BREAKING CHANGE: This changes the DOM structure used for the video poster.
2022-11-23 09:49:29 -05:00
Gary Katsevman
b0101a6b9b feat: Enable sourceset by default (#7879)
Can still be disabled with enableSourceset: false
2022-11-23 09:49:29 -05:00
Gary Katsevman
d4559b1ebe feat: make retryOnError be the default (#7868)
This means that a retryOnError is removed and is no longer needed for
this behavior, which means that during source selection, if a source
fails, it'll try the next source that's available, to match the video
element.

BREAKING CHANGE: remove retryOnError option, turn it on by default
2022-11-23 09:49:28 -05:00
Gary Katsevman
bd54b4112e fix: update icons import path for sass (#7867)
This updates the path to remove node_modules as some tools expect the
module name to be first. This is particularly important for PnP tools as
local node_modules may not have the module.

Fixes #7208, fixes #7863

BREAKING CHANGE: update icons path in sass to remove node_modules
2022-11-23 09:49:28 -05:00
Grzegorz Blaszczyk
9b3d9415aa feat: addClass and removeClass method supports adding/removing multiple classes (#7798) 2022-11-23 09:49:27 -05:00
mister-ben
63a2d027f4 feat: remove closest fallback (#7853) 2022-11-23 09:49:27 -05:00
Roman Pougatchev
f46b83002e feature: Remove support for setting nonstandard attributes as props (#7857)
* remove statement that handles attributes in props argument

* clean up function

* add unit test

* add unit test

* remove duplicate set attr

* revert function cleanup
2022-11-23 09:49:26 -05:00
Roman Pougatchev
706983caa3 feat: Remove references and logic related to Flash and SWF (#7852)
* remove flash references, update comments & tests

* remove references to swf & stageclick listener
2022-11-23 09:49:26 -05:00
Pat O'Neill
a5e7222353 feat(lang): use less ambiguous text for the fullscreen button when in fullscreen mode (#7856) 2022-11-23 09:49:25 -05:00
Pat O'Neill
5d165dc33c feat: add a new title bar component (#7788) 2022-11-23 09:49:25 -05:00
Roman Pougatchev
e4945cb78c refactor: Remove logic and style that accommodates non-flex fallbacks (#7820) 2022-11-23 09:49:24 -05:00
Pat O'Neill
a0fd14894c feat: playback rate button now opens the menu rather than changing the playback rate (#7779)
BREAKING CHANGE: This changes the behavior of the playback rate button.
2022-11-23 09:49:24 -05:00
Pat O'Neill
cc84ff4f80 refactor: remove internal Map, Set, and WeakMap shams, assume window.performance and requestAnimationFrame support (#7775) 2022-11-23 09:49:24 -05:00
Pat O'Neill
28029d93f4 feat: update exposed utility functions and deprecate several top-level methods of the videojs global (#7761) 2022-11-23 09:49:23 -05:00
Alex Barstow
bd8aebb827 refactor: remove ie-specific code (#7701)
BREAKING CHANGE: This will cause Video.js to fail in many cases in all versions of Internet Explorer.
2022-11-23 09:48:13 -05:00
Alex Barstow
dd1b478e4d feat: assume native promises, remove promise option and workarounds (#7715)
BREAKING CHANGE: Removes support for Promise class option and assumes native Promise is available. Will break in older browsers or devices.
2022-11-23 09:48:13 -05:00
Alex Barstow
f99ace0fba revert: revert #7067 so we throw an error for invalid event types (#7719)
BREAKING CHANGE: Instead of logging an error message, invalid events will now trigger an `Error` which will terminate the call stack.
2022-11-23 09:48:13 -05:00
hugorogz
c190b21de7 feat: remove the firstplay event (#7707)
Co-authored-by: Hugo Rodriguez <hrodriguez@brightcove.com>

BREAKING CHANGE: Removes the firstplay event. Use one('play') instead.
2022-11-23 09:48:12 -05:00
hugorogz
9d832eca5f feat: export more helpers in videojs object (#7717)
Co-authored-by: Hugo Rodriguez <hrodriguez@brightcove.com>
Co-authored-by: Pat O'Neill <pgoneill@gmail.com>
2022-11-23 09:48:12 -05:00
Alex Barstow
1281d68d78 chore: Update preset env, drop IE11 and older browser support (#7708) 2022-11-23 09:48:11 -05:00
Alex Barstow
3faa866834 feat: Change addRemoteTextTrack's manualCleanup option default value to false (#7588) 2022-11-23 09:48:11 -05:00
Grzegorz Blaszczyk
e49286a81c
fix: last timeout in queueTrigger() never clears map (#7964) 2022-10-20 18:10:50 -04:00
Pat O'Neill
b58a2201c4
fix: deprecate the extend() function (#7944)
This function will be removed in Video.js 8.0
2022-10-03 17:22:01 -04:00
mister-ben
d736541ba6
fix: allow for techs that init slowly in rvfc (#7864)
Don't call tech.paused() in the requestVideoFrameCallback fallback if the tech is not ready. I've seen this is an issue in the Flash tech, as its methods are set up after the swf loads. Yes, Flash, it's 2022, but in theory another tech could be impacted if it's also async.
2022-09-09 13:52:34 -04:00
mister-ben
9b81afee80
fix: Use timeupdate as well as rvfc/raf for cues (#7918)
Use the timeupdate event as well as the rvfc and raf callbacks to check cues. This is a bit overkill for "usual" playback but avoids edge cases. If the more preceise callback trigger first the cue will update but the timeupdate event should catch any that were missed, notwithstanding that timeupdate was always somewhat unpredictable.

Fixes #7910 (audio in video els and Samsung being weird) and fixes #7902 (no updates off screen).
2022-09-09 13:50:21 -04:00
Ikko Ashimine
9ca2e8764a
refactor: fix typo in player.js (#7805)
langauge -> language
2022-08-02 12:31:22 -04:00
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
André
1445f87800
fix(control-bar): audio player no longer responds to touch events (#7825) 2022-07-01 15:17:43 -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
Grzegorz Blaszczyk
75ea699273
fix: error message should not be localized in the player class (#7776) 2022-05-31 15:50:27 -04:00
Grzegorz Blaszczyk
05d52783e6 fix(accessibility): frame must have a title attribute (#7754) 2022-05-20 09:54:45 -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
Alex Barstow
145aba6aea
fix: Audio only mode styling conflicts with fluid mode (#7724)
* css changes

* make audio only mode player responsive in fluid mode
2022-04-15 12:55:27 -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
Wayne-Morgan
337ff2fed3
fix: text-track-display position with no ui (#7682)
Fixes #7681
2022-03-21 10:00:41 -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
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
André
a0bb5264c7
feat: Assume DASH MIME type when an MPD source URL is given (#7602) 2022-03-02 10:36:25 -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
Pat O'Neill
c44057d217
fix(accessibility): By default, show track selection buttons at all responsive breakpoints (#7603) 2022-02-23 12:17:27 -05:00
Claire Kannapell
950deae59b
fix: keep focus trapping contained to modal (#6983) 2022-02-23 12:16:28 -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
1d4bad8199
fix: regression with AD audio track menu items (#7559)
In #7337, a lot of code was updated to no longer user innerHTML, but we
accidentally caused an issue with Audio Description (AD) tracks where
the track title was included twice. Once before and once after the AD
icon.

This is because we were calling `super.createEl()` but MenuItem created
a specific element and didn't just pass things the arguments along.
Instead, we should use `Dom.createEl()` directly.

Fixes #7556
2021-12-08 15:30:20 -05:00
Gary Katsevman
3c213455ee
fix: volume control showing up on iOS (#7550)
This is a follow-up to #7514. But turns out, that we still had a timing
issue around when we were doing the check and when the volume control
was created.

Instead, we should make `featuresVolumeControl` not be a lazy property,
so, that we do that check as early as possible. Also, we should
default this property to `false` in this case, so, that we assume we
can't until we confirm we can.

Additionally, added a null check for Html5, to be extra defensive since
the timeout isn't tied to a player.
2021-12-01 17:33:11 -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
1d96d1cf20
fix: try again on volume feature detection on iOS (#7514)
On latest iOS, we are seeing times when the volume feature detection is
showing that we are able to change the volume, though, that is not the
case. Instead, on iOS, when we detect that we can control the volume, we
set a short timer to retest and reset the featuresVolumeControl property.

Fixes #7040
2021-11-17 12:27:08 -05:00
Gary Katsevman
115a04745f
fix: turn off other tracks with native audio track (#7519)
Audio Tracks are supposed to allow multiple tracks at the same time.
Safari 15 has added, at least partial support for this.

In #7163, we stopped turning other tracks of manually since we already
were doing so in the AudioTrackList. However, this only worked for
non-native AudioTracks. Before Safari 15, Safari automatically turned
off the other tracks for us so things continued to work.

With this change, when native audio tracks are used, we will turn off
the other tracks, partially reverting #7163.

We currently do not have any tests or are set up for writing tests for
these proxy tracks. Adding such tests will take too long for not a lot
of benefit, unfortunately.

Fixes #7494.
2021-11-16 11:23:03 -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
iChengbo
ca2f5a3cae
docs: fix a comment of the player's loadedmetadata event (#7506) 2021-11-10 14:07:24 -05:00
Robert J. Berger
749105d32c
feat: Add userAction.click to prevent pause/play when player is clicked (#7495)
Pass `false` as `userAction.click` to disable the default click-to-play behavior. Alternatively, pass in a function, to enable custom behavior.

Fixes #7123.
2021-11-10 14:06:25 -05:00
André
78cf834e6f
fix: volume button empty space (#7466)
When responsive mode is used and the player layout is small or smaller, an empty space appears to the right of the mute button on hover.

Fixes #7465
2021-11-10 14:04:08 -05:00
Ikko Ashimine
8e8b7be190
docs: fix typo in html-track-element.js (#7504)
vesion -> version
2021-11-09 10:17:47 -05:00
Gary Katsevman
bcd80f922e
fix: don't let the player be translated except captions (#7474)
This is another follow-up to #6699.

Potentially, it means we could get rid of #6977
2021-11-09 10:17:04 -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
Ileana Padilla
1d91831992
fix: remove rule on small layout (#7449) 2021-09-28 14:37:44 -04:00
Gary Katsevman
6d39ee24b1
fix: remove deprecation of getComponent feature (#7410)
Since Video.js 6, we've removed the deprecated functionality, we no longer need to have a deprecation warning.
2021-09-02 14:35:34 -04:00
John Caruso
1f4d95b050
fix: prevent cached inactivityTimeout from being overwritten with 0 (#7383)
If multiple `mouseenter` events fire on the controlBar before a `mouseleave` event occurs, the cached inactivityTimeout value will get overwitten with a 0. This prevents the control bar from being hidden when the inactivity timeout is reached because the hide call is skipped when inactivityTimeout <= 0.

The circumstances around multiple `mouseenter` events firing before a `mouseleave` event are when a menubutton on the toolbar has its `update()` method called: the menu popup is disposed but a `mouseleave` event isn't fired for it.

Fixes #7313
2021-08-19 15:33:37 -04:00
Brandon Casey
eb8f802391
refactor: remove most usage of innerHTML (#7337) 2021-07-28 16:42:23 -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
Brandon Casey
2ad4d60dac
fix: prevent control bar clicks/taps with while user inactive (#7329) 2021-07-27 12:33:16 -04:00
Chocobozzz
956379c570
fix: use click event for tech click event (#7302)
Flash is not really a thing anymore.
Prevent some weird behaviour when pressing left click outside the player, move the custor inside the player and release the button
2021-07-27 12:01:02 -04:00
Gary Katsevman
b483a7613f
fix: don't add anchor to DOM for getAbsoluteURL (#7336) 2021-07-22 16:01:12 -04:00
Gary Katsevman
b3acf66364
fix: remove IE8 url parsing workaround (#7334) 2021-07-22 13:14:26 -04:00
Travis Bader
2990cc7d65 fix(dom): in removeClass, check element for null in case of a disposed player (#6701) 2021-07-15 11:16:21 -04:00
Gary Katsevman
14da28dabe
fix: remove loading spinner on ended (#7311)
If we've ended, there's no point in having the loading spinner. In
addition, there are cases where we get a waiting event immediately
before ended, and this works around that.

Fixes videojs/http-streaming#1156
2021-07-06 15:42:43 -04:00
Gary Katsevman
508a424b02
fix: all !important properties of vjs-lock-showing (#7312) 2021-07-06 15:42:24 -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
Alex Barstow
c74c27d99b
feat: add ended getter middleware (#7287)
One thing to note is that this won't affect the play toggle from changing to the replay button on ended because it only listens to the ended event. Otherwise, this works fine.
2021-06-30 12:50:05 -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
Alec Winograd
a221be1d83
fix(event): event polyfill detection compatibility with react-native-web (#7286)
Fixes #7259
2021-06-24 16:54:02 -04:00
Gary Katsevman
688879858c
fix: do a null check on playbackRates player method (#7273) 2021-06-14 14:58:53 -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
mister-ben
35ad17a0ef
feat: Add helper classes for 9:16 and 1:1 (#7219)
Fluid mode's automatic detection is nice, but there can be a layout jump once the video dimensions are known. We have the vjs-16-9 and vjs-9-16 classes already, but square and portrait are also common now.
2021-06-08 11:02:57 -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
Tim Fischbach
8082c5a3d0
fix: allow Video.js to be required in an env without setTimeout (#7247)
Some JavaScript environments don't implement setTimeout, which causes Video.js to fail on require. Instead, move our Dom.isReal() check earlier to before we call setTimeout.
2021-06-02 15:51:20 -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
Dtthatcher
11ac0b9bf2
chore(component): update comment around triggering ready in component (#7256) 2021-06-02 15:48:07 -04:00
Boris Petrov
c70c29885a
fix(seek-bar): remove event listener on dispose (#7258)
We were accidentally listening to `liveedgechange` when the seek-bar disposed. Instead, we should remove that event handler.
2021-06-02 15:44:40 -04:00
mister-ben
b3503c93dd
chore: Update sass and remove now deprecated / for division. (#7253)
Fixes #7244
2021-06-02 13:13:00 -04:00
weiz18
90ce2d7143
fix(utils): add try and catch for computedStyle (#7214) 2021-05-11 12:58:45 -04:00
Aaron Mertzenich
06cdb6f49f
fix: incorrect focus styles on selected MenuItem (#7202)
Adds a :not() pseudo class to ensure that the MenuItem background color doesn't get incorrectly reset on mouse focus.

Fixes #7200
2021-05-11 12:54:43 -04:00
FredTsang
e9953e59fa
fix: exit full window mode with Esc key (#7224) 2021-05-11 12:54:15 -04:00
mister-ben
0e46624f1a
fix: Better text for exit fullscreen (#7183) 2021-05-10 18:51:32 -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
Owen Edwards
17919ce77b
fix: make Playback Rate control work better with screen readers (#7193)
Add an aria-describedby to the playback rate button.

Improves behavior of #7121.
2021-04-20 19:11:29 -04:00
Gary Katsevman
2c6e4397bb
fix: silence play promise in the play toggle. (#7189)
Fixes #6998
2021-04-16 14:06:19 -04:00
Brandon Casey
4707ce82c0
fix: always have an enabled audio track when switching (#7163) 2021-04-06 16:22:54 -04:00
Gary Katsevman
17a61474d0
perf: wrap prototype methods in handlers in an arrow function (#7060) 2021-03-24 15:38:27 -04:00
Grzegorz Blaszczyk
b2edfd24ac
feat: Add a mouse volume tooltip (#6824) 2021-03-23 18:02:07 -04:00
Ileana Padilla
239c9a1552
feat: enable responsive controls on fullscreen (#7098)
Co-authored-by: Ileana Padilla <ipadilla@brightcove.com>
2021-03-23 17:50:59 -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
Owen Edwards
5f59391a74
feat: Add a player option noUITitleAttributes to prevent title attributes in the UI (#7134)
Fixes #6767
2021-03-23 17:47:16 -04:00
Alex Barstow
b2336aacc9
fix: remove extra timeupdate event when progress controls is disabled (#7142) 2021-03-23 14:56:17 -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
Łukasz Polowczyk
45eef66b09
fix: add display block to all buttons icon placeholder (#7094)
Fixes #6989
2021-03-09 15:07:14 -05:00
Aaron Mertzenich
1b52e7bea0
fix: focus-visible shouldn't change background styles (#7113)
Only set background:none focus styles on menu
2021-03-09 15:06:35 -05:00
Gary Katsevman
3d676d68ca
fix: try enabling liveui on canplay (#7114)
On native playback engines, like Safari, for some streams, seekable and
currentTime won't have correct values until video data has started
loading. Previously, we only tried to turn toggle tracking on
durationchange, now we also do it on canplay.

This is a followup to #7034 which helped prevent the live tracker from
showing up in some cases.
2021-03-08 16:27:53 -05:00
Brandon Casey
ba47953851
chore: video.js debug build (#7082)
Adds a debug build to video.js that does the following:
- Exposes DomData on video.js. DomData our internal event tracking object and should be empty on player dispose.
- Set log level to debug by default.
2021-02-18 10:00:42 -05:00
Gary Katsevman
134f039573
fix: clear progress control related rAFs when tab is hidden (#7099)
The progress control is updated inside of requestAnimationFrames (rAFs). Normally, this is fine. However, when a tab is hidden, rAFs are generally not triggered. So, what happens is that we get a cached rAF from the last time the tab was active. When we come back to be active, we update again, but because we already have a named rAF, we don't clear it out and instead that one gets triggered. This isn't an issue if the video is still playing, because in a second, another rAF will be triggered which will update things. However, if the video has ended, we won't get any more updated and the progress bar will still be in the old position.

Instead, when the document becomes hidden, we should clear out both the SeekBar#update and the Slider#update rAFs. Doing just one, unfortunately, isn't enough. In addition, we also only re-enable the interval if we aren't ended or paused and ignore the update method if the tab is hidden.

Fixes #7086
2021-02-18 09:58:40 -05:00
Gary Katsevman
542cead6ea
fix(dom): account for translated parent in pointer position on iOS (#7079)
Since we switched to using adding up offsets to calculate the pointer position relative to the current element, we've had some issues, particularly on iOS, where a translated parent would cause us to miscalculate the position. This is currently a quickfix for the issue, and I'd like to spend some time to figure out a better solution that hopefully won't require us to iterate through the DOM and add up the transform matrix.
2021-02-04 11:33:25 -05:00
Gary Katsevman
541f2e584b
fix(dom): stop findPosition at a fullscreenElement (#7074)
On iPads, if the player is inside a floating div, when fullscreen, we'll have an incorrect offset value. Instead, we should stop counting our offsets once we get to our fullscreen element (i.e. the player) because in fullscreen it's outside the regular flow, and we don't actually want to add offset the float gives us inline.
2021-02-03 17:21:38 -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
KuanYu Chu
b13cb07d5b
fix: only preventDefault if event is cancelable (#7063) 2021-01-25 11:55:46 -05:00
Gary Katsevman
ed3c54d13a
fix(time-display): fix IE11 appending times instead of replacing (#7059)
IE11 only supports HTMLElement and not text nodes in the contains
method. See https://developer.mozilla.org/en-US/docs/Web/API/Node/contains
Instead, compare firstChild.
2021-01-22 13:55:58 -05:00
Gary Katsevman
dceedb6746
fix(fs): make sure handlers are unique per player (#7035)
Using Video.js's .bind still makes us attach prototype methods as
handlers. Then when one is removed, all handlers are removed.

Instead, use arrow methods to make these methods unique.

Fixes #7013.
2021-01-22 13:06:58 -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
Armin
a35a1217f0
fix(MapSham): fix set method to use map property (#7000) 2020-12-17 17:19:17 -05:00
Brandon Casey
11d37e28fd
fix: clear readyQueue with dispose (#6967) 2020-12-11 16:04:09 -05:00
kontrollanten
3e30f83bb1
fix(time-display): add a null check for text node (#6977)
fixes #6699
closes #6700
2020-12-11 16:01:36 -05:00
Brandon Casey
799616deee
fix: play progress time tooltip from jittering during live (#6968) 2020-12-11 15:57:51 -05:00
Kevin Kipp
dcce0e908d
fix: cast TOUCH_ENABLED to boolean (#6943)
This needs to be cast before exporting so users
can confidently pass it into their videojs config
and not worry about videojs internals doing strict
equality checks against true/false.

Co-authored-by: Kevin Kipp <kkipp@cloudflare.com>
2020-11-16 14:46:21 -05:00
genofire
3901ab0e72
fix(css): set seek to live button's align-items prop to center (#6942)
Fixes https://github.com/videojs/themes/issues/7
2020-11-16 14:44:29 -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
Zenon Mousmoulas
0140b28cc3
fix: always set tabIndex to restore keydown a11y (#6871)
Skipping the tabIndex property on created elements due to #6145
optimizations blocks them from receiving keyboard events, due to not
being focusable; for example this breaks closing ModalDialog elements by
pressing Escape.
Fix this by always setting tabIndex, as the element may return the same
value even though the property has not been explicitly set.

Fixes #6870
2020-11-10 18:10:59 -05:00
Aaron Mertzenich
694fe0f787
fix(menu): focus correct MenuItem on keyboard open (#6914)
Closes #6912

Co-authored-by: Aaron Mertzenich <aaron.mertzenich@sonicfoundry.net>
2020-11-10 18:10:25 -05:00
Gary Katsevman
a803484a39
feat(tech): add a scrubbing getter. (#6920)
This is helpful for source handlers and anything else that could have
customer behavior for when we're scrubbing or not.
2020-11-10 18:10:04 -05:00
Marco Del Toro Barragan
a0d09c107a
feat: trigger languagechange event on a language change (#6891) 2020-11-10 18:09:37 -05:00
Gary Katsevman
affc0611d9
fix(text-track): don't overlap captions when font-size changes (#6874)
For whatever reason, when the font size for text tracks is changed in
the text track settings dialog, we set a bottom of 2px on the cue.
This was added as part of the initial vtt work for Video.js in
4e5c28cc56 (diff-8169d53aa7eee6cab5f85b6641ef3117R176).
However, this doesn't seem to be doing anything right now and having it
means that when font-size is changed, multiple cues end up with a button
value of 2px causing them to overlap and obscure each other.

This works fine if the cues are positioned away from each other,
however, if multiple cues are positioned by default and a large font
size is used, while they will now stay on their lines, they may
partially obscure each other. This does not fix that issue and may
require modification (addition of overrides) to vtt.js to properly
support.
2020-10-06 10:18:23 -04:00
Gary Katsevman
1963086aef
fix(dom): vertical getPointerPosition value (#6864)
From my understand, in the changes #5773, the Y position of all the
boxes is already calculated and accounted for in the offsetY value we
get. However, because the HTML coordinate system has Y=0 at the top,
when we do offsetY/boxH, we get a position relative to the top of the
element. However, we expect that position relative to the "start" of the
slider, or the bottom of it. Therefore, we want to get the inverse
value, which is '1 - clamp(offsetY/boxH)'.

Fixes #6863
2020-10-01 11:16:53 -04: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
Samuel Burbano
c4c8fc1caf fix: Better mouse position handling (#5773)
This uses offsetX and offsetY on the MouseEvents which helps account for transforms on the player. Unfortunately, this isn't available on TouchEvents, so, while this helps desktop devices with using a mouse, it doesn't help mobile devices using touch.

Fixes #6726, fixes #1102.
2020-08-31 12:32:57 -04:00
Gary Katsevman
c91b510ef2
fix(tech): add abstract setScrubbing in tech.js (#6808) 2020-08-17 15:15:32 -04:00
Gary Katsevman
245efacb59
fix(tech): add abstract crossOrigin method on Tech (#6765)
As part of #6588, we started using the crossOrigin method. However, it's
possible that a tech doesn't support this. Notably, the Flash tech. We
should instead have an abstract method on Tech that returns nothing so
we don't fail on those browsers.
2020-07-20 17:02:12 -04:00
Gary Katsevman
94bea3502e
fix: limit fastSeek to Safari based browsers only (#6752)
Fixes #6722
2020-07-13 12:00:17 -04:00
Yichao Yu
8d462bcab0
feat: Add support for CAF, FLAC and WAV formats in known mimetypes (#6657)
Following https://en.wikipedia.org/wiki/HTML5_audio#Supported_audio_coding_formats
and https://hpr.dogphilosophy.net/test/index.php . These are formats that are supported
on some (most?) browsers.

Tested with a patched version of seafile. The flac and wav files correctly plays on
chromium on my Linux laptop and the caf file plays on my iPad.
(Chromium appears to play the caf file just fine but claim to not support it.)

Of course not all browsers support these but according to #5982 and my test result
I assume the browser detection is implemented somewhere else already.
2020-07-10 12:25:41 -04:00
Ileana Padilla
3d505ef0c5
feat: add debug mode (#6687)
When `debug(true)` is called, it will fire a `debugon` event that plugins and components can then use to do extra logging or anything else that's helpful to for debugging. It will also set the log level to debug.

When `debug(false)` is called, it will fire a `debugoff` event that plugins and components can then use to stop doing extra logging or helpful debugging. It will reset the log level to whatever it was previously.

Co-authored-by: ipadilla4 <ipadilla@brightcove.com>
2020-07-10 12:24:58 -04:00
Pat O'Neill
f6a66e62de feat: Add a default, plugin-specific logger to advanced plugins (#6693) 2020-07-10 11:59:04 -04:00
Alex Barstow
fdd807b81e
fix: Fullscreen broken in iOS (#6735)
The Fullscreen API is unsupported in iOS, so self.fsApi_.fullscreenerror and self.fsApi_.fullscreenchange are undefined, which was breaking the player after entering fullscreen by removing all bound player events.

Fixes #6707, fixes #6684, fixes #6645.
2020-07-07 17:33:03 -04:00
Brandon Casey
cad9114b2e
fix: Use clamp correctly in progress control (#6625) 2020-06-19 15:06:49 -04:00
Brandon Casey
6e7cc75aaa feat: Add named requestAnimationFrame to prevent performance issues (#6627)
Make sure we don't create multiple rAFs particularly when in a background tab.

Fixes #5937
2020-06-19 14:50:39 -04:00
mister-ben
907d1cd730
fix: Disable PIP if tech doesn't support it (#6678)
The requestPictureInPicture API and button currently assume thta if the browser supports the PIP API, the tech supports it. This results in a broken button with certain techs, such as youtube or HTML5 with an audio el.

Checks if disablePictureInPicture is exactly false. If true it's disabled and if undefined the tech does not support it.

Fixes #6398.
2020-06-19 14:36:43 -04:00