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

2678 Commits

Author SHA1 Message Date
Gary Katsevman
34aab3f357 feat: middleware (#3788)
Add middleware support. Middleware can function as go-between between the player and the tech. For example, it can modify the duration that the tech returns to the player. In addition, middleware allow for supporting custom video sources and types.

Currently, middleware can only intercept timeline methods like duration, currentTime, and setCurrentTime.

For example,
```js
videojs.use('video/foo', {
  setSource(src, next) {
    next(null, {
      src: 'http://example.com/video.mp4',
      type: 'video/mp4'
    });
  }
});
```
Will allow you to set a source with type `video/foo` which will play back `video.mp4`.

This makes setting the source asynchronous, which aligns it with the spec a bit more. Methods like play can still be called synchronously on the player after setting the source and the player will play once the source has loaded.

`sourceOrder` option was removed as well and it will now always use source ordering.

BREAKING CHANGE: setting the source is now asynchronous. `sourceOrder` option removed and made the default.
2017-01-19 17:29:09 -05:00
Brandon Casey
b387437aed feat: remove flash tech (#3956)
Remove Flash Tech from core. Use videojs-flash if flash is needed.
Also, update DOM method names.

BREAKING CHANGE: remove flash tech from core.
2017-01-19 16:01:56 -05:00
Brandon Casey
524f868e31 feat(volume panel): accessibly volume control (#3957)
Internally uses the VolumeControl and MuteToggle components to create the VolumePanel component. Acts like the old VolumeMenuButton but does not have the screen reader issues of the older version.

BREAKING CHANGE: remove VolumeMenuButton, introduce a new default volume control: VolumePanel.
2017-01-19 15:54:47 -05:00
Pat O'Neill
1ba1f5aabd feat: Time Tooltips (#3836)
Switch to `keepTooltipsInside` by default and simplify DOM structure around the time tooltips and progress control.

BREAKING CHANGE: removal of `keepTooltipsInside` option.
2017-01-19 15:30:47 -05:00
Brandon Casey
49bed07039 refactor: unify all Track and TrackList APIs (#3783)
Unify all track-related usage internally.

BREAKING CHANGE: some externally accessibly functions for tracks are now private.
2017-01-19 15:16:28 -05:00
Gary Katsevman
7bafcc2a55 test: fix tests (#3953)
* Switch to es3 preset for babel so that it runs last. Plugins run before presets and presets run in reverse order. Also, we ran into a weird bug in babel that causes `default` not to be quoted in some cases (https://github.com/babel/babel/issues/4799) which we've worked around here.
* Restore the es-shims for tests and the ie8 fallback script.
* Do a null-check around `Player.players`.
* use more round fractions (like 0.5 and 1) to avoid rounding issues.
2017-01-19 11:17:46 -05:00
Brandon Casey
2037e18235 feat(player): add played(), defaultMuted(), defaultPlaybackRate() (#3845)
Add `played()`, `defaultMuted()` and `defaultPlaybackRate()` methods to the player.

Fixes #523.
2017-01-18 14:59:15 -05:00
Pat O'Neill
8d1653aebc feat: Advanced Class-based Plugins for 6.0 (#3690) 2017-01-18 01:52:23 -05:00
Brandon Casey
8f07f5d57c refactor: Remove method Chaining from videojs (#3860)
Remove method chaining from videojs. This helps keep the methods consistent especially since play() now returns a Promise in some cases. Also, it can add some performance benefits.

BREAKING CHANGE: player methods no longer return a player instance when called. Fixes #3704.
2017-01-18 01:50:22 -05:00
mrocajr
0bba3196d8 chore: Remove component.json and remove references to it (#3866)
Remove component.json and references to it in grunt.js because component is no longer maintained.

BREAKING CHANGE: removal of component.json
2017-01-18 01:48:55 -05:00
Brandon Casey
091bdf9261 feat: Return the native Promise from play() (#3907)
Return the native Promise from `play()` if it exists. `undefined` is returned otherwise.
This comes in as part of the greater effort to remove method chaining.

BREAKING CHANGE: `play()` no longer returns the player object but instead the native Promise or nothing.
2017-01-18 00:53:11 -05:00
Pat O'Neill
29ffbfbc87 feat: Restore all outlines for greater accessibility (#3829)
Restore all outlines on components that are focusable to increase accessibility of these components.

BREAKING CHANGE: restoring the outlines changes the skin slightly and potentially break users. Fixes #3200.
2017-01-18 00:49:12 -05:00
Pat O'Neill
57af15ce8b refactor: Make registerComponent only work with Components (#3802)
Prevent techs (and others) from being registered via registerComponent.
* `registerComponent` now throws if given an object that is not a subclass of Component (or Component itself).
* `registerComponent` now throws if given a non-empty string as its name argument.

BREAKING CHANGE: registerComponent now throws if no name or not a component is passed in.
2017-01-18 00:46:43 -05:00
mrocajr
ce6acc832a feat: Replay at ended (#3868)
Made the play button turn into a replay button at the end of the video.
Updated the translations needed docs with "replay".
2017-01-18 00:41:43 -05:00
Gary Katsevman
8622b2648e refactor: expose tech but warn without safety var (#3916)
`Player#tech` can now be called without passing an object into it. It no longer requires passing an object into it, so, current code will not break.
If nothing is passed in, a warning will be logged about knowing what you're doing. If anything is passed in, the warning is silenced.
2017-01-18 00:40:24 -05:00
Brandon Casey
73b6316f3b refactor: remove special loadstart handling (#3906)
This is both a change as well as a bug fix. We tried to have better awareness of when the underlying video element changed underneath us so we can dispose of the source handler but that broke some use cases of MSE. Given that we weren't able to fix it in a reasonable non-breaking and non-invasive solution, we're taking it out.

BREAKING CHANGE: remove the double loadstart handlers that dispose the tech/source handlers if a secondary loadstart event is heard.
2017-01-18 00:38:31 -05:00
Pat O'Neill
844e4f0107 feat: Log Levels (#3853)
Add a log levels and history api: `videojs.log.level()` and `videojs.log.history()`.
`.level()` will return the current level and you can also set it to be one of: `all`, `error`, `off`, or `warn`.
`.history()` will return a list of all things logged since videojs loaded. It can be disabled via `videojs.log.history.disable()` (and re-enabled with `enable()`) as well as cleared with `videojs.log.history.clear()`.
2017-01-18 00:35:42 -05:00
Brandon Casey
b07143d276 refactor: do not allow adding children with options passed in as a boolean (#3872)
This has been deprecated throughout 5.0 and being removed. To include a child, you must use an object  or false to exclude it. true will no longer be supported.

BREAKING CHANGE: remove ability to add children with options as a boolean.
2017-01-18 00:31:34 -05:00
Pat O'Neill
e12bedbb45 refactor: Remove TimeRanges without an index deprecation warning (#3827)
This aligns the methods with the spec.

BREAKING CHANGE: removing ability to use TimeRange methods without an index.
2017-01-18 00:29:27 -05:00
Pat O'Neill
c340dbcccd refactor: Buttons will always use a button element (#3828)
BREAKING CHANGE: button component will always use a button element.
2017-01-18 00:28:01 -05:00
Pat O'Neill
20141202c1 refactor: Remove custom UMD (#3826)
Only use `module.exports` for better compatibility between bundlers and module systems.
2017-01-18 00:27:00 -05:00
Pat O'Neill
5377ffc176 refactor: Remove unused defaultVolume option default (#3915) 2017-01-18 00:26:10 -05:00
Pat O'Neill
f8aed4dc32 refactor: Remove deprecated features of extend/Component#extend (#3825)
This removes the Component.extend() method entirely, which has been deprecated since 5.0. Additionally, it removes the deprecated support for an init method in videojs.extend().

BREAKING CHANGE: remove deprecated features.
2017-01-18 00:25:14 -05:00
Andrew Farmer
6578ed98ac docs: minor fix to currentTime() comment: "setting" not "getting" (#3944) 2017-01-13 14:30:13 -05:00
Gary Katsevman
bb9b710d95 v5.16.0 2017-01-12 14:54:11 -05:00
Gary Katsevman
305e5ea192 fix: showing custom poster with controls disabled (#3933)
We previously hid the poster image when controls were disabled because
the poster image had a click handler on it. However, this meant that in
the case of Flash, which doesn't have a native poster image ability, we
lost the poster.

Fixes #1625.
2017-01-11 16:26:35 -05:00
Gary Katsevman
94fd5c12c8 fix: give techs a name (#3934)
This helps with debugging to know what a component's name is.
We try to look up the tech's name via the constructor's name property,
otherwise, we set it to 'Unknown Tech'. Can be overridden by setting
`this.name_` after calling `super()` in the constructor.

Fixes #1786.
2017-01-11 16:26:24 -05:00
Mattias Buelens
2ceed0a4eb fix: Pause player before seeking in seek bar mousedown (#3921)
Previously, seek bar's mousedown handler would first seek the video,
then pause it. This can trigger a bug in Chrome 55 where seeking
backwards and then immediately pausing can break the video player.

Instead, call the super handler last so that we pause the video before
we start seeking.

Fixes #3839. This reverts commit e92db4f407 (#3886)
2017-01-11 15:03:04 -05:00
Michael Stramel
bbe82530aa fix: player el ingest when parent doesn't have hasAttribute method (#3929)
For elements which parent doesn't have `hasAttribute` it needs do another check to prevent erroring out. One case of this is when video.js is created inside a documentFragment, the parent node won't have a `hasAttribute` method.
2017-01-11 15:00:11 -05:00
Brandon Casey
d290db1765 refactor: require videojs-vtt.js via require rather than concat (#3919)
Using aliasify and require, we can generate the dist/video.js and dist/alt/video.novtt.js files each with and without vttjs while having the require-able version of video.js available to require vttjs and have it work with bundlers like browserify and webpack.
2017-01-11 14:56:07 -05:00
Petros G. Sideris
f35de1c98d chore: fix typo in collaborator guide (#3931) 2017-01-11 11:26:54 -05:00
Brandon Casey
02da69741a chore(development): fix npm start file watching (#3922)
A invalid argument (`--w`) was being passed to the babel cli in the grunt task `shell:babel`. This argument has been changed to `--watch` to get the babel cli to watch files for changes as intended.
2017-01-06 12:04:10 -05:00
mister-ben
0ce7cd4fe3 docs(troubleshooting): updates to troubleshooting doc (#3912)
* Fixed (and simplified) the codecs header.
* Elaborated slightly on codecs and flash in v6
* Changed case of 'Video.js' throughout and some other capilatisation to be consistent with the doc
2017-01-05 11:36:49 -05:00
Gary Katsevman
d120ea29b7 chore(release): add es5 folder to the tagged commit (#3913) 2017-01-04 10:59:20 -05:00
Gary Katsevman
c239bd5c5a chore: don't run tests on travis if only docs were changed (#3908) 2017-01-04 10:58:54 -05:00
geibi
b5472145bf feat: Show big play button on pause if specified (#3892) 2017-01-03 15:32:06 -05:00
Gary Katsevman
9ec55879a1 chore: better dev experience (#3896)
npm start now runs `grunt dev` which in turn runs the connect server,
sets up babel watching, browserify watching (for both src and test
files), and css and alternate builds watching.

Additionally, it will copy over the dev build files into the dist folder
so that if you're linking videojs and you have a project that gets
video.js from the dist, you can link and develop with more easy without
rerunning all of `grunt dist` each time.

Additionally, this specifically does not run more time consumming
operations like minification.
2017-01-03 15:05:58 -05:00
Gary Katsevman
83d453b498 chore(sass): upgrade to latest version of grunt-sass (#3897)
Fixes #3692.
2017-01-03 15:05:41 -05:00
Gary Katsevman
e5a240a631 docs(faq): add a question about autoplay (#3898) 2017-01-03 15:05:12 -05:00
Gary Katsevman
9c74116578 docs(faq): add FAQ question about RTMP url (#3899) 2017-01-03 14:28:10 -05:00
Gary Katsevman
b914c76247 v5.15.1 2016-12-23 14:19:13 -05:00
Pat O'Neill
26d4e7b0bf ignore: Prevent test failures in IE8 (#3891) 2016-12-23 14:03:58 -05:00
Pat O'Neill
ac0b03f2f7 fix: Support require()-ing video.js (#3889)
Introduce the Dom.isReal() function, which makes an educated assumption about the "realness" of the document object.
Wrap code here and there with checks against Dom.isReal() as well as other defensive code.

Fixes #3869.
2016-12-23 11:30:49 -05:00
Garrett
b7c384eb5b fix: extra warn logs on already initialized player references (#3888) 2016-12-23 11:29:23 -05:00
Gary Katsevman
4fd902229f v5.15.0 2016-12-22 17:37:21 -05:00
Darren Nolan
42507f8c11 fix: don't emit tap events on tech when using native controls (#3873)
If using nativeControlsForTouch, skip the emitTapEvents listeners from
being setup. This avoids taps being taken away from native video
elements and stopping controls being displayed.
2016-12-22 15:20:43 -05:00
Gary Katsevman
e92db4f407 fix(seeking): don't always pause in mouse down (#3886)
In chrome 55, something changed which introduced a bug in videojs where
if you seeked back, it wouldn't work. This is because we always paused
the video in the mousedown handler.

Instead, we should create a timer for pausing that is cleared in the
mouseup handler or in the mouse move handler. This is so that if someone
is seeking by clicking and waiting the video pauses. As soon as we start
moving and we get a mousemove event, we can know that it's safe to pause
as well.

Fixes #3839.
2016-12-22 15:19:35 -05:00
Brandon Casey
22cf3dd935 feat: deprecate the use of starttime in player.js (#3838) 2016-12-21 14:23:00 -05:00
Gary Katsevman
eb389c57c0 chore(videojs-standard): update to version 6.0.1 (#3884) 2016-12-20 18:32:24 -05:00
Gary Katsevman
26789e7470 chore(faq): move FAQ and troubleshooting guide to docs/ (#3883) 2016-12-20 18:21:18 -05:00