mirror of
https://github.com/videojs/video.js.git
synced 2024-12-04 10:34:51 +02:00
34aab3f357
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. |
||
---|---|---|
.. | ||
api | ||
require | ||
unit | ||
globals-shim.js | ||
index.html | ||
karma.conf.js |