Skip to content

Commit

Permalink
@gkatsev added get and set global options methods. closes #2115
Browse files Browse the repository at this point in the history
  • Loading branch information
gkatsev authored and heff committed May 6, 2015
1 parent e5595b1 commit b65bad8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))

--------------------

Expand Down
6 changes: 5 additions & 1 deletion sandbox/index.html.example
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@

<!-- Set the location of the flash SWF -->
<script>
videojs.options.flash.swf = '../build/temp/video-js.swf';
videojs.setGlobalOptions({
flash: {
swf: '../build/temp/video-js.swf'
}
});
</script>

</head>
Expand Down
6 changes: 6 additions & 0 deletions src/js/video.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -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
Expand Down

0 comments on commit b65bad8

Please sign in to comment.