1
0
mirror of https://github.com/videojs/video.js.git synced 2024-12-04 10:34:51 +02:00
video.js/test
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
..
api feat: remove flash tech (#3956) 2017-01-19 16:01:56 -05:00
require @gkatsev added tests for webpack and browserify bundling and node.js requiring. closes #3558 2016-08-24 16:32:05 -04:00
unit feat: middleware (#3788) 2017-01-19 17:29:09 -05:00
globals-shim.js test: fix tests (#3953) 2017-01-19 11:17:46 -05:00
index.html test: fix tests (#3953) 2017-01-19 11:17:46 -05:00
karma.conf.js test: fix tests (#3953) 2017-01-19 11:17:46 -05:00