Skip to content

Commit

Permalink
feat: export more helpers in videojs object (#7717)
Browse files Browse the repository at this point in the history
Co-authored-by: Hugo Rodriguez <hrodriguez@brightcove.com>
Co-authored-by: Pat O'Neill <pgoneill@gmail.com>
  • Loading branch information
3 people committed Nov 23, 2022
1 parent 1281d68 commit 9d832ec
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/js/video.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,16 @@ import * as Fn from './utils/fn.js';
import TextTrack from './tracks/text-track.js';
import AudioTrack from './tracks/audio-track.js';
import VideoTrack from './tracks/video-track.js';

import { createTimeRanges } from './utils/time-ranges.js';
import formatTime, { setFormatTime, resetFormatTime } from './utils/format-time.js';
import log, { createLogger } from './utils/log.js';
import * as Dom from './utils/dom.js';
import * as browser from './utils/browser.js';
import * as Url from './utils/url.js';
import {isObject} from './utils/obj';
import * as Obj from './utils/obj';
import clamp from './utils/clamp';
import { isPromise, silencePromise } from './utils/promise';
import * as StringCases from './utils/string-cases';
import computedStyle from './utils/computed-style.js';
import extend from './extend.js';
import xhr from '@videojs/xhr';
Expand Down Expand Up @@ -171,7 +173,7 @@ function videojs(id, options, ready) {
hooks('beforesetup').forEach((hookFunction) => {
const opts = hookFunction(el, mergeOptions(options));

if (!isObject(opts) || Array.isArray(opts)) {
if (!Obj.isObject(opts) || Array.isArray(opts)) {
log.error('please return an object in beforesetup hooks');
return;
}
Expand Down Expand Up @@ -506,5 +508,12 @@ videojs.defineLazyProperty = defineLazyProperty;
// In a major update this could become the default text and key.
videojs.addLanguage('en', {'Non-Fullscreen': 'Exit Fullscreen'});

videojs.clamp = clamp;
videojs.fn = Fn;
videojs.obj = Obj;
videojs.isPromise = isPromise;
videojs.silencePromise = silencePromise;
videojs.strings = StringCases;

export default videojs;

0 comments on commit 9d832ec

Please sign in to comment.