diff --git a/src/js/video.js b/src/js/video.js index 3a4e62c96..9047281f1 100644 --- a/src/js/video.js +++ b/src/js/video.js @@ -107,14 +107,14 @@ function videojs(id, options, ready) { } videojs.hooks('beforesetup').forEach(function(hookFunction) { - const opts = hookFunction(tag, videojs.mergeOptions({}, options)); + const opts = hookFunction(tag, mergeOptions(options)); if (!opts || typeof opts !== 'object' || Array.isArray(opts)) { videojs.log.error('please return an object in beforesetup hooks'); return; } - options = videojs.mergeOptions(options, opts); + options = mergeOptions(options, opts); }); // If not, set up a new player diff --git a/test/unit/video.test.js b/test/unit/video.test.js index bc2402a68..ac7843b19 100644 --- a/test/unit/video.test.js +++ b/test/unit/video.test.js @@ -336,7 +336,7 @@ QUnit.test('beforesetup options override videojs options', function(assert) { const vid = document.getElementById('test_vid_id'); - videojs.hook('beforesetup', function(options) { + videojs.hook('beforesetup', function(tag, options) { assert.equal(options.autoplay, false, 'false was passed to us'); return {autoplay: true}; });