diff --git a/CHANGELOG.md b/CHANGELOG.md index 3578e9545..4d65928bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,7 @@ CHANGELOG * @gkatsev added a sensible toJSON function ([view](https://github.com/videojs/video.js/pull/2114)) * @bc-bbay fixed instance where progress bars would go passed 100% ([view](https://github.com/videojs/video.js/pull/2040)) * @eXon began Tech 2.0 work, improved how tech events are handled by the player ([view](https://github.com/videojs/video.js/pull/2057)) +* @gkatsev added get and set global options methods ([view](https://github.com/videojs/video.js/pull/2115)) -------------------- diff --git a/sandbox/index.html.example b/sandbox/index.html.example index b69e90b1b..58eb19a7a 100644 --- a/sandbox/index.html.example +++ b/sandbox/index.html.example @@ -10,7 +10,11 @@ diff --git a/src/js/video.js b/src/js/video.js index 12e536e11..206a53e5e 100644 --- a/src/js/video.js +++ b/src/js/video.js @@ -18,6 +18,7 @@ import * as Util from './util.js'; import Player from './player'; import extendsFn from './extends.js'; import plugin from './plugins.js'; +import options from './options.js'; if (typeof HTMLVideoElement === 'undefined') { document.createElement('video'); @@ -42,6 +43,11 @@ videojs.players = Player.players; videojs.extends = extendsFn; +videojs.getGlobalOptions = () => options; +videojs.setGlobalOptions = function(newOptions) { + Lib.util.mergeOptions(options, newOptions); +}; + videojs.plugin = plugin; // REMOVING: We probably should not include this in 5.0 thought it would make it