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

113 Commits

Author SHA1 Message Date
André
7972c23a55
fix(error-display): component remains displayed after player reset (#8482)
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.
2023-11-28 23:38:41 +01:00
André
68f1429d9b
fix(error): chromium reset mediaError when the poster is invalid (#8410)
When both the media URL and the poster return a response other than 200.
The media error is overwritten by an empty error, leaving the player in an inconsistent state.

- add a condition to `handleTechError_` to ensure that the `error` is truthy
- add a test case

Fixes #8409
2023-09-27 10:18:58 +02:00
mister-ben
c66bf4023f
fix: make compatible with chrome 53 (#8354) 2023-07-12 19:43:17 +02:00
François Beaufort
8dd98f602b
fix: Don't use copyStyleSheets with documentPIP (#8314)
* Don't use copyStyleSheets

* Move to dom.js

* Add tests

* Address feedback
2023-07-07 15:56:54 +02:00
François Beaufort
146008f610
Use pagehide instead of unload for PiP (#8321) 2023-07-04 13:43:09 +02:00
Walter Seymour
6fc0dc783a
feat: Add useSVGIcons option (#8260) 2023-06-12 13:31:06 -05:00
André
b782cb09f4
fix(player): cache_.currentTime is not updated when the current time is set (#8285)
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
2023-06-01 08:50:29 -04:00
mister-ben
3af36383ca
fix(jsdoc): corrections to jsdoc (#8277) 2023-05-31 11:12:57 -04:00
André
d524e5755d
fix(picture-in-picture-control): hide the component in non-compatible browsers (#7899) 2023-05-31 10:54:51 -04:00
André
35fad1d454
fix(player): load method fails to reset the media element to its initial state when the VHS is used (#8274) 2023-05-31 10:41:44 -04:00
André
1a1adf3275
fix(player): address loss of crossOrigin value when loadMedia is called (#8085) 2023-05-31 10:25:34 -04:00
André
f1558c660b
fix(videojs): missing return in registerComponent (#8247) 2023-05-12 12:23:27 -04:00
mister-ben
0c72805500
feat: Add document picture-in-picture support (#8113)
Co-authored-by: François Beaufort <beaufort.francois@gmail.com>
2023-04-04 16:44:16 -04:00
Jon Dufresne
423f7ebd67
Fix several typos in docs and comments (#8110) 2023-03-22 15:00:01 +01: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
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
cc84ff4f80 refactor: remove internal Map, Set, and WeakMap shams, assume window.performance and requestAnimationFrame support (#7775) 2022-11-23 09:49:24 -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
Alex Barstow
3faa866834 feat: Change addRemoteTextTrack's manualCleanup option default value to false (#7588) 2022-11-23 09:48:11 -05: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
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
Harisha Rajam Swaminathan
64e55f5492
feat: Add audioPosterMode option (#7629) 2022-03-01 15:50:46 -05: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
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
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
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
Marco Del Toro Barragan
a0d09c107a
feat: trigger languagechange event on a language change (#6891) 2020-11-10 18:09:37 -05: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
Gary Katsevman
6d2e52ab83
test: skip requestPictureInPicture test if API isn't available (#6719) 2020-06-19 15:09:25 -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
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
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
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
Grzegorz Blaszczyk
f324d1f23c Allows middleware to handle muted setter/getter (#6177) 2019-08-29 16:42:42 -04:00
Brandon Casey
9d2e5f3f7a test: silence test logs (#6165) 2019-08-07 17:36:55 -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
Gary Katsevman
c59ba5f465
chore(test): upgrade to latest sinon (#5954)
Fixes #5953
2019-04-24 10:22:48 -04:00
Owen Edwards
322dae44b5 feat(middleware): allow middleware to handle volume setter and getter (#5906)
Allow middleware to handle volume setter and getter. This supports things like ducking the playback volume programmatically, without affecting the player's UI volume control.
2019-04-23 13:42:52 -04:00
Evan Farina
5973a62f67 fix: call reset if we are paused or no promises, otherwise wait for play promise to resolve (#5876)
Calling video.load while the video is trying to play (that is between play and playing event) throws an error. Instead, just wait for playback to happen before resetting.

Fixes #5875
2019-04-11 15:53:31 -04:00
Brandon Casey
ad53b80b8a fix: correctly resolve play promise when terminated via middleware (#5895) 2019-04-11 14:29:27 -04:00
Henrique Lima
175f773253 feat: reset player ui on Player#reset (#5684)
Fixes #4683
2019-01-08 14:15:51 -05:00
Pat O'Neill
4c9e09d460 fix: make sure sources, volume, and playback rate are reset along with the player (#5676)
Clear out the player cache_ on reset.

Fixes #5675
2019-01-03 15:14:54 -05:00
Tiago Fragoso
b02181b9fc feat: Add vjs-touch-enabled class for touch supporting devices (#5663)
Fixes #2999
2019-01-03 13:50:48 -05:00
Pat O'Neill
874cc21a4e feat: Add loadMedia and getMedia methods (#5652)
`loadMedia` accepts a MediaObject and an optional ready handler. It'll reset the player -- including text tracks, poster, and source -- before setting the new provided media, which include sources, poster, text tracks.
`getMedia` will return either the provided media object or the currently set values for sources, text tracks, and poster.

Fixes #4342
2019-01-03 13:49:34 -05:00
JoaoAlves
6ebc7727ef fix: Control-bar autohide when cursor placed over it #5258 (#5692)
Listen to 'mouseenter' and 'mouseleave' events when triggered in the control-bar and temporarily sets inactivity timeout to zero before restoring it.

Closes #5258
2018-12-26 13:03:36 -05:00