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

174 Commits

Author SHA1 Message Date
Grzegorz Blaszczyk
dbd5203a0b
feat: adds disablePictureInPicture method to the player API. (#6378) 2020-04-22 12:41:21 -04:00
Gary Katsevman
808d818c7d
docs(faq): update FAQ about HLS and DASH with VHS (#6608)
Fixes #6590
2020-04-22 12:13:58 -04:00
EdgeNeko
8f930c5857
docs(angular): fix demo for angular v8+. (#6581)
Without the `static: true` property, an `not defined ReferenceError` will be thrown since the target is null on init.
2020-04-09 15:51:23 -04:00
Margaux
fce3ad23b9
docs: add an example Angular integration (#6390) 2020-03-16 17:29:00 -04:00
Brion Vibber
0e37fbf02c feat: option to load text tracks on demand vs preload (#6043)
Reimplementation of https://github.com/videojs/video.js/pull/2192
on current code. Seems to work but has not been carefully tested,
especially on conditions such as slow networks and complex tracks.

For https://github.com/videojs/video.js/issues/5252

A `preloadTextTracks` tech option is added, set to true by default,
to keep current behavior intact. Alternate behavior can be enabled
by setting this to false.

This delays loading of the VTT cue files until they are selected.
For sites like Wikipedia that tend to have large numbers of
crowdsourced subtitles and can show many files together on one
page, this saves a lot of unnecessary network transfer and API
hits.

Does mean there may be dropped cues while switching to a track
that requires on-demand loading.

Example usage:

videojs(element, {
  html5: {
    preloadTextTracks: false
  }
};
2019-11-04 15:13:24 -05:00
Owen Edwards
f34d4413a0 docs: add note about SubsCapsButton only showing up when configured with text tracks (#6254) 2019-10-04 09:46:11 -04:00
Gary Katsevman
7a85e2a046
docs: update Components list (#6253)
Add SubsCapsButton, SeekToLive and LiveTracker.

Fixes #5980.
2019-10-03 13:38:20 -04:00
Pat O'Neill
064fcafd44 feat: add isDisposed method to components (#6099) 2019-08-29 18:42:15 -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
Gary Katsevman
cf6e0e8248
docs: update guides markdown (#6063) 2019-06-20 14:31: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
François Beaufort
116d84af75 feat: add built-in Picture-in-Picture button (#6002)
Adds a new PictureInPictureToggle component in the controls bar of the player. It depends on videojs-font 3.2.0 (videojs/font#41) for icons.

Final spec piece from #5824.
2019-06-18 16:42:02 -04:00
Gary Katsevman
2977d52592
refactor: switch to fullscreen.options (#6054) 2019-06-17 16:51:28 -04:00
Austin Morton
631ac3b68d feat(fs): support FullscreenOptions (#5856)
On browsers that implement the Unprefixed Fullscreen API, pass a FullscreenOptions dictionary to requestFullscreen.

Add `fullscreenOptions` option with default value of `{navigationUI: 'hide'}` to player.
See https://fullscreen.spec.whatwg.org/#dictdef-fullscreenoptions
2019-06-17 14:05:22 -04:00
mister-ben
e1afa3e181 docs: emphasize src object and video-js element (#5960) 2019-04-29 14:22:47 -04:00
Otis Wright
4c277fd0f6 docs: add an example Vue integration.md (#5899)
* Create vue.md

Instructions for Vue integration (based on React example).

* Add link to Vue guide
2019-03-28 19:56:29 -04:00
Chuck Wilson
6c644feaa0 docs(live): minor spelling/grammar corrections (#5894) 2019-03-28 15:36:33 -04:00
Thijs Triemstra
a271ecae8e docs(hotkeys): hotkeys require player focus (#5859)
Fixes #5832
2019-03-18 15:43:52 -04:00
Chuck Wilson
e612056bfa docs(audiotracks): correct typo (#5816) 2019-02-22 13:46:53 -05:00
mister-ben
76cc310dac docs: Update format information (#5783) 2019-02-11 14:03:30 -05:00
Owen Edwards
e8909231bd feat(player): add option to disable or override double-click handling. (#5611)
`userActions.doubleClick` can be set to false to disable double click to fullscreen. Can be set to a function to override behavior.

Fixes #5604.
2019-01-25 14:18:33 -05:00
Owen Edwards
61053bf674 feat: add hotkeys support ("m", "f", "k", and Space) (#5571)
Extend keyboard support for the SeekBar, and pass unhandled keydown events from components back to the player.
Switch from raw keycodes to the keycode module.

Using `userActions.hotkeys`, which can either be a function to match the hotkeys plugin, or an object with properties like `fullscreenKey`, see the documentation for more info.

This is currently off by default, we will consider turning it on by default in the future, see #5765.

Fixes #4048, fixes #3022.
2019-01-25 14:10:29 -05:00
Brandon Casey
c1475819b2 docs(liveui): Add a guide for the live ui and live api (#5677)
Add documentation of the new line ui feature.
2018-12-18 11:12:12 -05:00
Brandon Casey
dce4a2c7d4 fix(liveui): make edge detection less strict, add docs for option (#5661)
Use double the seekable increment for live edge detection.
Add liveui option.
2018-12-10 14:13:56 -05:00
Gary Katsevman
62f9e78cf2
docs: remove grunt and update usage of build scripts (#5656) 2018-12-05 16:12:21 -05:00
Gary Katsevman
287b267305
docs: update starter template (#5570)
Use a codepen template for the starter template that includes the latest version of Video.js.

The template is at https://codepen.io/gkatsev/pen/GwZegv?editors=1000#0

Fixes #5562
2018-11-14 13:45:20 -05:00
Grzegorz Blaszczyk
f1784587f6 feat: add 'replay' option to the PlayToggle component. (#5531)
The `PlayToggle` has one option `replay` which can show or hide replay icon. This can be set by passing `{replay: false}` as the default behavior replay icon is shown after video end playback.

Example of how to hide a replay icon
 ```js
let player = videojs('myplayer', {
  controlBar: {
    playToggle: {
      replay: false
    }
  }
});
```

Fixes #4802
2018-11-02 16:47:52 -04:00
Pat O'Neill
6df3ac78d4 feat: Add responsive option, which enables breakpoints support. (#5496)
Follow-up for #5471

This makes the breakpoints option and `breakpoints()` method clearer and introduces the responsive option and `responsive()` method, which will turn on the breakpoints.

The return value of `currentBreakpoint()` was simplified to only ever return a string (empty if none).

Also, added convenience methods: `responsive()`, `getBreakpointClass()`, and `currentBreakpointClass()`.
2018-10-11 17:03:33 -04:00
Pat O'Neill
51bd49f4bc feat: Add breakpoints option to support toggling classes based on player width. (#5471)
This adds a breakpoints option. By default, this option is false meaning this is an opt-in feature.

When passing true, it will use a default set of breakpoints. Or custom breakpoints can be passed if users do not like our breakpoints (or previously-existing style decisions).

- Add breakpoints option.
- Adds some new (currently unused) classes: vjs-layout-medium, vjs-layout-large, vjs-layout-x-large, and vjs-layout-huge.
- Add updateCurrentBreakpoint and currentBreakpoint methods to the player.
- Update css/components/_adaptive.scss
- Add sandbox/responsive.html.example

Closes videojs/video.js#4371
2018-10-10 15:30:20 -04:00
Gary Katsevman
794cd71682
docs(fixup): fixup docs (#5489) 2018-10-10 11:09:53 -04:00
Gary Katsevman
2e72fc3dec
docs(layout): document fluid and fill mode (#5481) 2018-10-05 15:28:19 -04:00
Gary Katsevman
966eb56c02
feat: createLogger for easier logging in individual modules (#5418)
Create a new createLogger module for better debugging. Each logger has its own log level and its own createLogger that will nest logs underneath them. `player.log` is also included, which logs the player id as part of the log statement. The history API also got a filter method.

For example:
```js
var log = videojs.log.createLogger('foo');
log('hello');
// > VIDEOJS: foo: hello
```
2018-09-28 16:52:58 -04:00
Gary Katsevman
9c00267728
chore(https): update a lot of links to be https (#5372) 2018-08-10 15:13:32 -04:00
Gary Katsevman
781a6d87c6
feat(middleware): make setSource be optional (#5295)
setSource is useful if you care to be fiddling with the source or doing some work depending on what source is set. However, sometimes, you don't need a setSource and want the middleware to always be selected.
Now, if setSource is missing, it will implicitly be included in the middleware chain.
2018-07-06 14:16:16 -04:00
Brandon Casey
e8e4fe2745 feat(autoplay): extend autoplay option for greater good (#5209)
This PR extends the `autoplay` to the player with a few options that should hopefully make working with browsers that disable unmuted autoplay by default easier.
The current boolean option will match current behavior and any unknown option will be treated as it does now. The new options are the string values `muted`, `play`, and `any`.

- `muted` will mute the element and call `play()` on `loadstart`,
- `play` will call `play()` on `loadstart()`, this is similar to the `autoplay` attribute
- `any` will call `play()` on `loadstart()` but if it fails it will try muting the video and calling `play()` again.
2018-06-21 14:32:07 -04:00
Owen Edwards
0aa827fac5 fix(time-display): restore hidden label text for screen readers. (#5157)
Restore hidden label text for screen readers that describes what the button control does.

Renames the Duration Time language item to Duration.

Deprecate controlText_ property.

Fix a typo in translations-needed.md.

Add a space in the hidden label for live-display, so that it doesn't run together with the visible "LIVE" indication.

Fixes #5135
2018-05-11 14:34:33 -04:00
axten
d44682849e feat: add 'autoSetup' option (#5123)
this must be set globally with videojs.options.autoSetup = false in the same tick as videojs source is loaded to take effect

fixes #5094
2018-05-11 13:53:46 -04:00
Thijs Triemstra
4399bdce5d docs(debugging): fix markup typo (#5086) 2018-04-11 11:39:33 -04:00
Thijs Triemstra
bec7f67c4a docs(languages): Use valid JSON in translation example (#5080) 2018-04-10 11:11:04 -04:00
Mayde
064c1be2ba docs: fix some misspellings (#5082) 2018-04-10 10:34:20 -04:00
Gary Katsevman
bc2da7c67b
refactor: remove IE8 specific changes (#5041)
BREAKING CHANGE: remove IE8, IE9, and IE10 specific JavaScript and CSS code. Remove Android 2.3 workaround.
2018-03-23 13:25:12 -04:00
Michael Vogel
8706941573 feat: Allow techs to change poster if player option techCanOverridePoster is set (#4921)
The option for the player techCanOverridePoster is introduced in this commit. It allows techs to update the post whenever they like. isPosterFromTech_ is introduced as a private player field in order to track when a poster was set by a tech. This allows us to clear the poster whenever the tech is disposed of by the player.

Additionally, attempting to set the same poster more than once will have no effect / no changes will be made, since the poster is the same. This was done in order to stop triggering multiple posterchange events when calling player.poster(aPoster) with techCanOverridePoster set to true.

When a tech is disposed and a poster was set by it, unset the poster.

Pass a `canOverridePoster` option to techs to know whether techCanOverridePoster was set.

Fixes #4910.
2018-03-07 14:31:50 -05:00
Edward Hummerston
1fa9dfbee2 docs(react guide): update guide to prevent memory leaks when components are disposed of (#4998)
When a component is disposed of, without calling ReactDOM.unmountComponentAtNode() on the data-reactroot in the destroyed component, the React.Component and videojs.Component (here EpisodeList and vjsEpisodeList) remain in memory.

The videojs.Component should listen for its dispose event and unmount its React root in the corresponding React.Component.
2018-03-07 12:09:06 -05:00
jessicaweberdev
763a7f5762 docs(plugins guide): changed paused to pause where appropriate (#4957)
Fixes #4951
2018-02-14 13:43:55 -05:00
Zhulduz
7c30f97ef7 docs(react): Update docs for react tutorial (#4935) (#4952)
Using the default example, when disposing the player, a React DOMException was thrown because Video.js removed an element managed by React.
A simple solution is to wrap the player div in a separate div.

Fixes #4935.
2018-02-13 13:55:09 -05:00
ldayananda
a434551555 docs(middleware): update the middleware guide with setTech and other corrections (#4926) 2018-02-12 18:55:08 -05:00
Ku Lok Sun
4afabc2b0e docs: Fix the advance plugin example in documentation (#4923) 2018-02-09 14:16:18 -05:00
Gary Katsevman
9ceb4e4fe0
feat: playerresize event in all cases (#4864)
Use ResizeObserver when available for better and more performant resizing information, otherwise, fall back to a throttled resize event on an iframe that's the size of the player.
Allows a video.js user to disable this by setting resizeManager: false as an option since the component will not be initialized.

Add a debounce util.

This reverts #4800 (e0ed0b5) because we end up getting two playerresize events with the dimension methods now.
2018-01-30 13:26:21 -05:00
ldayananda
bf3eb45a37 feat: add mediator middleware type for play() (#4868)
This will allow middleware to interact with calls to play() from the tech. This will require a method of indicating to middleware previously run that a middleware down the chain has terminated or stopped execution.

* Adds middleware mediator method that runs middleware from the player to the tech and a second time back up to the player. This category was created because play is both a setter(changes the playback state) and a getter(gets a native play promise if available). This also has the ability to tell whether a middleware has terminated before reaching the tech.
* Adds a middleware.TERMINATOR sentinel value that is available on the videojs object
* Adds play to the allowedMediators
* Adds paused to the allowedGetters
* Adds a sandbox example of a play mediator middleware
2018-01-30 11:30:42 -05:00