From a63a28f6a1e01b16eb85b7810d072de7e5763650 Mon Sep 17 00:00:00 2001 From: Gary Katsevman Date: Thu, 9 Jul 2015 16:32:45 -0400 Subject: [PATCH] Export bind on videojs. Fixes #2322 --- src/js/video.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/js/video.js b/src/js/video.js index 38142566a3..f8e80e60b2 100644 --- a/src/js/video.js +++ b/src/js/video.js @@ -5,6 +5,7 @@ import globalOptions from './global-options.js'; import Player from './player'; import plugin from './plugins.js'; import mergeOptions from '../../src/js/utils/merge-options.js'; +import * as Fn from './utils/fn.js'; import assign from 'object.assign'; import log from './utils/log.js'; @@ -243,6 +244,16 @@ videojs.extends = extendsFn; */ videojs.mergeOptions = mergeOptions; +/** + * Bind (a.k.a proxy or Context). A simple method for changing the context of a function + It also stores a unique id on the function so it can be easily removed from events + * @param {*} context The object to bind as scope + * @param {Function} fn The function to be bound to a scope + * @param {Number=} uid An optional unique ID for the function to be set + * @return {Function} + */ +videojs.bind = Fn.bind; + /** * Create a Video.js player plugin *