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

685 Commits

Author SHA1 Message Date
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
Pat O'Neill
51b9861d5b fix: do not handle hotkeys in contenteditable elements (#6182)
Exclude elements where `el.isContentEditable == true;` for hotkeys.
2019-08-19 14:57:15 -04:00
Brandon Casey
9d2e5f3f7a test: silence test logs (#6165) 2019-08-07 17:36:55 -04:00
Brandon Casey
5ee247762e perf: Do not add/remove listeners for each timer (#6144) 2019-08-07 16:11:24 -04:00
Brandon Casey
266cb151fa perf: Improve performance of toTitleCase, register with lower and TitleCase (#6148) 2019-08-07 16:05:41 -04:00
Brandon Casey
8610f99673 perf: Use WeakMap for dom data (#6103) 2019-08-01 14:26:59 -04:00
Grzegorz Blaszczyk
f2aedb72ec fix: Improves isSingleLeftClick() to handle mousemove (#6138)
Fixes #6132
2019-07-29 17:45:40 -04:00
Brandon Casey
3c932c5f8e refactor: use the new any event function (#6080) 2019-07-29 17:21:42 -04:00
Gary Katsevman
10ed08a15a
refactor(pip): rely only on WICG spec events (#6064)
The WICG spec calls out only two events, enterpictureinpicture and
leavepictureinpicture. We should try and only use those.
If pictureinpicturechange is still necessary, it can be re-added at a
later date.
2019-06-20 15:11:21 -04:00
mister-ben
5a538c3caf feat: add option to suppress initial error for non-playable sources (#6057)
Video.js checks whether sources are playable and both displays a message to the user and logs an error to the console. In Google's mobile friendly test and related tools, this message and error is triggered because their test browser's video element does not support any video formats. Some Video.js users are concerned about the æsthetics of the rendered preview within the tools and whether this might have an SEO impact.

Adds a suppressNotSupportedError option, defaulting to false. If set to true, if no sources are playable the error is deferred to the first human interaction (click or touchstart) but cleared if a loadstart occurs.
2019-06-20 14:00:12 -04:00
Pat O'Neill
70ba84eb6a fix(liveui): do not seek to live on first seek when autoplaying a live stream (#6062)
Before listening for the play/timeupdate combination when starting the LiveTracker, check if the player has already started playback.
2019-06-20 13:56:00 -04:00