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

695 Commits

Author SHA1 Message Date
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
Gary Katsevman
6a28562d74
chore: setup Github CI (#6940) 2020-11-10 17:45:26 -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
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
94bea3502e
fix: limit fastSeek to Safari based browsers only (#6752)
Fixes #6722
2020-07-13 12:00:17 -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
Gary Katsevman
6d2e52ab83
test: skip requestPictureInPicture test if API isn't available (#6719) 2020-06-19 15:09:25 -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
mister-ben
0b91f74260
fix: addChild with index should allow for children that are elements (#6644)
The fix in #6297 doesn't work where the child to insert before is an element rather than a component, e.g. the video element.
Check if the child to insert before is an element, as well as checking if it has an el_
2020-05-26 17:00:23 -04:00
Gary Katsevman
a4ea1f9657
fix(text-tracks): set withCredentials on XHR if crossOrigin='use-credentials' (#6588)
Fixes #6587
2020-04-22 16:39:01 -04:00
Grzegorz Blaszczyk
dbd5203a0b
feat: adds disablePictureInPicture method to the player API. (#6378) 2020-04-22 12:41:21 -04:00
Gary Katsevman
8c66c58346
feat: support fastSeek during scrubbing if available (#6525)
This will allow us to use iframe playlists on HLS on Safari browsers and eventually, add support in VHS.
2020-04-22 12:40:26 -04:00
Brandon Casey
47ba7040b0
feat: Add a function for getting descendants from components (#6519) 2020-03-30 17:39:23 -04:00
Brandon Casey
668c7f44d6
fix(liveui): tweaks to prevent jitter (#6405) 2020-03-30 17:27:45 -04:00
Marco Garay
768adb1200
feat: Improve currentTime to allow it to be called before player is ready (#6507)
In the cases where the player isn't ready, or we are in the middle of changing sources, we will wait for `canplay` and then seek to the provided time without requiring Video.js users to handle this themselves.

Co-authored-by: Marco Garay <mgaray@brightcove.com>
2020-03-25 17:54:51 -04:00
Gary Katsevman
52c181ddb0
fix: trigger change events on remoteTextTrack when nativeTextTrack is set to true (#6410)
It seems we have never triggered change events on remoteTextTrack when we were using native text tracks. This was a problem for VHS, which exclusively uses text tracks.
This makes it so we do trigger the event. Main issue with this change is that it creates a potential for a false positive where a change event was triggered from a non-remote text track but the remoteTextTrack list still received a change event. This issue is mitigated by best practices of looping through the list looking for the modes that you care about.

Co-authored-by: Kevin Kipp <kevin.kipp@gmail.com>
Co-authored-by: Kyle Boutette <kyleveB@gmail.com>
2020-03-12 11:26:09 -04:00
Brandon Casey
47349c8e29
fix: add a threshold of 30s for the liveui to show (#6409) 2020-03-10 15:53:17 -04:00
Gary Katsevman
8a205d049e
refactor: support requestFullscreen's promise, better internal handling of events (#6422) 2020-01-31 15:59:12 -05:00
Gary Katsevman
25d15d4b14
fix(extend): super_ should be available for backwards compatibility (#6329)
Fixes #6328
2019-11-22 12:32:18 -05:00
Grzegorz Blaszczyk
ccca846da8 feat: resets pastSeekEnd_ variable. (#6249)
* feat: resets pastSeekEnd_ when its value is much higher than seeking increment.

* fixes unit tests
2019-11-15 13:44:34 -05:00
mister-ben
f7b3772e27 fix: ensure components added with an index are added in the correct location (#6297) 2019-11-14 15:22:42 -05:00
Pat O'Neill
29638b7969 fix: ensure the default ID of the first player is 'vjs_video_3' as some people have relied on this (#6216)
When a player is created without an id on the embed code, Video.js automatically assigns it one based on an auto-incrementing number (a.k.a. a GUID). For the longest time, this has happened to result in the default id of the first player being vjs_video_3.

It was never intended for users to rely on this value being consistent, but users do strange and inadvisable things.

PR #6103 had an unintended side effect in that it changed the default id to vjs_video_2, which we worry could affect some users of Video.js.
2019-11-07 17:21:52 -05:00
Brandon Casey
4134a9734b test: run tests via rollup (#5601) 2019-08-30 14:56:41 -04:00
Brandon Casey
85ad44e13e chore: package json cleanup (#5649) 2019-08-30 14:14:53 -04:00
Pat O'Neill
064fcafd44 feat: add isDisposed method to components (#6099) 2019-08-29 18:42:15 -04:00
Brandon Casey
5fa4257b91 feat: cap log history at 1000 items (#6192) 2019-08-29 17:32:34 -04:00
Brandon Casey
99b610bd92 perf: only update ui on change, wrap things in requestAnimationFrame (#6155) 2019-08-29 17:02:56 -04:00
mister-ben
f7185bad9e feat: allow a click handler to be specified in clickable component's options (#6140) 2019-08-29 16:46:49 -04:00
Grzegorz Blaszczyk
f324d1f23c Allows middleware to handle muted setter/getter (#6177) 2019-08-29 16:42:42 -04:00
Grzegorz Blaszczyk
714aba0ca8 fix: make live UI button more consistent (#6201)
Use a simple moving average for setting the seekableIncrement value, which is used to determine whether we're at the live edge of nor.
2019-08-28 13:41:32 -04:00