From 6354329a1bf44228e106eb311905a4e6553ef75a Mon Sep 17 00:00:00 2001 From: heff Date: Tue, 29 Sep 2015 09:31:22 -0700 Subject: [PATCH] Removed outdated API docs --- docs/api/vjs.BigPlayButton.md | 660 ------------ docs/api/vjs.Button.md | 659 ------------ docs/api/vjs.CaptionsButton.md | 10 - docs/api/vjs.CaptionsTrack.md | 793 -------------- docs/api/vjs.ChaptersButton.md | 10 - docs/api/vjs.ChaptersTrack.md | 793 -------------- docs/api/vjs.ChaptersTrackMenuItem.md | 8 - docs/api/vjs.Component.md | 679 ------------ docs/api/vjs.ControlBar.md | 659 ------------ docs/api/vjs.CoreObject.md | 93 -- docs/api/vjs.CurrentTimeDisplay.md | 657 ------------ docs/api/vjs.DurationDisplay.md | 657 ------------ docs/api/vjs.Flash.md | 43 - docs/api/vjs.FullscreenToggle.md | 657 ------------ docs/api/vjs.Html5.md | 77 -- docs/api/vjs.JSON.md | 30 - docs/api/vjs.LoadProgressBar.md | 657 ------------ docs/api/vjs.LoadingSpinner.md | 657 ------------ docs/api/vjs.MediaLoader.md | 659 ------------ docs/api/vjs.MediaTechController.md | 33 - docs/api/vjs.Menu.md | 668 ------------ docs/api/vjs.MenuButton.md | 662 ------------ docs/api/vjs.MenuItem.md | 673 ------------ docs/api/vjs.MuteToggle.md | 657 ------------ docs/api/vjs.OffTextTrackMenuItem.md | 10 - docs/api/vjs.PlayProgressBar.md | 657 ------------ docs/api/vjs.PlayToggle.md | 657 ------------ docs/api/vjs.Player.md | 1419 ------------------------- docs/api/vjs.PosterImage.md | 680 ------------ docs/api/vjs.ProgressControl.md | 658 ------------ docs/api/vjs.RemainingTimeDisplay.md | 657 ------------ docs/api/vjs.SeekBar.md | 669 ------------ docs/api/vjs.SeekHandle.md | 657 ------------ docs/api/vjs.Slider.md | 669 ------------ docs/api/vjs.SliderHandle.md | 657 ------------ docs/api/vjs.SubtitlesButton.md | 10 - docs/api/vjs.SubtitlesTrack.md | 793 -------------- docs/api/vjs.TextTrack.md | 795 -------------- docs/api/vjs.TextTrackButton.md | 10 - docs/api/vjs.TextTrackDisplay.md | 10 - docs/api/vjs.TextTrackMenuItem.md | 10 - docs/api/vjs.TimeDivider.md | 659 ------------ docs/api/vjs.VolumeBar.md | 669 ------------ docs/api/vjs.VolumeControl.md | 657 ------------ docs/api/vjs.VolumeHandle.md | 656 ------------ docs/api/vjs.VolumeLevel.md | 657 ------------ docs/api/vjs.VolumeMenuButton.md | 662 ------------ docs/api/vjs.md | 183 ---- docs/api/vjs.media.md | 23 - 49 files changed, 24335 deletions(-) delete mode 100644 docs/api/vjs.BigPlayButton.md delete mode 100644 docs/api/vjs.Button.md delete mode 100644 docs/api/vjs.CaptionsButton.md delete mode 100644 docs/api/vjs.CaptionsTrack.md delete mode 100644 docs/api/vjs.ChaptersButton.md delete mode 100644 docs/api/vjs.ChaptersTrack.md delete mode 100644 docs/api/vjs.ChaptersTrackMenuItem.md delete mode 100644 docs/api/vjs.Component.md delete mode 100644 docs/api/vjs.ControlBar.md delete mode 100644 docs/api/vjs.CoreObject.md delete mode 100644 docs/api/vjs.CurrentTimeDisplay.md delete mode 100644 docs/api/vjs.DurationDisplay.md delete mode 100644 docs/api/vjs.Flash.md delete mode 100644 docs/api/vjs.FullscreenToggle.md delete mode 100644 docs/api/vjs.Html5.md delete mode 100644 docs/api/vjs.JSON.md delete mode 100644 docs/api/vjs.LoadProgressBar.md delete mode 100644 docs/api/vjs.LoadingSpinner.md delete mode 100644 docs/api/vjs.MediaLoader.md delete mode 100644 docs/api/vjs.MediaTechController.md delete mode 100644 docs/api/vjs.Menu.md delete mode 100644 docs/api/vjs.MenuButton.md delete mode 100644 docs/api/vjs.MenuItem.md delete mode 100644 docs/api/vjs.MuteToggle.md delete mode 100644 docs/api/vjs.OffTextTrackMenuItem.md delete mode 100644 docs/api/vjs.PlayProgressBar.md delete mode 100644 docs/api/vjs.PlayToggle.md delete mode 100644 docs/api/vjs.Player.md delete mode 100644 docs/api/vjs.PosterImage.md delete mode 100644 docs/api/vjs.ProgressControl.md delete mode 100644 docs/api/vjs.RemainingTimeDisplay.md delete mode 100644 docs/api/vjs.SeekBar.md delete mode 100644 docs/api/vjs.SeekHandle.md delete mode 100644 docs/api/vjs.Slider.md delete mode 100644 docs/api/vjs.SliderHandle.md delete mode 100644 docs/api/vjs.SubtitlesButton.md delete mode 100644 docs/api/vjs.SubtitlesTrack.md delete mode 100644 docs/api/vjs.TextTrack.md delete mode 100644 docs/api/vjs.TextTrackButton.md delete mode 100644 docs/api/vjs.TextTrackDisplay.md delete mode 100644 docs/api/vjs.TextTrackMenuItem.md delete mode 100644 docs/api/vjs.TimeDivider.md delete mode 100644 docs/api/vjs.VolumeBar.md delete mode 100644 docs/api/vjs.VolumeControl.md delete mode 100644 docs/api/vjs.VolumeHandle.md delete mode 100644 docs/api/vjs.VolumeLevel.md delete mode 100644 docs/api/vjs.VolumeMenuButton.md delete mode 100644 docs/api/vjs.md delete mode 100644 docs/api/vjs.media.md diff --git a/docs/api/vjs.BigPlayButton.md b/docs/api/vjs.BigPlayButton.md deleted file mode 100644 index 37d8ef616b..0000000000 --- a/docs/api/vjs.BigPlayButton.md +++ /dev/null @@ -1,660 +0,0 @@ - - -# vjs.BigPlayButton - -__EXTENDS__: [vjs.Button](vjs.Button.md) -__DEFINED IN__: [src/js/big-play-button.js#L11](https://github.com/videojs/video.js/blob/master/src/js/big-play-button.js#L11) - -Initial play button. Shows before the video has played. The hiding of the -big play button is done via CSS and player states. - ---- - -## INDEX - -- [METHODS](#methods) - - [addChild](#addchild-child-options-) _`inherited`_ - - [addClass](#addclass-classtoadd-) _`inherited`_ - - [buildCSSClass](#buildcssclass) _`inherited`_ - - [children](#children) _`inherited`_ - - [clearInterval](#clearinterval-intervalid-) _`inherited`_ - - [clearTimeout](#cleartimeout-timeoutid-) _`inherited`_ - - [contentEl](#contentel) _`inherited`_ - - [createEl](#createel-tagname-attributes-) _`inherited`_ - - [dimensions](#dimensions-width-height-) _`inherited`_ - - [dispose](#dispose) _`inherited`_ - - [el](#el) _`inherited`_ - - [enableTouchActivity](#enabletouchactivity) _`inherited`_ - - [getChild](#getchild-name-) _`inherited`_ - - [getChildById](#getchildbyid-id-) _`inherited`_ - - [hasClass](#hasclass-classtocheck-) _`inherited`_ - - [height](#height-num-skiplisteners-) _`inherited`_ - - [hide](#hide) _`inherited`_ - - [id](#id) _`inherited`_ - - [init](#init-player-options-ready-) _`inherited`_ - - [initChildren](#initchildren) _`inherited`_ - - [name](#name) _`inherited`_ - - [off](#off-first-second-third-) _`inherited`_ - - [on](#on-first-second-third-) _`inherited`_ - - [one](#one-first-second-third-) _`inherited`_ - - [options](#options-obj-) _`inherited`_ - - [player](#player) _`inherited`_ - - [ready](#ready-fn-) _`inherited`_ - - [removeChild](#removechild-component-) _`inherited`_ - - [removeClass](#removeclass-classtoremove-) _`inherited`_ - - [setInterval](#setinterval-fn-interval-) _`inherited`_ - - [setTimeout](#settimeout-fn-timeout-) _`inherited`_ - - [show](#show) _`inherited`_ - - [trigger](#trigger-event-) _`inherited`_ - - [triggerReady](#triggerready) _`inherited`_ - - [width](#width-num-skiplisteners-) _`inherited`_ - -- [EVENTS](#events) - - [resize](#resize-event) _`inherited`_ - ---- - -## METHODS - -### addChild( child, [options] ) -> Adds a child component inside this component -> -> myComponent.el(); -> // ->
-> myComonent.children(); -> // [empty array] -> -> var myButton = myComponent.addChild('MyButton'); -> // ->
myButton
-> // -> myButton === myComonent.children()[0]; -> -> Pass in options for child constructors and options for children of the child -> -> var myButton = myComponent.addChild('MyButton', { -> text: 'Press Me', -> children: { -> buttonChildExample: { -> buttonChildOption: true -> } -> } -> }); - -##### PARAMETERS: -* __child__ `String|vjs.Component` The class name or instance of a child to add -* __options__ `Object` _(OPTIONAL)_ Options, including options to be passed to children of the child. - -##### RETURNS: -* `vjs.Component` The child component (created by this process if a string was used) - -_inherited from_: [src/js/component.js#L362](https://github.com/videojs/video.js/blob/master/src/js/component.js#L362) - ---- - -### addClass( classToAdd ) -> Add a CSS class name to the component's element - -##### PARAMETERS: -* __classToAdd__ `String` Classname to add - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L826](https://github.com/videojs/video.js/blob/master/src/js/component.js#L826) - ---- - -### buildCSSClass() -> Allows sub components to stack CSS class names - -##### RETURNS: -* `String` The constructed class name - -_inherited from_: [src/js/component.js#L536](https://github.com/videojs/video.js/blob/master/src/js/component.js#L536) - ---- - -### children() -> Get an array of all child components -> -> var kids = myComponent.children(); - -##### RETURNS: -* `Array` The children - -_inherited from_: [src/js/component.js#L296](https://github.com/videojs/video.js/blob/master/src/js/component.js#L296) - ---- - -### clearInterval( intervalId ) -> Clears an interval and removes the associated dispose listener - -##### PARAMETERS: -* __intervalId__ `Number` The id of the interval to clear - -##### RETURNS: -* `Number` Returns the interval ID - -_inherited from_: [src/js/component.js#L1223](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1223) - ---- - -### clearTimeout( timeoutId ) -> Clears a timeout and removes the associated dispose listener - -##### PARAMETERS: -* __timeoutId__ `Number` The id of the timeout to clear - -##### RETURNS: -* `Number` Returns the timeout ID - -_inherited from_: [src/js/component.js#L1185](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1185) - ---- - -### contentEl() -> Return the component's DOM element for embedding content. -> Will either be el_ or a new element defined in createEl. - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L239](https://github.com/videojs/video.js/blob/master/src/js/component.js#L239) - ---- - -### createEl( [tagName], [attributes] ) -> Create the component's DOM element - -##### PARAMETERS: -* __tagName__ `String` _(OPTIONAL)_ Element's node type. e.g. 'div' -* __attributes__ `Object` _(OPTIONAL)_ An object of element attributes that should be set on the element - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L200](https://github.com/videojs/video.js/blob/master/src/js/component.js#L200) - ---- - -### dimensions( width, height ) -> Set both width and height at the same time - -##### PARAMETERS: -* __width__ `Number|String` -* __height__ `Number|String` - -##### RETURNS: -* `vjs.Component` The component - -_inherited from_: [src/js/component.js#L938](https://github.com/videojs/video.js/blob/master/src/js/component.js#L938) - ---- - -### dispose() -> Dispose of the component and all child components - -_inherited from_: [src/js/component.js#L84](https://github.com/videojs/video.js/blob/master/src/js/component.js#L84) - ---- - -### el() -> Get the component's DOM element -> -> var domEl = myComponent.el(); - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L220](https://github.com/videojs/video.js/blob/master/src/js/component.js#L220) - ---- - -### enableTouchActivity() -> Report user touch activity when touch events occur -> -> User activity is used to determine when controls should show/hide. It's -> relatively simple when it comes to mouse events, because any mouse event -> should show the controls. So we capture mouse events that bubble up to the -> player and report activity when that happens. -> -> With touch events it isn't as easy. We can't rely on touch events at the -> player level, because a tap (touchstart + touchend) on the video itself on -> mobile devices is meant to turn controls off (and on). User activity is -> checked asynchronously, so what could happen is a tap event on the video -> turns the controls off, then the touchend event bubbles up to the player, -> which if it reported user activity, would turn the controls right back on. -> (We also don't want to completely block touch events from bubbling up) -> -> Also a touchmove, touch+hold, and anything other than a tap is not supposed -> to turn the controls back on on a mobile device. -> -> Here we're setting the default component behavior to report user activity -> whenever touch events happen, and this can be turned off by components that -> want touch events to act differently. - -_inherited from_: [src/js/component.js#L1124](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1124) - ---- - -### getChild( name ) -> Returns a child component with the provided name - -##### PARAMETERS: -* __name__ - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L330](https://github.com/videojs/video.js/blob/master/src/js/component.js#L330) - ---- - -### getChildById( id ) -> Returns a child component with the provided ID - -##### PARAMETERS: -* __id__ - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L313](https://github.com/videojs/video.js/blob/master/src/js/component.js#L313) - ---- - -### hasClass( classToCheck ) -> Check if a component's element has a CSS class name - -##### PARAMETERS: -* __classToCheck__ `String` Classname to check - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L816](https://github.com/videojs/video.js/blob/master/src/js/component.js#L816) - ---- - -### height( [num], [skipListeners] ) -> Get or set the height of the component (CSS values) -> -> Setting the video tag dimension values only works with values in pixels. -> Percent values will not work. -> Some percents can be used, but width()/height() will return the number + %, -> not the actual computed width/height. - -##### PARAMETERS: -* __num__ `Number|String` _(OPTIONAL)_ New component height -* __skipListeners__ `Boolean` _(OPTIONAL)_ Skip the resize event trigger - -##### RETURNS: -* `vjs.Component` This component, when setting the height -* `Number|String` The height, when getting - -_inherited from_: [src/js/component.js#L927](https://github.com/videojs/video.js/blob/master/src/js/component.js#L927) - ---- - -### hide() -> Hide the component element if currently showing - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L857](https://github.com/videojs/video.js/blob/master/src/js/component.js#L857) - ---- - -### id() -> Get the component's ID -> -> var id = myComponent.id(); - -##### RETURNS: -* `String` - -_inherited from_: [src/js/component.js#L258](https://github.com/videojs/video.js/blob/master/src/js/component.js#L258) - ---- - -### init( player, options, ready ) -> the constructor function for the class - -##### PARAMETERS: -* __player__ -* __options__ -* __ready__ - -_inherited from_: [src/js/button.js#L15](https://github.com/videojs/video.js/blob/master/src/js/button.js#L15) - ---- - -### initChildren() -> Add and initialize default child components from options -> -> // when an instance of MyComponent is created, all children in options -> // will be added to the instance by their name strings and options -> MyComponent.prototype.options_.children = { -> myChildComponent: { -> myChildOption: true -> } -> } -> -> // Or when creating the component -> var myComp = new MyComponent(player, { -> children: { -> myChildComponent: { -> myChildOption: true -> } -> } -> }); -> -> The children option can also be an Array of child names or -> child options objects (that also include a 'name' key). -> -> var myComp = new MyComponent(player, { -> children: [ -> 'button', -> { -> name: 'button', -> someOtherOption: true -> } -> ] -> }); - -_inherited from_: [src/js/component.js#L481](https://github.com/videojs/video.js/blob/master/src/js/component.js#L481) - ---- - -### name() -> Get the component's name. The name is often used to reference the component. -> -> var name = myComponent.name(); - -##### RETURNS: -* `String` - -_inherited from_: [src/js/component.js#L277](https://github.com/videojs/video.js/blob/master/src/js/component.js#L277) - ---- - -### off( [first], [second], [third] ) -> Remove an event listener from this component's element -> -> myComponent.off('eventType', myFunc); -> -> If myFunc is excluded, ALL listeners for the event type will be removed. -> If eventType is excluded, ALL listeners will be removed from the component. -> -> Alternatively you can use `off` to remove listeners that were added to other -> elements or components using `myComponent.on(otherComponent...`. -> In this case both the event type and listener function are REQUIRED. -> -> myComponent.off(otherElement, 'eventType', myFunc); -> myComponent.off(otherComponent, 'eventType', myFunc); - -##### PARAMETERS: -* __first__ `String|vjs.Component` _(OPTIONAL)_ The event type or other component -* __second__ `Function|String` _(OPTIONAL)_ The listener function or event type -* __third__ `Function` _(OPTIONAL)_ The listener for other component - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L646](https://github.com/videojs/video.js/blob/master/src/js/component.js#L646) - ---- - -### on( first, second, third ) -> Add an event listener to this component's element -> -> var myFunc = function(){ -> var myComponent = this; -> // Do something when the event is fired -> }; -> -> myComponent.on('eventType', myFunc); -> -> The context of myFunc will be myComponent unless previously bound. -> -> Alternatively, you can add a listener to another element or component. -> -> myComponent.on(otherElement, 'eventName', myFunc); -> myComponent.on(otherComponent, 'eventName', myFunc); -> -> The benefit of using this over `vjs.on(otherElement, 'eventName', myFunc)` -> and `otherComponent.on('eventName', myFunc)` is that this way the listeners -> will be automatically cleaned up when either component is disposed. -> It will also bind myComponent as the context of myFunc. -> -> **NOTE**: When using this on elements in the page other than window -> and document (both permanent), if you remove the element from the DOM -> you need to call `vjs.trigger(el, 'dispose')` on it to clean up -> references to it and allow the browser to garbage collect it. - -##### PARAMETERS: -* __first__ `String|vjs.Component` The event type or other component -* __second__ `Function|String` The event handler or event type -* __third__ `Function` The event handler - -##### RETURNS: -* `vjs.Component` self - -_inherited from_: [src/js/component.js#L577](https://github.com/videojs/video.js/blob/master/src/js/component.js#L577) - ---- - -### one( first, second, [third] ) -> Add an event listener to be triggered only once and then removed -> -> myComponent.one('eventName', myFunc); -> -> Alternatively you can add a listener to another element or component -> that will be triggered only once. -> -> myComponent.one(otherElement, 'eventName', myFunc); -> myComponent.one(otherComponent, 'eventName', myFunc); - -##### PARAMETERS: -* __first__ `String|vjs.Component` The event type or other component -* __second__ `Function|String` The listener function or event type -* __third__ `Function` _(OPTIONAL)_ The listener function for other component - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L691](https://github.com/videojs/video.js/blob/master/src/js/component.js#L691) - ---- - -### options( obj ) -> Deep merge of options objects -> -> Whenever a property is an object on both options objects -> the two properties will be merged using vjs.obj.deepMerge. -> -> This is used for merging options for child components. We -> want it to be easy to override individual options on a child -> component without having to rewrite all the other default options. -> -> Parent.prototype.options_ = { -> children: { -> 'childOne': { 'foo': 'bar', 'asdf': 'fdsa' }, -> 'childTwo': {}, -> 'childThree': {} -> } -> } -> newOptions = { -> children: { -> 'childOne': { 'foo': 'baz', 'abc': '123' } -> 'childTwo': null, -> 'childFour': {} -> } -> } -> -> this.options(newOptions); -> -> RESULT -> -> { -> children: { -> 'childOne': { 'foo': 'baz', 'asdf': 'fdsa', 'abc': '123' }, -> 'childTwo': null, // Disabled. Won't be initialized. -> 'childThree': {}, -> 'childFour': {} -> } -> } - -##### PARAMETERS: -* __obj__ `Object` Object of new option values - -##### RETURNS: -* `Object` A NEW object of this.options_ and obj merged - -_inherited from_: [src/js/component.js#L179](https://github.com/videojs/video.js/blob/master/src/js/component.js#L179) - ---- - -### player() -> Return the component's player - -##### RETURNS: -* `vjs.Player` - -_inherited from_: [src/js/component.js#L126](https://github.com/videojs/video.js/blob/master/src/js/component.js#L126) - ---- - -### ready( fn ) -> Bind a listener to the component's ready state -> -> Different from event listeners in that if the ready event has already happened -> it will trigger the function immediately. - -##### PARAMETERS: -* __fn__ `Function` Ready listener - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L769](https://github.com/videojs/video.js/blob/master/src/js/component.js#L769) - ---- - -### removeChild( component ) -> Remove a child component from this component's list of children, and the -> child component's element from this component's element - -##### PARAMETERS: -* __component__ `vjs.Component` Component to remove - -_inherited from_: [src/js/component.js#L420](https://github.com/videojs/video.js/blob/master/src/js/component.js#L420) - ---- - -### removeClass( classToRemove ) -> Remove a CSS class name from the component's element - -##### PARAMETERS: -* __classToRemove__ `String` Classname to remove - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L837](https://github.com/videojs/video.js/blob/master/src/js/component.js#L837) - ---- - -### setInterval( fn, interval ) -> Creates an interval and sets up disposal automatically. - -##### PARAMETERS: -* __fn__ `Function` The function to run every N seconds. -* __interval__ `Number` Number of ms to delay before executing specified function. - -##### RETURNS: -* `Number` Returns the interval ID - -_inherited from_: [src/js/component.js#L1202](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1202) - ---- - -### setTimeout( fn, timeout ) -> Creates timeout and sets up disposal automatically. - -##### PARAMETERS: -* __fn__ `Function` The function to run after the timeout. -* __timeout__ `Number` Number of ms to delay before executing specified function. - -##### RETURNS: -* `Number` Returns the timeout ID - -_inherited from_: [src/js/component.js#L1162](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1162) - ---- - -### show() -> Show the component element if hidden - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L847](https://github.com/videojs/video.js/blob/master/src/js/component.js#L847) - ---- - -### trigger( event ) -> Trigger an event on an element -> -> myComponent.trigger('eventName'); -> myComponent.trigger({'type':'eventName'}); - -##### PARAMETERS: -* __event__ `Event|Object|String` A string (the type) or an event object with a type attribute - -##### RETURNS: -* `vjs.Component` self - -_inherited from_: [src/js/component.js#L724](https://github.com/videojs/video.js/blob/master/src/js/component.js#L724) - ---- - -### triggerReady() -> Trigger the ready listeners - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L788](https://github.com/videojs/video.js/blob/master/src/js/component.js#L788) - ---- - -### width( [num], skipListeners ) -> Set or get the width of the component (CSS values) -> -> Setting the video tag dimension values only works with values in pixels. -> Percent values will not work. -> Some percents can be used, but width()/height() will return the number + %, -> not the actual computed width/height. - -##### PARAMETERS: -* __num__ `Number|String` _(OPTIONAL)_ Optional width number -* __skipListeners__ `Boolean` Skip the 'resize' event trigger - -##### RETURNS: -* `vjs.Component` This component, when setting the width -* `Number|String` The width, when getting - -_inherited from_: [src/js/component.js#L910](https://github.com/videojs/video.js/blob/master/src/js/component.js#L910) - ---- - -## EVENTS - -### resize `EVENT` -> Fired when the width and/or height of the component changes - -_inherited from_: [src/js/component.js#L1020](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1020) - ---- - diff --git a/docs/api/vjs.Button.md b/docs/api/vjs.Button.md deleted file mode 100644 index 162b87ae1c..0000000000 --- a/docs/api/vjs.Button.md +++ /dev/null @@ -1,659 +0,0 @@ - - -# vjs.Button - -__EXTENDS__: [vjs.Component](vjs.Component.md) -__DEFINED IN__: [src/js/button.js#L10](https://github.com/videojs/video.js/blob/master/src/js/button.js#L10) - -Base class for all buttons - ---- - -## INDEX - -- [METHODS](#methods) - - [init](#init-player-options-ready-) - - [addChild](#addchild-child-options-) _`inherited`_ - - [addClass](#addclass-classtoadd-) _`inherited`_ - - [buildCSSClass](#buildcssclass) _`inherited`_ - - [children](#children) _`inherited`_ - - [clearInterval](#clearinterval-intervalid-) _`inherited`_ - - [clearTimeout](#cleartimeout-timeoutid-) _`inherited`_ - - [contentEl](#contentel) _`inherited`_ - - [createEl](#createel-tagname-attributes-) _`inherited`_ - - [dimensions](#dimensions-width-height-) _`inherited`_ - - [dispose](#dispose) _`inherited`_ - - [el](#el) _`inherited`_ - - [enableTouchActivity](#enabletouchactivity) _`inherited`_ - - [getChild](#getchild-name-) _`inherited`_ - - [getChildById](#getchildbyid-id-) _`inherited`_ - - [hasClass](#hasclass-classtocheck-) _`inherited`_ - - [height](#height-num-skiplisteners-) _`inherited`_ - - [hide](#hide) _`inherited`_ - - [id](#id) _`inherited`_ - - [initChildren](#initchildren) _`inherited`_ - - [name](#name) _`inherited`_ - - [off](#off-first-second-third-) _`inherited`_ - - [on](#on-first-second-third-) _`inherited`_ - - [one](#one-first-second-third-) _`inherited`_ - - [options](#options-obj-) _`inherited`_ - - [player](#player) _`inherited`_ - - [ready](#ready-fn-) _`inherited`_ - - [removeChild](#removechild-component-) _`inherited`_ - - [removeClass](#removeclass-classtoremove-) _`inherited`_ - - [setInterval](#setinterval-fn-interval-) _`inherited`_ - - [setTimeout](#settimeout-fn-timeout-) _`inherited`_ - - [show](#show) _`inherited`_ - - [trigger](#trigger-event-) _`inherited`_ - - [triggerReady](#triggerready) _`inherited`_ - - [width](#width-num-skiplisteners-) _`inherited`_ - -- [EVENTS](#events) - - [resize](#resize-event) _`inherited`_ - ---- - -## METHODS - -### addChild( child, [options] ) -> Adds a child component inside this component -> -> myComponent.el(); -> // ->
-> myComonent.children(); -> // [empty array] -> -> var myButton = myComponent.addChild('MyButton'); -> // ->
myButton
-> // -> myButton === myComonent.children()[0]; -> -> Pass in options for child constructors and options for children of the child -> -> var myButton = myComponent.addChild('MyButton', { -> text: 'Press Me', -> children: { -> buttonChildExample: { -> buttonChildOption: true -> } -> } -> }); - -##### PARAMETERS: -* __child__ `String|vjs.Component` The class name or instance of a child to add -* __options__ `Object` _(OPTIONAL)_ Options, including options to be passed to children of the child. - -##### RETURNS: -* `vjs.Component` The child component (created by this process if a string was used) - -_inherited from_: [src/js/component.js#L362](https://github.com/videojs/video.js/blob/master/src/js/component.js#L362) - ---- - -### addClass( classToAdd ) -> Add a CSS class name to the component's element - -##### PARAMETERS: -* __classToAdd__ `String` Classname to add - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L826](https://github.com/videojs/video.js/blob/master/src/js/component.js#L826) - ---- - -### buildCSSClass() -> Allows sub components to stack CSS class names - -##### RETURNS: -* `String` The constructed class name - -_inherited from_: [src/js/component.js#L536](https://github.com/videojs/video.js/blob/master/src/js/component.js#L536) - ---- - -### children() -> Get an array of all child components -> -> var kids = myComponent.children(); - -##### RETURNS: -* `Array` The children - -_inherited from_: [src/js/component.js#L296](https://github.com/videojs/video.js/blob/master/src/js/component.js#L296) - ---- - -### clearInterval( intervalId ) -> Clears an interval and removes the associated dispose listener - -##### PARAMETERS: -* __intervalId__ `Number` The id of the interval to clear - -##### RETURNS: -* `Number` Returns the interval ID - -_inherited from_: [src/js/component.js#L1223](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1223) - ---- - -### clearTimeout( timeoutId ) -> Clears a timeout and removes the associated dispose listener - -##### PARAMETERS: -* __timeoutId__ `Number` The id of the timeout to clear - -##### RETURNS: -* `Number` Returns the timeout ID - -_inherited from_: [src/js/component.js#L1185](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1185) - ---- - -### contentEl() -> Return the component's DOM element for embedding content. -> Will either be el_ or a new element defined in createEl. - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L239](https://github.com/videojs/video.js/blob/master/src/js/component.js#L239) - ---- - -### createEl( [tagName], [attributes] ) -> Create the component's DOM element - -##### PARAMETERS: -* __tagName__ `String` _(OPTIONAL)_ Element's node type. e.g. 'div' -* __attributes__ `Object` _(OPTIONAL)_ An object of element attributes that should be set on the element - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L200](https://github.com/videojs/video.js/blob/master/src/js/component.js#L200) - ---- - -### dimensions( width, height ) -> Set both width and height at the same time - -##### PARAMETERS: -* __width__ `Number|String` -* __height__ `Number|String` - -##### RETURNS: -* `vjs.Component` The component - -_inherited from_: [src/js/component.js#L938](https://github.com/videojs/video.js/blob/master/src/js/component.js#L938) - ---- - -### dispose() -> Dispose of the component and all child components - -_inherited from_: [src/js/component.js#L84](https://github.com/videojs/video.js/blob/master/src/js/component.js#L84) - ---- - -### el() -> Get the component's DOM element -> -> var domEl = myComponent.el(); - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L220](https://github.com/videojs/video.js/blob/master/src/js/component.js#L220) - ---- - -### enableTouchActivity() -> Report user touch activity when touch events occur -> -> User activity is used to determine when controls should show/hide. It's -> relatively simple when it comes to mouse events, because any mouse event -> should show the controls. So we capture mouse events that bubble up to the -> player and report activity when that happens. -> -> With touch events it isn't as easy. We can't rely on touch events at the -> player level, because a tap (touchstart + touchend) on the video itself on -> mobile devices is meant to turn controls off (and on). User activity is -> checked asynchronously, so what could happen is a tap event on the video -> turns the controls off, then the touchend event bubbles up to the player, -> which if it reported user activity, would turn the controls right back on. -> (We also don't want to completely block touch events from bubbling up) -> -> Also a touchmove, touch+hold, and anything other than a tap is not supposed -> to turn the controls back on on a mobile device. -> -> Here we're setting the default component behavior to report user activity -> whenever touch events happen, and this can be turned off by components that -> want touch events to act differently. - -_inherited from_: [src/js/component.js#L1124](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1124) - ---- - -### getChild( name ) -> Returns a child component with the provided name - -##### PARAMETERS: -* __name__ - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L330](https://github.com/videojs/video.js/blob/master/src/js/component.js#L330) - ---- - -### getChildById( id ) -> Returns a child component with the provided ID - -##### PARAMETERS: -* __id__ - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L313](https://github.com/videojs/video.js/blob/master/src/js/component.js#L313) - ---- - -### hasClass( classToCheck ) -> Check if a component's element has a CSS class name - -##### PARAMETERS: -* __classToCheck__ `String` Classname to check - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L816](https://github.com/videojs/video.js/blob/master/src/js/component.js#L816) - ---- - -### height( [num], [skipListeners] ) -> Get or set the height of the component (CSS values) -> -> Setting the video tag dimension values only works with values in pixels. -> Percent values will not work. -> Some percents can be used, but width()/height() will return the number + %, -> not the actual computed width/height. - -##### PARAMETERS: -* __num__ `Number|String` _(OPTIONAL)_ New component height -* __skipListeners__ `Boolean` _(OPTIONAL)_ Skip the resize event trigger - -##### RETURNS: -* `vjs.Component` This component, when setting the height -* `Number|String` The height, when getting - -_inherited from_: [src/js/component.js#L927](https://github.com/videojs/video.js/blob/master/src/js/component.js#L927) - ---- - -### hide() -> Hide the component element if currently showing - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L857](https://github.com/videojs/video.js/blob/master/src/js/component.js#L857) - ---- - -### id() -> Get the component's ID -> -> var id = myComponent.id(); - -##### RETURNS: -* `String` - -_inherited from_: [src/js/component.js#L258](https://github.com/videojs/video.js/blob/master/src/js/component.js#L258) - ---- - -### init( player, options, ready ) -> the constructor function for the class - -##### PARAMETERS: -* __player__ -* __options__ -* __ready__ - -_defined in_: [src/js/button.js#L15](https://github.com/videojs/video.js/blob/master/src/js/button.js#L15) - ---- - -### initChildren() -> Add and initialize default child components from options -> -> // when an instance of MyComponent is created, all children in options -> // will be added to the instance by their name strings and options -> MyComponent.prototype.options_.children = { -> myChildComponent: { -> myChildOption: true -> } -> } -> -> // Or when creating the component -> var myComp = new MyComponent(player, { -> children: { -> myChildComponent: { -> myChildOption: true -> } -> } -> }); -> -> The children option can also be an Array of child names or -> child options objects (that also include a 'name' key). -> -> var myComp = new MyComponent(player, { -> children: [ -> 'button', -> { -> name: 'button', -> someOtherOption: true -> } -> ] -> }); - -_inherited from_: [src/js/component.js#L481](https://github.com/videojs/video.js/blob/master/src/js/component.js#L481) - ---- - -### name() -> Get the component's name. The name is often used to reference the component. -> -> var name = myComponent.name(); - -##### RETURNS: -* `String` - -_inherited from_: [src/js/component.js#L277](https://github.com/videojs/video.js/blob/master/src/js/component.js#L277) - ---- - -### off( [first], [second], [third] ) -> Remove an event listener from this component's element -> -> myComponent.off('eventType', myFunc); -> -> If myFunc is excluded, ALL listeners for the event type will be removed. -> If eventType is excluded, ALL listeners will be removed from the component. -> -> Alternatively you can use `off` to remove listeners that were added to other -> elements or components using `myComponent.on(otherComponent...`. -> In this case both the event type and listener function are REQUIRED. -> -> myComponent.off(otherElement, 'eventType', myFunc); -> myComponent.off(otherComponent, 'eventType', myFunc); - -##### PARAMETERS: -* __first__ `String|vjs.Component` _(OPTIONAL)_ The event type or other component -* __second__ `Function|String` _(OPTIONAL)_ The listener function or event type -* __third__ `Function` _(OPTIONAL)_ The listener for other component - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L646](https://github.com/videojs/video.js/blob/master/src/js/component.js#L646) - ---- - -### on( first, second, third ) -> Add an event listener to this component's element -> -> var myFunc = function(){ -> var myComponent = this; -> // Do something when the event is fired -> }; -> -> myComponent.on('eventType', myFunc); -> -> The context of myFunc will be myComponent unless previously bound. -> -> Alternatively, you can add a listener to another element or component. -> -> myComponent.on(otherElement, 'eventName', myFunc); -> myComponent.on(otherComponent, 'eventName', myFunc); -> -> The benefit of using this over `vjs.on(otherElement, 'eventName', myFunc)` -> and `otherComponent.on('eventName', myFunc)` is that this way the listeners -> will be automatically cleaned up when either component is disposed. -> It will also bind myComponent as the context of myFunc. -> -> **NOTE**: When using this on elements in the page other than window -> and document (both permanent), if you remove the element from the DOM -> you need to call `vjs.trigger(el, 'dispose')` on it to clean up -> references to it and allow the browser to garbage collect it. - -##### PARAMETERS: -* __first__ `String|vjs.Component` The event type or other component -* __second__ `Function|String` The event handler or event type -* __third__ `Function` The event handler - -##### RETURNS: -* `vjs.Component` self - -_inherited from_: [src/js/component.js#L577](https://github.com/videojs/video.js/blob/master/src/js/component.js#L577) - ---- - -### one( first, second, [third] ) -> Add an event listener to be triggered only once and then removed -> -> myComponent.one('eventName', myFunc); -> -> Alternatively you can add a listener to another element or component -> that will be triggered only once. -> -> myComponent.one(otherElement, 'eventName', myFunc); -> myComponent.one(otherComponent, 'eventName', myFunc); - -##### PARAMETERS: -* __first__ `String|vjs.Component` The event type or other component -* __second__ `Function|String` The listener function or event type -* __third__ `Function` _(OPTIONAL)_ The listener function for other component - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L691](https://github.com/videojs/video.js/blob/master/src/js/component.js#L691) - ---- - -### options( obj ) -> Deep merge of options objects -> -> Whenever a property is an object on both options objects -> the two properties will be merged using vjs.obj.deepMerge. -> -> This is used for merging options for child components. We -> want it to be easy to override individual options on a child -> component without having to rewrite all the other default options. -> -> Parent.prototype.options_ = { -> children: { -> 'childOne': { 'foo': 'bar', 'asdf': 'fdsa' }, -> 'childTwo': {}, -> 'childThree': {} -> } -> } -> newOptions = { -> children: { -> 'childOne': { 'foo': 'baz', 'abc': '123' } -> 'childTwo': null, -> 'childFour': {} -> } -> } -> -> this.options(newOptions); -> -> RESULT -> -> { -> children: { -> 'childOne': { 'foo': 'baz', 'asdf': 'fdsa', 'abc': '123' }, -> 'childTwo': null, // Disabled. Won't be initialized. -> 'childThree': {}, -> 'childFour': {} -> } -> } - -##### PARAMETERS: -* __obj__ `Object` Object of new option values - -##### RETURNS: -* `Object` A NEW object of this.options_ and obj merged - -_inherited from_: [src/js/component.js#L179](https://github.com/videojs/video.js/blob/master/src/js/component.js#L179) - ---- - -### player() -> Return the component's player - -##### RETURNS: -* `vjs.Player` - -_inherited from_: [src/js/component.js#L126](https://github.com/videojs/video.js/blob/master/src/js/component.js#L126) - ---- - -### ready( fn ) -> Bind a listener to the component's ready state -> -> Different from event listeners in that if the ready event has already happened -> it will trigger the function immediately. - -##### PARAMETERS: -* __fn__ `Function` Ready listener - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L769](https://github.com/videojs/video.js/blob/master/src/js/component.js#L769) - ---- - -### removeChild( component ) -> Remove a child component from this component's list of children, and the -> child component's element from this component's element - -##### PARAMETERS: -* __component__ `vjs.Component` Component to remove - -_inherited from_: [src/js/component.js#L420](https://github.com/videojs/video.js/blob/master/src/js/component.js#L420) - ---- - -### removeClass( classToRemove ) -> Remove a CSS class name from the component's element - -##### PARAMETERS: -* __classToRemove__ `String` Classname to remove - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L837](https://github.com/videojs/video.js/blob/master/src/js/component.js#L837) - ---- - -### setInterval( fn, interval ) -> Creates an interval and sets up disposal automatically. - -##### PARAMETERS: -* __fn__ `Function` The function to run every N seconds. -* __interval__ `Number` Number of ms to delay before executing specified function. - -##### RETURNS: -* `Number` Returns the interval ID - -_inherited from_: [src/js/component.js#L1202](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1202) - ---- - -### setTimeout( fn, timeout ) -> Creates timeout and sets up disposal automatically. - -##### PARAMETERS: -* __fn__ `Function` The function to run after the timeout. -* __timeout__ `Number` Number of ms to delay before executing specified function. - -##### RETURNS: -* `Number` Returns the timeout ID - -_inherited from_: [src/js/component.js#L1162](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1162) - ---- - -### show() -> Show the component element if hidden - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L847](https://github.com/videojs/video.js/blob/master/src/js/component.js#L847) - ---- - -### trigger( event ) -> Trigger an event on an element -> -> myComponent.trigger('eventName'); -> myComponent.trigger({'type':'eventName'}); - -##### PARAMETERS: -* __event__ `Event|Object|String` A string (the type) or an event object with a type attribute - -##### RETURNS: -* `vjs.Component` self - -_inherited from_: [src/js/component.js#L724](https://github.com/videojs/video.js/blob/master/src/js/component.js#L724) - ---- - -### triggerReady() -> Trigger the ready listeners - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L788](https://github.com/videojs/video.js/blob/master/src/js/component.js#L788) - ---- - -### width( [num], skipListeners ) -> Set or get the width of the component (CSS values) -> -> Setting the video tag dimension values only works with values in pixels. -> Percent values will not work. -> Some percents can be used, but width()/height() will return the number + %, -> not the actual computed width/height. - -##### PARAMETERS: -* __num__ `Number|String` _(OPTIONAL)_ Optional width number -* __skipListeners__ `Boolean` Skip the 'resize' event trigger - -##### RETURNS: -* `vjs.Component` This component, when setting the width -* `Number|String` The width, when getting - -_inherited from_: [src/js/component.js#L910](https://github.com/videojs/video.js/blob/master/src/js/component.js#L910) - ---- - -## EVENTS - -### resize `EVENT` -> Fired when the width and/or height of the component changes - -_inherited from_: [src/js/component.js#L1020](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1020) - ---- - diff --git a/docs/api/vjs.CaptionsButton.md b/docs/api/vjs.CaptionsButton.md deleted file mode 100644 index efa2ab7b5c..0000000000 --- a/docs/api/vjs.CaptionsButton.md +++ /dev/null @@ -1,10 +0,0 @@ - - -# vjs.CaptionsButton - -__DEFINED IN__: [src/js/tracks/text-track-controls.js#L401](https://github.com/videojs/video.js/blob/master/src/js/tracks/text-track-controls.js#L401) - -The button component for toggling and selecting captions - ---- - diff --git a/docs/api/vjs.CaptionsTrack.md b/docs/api/vjs.CaptionsTrack.md deleted file mode 100644 index d5fec74f09..0000000000 --- a/docs/api/vjs.CaptionsTrack.md +++ /dev/null @@ -1,793 +0,0 @@ - - -# vjs.CaptionsTrack - -__EXTENDS__: [vjs.TextTrack](vjs.TextTrack.md) -__DEFINED IN__: [src/js/tracks.js#L676](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L676) - -The track component for managing the hiding and showing of captions - ---- - -## INDEX - -- [METHODS](#methods) - - [activate](#activate) _`inherited`_ - - [activeCues](#activecues) _`inherited`_ - - [addChild](#addchild-child-options-) _`inherited`_ - - [addClass](#addclass-classtoadd-) _`inherited`_ - - [buildCSSClass](#buildcssclass) _`inherited`_ - - [children](#children) _`inherited`_ - - [clearInterval](#clearinterval-intervalid-) _`inherited`_ - - [clearTimeout](#cleartimeout-timeoutid-) _`inherited`_ - - [contentEl](#contentel) _`inherited`_ - - [createEl](#createel) _`inherited`_ - - [cues](#cues) _`inherited`_ - - [deactivate](#deactivate) _`inherited`_ - - [dflt](#dflt) _`inherited`_ - - [dimensions](#dimensions-width-height-) _`inherited`_ - - [disable](#disable) _`inherited`_ - - [dispose](#dispose) _`inherited`_ - - [el](#el) _`inherited`_ - - [enableTouchActivity](#enabletouchactivity) _`inherited`_ - - [getChild](#getchild-name-) _`inherited`_ - - [getChildById](#getchildbyid-id-) _`inherited`_ - - [hasClass](#hasclass-classtocheck-) _`inherited`_ - - [height](#height-num-skiplisteners-) _`inherited`_ - - [hide](#hide) _`inherited`_ - - [id](#id) _`inherited`_ - - [init](#init-player-options-) _`inherited`_ - - [initChildren](#initchildren) _`inherited`_ - - [kind](#kind) _`inherited`_ - - [label](#label) _`inherited`_ - - [language](#language) _`inherited`_ - - [mode](#mode) _`inherited`_ - - [name](#name) _`inherited`_ - - [off](#off-first-second-third-) _`inherited`_ - - [on](#on-first-second-third-) _`inherited`_ - - [one](#one-first-second-third-) _`inherited`_ - - [options](#options-obj-) _`inherited`_ - - [player](#player) _`inherited`_ - - [ready](#ready-fn-) _`inherited`_ - - [readyState](#readystate) _`inherited`_ - - [removeChild](#removechild-component-) _`inherited`_ - - [removeClass](#removeclass-classtoremove-) _`inherited`_ - - [setInterval](#setinterval-fn-interval-) _`inherited`_ - - [setTimeout](#settimeout-fn-timeout-) _`inherited`_ - - [show](#show) _`inherited`_ - - [src](#src) _`inherited`_ - - [title](#title) _`inherited`_ - - [trigger](#trigger-event-) _`inherited`_ - - [triggerReady](#triggerready) _`inherited`_ - - [width](#width-num-skiplisteners-) _`inherited`_ - -- [EVENTS](#events) - - [resize](#resize-event) _`inherited`_ - ---- - -## METHODS - -### activate() -> Turn on cue tracking. Tracks that are showing OR hidden are active. - -_inherited from_: [src/js/tracks.js#L375](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L375) - ---- - -### activeCues() -> Get the track active cues - -##### RETURNS: -* `Array` - -_inherited from_: [src/js/tracks.js#L270](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L270) - ---- - -### addChild( child, [options] ) -> Adds a child component inside this component -> -> myComponent.el(); -> // ->
-> myComonent.children(); -> // [empty array] -> -> var myButton = myComponent.addChild('MyButton'); -> // ->
myButton
-> // -> myButton === myComonent.children()[0]; -> -> Pass in options for child constructors and options for children of the child -> -> var myButton = myComponent.addChild('MyButton', { -> text: 'Press Me', -> children: { -> buttonChildExample: { -> buttonChildOption: true -> } -> } -> }); - -##### PARAMETERS: -* __child__ `String|vjs.Component` The class name or instance of a child to add -* __options__ `Object` _(OPTIONAL)_ Options, including options to be passed to children of the child. - -##### RETURNS: -* `vjs.Component` The child component (created by this process if a string was used) - -_inherited from_: [src/js/component.js#L362](https://github.com/videojs/video.js/blob/master/src/js/component.js#L362) - ---- - -### addClass( classToAdd ) -> Add a CSS class name to the component's element - -##### PARAMETERS: -* __classToAdd__ `String` Classname to add - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L826](https://github.com/videojs/video.js/blob/master/src/js/component.js#L826) - ---- - -### buildCSSClass() -> Allows sub components to stack CSS class names - -##### RETURNS: -* `String` The constructed class name - -_inherited from_: [src/js/component.js#L536](https://github.com/videojs/video.js/blob/master/src/js/component.js#L536) - ---- - -### children() -> Get an array of all child components -> -> var kids = myComponent.children(); - -##### RETURNS: -* `Array` The children - -_inherited from_: [src/js/component.js#L296](https://github.com/videojs/video.js/blob/master/src/js/component.js#L296) - ---- - -### clearInterval( intervalId ) -> Clears an interval and removes the associated dispose listener - -##### PARAMETERS: -* __intervalId__ `Number` The id of the interval to clear - -##### RETURNS: -* `Number` Returns the interval ID - -_inherited from_: [src/js/component.js#L1219](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1219) - ---- - -### clearTimeout( timeoutId ) -> Clears a timeout and removes the associated dispose listener - -##### PARAMETERS: -* __timeoutId__ `Number` The id of the timeout to clear - -##### RETURNS: -* `Number` Returns the timeout ID - -_inherited from_: [src/js/component.js#L1181](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1181) - ---- - -### contentEl() -> Return the component's DOM element for embedding content. -> Will either be el_ or a new element defined in createEl. - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L239](https://github.com/videojs/video.js/blob/master/src/js/component.js#L239) - ---- - -### createEl() -> Create basic div to hold cue text - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/tracks.js#L315](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L315) - ---- - -### cues() -> Get the track cues - -##### RETURNS: -* `Array` - -_inherited from_: [src/js/tracks.js#L255](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L255) - ---- - -### deactivate() -> Turn off cue tracking. - -_inherited from_: [src/js/tracks.js#L398](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L398) - ---- - -### dflt() -> Get the track default value. ('default' is a reserved keyword) - -##### RETURNS: -* `Boolean` - -_inherited from_: [src/js/tracks.js#L196](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L196) - ---- - -### dimensions( width, height ) -> Set both width and height at the same time - -##### PARAMETERS: -* __width__ `Number|String` -* __height__ `Number|String` - -##### RETURNS: -* `vjs.Component` The component - -_inherited from_: [src/js/component.js#L938](https://github.com/videojs/video.js/blob/master/src/js/component.js#L938) - ---- - -### disable() -> Disable: Mode Off/Disable (0) -> Indicates that the text track is not active. Other than for the purposes of exposing the track in the DOM, the user agent is ignoring the text track. -> No cues are active, no events are fired, and the user agent will not attempt to obtain the track's cues. - -_inherited from_: [src/js/tracks.js#L361](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L361) - ---- - -### dispose() -> Dispose of the component and all child components - -_inherited from_: [src/js/component.js#L84](https://github.com/videojs/video.js/blob/master/src/js/component.js#L84) - ---- - -### el() -> Get the component's DOM element -> -> var domEl = myComponent.el(); - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L220](https://github.com/videojs/video.js/blob/master/src/js/component.js#L220) - ---- - -### enableTouchActivity() -> Report user touch activity when touch events occur -> -> User activity is used to determine when controls should show/hide. It's -> relatively simple when it comes to mouse events, because any mouse event -> should show the controls. So we capture mouse events that bubble up to the -> player and report activity when that happens. -> -> With touch events it isn't as easy. We can't rely on touch events at the -> player level, because a tap (touchstart + touchend) on the video itself on -> mobile devices is meant to turn controls off (and on). User activity is -> checked asynchronously, so what could happen is a tap event on the video -> turns the controls off, then the touchend event bubbles up to the player, -> which if it reported user activity, would turn the controls right back on. -> (We also don't want to completely block touch events from bubbling up) -> -> Also a touchmove, touch+hold, and anything other than a tap is not supposed -> to turn the controls back on on a mobile device. -> -> Here we're setting the default component behavior to report user activity -> whenever touch events happen, and this can be turned off by components that -> want touch events to act differently. - -_inherited from_: [src/js/component.js#L1120](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1120) - ---- - -### getChild( name ) -> Returns a child component with the provided name - -##### PARAMETERS: -* __name__ - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L330](https://github.com/videojs/video.js/blob/master/src/js/component.js#L330) - ---- - -### getChildById( id ) -> Returns a child component with the provided ID - -##### PARAMETERS: -* __id__ - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L313](https://github.com/videojs/video.js/blob/master/src/js/component.js#L313) - ---- - -### hasClass( classToCheck ) -> Check if a component's element has a CSS class name - -##### PARAMETERS: -* __classToCheck__ `String` Classname to check - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L816](https://github.com/videojs/video.js/blob/master/src/js/component.js#L816) - ---- - -### height( [num], [skipListeners] ) -> Get or set the height of the component (CSS values) -> -> Setting the video tag dimension values only works with values in pixels. -> Percent values will not work. -> Some percents can be used, but width()/height() will return the number + %, -> not the actual computed width/height. - -##### PARAMETERS: -* __num__ `Number|String` _(OPTIONAL)_ New component height -* __skipListeners__ `Boolean` _(OPTIONAL)_ Skip the resize event trigger - -##### RETURNS: -* `vjs.Component` This component, when setting the height -* `Number|String` The height, when getting - -_inherited from_: [src/js/component.js#L927](https://github.com/videojs/video.js/blob/master/src/js/component.js#L927) - ---- - -### hide() -> Hide: Mode Hidden (1) -> Indicates that the text track is active, but that the user agent is not actively displaying the cues. -> If no attempt has yet been made to obtain the track's cues, the user agent will perform such an attempt momentarily. -> The user agent is maintaining a list of which cues are active, and events are being fired accordingly. - -_inherited from_: [src/js/tracks.js#L346](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L346) - ---- - -### id() -> Get the component's ID -> -> var id = myComponent.id(); - -##### RETURNS: -* `String` - -_inherited from_: [src/js/component.js#L258](https://github.com/videojs/video.js/blob/master/src/js/component.js#L258) - ---- - -### init( player, options ) - -##### PARAMETERS: -* __player__ -* __options__ - -_inherited from_: [src/js/tracks.js#L134](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L134) - ---- - -### initChildren() -> Add and initialize default child components from options -> -> // when an instance of MyComponent is created, all children in options -> // will be added to the instance by their name strings and options -> MyComponent.prototype.options_.children = { -> myChildComponent: { -> myChildOption: true -> } -> } -> -> // Or when creating the component -> var myComp = new MyComponent(player, { -> children: { -> myChildComponent: { -> myChildOption: true -> } -> } -> }); -> -> The children option can also be an Array of child names or -> child options objects (that also include a 'name' key). -> -> var myComp = new MyComponent(player, { -> children: [ -> 'button', -> { -> name: 'button', -> someOtherOption: true -> } -> ] -> }); - -_inherited from_: [src/js/component.js#L481](https://github.com/videojs/video.js/blob/master/src/js/component.js#L481) - ---- - -### kind() -> Get the track kind value - -##### RETURNS: -* `String` - -_inherited from_: [src/js/tracks.js#L167](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L167) - ---- - -### label() -> Get the track label value - -##### RETURNS: -* `String` - -_inherited from_: [src/js/tracks.js#L240](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L240) - ---- - -### language() -> Get the track language value - -##### RETURNS: -* `String` - -_inherited from_: [src/js/tracks.js#L225](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L225) - ---- - -### mode() -> Get the track mode - -##### RETURNS: -* `Number` - -_inherited from_: [src/js/tracks.js#L307](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L307) - ---- - -### name() -> Get the component's name. The name is often used to reference the component. -> -> var name = myComponent.name(); - -##### RETURNS: -* `String` - -_inherited from_: [src/js/component.js#L277](https://github.com/videojs/video.js/blob/master/src/js/component.js#L277) - ---- - -### off( [first], [second], [third] ) -> Remove an event listener from this component's element -> -> myComponent.off('eventType', myFunc); -> -> If myFunc is excluded, ALL listeners for the event type will be removed. -> If eventType is excluded, ALL listeners will be removed from the component. -> -> Alternatively you can use `off` to remove listeners that were added to other -> elements or components using `myComponent.on(otherComponent...`. -> In this case both the event type and listener function are REQUIRED. -> -> myComponent.off(otherElement, 'eventType', myFunc); -> myComponent.off(otherComponent, 'eventType', myFunc); - -##### PARAMETERS: -* __first__ `String|vjs.Component` _(OPTIONAL)_ The event type or other component -* __second__ `Function|String` _(OPTIONAL)_ The listener function or event type -* __third__ `Function` _(OPTIONAL)_ The listener for other component - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L646](https://github.com/videojs/video.js/blob/master/src/js/component.js#L646) - ---- - -### on( first, second, third ) -> Add an event listener to this component's element -> -> var myFunc = function(){ -> var myComponent = this; -> // Do something when the event is fired -> }; -> -> myComponent.on('eventType', myFunc); -> -> The context of myFunc will be myComponent unless previously bound. -> -> Alternatively, you can add a listener to another element or component. -> -> myComponent.on(otherElement, 'eventName', myFunc); -> myComponent.on(otherComponent, 'eventName', myFunc); -> -> The benefit of using this over `vjs.on(otherElement, 'eventName', myFunc)` -> and `otherComponent.on('eventName', myFunc)` is that this way the listeners -> will be automatically cleaned up when either component is disposed. -> It will also bind myComponent as the context of myFunc. -> -> **NOTE**: When using this on elements in the page other than window -> and document (both permanent), if you remove the element from the DOM -> you need to call `vjs.trigger(el, 'dispose')` on it to clean up -> references to it and allow the browser to garbage collect it. - -##### PARAMETERS: -* __first__ `String|vjs.Component` The event type or other component -* __second__ `Function|String` The event handler or event type -* __third__ `Function` The event handler - -##### RETURNS: -* `vjs.Component` self - -_inherited from_: [src/js/component.js#L577](https://github.com/videojs/video.js/blob/master/src/js/component.js#L577) - ---- - -### one( first, second, [third] ) -> Add an event listener to be triggered only once and then removed -> -> myComponent.one('eventName', myFunc); -> -> Alternatively you can add a listener to another element or component -> that will be triggered only once. -> -> myComponent.one(otherElement, 'eventName', myFunc); -> myComponent.one(otherComponent, 'eventName', myFunc); - -##### PARAMETERS: -* __first__ `String|vjs.Component` The event type or other component -* __second__ `Function|String` The listener function or event type -* __third__ `Function` _(OPTIONAL)_ The listener function for other component - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L691](https://github.com/videojs/video.js/blob/master/src/js/component.js#L691) - ---- - -### options( obj ) -> Deep merge of options objects -> -> Whenever a property is an object on both options objects -> the two properties will be merged using vjs.obj.deepMerge. -> -> This is used for merging options for child components. We -> want it to be easy to override individual options on a child -> component without having to rewrite all the other default options. -> -> Parent.prototype.options_ = { -> children: { -> 'childOne': { 'foo': 'bar', 'asdf': 'fdsa' }, -> 'childTwo': {}, -> 'childThree': {} -> } -> } -> newOptions = { -> children: { -> 'childOne': { 'foo': 'baz', 'abc': '123' } -> 'childTwo': null, -> 'childFour': {} -> } -> } -> -> this.options(newOptions); -> -> RESULT -> -> { -> children: { -> 'childOne': { 'foo': 'baz', 'asdf': 'fdsa', 'abc': '123' }, -> 'childTwo': null, // Disabled. Won't be initialized. -> 'childThree': {}, -> 'childFour': {} -> } -> } - -##### PARAMETERS: -* __obj__ `Object` Object of new option values - -##### RETURNS: -* `Object` A NEW object of this.options_ and obj merged - -_inherited from_: [src/js/component.js#L179](https://github.com/videojs/video.js/blob/master/src/js/component.js#L179) - ---- - -### player() -> Return the component's player - -##### RETURNS: -* `vjs.Player` - -_inherited from_: [src/js/component.js#L126](https://github.com/videojs/video.js/blob/master/src/js/component.js#L126) - ---- - -### ready( fn ) -> Bind a listener to the component's ready state -> -> Different from event listeners in that if the ready event has already happened -> it will trigger the function immediately. - -##### PARAMETERS: -* __fn__ `Function` Ready listener - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L769](https://github.com/videojs/video.js/blob/master/src/js/component.js#L769) - ---- - -### readyState() -> Get the track readyState - -##### RETURNS: -* `Number` - -_inherited from_: [src/js/tracks.js#L289](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L289) - ---- - -### removeChild( component ) -> Remove a child component from this component's list of children, and the -> child component's element from this component's element - -##### PARAMETERS: -* __component__ `vjs.Component` Component to remove - -_inherited from_: [src/js/component.js#L420](https://github.com/videojs/video.js/blob/master/src/js/component.js#L420) - ---- - -### removeClass( classToRemove ) -> Remove a CSS class name from the component's element - -##### PARAMETERS: -* __classToRemove__ `String` Classname to remove - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L837](https://github.com/videojs/video.js/blob/master/src/js/component.js#L837) - ---- - -### setInterval( fn, interval ) -> Creates an interval and sets up disposal automatically. - -##### PARAMETERS: -* __fn__ `Function` The function to run every N seconds. -* __interval__ `Number` Number of ms to delay before executing specified function. - -##### RETURNS: -* `Number` Returns the interval ID - -_inherited from_: [src/js/component.js#L1198](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1198) - ---- - -### setTimeout( fn, timeout ) -> Creates timeout and sets up disposal automatically. - -##### PARAMETERS: -* __fn__ `Function` The function to run after the timeout. -* __timeout__ `Number` Number of ms to delay before executing specified function. - -##### RETURNS: -* `Number` Returns the timeout ID - -_inherited from_: [src/js/component.js#L1158](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1158) - ---- - -### show() -> Show: Mode Showing (2) -> Indicates that the text track is active. If no attempt has yet been made to obtain the track's cues, the user agent will perform such an attempt momentarily. -> The user agent is maintaining a list of which cues are active, and events are being fired accordingly. -> In addition, for text tracks whose kind is subtitles or captions, the cues are being displayed over the video as appropriate; -> for text tracks whose kind is descriptions, the user agent is making the cues available to the user in a non-visual fashion; -> and for text tracks whose kind is chapters, the user agent is making available to the user a mechanism by which the user can navigate to any point in the media resource by selecting a cue. -> The showing by default state is used in conjunction with the default attribute on track elements to indicate that the text track was enabled due to that attribute. -> This allows the user agent to override the state if a later track is discovered that is more appropriate per the user's preferences. - -_inherited from_: [src/js/tracks.js#L331](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L331) - ---- - -### src() -> Get the track src value - -##### RETURNS: -* `String` - -_inherited from_: [src/js/tracks.js#L181](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L181) - ---- - -### title() -> Get the track title value - -##### RETURNS: -* `String` - -_inherited from_: [src/js/tracks.js#L210](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L210) - ---- - -### trigger( event ) -> Trigger an event on an element -> -> myComponent.trigger('eventName'); -> myComponent.trigger({'type':'eventName'}); - -##### PARAMETERS: -* __event__ `Event|Object|String` A string (the type) or an event object with a type attribute - -##### RETURNS: -* `vjs.Component` self - -_inherited from_: [src/js/component.js#L724](https://github.com/videojs/video.js/blob/master/src/js/component.js#L724) - ---- - -### triggerReady() -> Trigger the ready listeners - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L788](https://github.com/videojs/video.js/blob/master/src/js/component.js#L788) - ---- - -### width( [num], skipListeners ) -> Set or get the width of the component (CSS values) -> -> Setting the video tag dimension values only works with values in pixels. -> Percent values will not work. -> Some percents can be used, but width()/height() will return the number + %, -> not the actual computed width/height. - -##### PARAMETERS: -* __num__ `Number|String` _(OPTIONAL)_ Optional width number -* __skipListeners__ `Boolean` Skip the 'resize' event trigger - -##### RETURNS: -* `vjs.Component` This component, when setting the width -* `Number|String` The width, when getting - -_inherited from_: [src/js/component.js#L910](https://github.com/videojs/video.js/blob/master/src/js/component.js#L910) - ---- - -## EVENTS - -### resize `EVENT` -> Fired when the width and/or height of the component changes - -_inherited from_: [src/js/component.js#L1020](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1020) - ---- - diff --git a/docs/api/vjs.ChaptersButton.md b/docs/api/vjs.ChaptersButton.md deleted file mode 100644 index b3fd88afab..0000000000 --- a/docs/api/vjs.ChaptersButton.md +++ /dev/null @@ -1,10 +0,0 @@ - - -# vjs.ChaptersButton - -__DEFINED IN__: [src/js/tracks/text-track-controls.js#L451](https://github.com/videojs/video.js/blob/master/src/js/tracks/text-track-controls.js#L451) - -The button component for toggling and selecting chapters - ---- - diff --git a/docs/api/vjs.ChaptersTrack.md b/docs/api/vjs.ChaptersTrack.md deleted file mode 100644 index 382cf98fd8..0000000000 --- a/docs/api/vjs.ChaptersTrack.md +++ /dev/null @@ -1,793 +0,0 @@ - - -# vjs.ChaptersTrack - -__EXTENDS__: [vjs.TextTrack](vjs.TextTrack.md) -__DEFINED IN__: [src/js/tracks.js#L694](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L694) - -The track component for managing the hiding and showing of chapters - ---- - -## INDEX - -- [METHODS](#methods) - - [activate](#activate) _`inherited`_ - - [activeCues](#activecues) _`inherited`_ - - [addChild](#addchild-child-options-) _`inherited`_ - - [addClass](#addclass-classtoadd-) _`inherited`_ - - [buildCSSClass](#buildcssclass) _`inherited`_ - - [children](#children) _`inherited`_ - - [clearInterval](#clearinterval-intervalid-) _`inherited`_ - - [clearTimeout](#cleartimeout-timeoutid-) _`inherited`_ - - [contentEl](#contentel) _`inherited`_ - - [createEl](#createel) _`inherited`_ - - [cues](#cues) _`inherited`_ - - [deactivate](#deactivate) _`inherited`_ - - [dflt](#dflt) _`inherited`_ - - [dimensions](#dimensions-width-height-) _`inherited`_ - - [disable](#disable) _`inherited`_ - - [dispose](#dispose) _`inherited`_ - - [el](#el) _`inherited`_ - - [enableTouchActivity](#enabletouchactivity) _`inherited`_ - - [getChild](#getchild-name-) _`inherited`_ - - [getChildById](#getchildbyid-id-) _`inherited`_ - - [hasClass](#hasclass-classtocheck-) _`inherited`_ - - [height](#height-num-skiplisteners-) _`inherited`_ - - [hide](#hide) _`inherited`_ - - [id](#id) _`inherited`_ - - [init](#init-player-options-) _`inherited`_ - - [initChildren](#initchildren) _`inherited`_ - - [kind](#kind) _`inherited`_ - - [label](#label) _`inherited`_ - - [language](#language) _`inherited`_ - - [mode](#mode) _`inherited`_ - - [name](#name) _`inherited`_ - - [off](#off-first-second-third-) _`inherited`_ - - [on](#on-first-second-third-) _`inherited`_ - - [one](#one-first-second-third-) _`inherited`_ - - [options](#options-obj-) _`inherited`_ - - [player](#player) _`inherited`_ - - [ready](#ready-fn-) _`inherited`_ - - [readyState](#readystate) _`inherited`_ - - [removeChild](#removechild-component-) _`inherited`_ - - [removeClass](#removeclass-classtoremove-) _`inherited`_ - - [setInterval](#setinterval-fn-interval-) _`inherited`_ - - [setTimeout](#settimeout-fn-timeout-) _`inherited`_ - - [show](#show) _`inherited`_ - - [src](#src) _`inherited`_ - - [title](#title) _`inherited`_ - - [trigger](#trigger-event-) _`inherited`_ - - [triggerReady](#triggerready) _`inherited`_ - - [width](#width-num-skiplisteners-) _`inherited`_ - -- [EVENTS](#events) - - [resize](#resize-event) _`inherited`_ - ---- - -## METHODS - -### activate() -> Turn on cue tracking. Tracks that are showing OR hidden are active. - -_inherited from_: [src/js/tracks.js#L375](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L375) - ---- - -### activeCues() -> Get the track active cues - -##### RETURNS: -* `Array` - -_inherited from_: [src/js/tracks.js#L270](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L270) - ---- - -### addChild( child, [options] ) -> Adds a child component inside this component -> -> myComponent.el(); -> // ->
-> myComonent.children(); -> // [empty array] -> -> var myButton = myComponent.addChild('MyButton'); -> // ->
myButton
-> // -> myButton === myComonent.children()[0]; -> -> Pass in options for child constructors and options for children of the child -> -> var myButton = myComponent.addChild('MyButton', { -> text: 'Press Me', -> children: { -> buttonChildExample: { -> buttonChildOption: true -> } -> } -> }); - -##### PARAMETERS: -* __child__ `String|vjs.Component` The class name or instance of a child to add -* __options__ `Object` _(OPTIONAL)_ Options, including options to be passed to children of the child. - -##### RETURNS: -* `vjs.Component` The child component (created by this process if a string was used) - -_inherited from_: [src/js/component.js#L362](https://github.com/videojs/video.js/blob/master/src/js/component.js#L362) - ---- - -### addClass( classToAdd ) -> Add a CSS class name to the component's element - -##### PARAMETERS: -* __classToAdd__ `String` Classname to add - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L826](https://github.com/videojs/video.js/blob/master/src/js/component.js#L826) - ---- - -### buildCSSClass() -> Allows sub components to stack CSS class names - -##### RETURNS: -* `String` The constructed class name - -_inherited from_: [src/js/component.js#L536](https://github.com/videojs/video.js/blob/master/src/js/component.js#L536) - ---- - -### children() -> Get an array of all child components -> -> var kids = myComponent.children(); - -##### RETURNS: -* `Array` The children - -_inherited from_: [src/js/component.js#L296](https://github.com/videojs/video.js/blob/master/src/js/component.js#L296) - ---- - -### clearInterval( intervalId ) -> Clears an interval and removes the associated dispose listener - -##### PARAMETERS: -* __intervalId__ `Number` The id of the interval to clear - -##### RETURNS: -* `Number` Returns the interval ID - -_inherited from_: [src/js/component.js#L1219](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1219) - ---- - -### clearTimeout( timeoutId ) -> Clears a timeout and removes the associated dispose listener - -##### PARAMETERS: -* __timeoutId__ `Number` The id of the timeout to clear - -##### RETURNS: -* `Number` Returns the timeout ID - -_inherited from_: [src/js/component.js#L1181](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1181) - ---- - -### contentEl() -> Return the component's DOM element for embedding content. -> Will either be el_ or a new element defined in createEl. - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L239](https://github.com/videojs/video.js/blob/master/src/js/component.js#L239) - ---- - -### createEl() -> Create basic div to hold cue text - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/tracks.js#L315](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L315) - ---- - -### cues() -> Get the track cues - -##### RETURNS: -* `Array` - -_inherited from_: [src/js/tracks.js#L255](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L255) - ---- - -### deactivate() -> Turn off cue tracking. - -_inherited from_: [src/js/tracks.js#L398](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L398) - ---- - -### dflt() -> Get the track default value. ('default' is a reserved keyword) - -##### RETURNS: -* `Boolean` - -_inherited from_: [src/js/tracks.js#L196](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L196) - ---- - -### dimensions( width, height ) -> Set both width and height at the same time - -##### PARAMETERS: -* __width__ `Number|String` -* __height__ `Number|String` - -##### RETURNS: -* `vjs.Component` The component - -_inherited from_: [src/js/component.js#L938](https://github.com/videojs/video.js/blob/master/src/js/component.js#L938) - ---- - -### disable() -> Disable: Mode Off/Disable (0) -> Indicates that the text track is not active. Other than for the purposes of exposing the track in the DOM, the user agent is ignoring the text track. -> No cues are active, no events are fired, and the user agent will not attempt to obtain the track's cues. - -_inherited from_: [src/js/tracks.js#L361](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L361) - ---- - -### dispose() -> Dispose of the component and all child components - -_inherited from_: [src/js/component.js#L84](https://github.com/videojs/video.js/blob/master/src/js/component.js#L84) - ---- - -### el() -> Get the component's DOM element -> -> var domEl = myComponent.el(); - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L220](https://github.com/videojs/video.js/blob/master/src/js/component.js#L220) - ---- - -### enableTouchActivity() -> Report user touch activity when touch events occur -> -> User activity is used to determine when controls should show/hide. It's -> relatively simple when it comes to mouse events, because any mouse event -> should show the controls. So we capture mouse events that bubble up to the -> player and report activity when that happens. -> -> With touch events it isn't as easy. We can't rely on touch events at the -> player level, because a tap (touchstart + touchend) on the video itself on -> mobile devices is meant to turn controls off (and on). User activity is -> checked asynchronously, so what could happen is a tap event on the video -> turns the controls off, then the touchend event bubbles up to the player, -> which if it reported user activity, would turn the controls right back on. -> (We also don't want to completely block touch events from bubbling up) -> -> Also a touchmove, touch+hold, and anything other than a tap is not supposed -> to turn the controls back on on a mobile device. -> -> Here we're setting the default component behavior to report user activity -> whenever touch events happen, and this can be turned off by components that -> want touch events to act differently. - -_inherited from_: [src/js/component.js#L1120](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1120) - ---- - -### getChild( name ) -> Returns a child component with the provided name - -##### PARAMETERS: -* __name__ - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L330](https://github.com/videojs/video.js/blob/master/src/js/component.js#L330) - ---- - -### getChildById( id ) -> Returns a child component with the provided ID - -##### PARAMETERS: -* __id__ - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L313](https://github.com/videojs/video.js/blob/master/src/js/component.js#L313) - ---- - -### hasClass( classToCheck ) -> Check if a component's element has a CSS class name - -##### PARAMETERS: -* __classToCheck__ `String` Classname to check - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L816](https://github.com/videojs/video.js/blob/master/src/js/component.js#L816) - ---- - -### height( [num], [skipListeners] ) -> Get or set the height of the component (CSS values) -> -> Setting the video tag dimension values only works with values in pixels. -> Percent values will not work. -> Some percents can be used, but width()/height() will return the number + %, -> not the actual computed width/height. - -##### PARAMETERS: -* __num__ `Number|String` _(OPTIONAL)_ New component height -* __skipListeners__ `Boolean` _(OPTIONAL)_ Skip the resize event trigger - -##### RETURNS: -* `vjs.Component` This component, when setting the height -* `Number|String` The height, when getting - -_inherited from_: [src/js/component.js#L927](https://github.com/videojs/video.js/blob/master/src/js/component.js#L927) - ---- - -### hide() -> Hide: Mode Hidden (1) -> Indicates that the text track is active, but that the user agent is not actively displaying the cues. -> If no attempt has yet been made to obtain the track's cues, the user agent will perform such an attempt momentarily. -> The user agent is maintaining a list of which cues are active, and events are being fired accordingly. - -_inherited from_: [src/js/tracks.js#L346](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L346) - ---- - -### id() -> Get the component's ID -> -> var id = myComponent.id(); - -##### RETURNS: -* `String` - -_inherited from_: [src/js/component.js#L258](https://github.com/videojs/video.js/blob/master/src/js/component.js#L258) - ---- - -### init( player, options ) - -##### PARAMETERS: -* __player__ -* __options__ - -_inherited from_: [src/js/tracks.js#L134](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L134) - ---- - -### initChildren() -> Add and initialize default child components from options -> -> // when an instance of MyComponent is created, all children in options -> // will be added to the instance by their name strings and options -> MyComponent.prototype.options_.children = { -> myChildComponent: { -> myChildOption: true -> } -> } -> -> // Or when creating the component -> var myComp = new MyComponent(player, { -> children: { -> myChildComponent: { -> myChildOption: true -> } -> } -> }); -> -> The children option can also be an Array of child names or -> child options objects (that also include a 'name' key). -> -> var myComp = new MyComponent(player, { -> children: [ -> 'button', -> { -> name: 'button', -> someOtherOption: true -> } -> ] -> }); - -_inherited from_: [src/js/component.js#L481](https://github.com/videojs/video.js/blob/master/src/js/component.js#L481) - ---- - -### kind() -> Get the track kind value - -##### RETURNS: -* `String` - -_inherited from_: [src/js/tracks.js#L167](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L167) - ---- - -### label() -> Get the track label value - -##### RETURNS: -* `String` - -_inherited from_: [src/js/tracks.js#L240](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L240) - ---- - -### language() -> Get the track language value - -##### RETURNS: -* `String` - -_inherited from_: [src/js/tracks.js#L225](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L225) - ---- - -### mode() -> Get the track mode - -##### RETURNS: -* `Number` - -_inherited from_: [src/js/tracks.js#L307](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L307) - ---- - -### name() -> Get the component's name. The name is often used to reference the component. -> -> var name = myComponent.name(); - -##### RETURNS: -* `String` - -_inherited from_: [src/js/component.js#L277](https://github.com/videojs/video.js/blob/master/src/js/component.js#L277) - ---- - -### off( [first], [second], [third] ) -> Remove an event listener from this component's element -> -> myComponent.off('eventType', myFunc); -> -> If myFunc is excluded, ALL listeners for the event type will be removed. -> If eventType is excluded, ALL listeners will be removed from the component. -> -> Alternatively you can use `off` to remove listeners that were added to other -> elements or components using `myComponent.on(otherComponent...`. -> In this case both the event type and listener function are REQUIRED. -> -> myComponent.off(otherElement, 'eventType', myFunc); -> myComponent.off(otherComponent, 'eventType', myFunc); - -##### PARAMETERS: -* __first__ `String|vjs.Component` _(OPTIONAL)_ The event type or other component -* __second__ `Function|String` _(OPTIONAL)_ The listener function or event type -* __third__ `Function` _(OPTIONAL)_ The listener for other component - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L646](https://github.com/videojs/video.js/blob/master/src/js/component.js#L646) - ---- - -### on( first, second, third ) -> Add an event listener to this component's element -> -> var myFunc = function(){ -> var myComponent = this; -> // Do something when the event is fired -> }; -> -> myComponent.on('eventType', myFunc); -> -> The context of myFunc will be myComponent unless previously bound. -> -> Alternatively, you can add a listener to another element or component. -> -> myComponent.on(otherElement, 'eventName', myFunc); -> myComponent.on(otherComponent, 'eventName', myFunc); -> -> The benefit of using this over `vjs.on(otherElement, 'eventName', myFunc)` -> and `otherComponent.on('eventName', myFunc)` is that this way the listeners -> will be automatically cleaned up when either component is disposed. -> It will also bind myComponent as the context of myFunc. -> -> **NOTE**: When using this on elements in the page other than window -> and document (both permanent), if you remove the element from the DOM -> you need to call `vjs.trigger(el, 'dispose')` on it to clean up -> references to it and allow the browser to garbage collect it. - -##### PARAMETERS: -* __first__ `String|vjs.Component` The event type or other component -* __second__ `Function|String` The event handler or event type -* __third__ `Function` The event handler - -##### RETURNS: -* `vjs.Component` self - -_inherited from_: [src/js/component.js#L577](https://github.com/videojs/video.js/blob/master/src/js/component.js#L577) - ---- - -### one( first, second, [third] ) -> Add an event listener to be triggered only once and then removed -> -> myComponent.one('eventName', myFunc); -> -> Alternatively you can add a listener to another element or component -> that will be triggered only once. -> -> myComponent.one(otherElement, 'eventName', myFunc); -> myComponent.one(otherComponent, 'eventName', myFunc); - -##### PARAMETERS: -* __first__ `String|vjs.Component` The event type or other component -* __second__ `Function|String` The listener function or event type -* __third__ `Function` _(OPTIONAL)_ The listener function for other component - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L691](https://github.com/videojs/video.js/blob/master/src/js/component.js#L691) - ---- - -### options( obj ) -> Deep merge of options objects -> -> Whenever a property is an object on both options objects -> the two properties will be merged using vjs.obj.deepMerge. -> -> This is used for merging options for child components. We -> want it to be easy to override individual options on a child -> component without having to rewrite all the other default options. -> -> Parent.prototype.options_ = { -> children: { -> 'childOne': { 'foo': 'bar', 'asdf': 'fdsa' }, -> 'childTwo': {}, -> 'childThree': {} -> } -> } -> newOptions = { -> children: { -> 'childOne': { 'foo': 'baz', 'abc': '123' } -> 'childTwo': null, -> 'childFour': {} -> } -> } -> -> this.options(newOptions); -> -> RESULT -> -> { -> children: { -> 'childOne': { 'foo': 'baz', 'asdf': 'fdsa', 'abc': '123' }, -> 'childTwo': null, // Disabled. Won't be initialized. -> 'childThree': {}, -> 'childFour': {} -> } -> } - -##### PARAMETERS: -* __obj__ `Object` Object of new option values - -##### RETURNS: -* `Object` A NEW object of this.options_ and obj merged - -_inherited from_: [src/js/component.js#L179](https://github.com/videojs/video.js/blob/master/src/js/component.js#L179) - ---- - -### player() -> Return the component's player - -##### RETURNS: -* `vjs.Player` - -_inherited from_: [src/js/component.js#L126](https://github.com/videojs/video.js/blob/master/src/js/component.js#L126) - ---- - -### ready( fn ) -> Bind a listener to the component's ready state -> -> Different from event listeners in that if the ready event has already happened -> it will trigger the function immediately. - -##### PARAMETERS: -* __fn__ `Function` Ready listener - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L769](https://github.com/videojs/video.js/blob/master/src/js/component.js#L769) - ---- - -### readyState() -> Get the track readyState - -##### RETURNS: -* `Number` - -_inherited from_: [src/js/tracks.js#L289](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L289) - ---- - -### removeChild( component ) -> Remove a child component from this component's list of children, and the -> child component's element from this component's element - -##### PARAMETERS: -* __component__ `vjs.Component` Component to remove - -_inherited from_: [src/js/component.js#L420](https://github.com/videojs/video.js/blob/master/src/js/component.js#L420) - ---- - -### removeClass( classToRemove ) -> Remove a CSS class name from the component's element - -##### PARAMETERS: -* __classToRemove__ `String` Classname to remove - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L837](https://github.com/videojs/video.js/blob/master/src/js/component.js#L837) - ---- - -### setInterval( fn, interval ) -> Creates an interval and sets up disposal automatically. - -##### PARAMETERS: -* __fn__ `Function` The function to run every N seconds. -* __interval__ `Number` Number of ms to delay before executing specified function. - -##### RETURNS: -* `Number` Returns the interval ID - -_inherited from_: [src/js/component.js#L1198](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1198) - ---- - -### setTimeout( fn, timeout ) -> Creates timeout and sets up disposal automatically. - -##### PARAMETERS: -* __fn__ `Function` The function to run after the timeout. -* __timeout__ `Number` Number of ms to delay before executing specified function. - -##### RETURNS: -* `Number` Returns the timeout ID - -_inherited from_: [src/js/component.js#L1158](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1158) - ---- - -### show() -> Show: Mode Showing (2) -> Indicates that the text track is active. If no attempt has yet been made to obtain the track's cues, the user agent will perform such an attempt momentarily. -> The user agent is maintaining a list of which cues are active, and events are being fired accordingly. -> In addition, for text tracks whose kind is subtitles or captions, the cues are being displayed over the video as appropriate; -> for text tracks whose kind is descriptions, the user agent is making the cues available to the user in a non-visual fashion; -> and for text tracks whose kind is chapters, the user agent is making available to the user a mechanism by which the user can navigate to any point in the media resource by selecting a cue. -> The showing by default state is used in conjunction with the default attribute on track elements to indicate that the text track was enabled due to that attribute. -> This allows the user agent to override the state if a later track is discovered that is more appropriate per the user's preferences. - -_inherited from_: [src/js/tracks.js#L331](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L331) - ---- - -### src() -> Get the track src value - -##### RETURNS: -* `String` - -_inherited from_: [src/js/tracks.js#L181](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L181) - ---- - -### title() -> Get the track title value - -##### RETURNS: -* `String` - -_inherited from_: [src/js/tracks.js#L210](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L210) - ---- - -### trigger( event ) -> Trigger an event on an element -> -> myComponent.trigger('eventName'); -> myComponent.trigger({'type':'eventName'}); - -##### PARAMETERS: -* __event__ `Event|Object|String` A string (the type) or an event object with a type attribute - -##### RETURNS: -* `vjs.Component` self - -_inherited from_: [src/js/component.js#L724](https://github.com/videojs/video.js/blob/master/src/js/component.js#L724) - ---- - -### triggerReady() -> Trigger the ready listeners - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L788](https://github.com/videojs/video.js/blob/master/src/js/component.js#L788) - ---- - -### width( [num], skipListeners ) -> Set or get the width of the component (CSS values) -> -> Setting the video tag dimension values only works with values in pixels. -> Percent values will not work. -> Some percents can be used, but width()/height() will return the number + %, -> not the actual computed width/height. - -##### PARAMETERS: -* __num__ `Number|String` _(OPTIONAL)_ Optional width number -* __skipListeners__ `Boolean` Skip the 'resize' event trigger - -##### RETURNS: -* `vjs.Component` This component, when setting the width -* `Number|String` The width, when getting - -_inherited from_: [src/js/component.js#L910](https://github.com/videojs/video.js/blob/master/src/js/component.js#L910) - ---- - -## EVENTS - -### resize `EVENT` -> Fired when the width and/or height of the component changes - -_inherited from_: [src/js/component.js#L1020](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1020) - ---- - diff --git a/docs/api/vjs.ChaptersTrackMenuItem.md b/docs/api/vjs.ChaptersTrackMenuItem.md deleted file mode 100644 index f62158a51f..0000000000 --- a/docs/api/vjs.ChaptersTrackMenuItem.md +++ /dev/null @@ -1,8 +0,0 @@ - - -# vjs.ChaptersTrackMenuItem - -__DEFINED IN__: [src/js/tracks/text-track-controls.js#L550](https://github.com/videojs/video.js/blob/master/src/js/tracks/text-track-controls.js#L550) - ---- - diff --git a/docs/api/vjs.Component.md b/docs/api/vjs.Component.md deleted file mode 100644 index 3b2e17a86a..0000000000 --- a/docs/api/vjs.Component.md +++ /dev/null @@ -1,679 +0,0 @@ - - -# vjs.Component - -__EXTENDS__: [vjs.CoreObject](vjs.CoreObject.md) -__DEFINED IN__: [src/js/component.js#L35](https://github.com/videojs/video.js/blob/master/src/js/component.js#L35) - -Base UI Component class - -Components are embeddable UI objects that are represented by both a -javascript object and an element in the DOM. They can be children of other -components, and can have many children themselves. - - // adding a button to the player - var button = player.addChild('button'); - button.el(); // -> button element - -
-
Button
-
- -Components are also event emitters. - - button.on('click', function(){ - console.log('Button Clicked!'); - }); - - button.trigger('customevent'); - ---- - -## INDEX - -- [METHODS](#methods) - - [addChild](#addchild-child-options-) - - [addClass](#addclass-classtoadd-) - - [buildCSSClass](#buildcssclass) - - [children](#children) - - [clearInterval](#clearinterval-intervalid-) - - [clearTimeout](#cleartimeout-timeoutid-) - - [contentEl](#contentel) - - [createEl](#createel-tagname-attributes-) - - [dimensions](#dimensions-width-height-) - - [dispose](#dispose) - - [el](#el) - - [enableTouchActivity](#enabletouchactivity) - - [getChild](#getchild-name-) - - [getChildById](#getchildbyid-id-) - - [hasClass](#hasclass-classtocheck-) - - [height](#height-num-skiplisteners-) - - [hide](#hide) - - [id](#id) - - [init](#init-player-options-ready-) - - [initChildren](#initchildren) - - [name](#name) - - [off](#off-first-second-third-) - - [on](#on-first-second-third-) - - [one](#one-first-second-third-) - - [options](#options-obj-) - - [player](#player) - - [ready](#ready-fn-) - - [removeChild](#removechild-component-) - - [removeClass](#removeclass-classtoremove-) - - [setInterval](#setinterval-fn-interval-) - - [setTimeout](#settimeout-fn-timeout-) - - [show](#show) - - [trigger](#trigger-event-) - - [triggerReady](#triggerready) - - [width](#width-num-skiplisteners-) - -- [EVENTS](#events) - - [resize](#resize-event) - ---- - -## METHODS - -### addChild( child, [options] ) -> Adds a child component inside this component -> -> myComponent.el(); -> // ->
-> myComonent.children(); -> // [empty array] -> -> var myButton = myComponent.addChild('MyButton'); -> // ->
myButton
-> // -> myButton === myComonent.children()[0]; -> -> Pass in options for child constructors and options for children of the child -> -> var myButton = myComponent.addChild('MyButton', { -> text: 'Press Me', -> children: { -> buttonChildExample: { -> buttonChildOption: true -> } -> } -> }); - -##### PARAMETERS: -* __child__ `String|vjs.Component` The class name or instance of a child to add -* __options__ `Object` _(OPTIONAL)_ Options, including options to be passed to children of the child. - -##### RETURNS: -* `vjs.Component` The child component (created by this process if a string was used) - -_defined in_: [src/js/component.js#L362](https://github.com/videojs/video.js/blob/master/src/js/component.js#L362) - ---- - -### addClass( classToAdd ) -> Add a CSS class name to the component's element - -##### PARAMETERS: -* __classToAdd__ `String` Classname to add - -##### RETURNS: -* `vjs.Component` - -_defined in_: [src/js/component.js#L826](https://github.com/videojs/video.js/blob/master/src/js/component.js#L826) - ---- - -### buildCSSClass() -> Allows sub components to stack CSS class names - -##### RETURNS: -* `String` The constructed class name - -_defined in_: [src/js/component.js#L536](https://github.com/videojs/video.js/blob/master/src/js/component.js#L536) - ---- - -### children() -> Get an array of all child components -> -> var kids = myComponent.children(); - -##### RETURNS: -* `Array` The children - -_defined in_: [src/js/component.js#L296](https://github.com/videojs/video.js/blob/master/src/js/component.js#L296) - ---- - -### clearInterval( intervalId ) -> Clears an interval and removes the associated dispose listener - -##### PARAMETERS: -* __intervalId__ `Number` The id of the interval to clear - -##### RETURNS: -* `Number` Returns the interval ID - -_defined in_: [src/js/component.js#L1223](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1223) - ---- - -### clearTimeout( timeoutId ) -> Clears a timeout and removes the associated dispose listener - -##### PARAMETERS: -* __timeoutId__ `Number` The id of the timeout to clear - -##### RETURNS: -* `Number` Returns the timeout ID - -_defined in_: [src/js/component.js#L1185](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1185) - ---- - -### contentEl() -> Return the component's DOM element for embedding content. -> Will either be el_ or a new element defined in createEl. - -##### RETURNS: -* `Element` - -_defined in_: [src/js/component.js#L239](https://github.com/videojs/video.js/blob/master/src/js/component.js#L239) - ---- - -### createEl( [tagName], [attributes] ) -> Create the component's DOM element - -##### PARAMETERS: -* __tagName__ `String` _(OPTIONAL)_ Element's node type. e.g. 'div' -* __attributes__ `Object` _(OPTIONAL)_ An object of element attributes that should be set on the element - -##### RETURNS: -* `Element` - -_defined in_: [src/js/component.js#L200](https://github.com/videojs/video.js/blob/master/src/js/component.js#L200) - ---- - -### dimensions( width, height ) -> Set both width and height at the same time - -##### PARAMETERS: -* __width__ `Number|String` -* __height__ `Number|String` - -##### RETURNS: -* `vjs.Component` The component - -_defined in_: [src/js/component.js#L938](https://github.com/videojs/video.js/blob/master/src/js/component.js#L938) - ---- - -### dispose() -> Dispose of the component and all child components - -_defined in_: [src/js/component.js#L84](https://github.com/videojs/video.js/blob/master/src/js/component.js#L84) - ---- - -### el() -> Get the component's DOM element -> -> var domEl = myComponent.el(); - -##### RETURNS: -* `Element` - -_defined in_: [src/js/component.js#L220](https://github.com/videojs/video.js/blob/master/src/js/component.js#L220) - ---- - -### enableTouchActivity() -> Report user touch activity when touch events occur -> -> User activity is used to determine when controls should show/hide. It's -> relatively simple when it comes to mouse events, because any mouse event -> should show the controls. So we capture mouse events that bubble up to the -> player and report activity when that happens. -> -> With touch events it isn't as easy. We can't rely on touch events at the -> player level, because a tap (touchstart + touchend) on the video itself on -> mobile devices is meant to turn controls off (and on). User activity is -> checked asynchronously, so what could happen is a tap event on the video -> turns the controls off, then the touchend event bubbles up to the player, -> which if it reported user activity, would turn the controls right back on. -> (We also don't want to completely block touch events from bubbling up) -> -> Also a touchmove, touch+hold, and anything other than a tap is not supposed -> to turn the controls back on on a mobile device. -> -> Here we're setting the default component behavior to report user activity -> whenever touch events happen, and this can be turned off by components that -> want touch events to act differently. - -_defined in_: [src/js/component.js#L1124](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1124) - ---- - -### getChild( name ) -> Returns a child component with the provided name - -##### PARAMETERS: -* __name__ - -##### RETURNS: -* `vjs.Component` - -_defined in_: [src/js/component.js#L330](https://github.com/videojs/video.js/blob/master/src/js/component.js#L330) - ---- - -### getChildById( id ) -> Returns a child component with the provided ID - -##### PARAMETERS: -* __id__ - -##### RETURNS: -* `vjs.Component` - -_defined in_: [src/js/component.js#L313](https://github.com/videojs/video.js/blob/master/src/js/component.js#L313) - ---- - -### hasClass( classToCheck ) -> Check if a component's element has a CSS class name - -##### PARAMETERS: -* __classToCheck__ `String` Classname to check - -##### RETURNS: -* `vjs.Component` - -_defined in_: [src/js/component.js#L816](https://github.com/videojs/video.js/blob/master/src/js/component.js#L816) - ---- - -### height( [num], [skipListeners] ) -> Get or set the height of the component (CSS values) -> -> Setting the video tag dimension values only works with values in pixels. -> Percent values will not work. -> Some percents can be used, but width()/height() will return the number + %, -> not the actual computed width/height. - -##### PARAMETERS: -* __num__ `Number|String` _(OPTIONAL)_ New component height -* __skipListeners__ `Boolean` _(OPTIONAL)_ Skip the resize event trigger - -##### RETURNS: -* `vjs.Component` This component, when setting the height -* `Number|String` The height, when getting - -_defined in_: [src/js/component.js#L927](https://github.com/videojs/video.js/blob/master/src/js/component.js#L927) - ---- - -### hide() -> Hide the component element if currently showing - -##### RETURNS: -* `vjs.Component` - -_defined in_: [src/js/component.js#L857](https://github.com/videojs/video.js/blob/master/src/js/component.js#L857) - ---- - -### id() -> Get the component's ID -> -> var id = myComponent.id(); - -##### RETURNS: -* `String` - -_defined in_: [src/js/component.js#L258](https://github.com/videojs/video.js/blob/master/src/js/component.js#L258) - ---- - -### init( player, options, ready ) -> the constructor function for the class - -##### PARAMETERS: -* __player__ -* __options__ -* __ready__ - -_defined in_: [src/js/component.js#L41](https://github.com/videojs/video.js/blob/master/src/js/component.js#L41) - ---- - -### initChildren() -> Add and initialize default child components from options -> -> // when an instance of MyComponent is created, all children in options -> // will be added to the instance by their name strings and options -> MyComponent.prototype.options_.children = { -> myChildComponent: { -> myChildOption: true -> } -> } -> -> // Or when creating the component -> var myComp = new MyComponent(player, { -> children: { -> myChildComponent: { -> myChildOption: true -> } -> } -> }); -> -> The children option can also be an Array of child names or -> child options objects (that also include a 'name' key). -> -> var myComp = new MyComponent(player, { -> children: [ -> 'button', -> { -> name: 'button', -> someOtherOption: true -> } -> ] -> }); - -_defined in_: [src/js/component.js#L481](https://github.com/videojs/video.js/blob/master/src/js/component.js#L481) - ---- - -### name() -> Get the component's name. The name is often used to reference the component. -> -> var name = myComponent.name(); - -##### RETURNS: -* `String` - -_defined in_: [src/js/component.js#L277](https://github.com/videojs/video.js/blob/master/src/js/component.js#L277) - ---- - -### off( [first], [second], [third] ) -> Remove an event listener from this component's element -> -> myComponent.off('eventType', myFunc); -> -> If myFunc is excluded, ALL listeners for the event type will be removed. -> If eventType is excluded, ALL listeners will be removed from the component. -> -> Alternatively you can use `off` to remove listeners that were added to other -> elements or components using `myComponent.on(otherComponent...`. -> In this case both the event type and listener function are REQUIRED. -> -> myComponent.off(otherElement, 'eventType', myFunc); -> myComponent.off(otherComponent, 'eventType', myFunc); - -##### PARAMETERS: -* __first__ `String|vjs.Component` _(OPTIONAL)_ The event type or other component -* __second__ `Function|String` _(OPTIONAL)_ The listener function or event type -* __third__ `Function` _(OPTIONAL)_ The listener for other component - -##### RETURNS: -* `vjs.Component` - -_defined in_: [src/js/component.js#L646](https://github.com/videojs/video.js/blob/master/src/js/component.js#L646) - ---- - -### on( first, second, third ) -> Add an event listener to this component's element -> -> var myFunc = function(){ -> var myComponent = this; -> // Do something when the event is fired -> }; -> -> myComponent.on('eventType', myFunc); -> -> The context of myFunc will be myComponent unless previously bound. -> -> Alternatively, you can add a listener to another element or component. -> -> myComponent.on(otherElement, 'eventName', myFunc); -> myComponent.on(otherComponent, 'eventName', myFunc); -> -> The benefit of using this over `vjs.on(otherElement, 'eventName', myFunc)` -> and `otherComponent.on('eventName', myFunc)` is that this way the listeners -> will be automatically cleaned up when either component is disposed. -> It will also bind myComponent as the context of myFunc. -> -> **NOTE**: When using this on elements in the page other than window -> and document (both permanent), if you remove the element from the DOM -> you need to call `vjs.trigger(el, 'dispose')` on it to clean up -> references to it and allow the browser to garbage collect it. - -##### PARAMETERS: -* __first__ `String|vjs.Component` The event type or other component -* __second__ `Function|String` The event handler or event type -* __third__ `Function` The event handler - -##### RETURNS: -* `vjs.Component` self - -_defined in_: [src/js/component.js#L577](https://github.com/videojs/video.js/blob/master/src/js/component.js#L577) - ---- - -### one( first, second, [third] ) -> Add an event listener to be triggered only once and then removed -> -> myComponent.one('eventName', myFunc); -> -> Alternatively you can add a listener to another element or component -> that will be triggered only once. -> -> myComponent.one(otherElement, 'eventName', myFunc); -> myComponent.one(otherComponent, 'eventName', myFunc); - -##### PARAMETERS: -* __first__ `String|vjs.Component` The event type or other component -* __second__ `Function|String` The listener function or event type -* __third__ `Function` _(OPTIONAL)_ The listener function for other component - -##### RETURNS: -* `vjs.Component` - -_defined in_: [src/js/component.js#L691](https://github.com/videojs/video.js/blob/master/src/js/component.js#L691) - ---- - -### options( obj ) -> Deep merge of options objects -> -> Whenever a property is an object on both options objects -> the two properties will be merged using vjs.obj.deepMerge. -> -> This is used for merging options for child components. We -> want it to be easy to override individual options on a child -> component without having to rewrite all the other default options. -> -> Parent.prototype.options_ = { -> children: { -> 'childOne': { 'foo': 'bar', 'asdf': 'fdsa' }, -> 'childTwo': {}, -> 'childThree': {} -> } -> } -> newOptions = { -> children: { -> 'childOne': { 'foo': 'baz', 'abc': '123' } -> 'childTwo': null, -> 'childFour': {} -> } -> } -> -> this.options(newOptions); -> -> RESULT -> -> { -> children: { -> 'childOne': { 'foo': 'baz', 'asdf': 'fdsa', 'abc': '123' }, -> 'childTwo': null, // Disabled. Won't be initialized. -> 'childThree': {}, -> 'childFour': {} -> } -> } - -##### PARAMETERS: -* __obj__ `Object` Object of new option values - -##### RETURNS: -* `Object` A NEW object of this.options_ and obj merged - -_defined in_: [src/js/component.js#L179](https://github.com/videojs/video.js/blob/master/src/js/component.js#L179) - ---- - -### player() -> Return the component's player - -##### RETURNS: -* `vjs.Player` - -_defined in_: [src/js/component.js#L126](https://github.com/videojs/video.js/blob/master/src/js/component.js#L126) - ---- - -### ready( fn ) -> Bind a listener to the component's ready state -> -> Different from event listeners in that if the ready event has already happened -> it will trigger the function immediately. - -##### PARAMETERS: -* __fn__ `Function` Ready listener - -##### RETURNS: -* `vjs.Component` - -_defined in_: [src/js/component.js#L769](https://github.com/videojs/video.js/blob/master/src/js/component.js#L769) - ---- - -### removeChild( component ) -> Remove a child component from this component's list of children, and the -> child component's element from this component's element - -##### PARAMETERS: -* __component__ `vjs.Component` Component to remove - -_defined in_: [src/js/component.js#L420](https://github.com/videojs/video.js/blob/master/src/js/component.js#L420) - ---- - -### removeClass( classToRemove ) -> Remove a CSS class name from the component's element - -##### PARAMETERS: -* __classToRemove__ `String` Classname to remove - -##### RETURNS: -* `vjs.Component` - -_defined in_: [src/js/component.js#L837](https://github.com/videojs/video.js/blob/master/src/js/component.js#L837) - ---- - -### setInterval( fn, interval ) -> Creates an interval and sets up disposal automatically. - -##### PARAMETERS: -* __fn__ `Function` The function to run every N seconds. -* __interval__ `Number` Number of ms to delay before executing specified function. - -##### RETURNS: -* `Number` Returns the interval ID - -_defined in_: [src/js/component.js#L1202](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1202) - ---- - -### setTimeout( fn, timeout ) -> Creates timeout and sets up disposal automatically. - -##### PARAMETERS: -* __fn__ `Function` The function to run after the timeout. -* __timeout__ `Number` Number of ms to delay before executing specified function. - -##### RETURNS: -* `Number` Returns the timeout ID - -_defined in_: [src/js/component.js#L1162](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1162) - ---- - -### show() -> Show the component element if hidden - -##### RETURNS: -* `vjs.Component` - -_defined in_: [src/js/component.js#L847](https://github.com/videojs/video.js/blob/master/src/js/component.js#L847) - ---- - -### trigger( event ) -> Trigger an event on an element -> -> myComponent.trigger('eventName'); -> myComponent.trigger({'type':'eventName'}); - -##### PARAMETERS: -* __event__ `Event|Object|String` A string (the type) or an event object with a type attribute - -##### RETURNS: -* `vjs.Component` self - -_defined in_: [src/js/component.js#L724](https://github.com/videojs/video.js/blob/master/src/js/component.js#L724) - ---- - -### triggerReady() -> Trigger the ready listeners - -##### RETURNS: -* `vjs.Component` - -_defined in_: [src/js/component.js#L788](https://github.com/videojs/video.js/blob/master/src/js/component.js#L788) - ---- - -### width( [num], skipListeners ) -> Set or get the width of the component (CSS values) -> -> Setting the video tag dimension values only works with values in pixels. -> Percent values will not work. -> Some percents can be used, but width()/height() will return the number + %, -> not the actual computed width/height. - -##### PARAMETERS: -* __num__ `Number|String` _(OPTIONAL)_ Optional width number -* __skipListeners__ `Boolean` Skip the 'resize' event trigger - -##### RETURNS: -* `vjs.Component` This component, when setting the width -* `Number|String` The width, when getting - -_defined in_: [src/js/component.js#L910](https://github.com/videojs/video.js/blob/master/src/js/component.js#L910) - ---- - -## EVENTS - -### resize `EVENT` -> Fired when the width and/or height of the component changes - -_defined in_: [src/js/component.js#L1020](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1020) - ---- - diff --git a/docs/api/vjs.ControlBar.md b/docs/api/vjs.ControlBar.md deleted file mode 100644 index 9840565630..0000000000 --- a/docs/api/vjs.ControlBar.md +++ /dev/null @@ -1,659 +0,0 @@ - - -# vjs.ControlBar - -__EXTENDS__: [vjs.Component](vjs.Component.md) -__DEFINED IN__: [src/js/control-bar/control-bar.js#L9](https://github.com/videojs/video.js/blob/master/src/js/control-bar/control-bar.js#L9) - -Container of main controls - ---- - -## INDEX - -- [METHODS](#methods) - - [addChild](#addchild-child-options-) _`inherited`_ - - [addClass](#addclass-classtoadd-) _`inherited`_ - - [buildCSSClass](#buildcssclass) _`inherited`_ - - [children](#children) _`inherited`_ - - [clearInterval](#clearinterval-intervalid-) _`inherited`_ - - [clearTimeout](#cleartimeout-timeoutid-) _`inherited`_ - - [contentEl](#contentel) _`inherited`_ - - [createEl](#createel-tagname-attributes-) _`inherited`_ - - [dimensions](#dimensions-width-height-) _`inherited`_ - - [dispose](#dispose) _`inherited`_ - - [el](#el) _`inherited`_ - - [enableTouchActivity](#enabletouchactivity) _`inherited`_ - - [getChild](#getchild-name-) _`inherited`_ - - [getChildById](#getchildbyid-id-) _`inherited`_ - - [hasClass](#hasclass-classtocheck-) _`inherited`_ - - [height](#height-num-skiplisteners-) _`inherited`_ - - [hide](#hide) _`inherited`_ - - [id](#id) _`inherited`_ - - [init](#init-player-options-ready-) _`inherited`_ - - [initChildren](#initchildren) _`inherited`_ - - [name](#name) _`inherited`_ - - [off](#off-first-second-third-) _`inherited`_ - - [on](#on-first-second-third-) _`inherited`_ - - [one](#one-first-second-third-) _`inherited`_ - - [options](#options-obj-) _`inherited`_ - - [player](#player) _`inherited`_ - - [ready](#ready-fn-) _`inherited`_ - - [removeChild](#removechild-component-) _`inherited`_ - - [removeClass](#removeclass-classtoremove-) _`inherited`_ - - [setInterval](#setinterval-fn-interval-) _`inherited`_ - - [setTimeout](#settimeout-fn-timeout-) _`inherited`_ - - [show](#show) _`inherited`_ - - [trigger](#trigger-event-) _`inherited`_ - - [triggerReady](#triggerready) _`inherited`_ - - [width](#width-num-skiplisteners-) _`inherited`_ - -- [EVENTS](#events) - - [resize](#resize-event) _`inherited`_ - ---- - -## METHODS - -### addChild( child, [options] ) -> Adds a child component inside this component -> -> myComponent.el(); -> // ->
-> myComonent.children(); -> // [empty array] -> -> var myButton = myComponent.addChild('MyButton'); -> // ->
myButton
-> // -> myButton === myComonent.children()[0]; -> -> Pass in options for child constructors and options for children of the child -> -> var myButton = myComponent.addChild('MyButton', { -> text: 'Press Me', -> children: { -> buttonChildExample: { -> buttonChildOption: true -> } -> } -> }); - -##### PARAMETERS: -* __child__ `String|vjs.Component` The class name or instance of a child to add -* __options__ `Object` _(OPTIONAL)_ Options, including options to be passed to children of the child. - -##### RETURNS: -* `vjs.Component` The child component (created by this process if a string was used) - -_inherited from_: [src/js/component.js#L362](https://github.com/videojs/video.js/blob/master/src/js/component.js#L362) - ---- - -### addClass( classToAdd ) -> Add a CSS class name to the component's element - -##### PARAMETERS: -* __classToAdd__ `String` Classname to add - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L826](https://github.com/videojs/video.js/blob/master/src/js/component.js#L826) - ---- - -### buildCSSClass() -> Allows sub components to stack CSS class names - -##### RETURNS: -* `String` The constructed class name - -_inherited from_: [src/js/component.js#L536](https://github.com/videojs/video.js/blob/master/src/js/component.js#L536) - ---- - -### children() -> Get an array of all child components -> -> var kids = myComponent.children(); - -##### RETURNS: -* `Array` The children - -_inherited from_: [src/js/component.js#L296](https://github.com/videojs/video.js/blob/master/src/js/component.js#L296) - ---- - -### clearInterval( intervalId ) -> Clears an interval and removes the associated dispose listener - -##### PARAMETERS: -* __intervalId__ `Number` The id of the interval to clear - -##### RETURNS: -* `Number` Returns the interval ID - -_inherited from_: [src/js/component.js#L1223](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1223) - ---- - -### clearTimeout( timeoutId ) -> Clears a timeout and removes the associated dispose listener - -##### PARAMETERS: -* __timeoutId__ `Number` The id of the timeout to clear - -##### RETURNS: -* `Number` Returns the timeout ID - -_inherited from_: [src/js/component.js#L1185](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1185) - ---- - -### contentEl() -> Return the component's DOM element for embedding content. -> Will either be el_ or a new element defined in createEl. - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L239](https://github.com/videojs/video.js/blob/master/src/js/component.js#L239) - ---- - -### createEl( [tagName], [attributes] ) -> Create the component's DOM element - -##### PARAMETERS: -* __tagName__ `String` _(OPTIONAL)_ Element's node type. e.g. 'div' -* __attributes__ `Object` _(OPTIONAL)_ An object of element attributes that should be set on the element - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L200](https://github.com/videojs/video.js/blob/master/src/js/component.js#L200) - ---- - -### dimensions( width, height ) -> Set both width and height at the same time - -##### PARAMETERS: -* __width__ `Number|String` -* __height__ `Number|String` - -##### RETURNS: -* `vjs.Component` The component - -_inherited from_: [src/js/component.js#L938](https://github.com/videojs/video.js/blob/master/src/js/component.js#L938) - ---- - -### dispose() -> Dispose of the component and all child components - -_inherited from_: [src/js/component.js#L84](https://github.com/videojs/video.js/blob/master/src/js/component.js#L84) - ---- - -### el() -> Get the component's DOM element -> -> var domEl = myComponent.el(); - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L220](https://github.com/videojs/video.js/blob/master/src/js/component.js#L220) - ---- - -### enableTouchActivity() -> Report user touch activity when touch events occur -> -> User activity is used to determine when controls should show/hide. It's -> relatively simple when it comes to mouse events, because any mouse event -> should show the controls. So we capture mouse events that bubble up to the -> player and report activity when that happens. -> -> With touch events it isn't as easy. We can't rely on touch events at the -> player level, because a tap (touchstart + touchend) on the video itself on -> mobile devices is meant to turn controls off (and on). User activity is -> checked asynchronously, so what could happen is a tap event on the video -> turns the controls off, then the touchend event bubbles up to the player, -> which if it reported user activity, would turn the controls right back on. -> (We also don't want to completely block touch events from bubbling up) -> -> Also a touchmove, touch+hold, and anything other than a tap is not supposed -> to turn the controls back on on a mobile device. -> -> Here we're setting the default component behavior to report user activity -> whenever touch events happen, and this can be turned off by components that -> want touch events to act differently. - -_inherited from_: [src/js/component.js#L1124](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1124) - ---- - -### getChild( name ) -> Returns a child component with the provided name - -##### PARAMETERS: -* __name__ - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L330](https://github.com/videojs/video.js/blob/master/src/js/component.js#L330) - ---- - -### getChildById( id ) -> Returns a child component with the provided ID - -##### PARAMETERS: -* __id__ - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L313](https://github.com/videojs/video.js/blob/master/src/js/component.js#L313) - ---- - -### hasClass( classToCheck ) -> Check if a component's element has a CSS class name - -##### PARAMETERS: -* __classToCheck__ `String` Classname to check - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L816](https://github.com/videojs/video.js/blob/master/src/js/component.js#L816) - ---- - -### height( [num], [skipListeners] ) -> Get or set the height of the component (CSS values) -> -> Setting the video tag dimension values only works with values in pixels. -> Percent values will not work. -> Some percents can be used, but width()/height() will return the number + %, -> not the actual computed width/height. - -##### PARAMETERS: -* __num__ `Number|String` _(OPTIONAL)_ New component height -* __skipListeners__ `Boolean` _(OPTIONAL)_ Skip the resize event trigger - -##### RETURNS: -* `vjs.Component` This component, when setting the height -* `Number|String` The height, when getting - -_inherited from_: [src/js/component.js#L927](https://github.com/videojs/video.js/blob/master/src/js/component.js#L927) - ---- - -### hide() -> Hide the component element if currently showing - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L857](https://github.com/videojs/video.js/blob/master/src/js/component.js#L857) - ---- - -### id() -> Get the component's ID -> -> var id = myComponent.id(); - -##### RETURNS: -* `String` - -_inherited from_: [src/js/component.js#L258](https://github.com/videojs/video.js/blob/master/src/js/component.js#L258) - ---- - -### init( player, options, ready ) -> the constructor function for the class - -##### PARAMETERS: -* __player__ -* __options__ -* __ready__ - -_inherited from_: [src/js/component.js#L41](https://github.com/videojs/video.js/blob/master/src/js/component.js#L41) - ---- - -### initChildren() -> Add and initialize default child components from options -> -> // when an instance of MyComponent is created, all children in options -> // will be added to the instance by their name strings and options -> MyComponent.prototype.options_.children = { -> myChildComponent: { -> myChildOption: true -> } -> } -> -> // Or when creating the component -> var myComp = new MyComponent(player, { -> children: { -> myChildComponent: { -> myChildOption: true -> } -> } -> }); -> -> The children option can also be an Array of child names or -> child options objects (that also include a 'name' key). -> -> var myComp = new MyComponent(player, { -> children: [ -> 'button', -> { -> name: 'button', -> someOtherOption: true -> } -> ] -> }); - -_inherited from_: [src/js/component.js#L481](https://github.com/videojs/video.js/blob/master/src/js/component.js#L481) - ---- - -### name() -> Get the component's name. The name is often used to reference the component. -> -> var name = myComponent.name(); - -##### RETURNS: -* `String` - -_inherited from_: [src/js/component.js#L277](https://github.com/videojs/video.js/blob/master/src/js/component.js#L277) - ---- - -### off( [first], [second], [third] ) -> Remove an event listener from this component's element -> -> myComponent.off('eventType', myFunc); -> -> If myFunc is excluded, ALL listeners for the event type will be removed. -> If eventType is excluded, ALL listeners will be removed from the component. -> -> Alternatively you can use `off` to remove listeners that were added to other -> elements or components using `myComponent.on(otherComponent...`. -> In this case both the event type and listener function are REQUIRED. -> -> myComponent.off(otherElement, 'eventType', myFunc); -> myComponent.off(otherComponent, 'eventType', myFunc); - -##### PARAMETERS: -* __first__ `String|vjs.Component` _(OPTIONAL)_ The event type or other component -* __second__ `Function|String` _(OPTIONAL)_ The listener function or event type -* __third__ `Function` _(OPTIONAL)_ The listener for other component - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L646](https://github.com/videojs/video.js/blob/master/src/js/component.js#L646) - ---- - -### on( first, second, third ) -> Add an event listener to this component's element -> -> var myFunc = function(){ -> var myComponent = this; -> // Do something when the event is fired -> }; -> -> myComponent.on('eventType', myFunc); -> -> The context of myFunc will be myComponent unless previously bound. -> -> Alternatively, you can add a listener to another element or component. -> -> myComponent.on(otherElement, 'eventName', myFunc); -> myComponent.on(otherComponent, 'eventName', myFunc); -> -> The benefit of using this over `vjs.on(otherElement, 'eventName', myFunc)` -> and `otherComponent.on('eventName', myFunc)` is that this way the listeners -> will be automatically cleaned up when either component is disposed. -> It will also bind myComponent as the context of myFunc. -> -> **NOTE**: When using this on elements in the page other than window -> and document (both permanent), if you remove the element from the DOM -> you need to call `vjs.trigger(el, 'dispose')` on it to clean up -> references to it and allow the browser to garbage collect it. - -##### PARAMETERS: -* __first__ `String|vjs.Component` The event type or other component -* __second__ `Function|String` The event handler or event type -* __third__ `Function` The event handler - -##### RETURNS: -* `vjs.Component` self - -_inherited from_: [src/js/component.js#L577](https://github.com/videojs/video.js/blob/master/src/js/component.js#L577) - ---- - -### one( first, second, [third] ) -> Add an event listener to be triggered only once and then removed -> -> myComponent.one('eventName', myFunc); -> -> Alternatively you can add a listener to another element or component -> that will be triggered only once. -> -> myComponent.one(otherElement, 'eventName', myFunc); -> myComponent.one(otherComponent, 'eventName', myFunc); - -##### PARAMETERS: -* __first__ `String|vjs.Component` The event type or other component -* __second__ `Function|String` The listener function or event type -* __third__ `Function` _(OPTIONAL)_ The listener function for other component - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L691](https://github.com/videojs/video.js/blob/master/src/js/component.js#L691) - ---- - -### options( obj ) -> Deep merge of options objects -> -> Whenever a property is an object on both options objects -> the two properties will be merged using vjs.obj.deepMerge. -> -> This is used for merging options for child components. We -> want it to be easy to override individual options on a child -> component without having to rewrite all the other default options. -> -> Parent.prototype.options_ = { -> children: { -> 'childOne': { 'foo': 'bar', 'asdf': 'fdsa' }, -> 'childTwo': {}, -> 'childThree': {} -> } -> } -> newOptions = { -> children: { -> 'childOne': { 'foo': 'baz', 'abc': '123' } -> 'childTwo': null, -> 'childFour': {} -> } -> } -> -> this.options(newOptions); -> -> RESULT -> -> { -> children: { -> 'childOne': { 'foo': 'baz', 'asdf': 'fdsa', 'abc': '123' }, -> 'childTwo': null, // Disabled. Won't be initialized. -> 'childThree': {}, -> 'childFour': {} -> } -> } - -##### PARAMETERS: -* __obj__ `Object` Object of new option values - -##### RETURNS: -* `Object` A NEW object of this.options_ and obj merged - -_inherited from_: [src/js/component.js#L179](https://github.com/videojs/video.js/blob/master/src/js/component.js#L179) - ---- - -### player() -> Return the component's player - -##### RETURNS: -* `vjs.Player` - -_inherited from_: [src/js/component.js#L126](https://github.com/videojs/video.js/blob/master/src/js/component.js#L126) - ---- - -### ready( fn ) -> Bind a listener to the component's ready state -> -> Different from event listeners in that if the ready event has already happened -> it will trigger the function immediately. - -##### PARAMETERS: -* __fn__ `Function` Ready listener - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L769](https://github.com/videojs/video.js/blob/master/src/js/component.js#L769) - ---- - -### removeChild( component ) -> Remove a child component from this component's list of children, and the -> child component's element from this component's element - -##### PARAMETERS: -* __component__ `vjs.Component` Component to remove - -_inherited from_: [src/js/component.js#L420](https://github.com/videojs/video.js/blob/master/src/js/component.js#L420) - ---- - -### removeClass( classToRemove ) -> Remove a CSS class name from the component's element - -##### PARAMETERS: -* __classToRemove__ `String` Classname to remove - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L837](https://github.com/videojs/video.js/blob/master/src/js/component.js#L837) - ---- - -### setInterval( fn, interval ) -> Creates an interval and sets up disposal automatically. - -##### PARAMETERS: -* __fn__ `Function` The function to run every N seconds. -* __interval__ `Number` Number of ms to delay before executing specified function. - -##### RETURNS: -* `Number` Returns the interval ID - -_inherited from_: [src/js/component.js#L1202](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1202) - ---- - -### setTimeout( fn, timeout ) -> Creates timeout and sets up disposal automatically. - -##### PARAMETERS: -* __fn__ `Function` The function to run after the timeout. -* __timeout__ `Number` Number of ms to delay before executing specified function. - -##### RETURNS: -* `Number` Returns the timeout ID - -_inherited from_: [src/js/component.js#L1162](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1162) - ---- - -### show() -> Show the component element if hidden - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L847](https://github.com/videojs/video.js/blob/master/src/js/component.js#L847) - ---- - -### trigger( event ) -> Trigger an event on an element -> -> myComponent.trigger('eventName'); -> myComponent.trigger({'type':'eventName'}); - -##### PARAMETERS: -* __event__ `Event|Object|String` A string (the type) or an event object with a type attribute - -##### RETURNS: -* `vjs.Component` self - -_inherited from_: [src/js/component.js#L724](https://github.com/videojs/video.js/blob/master/src/js/component.js#L724) - ---- - -### triggerReady() -> Trigger the ready listeners - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L788](https://github.com/videojs/video.js/blob/master/src/js/component.js#L788) - ---- - -### width( [num], skipListeners ) -> Set or get the width of the component (CSS values) -> -> Setting the video tag dimension values only works with values in pixels. -> Percent values will not work. -> Some percents can be used, but width()/height() will return the number + %, -> not the actual computed width/height. - -##### PARAMETERS: -* __num__ `Number|String` _(OPTIONAL)_ Optional width number -* __skipListeners__ `Boolean` Skip the 'resize' event trigger - -##### RETURNS: -* `vjs.Component` This component, when setting the width -* `Number|String` The width, when getting - -_inherited from_: [src/js/component.js#L910](https://github.com/videojs/video.js/blob/master/src/js/component.js#L910) - ---- - -## EVENTS - -### resize `EVENT` -> Fired when the width and/or height of the component changes - -_inherited from_: [src/js/component.js#L1020](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1020) - ---- - diff --git a/docs/api/vjs.CoreObject.md b/docs/api/vjs.CoreObject.md deleted file mode 100644 index 3d677eb0ec..0000000000 --- a/docs/api/vjs.CoreObject.md +++ /dev/null @@ -1,93 +0,0 @@ - - -# vjs.CoreObject - -__DEFINED IN__: [src/js/core-object.js#L52](https://github.com/videojs/video.js/blob/master/src/js/core-object.js#L52) - -Core Object/Class for objects that use inheritance + constructors - -To create a class that can be subclassed itself, extend the CoreObject class. - - var Animal = CoreObject.extend(); - var Horse = Animal.extend(); - -The constructor can be defined through the init property of an object argument. - - var Animal = CoreObject.extend({ - init: function(name, sound){ - this.name = name; - } - }); - -Other methods and properties can be added the same way, or directly to the -prototype. - - var Animal = CoreObject.extend({ - init: function(name){ - this.name = name; - }, - getName: function(){ - return this.name; - }, - sound: '...' - }); - - Animal.prototype.makeSound = function(){ - alert(this.sound); - }; - -To create an instance of a class, use the create method. - - var fluffy = Animal.create('Fluffy'); - fluffy.getName(); // -> Fluffy - -Methods and properties can be overridden in subclasses. - - var Horse = Animal.extend({ - sound: 'Neighhhhh!' - }); - - var horsey = Horse.create('Horsey'); - horsey.getName(); // -> Horsey - horsey.makeSound(); // -> Alert: Neighhhhh! - ---- - -## INDEX - -- [METHODS](#methods) - - [create](#create-static) - - [extend](#extend-props--static) - ---- - -## METHODS - -### create() `STATIC` -> Create a new instance of this Object class -> -> var myAnimal = Animal.create(); - -##### RETURNS: -* `vjs.CoreObject` An instance of a CoreObject subclass - -_defined in_: [src/js/core-object.js#L120](https://github.com/videojs/video.js/blob/master/src/js/core-object.js#L120) - ---- - -### extend( props ) `STATIC` -> Create a new object that inherits from this Object -> -> var Animal = CoreObject.extend(); -> var Horse = Animal.extend(); - -##### PARAMETERS: -* __props__ `Object` Functions and properties to be applied to the - -##### RETURNS: -* `vjs.CoreObject` An object that inherits from CoreObject - -_defined in_: [src/js/core-object.js#L70](https://github.com/videojs/video.js/blob/master/src/js/core-object.js#L70) - ---- - diff --git a/docs/api/vjs.CurrentTimeDisplay.md b/docs/api/vjs.CurrentTimeDisplay.md deleted file mode 100644 index 0df2174473..0000000000 --- a/docs/api/vjs.CurrentTimeDisplay.md +++ /dev/null @@ -1,657 +0,0 @@ - - -# vjs.CurrentTimeDisplay - -__EXTENDS__: [vjs.Component](vjs.Component.md) -__DEFINED IN__: [src/js/control-bar/time-display.js#L7](https://github.com/videojs/video.js/blob/master/src/js/control-bar/time-display.js#L7) - -Displays the current time - ---- - -## INDEX - -- [METHODS](#methods) - - [init](#init-player-options-) - - [addChild](#addchild-child-options-) _`inherited`_ - - [addClass](#addclass-classtoadd-) _`inherited`_ - - [buildCSSClass](#buildcssclass) _`inherited`_ - - [children](#children) _`inherited`_ - - [clearInterval](#clearinterval-intervalid-) _`inherited`_ - - [clearTimeout](#cleartimeout-timeoutid-) _`inherited`_ - - [contentEl](#contentel) _`inherited`_ - - [createEl](#createel-tagname-attributes-) _`inherited`_ - - [dimensions](#dimensions-width-height-) _`inherited`_ - - [dispose](#dispose) _`inherited`_ - - [el](#el) _`inherited`_ - - [enableTouchActivity](#enabletouchactivity) _`inherited`_ - - [getChild](#getchild-name-) _`inherited`_ - - [getChildById](#getchildbyid-id-) _`inherited`_ - - [hasClass](#hasclass-classtocheck-) _`inherited`_ - - [height](#height-num-skiplisteners-) _`inherited`_ - - [hide](#hide) _`inherited`_ - - [id](#id) _`inherited`_ - - [initChildren](#initchildren) _`inherited`_ - - [name](#name) _`inherited`_ - - [off](#off-first-second-third-) _`inherited`_ - - [on](#on-first-second-third-) _`inherited`_ - - [one](#one-first-second-third-) _`inherited`_ - - [options](#options-obj-) _`inherited`_ - - [player](#player) _`inherited`_ - - [ready](#ready-fn-) _`inherited`_ - - [removeChild](#removechild-component-) _`inherited`_ - - [removeClass](#removeclass-classtoremove-) _`inherited`_ - - [setInterval](#setinterval-fn-interval-) _`inherited`_ - - [setTimeout](#settimeout-fn-timeout-) _`inherited`_ - - [show](#show) _`inherited`_ - - [trigger](#trigger-event-) _`inherited`_ - - [triggerReady](#triggerready) _`inherited`_ - - [width](#width-num-skiplisteners-) _`inherited`_ - -- [EVENTS](#events) - - [resize](#resize-event) _`inherited`_ - ---- - -## METHODS - -### addChild( child, [options] ) -> Adds a child component inside this component -> -> myComponent.el(); -> // ->
-> myComonent.children(); -> // [empty array] -> -> var myButton = myComponent.addChild('MyButton'); -> // ->
myButton
-> // -> myButton === myComonent.children()[0]; -> -> Pass in options for child constructors and options for children of the child -> -> var myButton = myComponent.addChild('MyButton', { -> text: 'Press Me', -> children: { -> buttonChildExample: { -> buttonChildOption: true -> } -> } -> }); - -##### PARAMETERS: -* __child__ `String|vjs.Component` The class name or instance of a child to add -* __options__ `Object` _(OPTIONAL)_ Options, including options to be passed to children of the child. - -##### RETURNS: -* `vjs.Component` The child component (created by this process if a string was used) - -_inherited from_: [src/js/component.js#L362](https://github.com/videojs/video.js/blob/master/src/js/component.js#L362) - ---- - -### addClass( classToAdd ) -> Add a CSS class name to the component's element - -##### PARAMETERS: -* __classToAdd__ `String` Classname to add - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L826](https://github.com/videojs/video.js/blob/master/src/js/component.js#L826) - ---- - -### buildCSSClass() -> Allows sub components to stack CSS class names - -##### RETURNS: -* `String` The constructed class name - -_inherited from_: [src/js/component.js#L536](https://github.com/videojs/video.js/blob/master/src/js/component.js#L536) - ---- - -### children() -> Get an array of all child components -> -> var kids = myComponent.children(); - -##### RETURNS: -* `Array` The children - -_inherited from_: [src/js/component.js#L296](https://github.com/videojs/video.js/blob/master/src/js/component.js#L296) - ---- - -### clearInterval( intervalId ) -> Clears an interval and removes the associated dispose listener - -##### PARAMETERS: -* __intervalId__ `Number` The id of the interval to clear - -##### RETURNS: -* `Number` Returns the interval ID - -_inherited from_: [src/js/component.js#L1223](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1223) - ---- - -### clearTimeout( timeoutId ) -> Clears a timeout and removes the associated dispose listener - -##### PARAMETERS: -* __timeoutId__ `Number` The id of the timeout to clear - -##### RETURNS: -* `Number` Returns the timeout ID - -_inherited from_: [src/js/component.js#L1185](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1185) - ---- - -### contentEl() -> Return the component's DOM element for embedding content. -> Will either be el_ or a new element defined in createEl. - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L239](https://github.com/videojs/video.js/blob/master/src/js/component.js#L239) - ---- - -### createEl( [tagName], [attributes] ) -> Create the component's DOM element - -##### PARAMETERS: -* __tagName__ `String` _(OPTIONAL)_ Element's node type. e.g. 'div' -* __attributes__ `Object` _(OPTIONAL)_ An object of element attributes that should be set on the element - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L200](https://github.com/videojs/video.js/blob/master/src/js/component.js#L200) - ---- - -### dimensions( width, height ) -> Set both width and height at the same time - -##### PARAMETERS: -* __width__ `Number|String` -* __height__ `Number|String` - -##### RETURNS: -* `vjs.Component` The component - -_inherited from_: [src/js/component.js#L938](https://github.com/videojs/video.js/blob/master/src/js/component.js#L938) - ---- - -### dispose() -> Dispose of the component and all child components - -_inherited from_: [src/js/component.js#L84](https://github.com/videojs/video.js/blob/master/src/js/component.js#L84) - ---- - -### el() -> Get the component's DOM element -> -> var domEl = myComponent.el(); - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L220](https://github.com/videojs/video.js/blob/master/src/js/component.js#L220) - ---- - -### enableTouchActivity() -> Report user touch activity when touch events occur -> -> User activity is used to determine when controls should show/hide. It's -> relatively simple when it comes to mouse events, because any mouse event -> should show the controls. So we capture mouse events that bubble up to the -> player and report activity when that happens. -> -> With touch events it isn't as easy. We can't rely on touch events at the -> player level, because a tap (touchstart + touchend) on the video itself on -> mobile devices is meant to turn controls off (and on). User activity is -> checked asynchronously, so what could happen is a tap event on the video -> turns the controls off, then the touchend event bubbles up to the player, -> which if it reported user activity, would turn the controls right back on. -> (We also don't want to completely block touch events from bubbling up) -> -> Also a touchmove, touch+hold, and anything other than a tap is not supposed -> to turn the controls back on on a mobile device. -> -> Here we're setting the default component behavior to report user activity -> whenever touch events happen, and this can be turned off by components that -> want touch events to act differently. - -_inherited from_: [src/js/component.js#L1124](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1124) - ---- - -### getChild( name ) -> Returns a child component with the provided name - -##### PARAMETERS: -* __name__ - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L330](https://github.com/videojs/video.js/blob/master/src/js/component.js#L330) - ---- - -### getChildById( id ) -> Returns a child component with the provided ID - -##### PARAMETERS: -* __id__ - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L313](https://github.com/videojs/video.js/blob/master/src/js/component.js#L313) - ---- - -### hasClass( classToCheck ) -> Check if a component's element has a CSS class name - -##### PARAMETERS: -* __classToCheck__ `String` Classname to check - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L816](https://github.com/videojs/video.js/blob/master/src/js/component.js#L816) - ---- - -### height( [num], [skipListeners] ) -> Get or set the height of the component (CSS values) -> -> Setting the video tag dimension values only works with values in pixels. -> Percent values will not work. -> Some percents can be used, but width()/height() will return the number + %, -> not the actual computed width/height. - -##### PARAMETERS: -* __num__ `Number|String` _(OPTIONAL)_ New component height -* __skipListeners__ `Boolean` _(OPTIONAL)_ Skip the resize event trigger - -##### RETURNS: -* `vjs.Component` This component, when setting the height -* `Number|String` The height, when getting - -_inherited from_: [src/js/component.js#L927](https://github.com/videojs/video.js/blob/master/src/js/component.js#L927) - ---- - -### hide() -> Hide the component element if currently showing - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L857](https://github.com/videojs/video.js/blob/master/src/js/component.js#L857) - ---- - -### id() -> Get the component's ID -> -> var id = myComponent.id(); - -##### RETURNS: -* `String` - -_inherited from_: [src/js/component.js#L258](https://github.com/videojs/video.js/blob/master/src/js/component.js#L258) - ---- - -### init( player, options ) - -##### PARAMETERS: -* __player__ -* __options__ - -_defined in_: [src/js/control-bar/time-display.js#L9](https://github.com/videojs/video.js/blob/master/src/js/control-bar/time-display.js#L9) - ---- - -### initChildren() -> Add and initialize default child components from options -> -> // when an instance of MyComponent is created, all children in options -> // will be added to the instance by their name strings and options -> MyComponent.prototype.options_.children = { -> myChildComponent: { -> myChildOption: true -> } -> } -> -> // Or when creating the component -> var myComp = new MyComponent(player, { -> children: { -> myChildComponent: { -> myChildOption: true -> } -> } -> }); -> -> The children option can also be an Array of child names or -> child options objects (that also include a 'name' key). -> -> var myComp = new MyComponent(player, { -> children: [ -> 'button', -> { -> name: 'button', -> someOtherOption: true -> } -> ] -> }); - -_inherited from_: [src/js/component.js#L481](https://github.com/videojs/video.js/blob/master/src/js/component.js#L481) - ---- - -### name() -> Get the component's name. The name is often used to reference the component. -> -> var name = myComponent.name(); - -##### RETURNS: -* `String` - -_inherited from_: [src/js/component.js#L277](https://github.com/videojs/video.js/blob/master/src/js/component.js#L277) - ---- - -### off( [first], [second], [third] ) -> Remove an event listener from this component's element -> -> myComponent.off('eventType', myFunc); -> -> If myFunc is excluded, ALL listeners for the event type will be removed. -> If eventType is excluded, ALL listeners will be removed from the component. -> -> Alternatively you can use `off` to remove listeners that were added to other -> elements or components using `myComponent.on(otherComponent...`. -> In this case both the event type and listener function are REQUIRED. -> -> myComponent.off(otherElement, 'eventType', myFunc); -> myComponent.off(otherComponent, 'eventType', myFunc); - -##### PARAMETERS: -* __first__ `String|vjs.Component` _(OPTIONAL)_ The event type or other component -* __second__ `Function|String` _(OPTIONAL)_ The listener function or event type -* __third__ `Function` _(OPTIONAL)_ The listener for other component - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L646](https://github.com/videojs/video.js/blob/master/src/js/component.js#L646) - ---- - -### on( first, second, third ) -> Add an event listener to this component's element -> -> var myFunc = function(){ -> var myComponent = this; -> // Do something when the event is fired -> }; -> -> myComponent.on('eventType', myFunc); -> -> The context of myFunc will be myComponent unless previously bound. -> -> Alternatively, you can add a listener to another element or component. -> -> myComponent.on(otherElement, 'eventName', myFunc); -> myComponent.on(otherComponent, 'eventName', myFunc); -> -> The benefit of using this over `vjs.on(otherElement, 'eventName', myFunc)` -> and `otherComponent.on('eventName', myFunc)` is that this way the listeners -> will be automatically cleaned up when either component is disposed. -> It will also bind myComponent as the context of myFunc. -> -> **NOTE**: When using this on elements in the page other than window -> and document (both permanent), if you remove the element from the DOM -> you need to call `vjs.trigger(el, 'dispose')` on it to clean up -> references to it and allow the browser to garbage collect it. - -##### PARAMETERS: -* __first__ `String|vjs.Component` The event type or other component -* __second__ `Function|String` The event handler or event type -* __third__ `Function` The event handler - -##### RETURNS: -* `vjs.Component` self - -_inherited from_: [src/js/component.js#L577](https://github.com/videojs/video.js/blob/master/src/js/component.js#L577) - ---- - -### one( first, second, [third] ) -> Add an event listener to be triggered only once and then removed -> -> myComponent.one('eventName', myFunc); -> -> Alternatively you can add a listener to another element or component -> that will be triggered only once. -> -> myComponent.one(otherElement, 'eventName', myFunc); -> myComponent.one(otherComponent, 'eventName', myFunc); - -##### PARAMETERS: -* __first__ `String|vjs.Component` The event type or other component -* __second__ `Function|String` The listener function or event type -* __third__ `Function` _(OPTIONAL)_ The listener function for other component - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L691](https://github.com/videojs/video.js/blob/master/src/js/component.js#L691) - ---- - -### options( obj ) -> Deep merge of options objects -> -> Whenever a property is an object on both options objects -> the two properties will be merged using vjs.obj.deepMerge. -> -> This is used for merging options for child components. We -> want it to be easy to override individual options on a child -> component without having to rewrite all the other default options. -> -> Parent.prototype.options_ = { -> children: { -> 'childOne': { 'foo': 'bar', 'asdf': 'fdsa' }, -> 'childTwo': {}, -> 'childThree': {} -> } -> } -> newOptions = { -> children: { -> 'childOne': { 'foo': 'baz', 'abc': '123' } -> 'childTwo': null, -> 'childFour': {} -> } -> } -> -> this.options(newOptions); -> -> RESULT -> -> { -> children: { -> 'childOne': { 'foo': 'baz', 'asdf': 'fdsa', 'abc': '123' }, -> 'childTwo': null, // Disabled. Won't be initialized. -> 'childThree': {}, -> 'childFour': {} -> } -> } - -##### PARAMETERS: -* __obj__ `Object` Object of new option values - -##### RETURNS: -* `Object` A NEW object of this.options_ and obj merged - -_inherited from_: [src/js/component.js#L179](https://github.com/videojs/video.js/blob/master/src/js/component.js#L179) - ---- - -### player() -> Return the component's player - -##### RETURNS: -* `vjs.Player` - -_inherited from_: [src/js/component.js#L126](https://github.com/videojs/video.js/blob/master/src/js/component.js#L126) - ---- - -### ready( fn ) -> Bind a listener to the component's ready state -> -> Different from event listeners in that if the ready event has already happened -> it will trigger the function immediately. - -##### PARAMETERS: -* __fn__ `Function` Ready listener - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L769](https://github.com/videojs/video.js/blob/master/src/js/component.js#L769) - ---- - -### removeChild( component ) -> Remove a child component from this component's list of children, and the -> child component's element from this component's element - -##### PARAMETERS: -* __component__ `vjs.Component` Component to remove - -_inherited from_: [src/js/component.js#L420](https://github.com/videojs/video.js/blob/master/src/js/component.js#L420) - ---- - -### removeClass( classToRemove ) -> Remove a CSS class name from the component's element - -##### PARAMETERS: -* __classToRemove__ `String` Classname to remove - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L837](https://github.com/videojs/video.js/blob/master/src/js/component.js#L837) - ---- - -### setInterval( fn, interval ) -> Creates an interval and sets up disposal automatically. - -##### PARAMETERS: -* __fn__ `Function` The function to run every N seconds. -* __interval__ `Number` Number of ms to delay before executing specified function. - -##### RETURNS: -* `Number` Returns the interval ID - -_inherited from_: [src/js/component.js#L1202](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1202) - ---- - -### setTimeout( fn, timeout ) -> Creates timeout and sets up disposal automatically. - -##### PARAMETERS: -* __fn__ `Function` The function to run after the timeout. -* __timeout__ `Number` Number of ms to delay before executing specified function. - -##### RETURNS: -* `Number` Returns the timeout ID - -_inherited from_: [src/js/component.js#L1162](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1162) - ---- - -### show() -> Show the component element if hidden - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L847](https://github.com/videojs/video.js/blob/master/src/js/component.js#L847) - ---- - -### trigger( event ) -> Trigger an event on an element -> -> myComponent.trigger('eventName'); -> myComponent.trigger({'type':'eventName'}); - -##### PARAMETERS: -* __event__ `Event|Object|String` A string (the type) or an event object with a type attribute - -##### RETURNS: -* `vjs.Component` self - -_inherited from_: [src/js/component.js#L724](https://github.com/videojs/video.js/blob/master/src/js/component.js#L724) - ---- - -### triggerReady() -> Trigger the ready listeners - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L788](https://github.com/videojs/video.js/blob/master/src/js/component.js#L788) - ---- - -### width( [num], skipListeners ) -> Set or get the width of the component (CSS values) -> -> Setting the video tag dimension values only works with values in pixels. -> Percent values will not work. -> Some percents can be used, but width()/height() will return the number + %, -> not the actual computed width/height. - -##### PARAMETERS: -* __num__ `Number|String` _(OPTIONAL)_ Optional width number -* __skipListeners__ `Boolean` Skip the 'resize' event trigger - -##### RETURNS: -* `vjs.Component` This component, when setting the width -* `Number|String` The width, when getting - -_inherited from_: [src/js/component.js#L910](https://github.com/videojs/video.js/blob/master/src/js/component.js#L910) - ---- - -## EVENTS - -### resize `EVENT` -> Fired when the width and/or height of the component changes - -_inherited from_: [src/js/component.js#L1020](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1020) - ---- - diff --git a/docs/api/vjs.DurationDisplay.md b/docs/api/vjs.DurationDisplay.md deleted file mode 100644 index 33d8119aed..0000000000 --- a/docs/api/vjs.DurationDisplay.md +++ /dev/null @@ -1,657 +0,0 @@ - - -# vjs.DurationDisplay - -__EXTENDS__: [vjs.Component](vjs.Component.md) -__DEFINED IN__: [src/js/control-bar/time-display.js#L43](https://github.com/videojs/video.js/blob/master/src/js/control-bar/time-display.js#L43) - -Displays the duration - ---- - -## INDEX - -- [METHODS](#methods) - - [init](#init-player-options-) - - [addChild](#addchild-child-options-) _`inherited`_ - - [addClass](#addclass-classtoadd-) _`inherited`_ - - [buildCSSClass](#buildcssclass) _`inherited`_ - - [children](#children) _`inherited`_ - - [clearInterval](#clearinterval-intervalid-) _`inherited`_ - - [clearTimeout](#cleartimeout-timeoutid-) _`inherited`_ - - [contentEl](#contentel) _`inherited`_ - - [createEl](#createel-tagname-attributes-) _`inherited`_ - - [dimensions](#dimensions-width-height-) _`inherited`_ - - [dispose](#dispose) _`inherited`_ - - [el](#el) _`inherited`_ - - [enableTouchActivity](#enabletouchactivity) _`inherited`_ - - [getChild](#getchild-name-) _`inherited`_ - - [getChildById](#getchildbyid-id-) _`inherited`_ - - [hasClass](#hasclass-classtocheck-) _`inherited`_ - - [height](#height-num-skiplisteners-) _`inherited`_ - - [hide](#hide) _`inherited`_ - - [id](#id) _`inherited`_ - - [initChildren](#initchildren) _`inherited`_ - - [name](#name) _`inherited`_ - - [off](#off-first-second-third-) _`inherited`_ - - [on](#on-first-second-third-) _`inherited`_ - - [one](#one-first-second-third-) _`inherited`_ - - [options](#options-obj-) _`inherited`_ - - [player](#player) _`inherited`_ - - [ready](#ready-fn-) _`inherited`_ - - [removeChild](#removechild-component-) _`inherited`_ - - [removeClass](#removeclass-classtoremove-) _`inherited`_ - - [setInterval](#setinterval-fn-interval-) _`inherited`_ - - [setTimeout](#settimeout-fn-timeout-) _`inherited`_ - - [show](#show) _`inherited`_ - - [trigger](#trigger-event-) _`inherited`_ - - [triggerReady](#triggerready) _`inherited`_ - - [width](#width-num-skiplisteners-) _`inherited`_ - -- [EVENTS](#events) - - [resize](#resize-event) _`inherited`_ - ---- - -## METHODS - -### addChild( child, [options] ) -> Adds a child component inside this component -> -> myComponent.el(); -> // ->
-> myComonent.children(); -> // [empty array] -> -> var myButton = myComponent.addChild('MyButton'); -> // ->
myButton
-> // -> myButton === myComonent.children()[0]; -> -> Pass in options for child constructors and options for children of the child -> -> var myButton = myComponent.addChild('MyButton', { -> text: 'Press Me', -> children: { -> buttonChildExample: { -> buttonChildOption: true -> } -> } -> }); - -##### PARAMETERS: -* __child__ `String|vjs.Component` The class name or instance of a child to add -* __options__ `Object` _(OPTIONAL)_ Options, including options to be passed to children of the child. - -##### RETURNS: -* `vjs.Component` The child component (created by this process if a string was used) - -_inherited from_: [src/js/component.js#L362](https://github.com/videojs/video.js/blob/master/src/js/component.js#L362) - ---- - -### addClass( classToAdd ) -> Add a CSS class name to the component's element - -##### PARAMETERS: -* __classToAdd__ `String` Classname to add - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L826](https://github.com/videojs/video.js/blob/master/src/js/component.js#L826) - ---- - -### buildCSSClass() -> Allows sub components to stack CSS class names - -##### RETURNS: -* `String` The constructed class name - -_inherited from_: [src/js/component.js#L536](https://github.com/videojs/video.js/blob/master/src/js/component.js#L536) - ---- - -### children() -> Get an array of all child components -> -> var kids = myComponent.children(); - -##### RETURNS: -* `Array` The children - -_inherited from_: [src/js/component.js#L296](https://github.com/videojs/video.js/blob/master/src/js/component.js#L296) - ---- - -### clearInterval( intervalId ) -> Clears an interval and removes the associated dispose listener - -##### PARAMETERS: -* __intervalId__ `Number` The id of the interval to clear - -##### RETURNS: -* `Number` Returns the interval ID - -_inherited from_: [src/js/component.js#L1223](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1223) - ---- - -### clearTimeout( timeoutId ) -> Clears a timeout and removes the associated dispose listener - -##### PARAMETERS: -* __timeoutId__ `Number` The id of the timeout to clear - -##### RETURNS: -* `Number` Returns the timeout ID - -_inherited from_: [src/js/component.js#L1185](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1185) - ---- - -### contentEl() -> Return the component's DOM element for embedding content. -> Will either be el_ or a new element defined in createEl. - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L239](https://github.com/videojs/video.js/blob/master/src/js/component.js#L239) - ---- - -### createEl( [tagName], [attributes] ) -> Create the component's DOM element - -##### PARAMETERS: -* __tagName__ `String` _(OPTIONAL)_ Element's node type. e.g. 'div' -* __attributes__ `Object` _(OPTIONAL)_ An object of element attributes that should be set on the element - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L200](https://github.com/videojs/video.js/blob/master/src/js/component.js#L200) - ---- - -### dimensions( width, height ) -> Set both width and height at the same time - -##### PARAMETERS: -* __width__ `Number|String` -* __height__ `Number|String` - -##### RETURNS: -* `vjs.Component` The component - -_inherited from_: [src/js/component.js#L938](https://github.com/videojs/video.js/blob/master/src/js/component.js#L938) - ---- - -### dispose() -> Dispose of the component and all child components - -_inherited from_: [src/js/component.js#L84](https://github.com/videojs/video.js/blob/master/src/js/component.js#L84) - ---- - -### el() -> Get the component's DOM element -> -> var domEl = myComponent.el(); - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L220](https://github.com/videojs/video.js/blob/master/src/js/component.js#L220) - ---- - -### enableTouchActivity() -> Report user touch activity when touch events occur -> -> User activity is used to determine when controls should show/hide. It's -> relatively simple when it comes to mouse events, because any mouse event -> should show the controls. So we capture mouse events that bubble up to the -> player and report activity when that happens. -> -> With touch events it isn't as easy. We can't rely on touch events at the -> player level, because a tap (touchstart + touchend) on the video itself on -> mobile devices is meant to turn controls off (and on). User activity is -> checked asynchronously, so what could happen is a tap event on the video -> turns the controls off, then the touchend event bubbles up to the player, -> which if it reported user activity, would turn the controls right back on. -> (We also don't want to completely block touch events from bubbling up) -> -> Also a touchmove, touch+hold, and anything other than a tap is not supposed -> to turn the controls back on on a mobile device. -> -> Here we're setting the default component behavior to report user activity -> whenever touch events happen, and this can be turned off by components that -> want touch events to act differently. - -_inherited from_: [src/js/component.js#L1124](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1124) - ---- - -### getChild( name ) -> Returns a child component with the provided name - -##### PARAMETERS: -* __name__ - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L330](https://github.com/videojs/video.js/blob/master/src/js/component.js#L330) - ---- - -### getChildById( id ) -> Returns a child component with the provided ID - -##### PARAMETERS: -* __id__ - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L313](https://github.com/videojs/video.js/blob/master/src/js/component.js#L313) - ---- - -### hasClass( classToCheck ) -> Check if a component's element has a CSS class name - -##### PARAMETERS: -* __classToCheck__ `String` Classname to check - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L816](https://github.com/videojs/video.js/blob/master/src/js/component.js#L816) - ---- - -### height( [num], [skipListeners] ) -> Get or set the height of the component (CSS values) -> -> Setting the video tag dimension values only works with values in pixels. -> Percent values will not work. -> Some percents can be used, but width()/height() will return the number + %, -> not the actual computed width/height. - -##### PARAMETERS: -* __num__ `Number|String` _(OPTIONAL)_ New component height -* __skipListeners__ `Boolean` _(OPTIONAL)_ Skip the resize event trigger - -##### RETURNS: -* `vjs.Component` This component, when setting the height -* `Number|String` The height, when getting - -_inherited from_: [src/js/component.js#L927](https://github.com/videojs/video.js/blob/master/src/js/component.js#L927) - ---- - -### hide() -> Hide the component element if currently showing - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L857](https://github.com/videojs/video.js/blob/master/src/js/component.js#L857) - ---- - -### id() -> Get the component's ID -> -> var id = myComponent.id(); - -##### RETURNS: -* `String` - -_inherited from_: [src/js/component.js#L258](https://github.com/videojs/video.js/blob/master/src/js/component.js#L258) - ---- - -### init( player, options ) - -##### PARAMETERS: -* __player__ -* __options__ - -_defined in_: [src/js/control-bar/time-display.js#L45](https://github.com/videojs/video.js/blob/master/src/js/control-bar/time-display.js#L45) - ---- - -### initChildren() -> Add and initialize default child components from options -> -> // when an instance of MyComponent is created, all children in options -> // will be added to the instance by their name strings and options -> MyComponent.prototype.options_.children = { -> myChildComponent: { -> myChildOption: true -> } -> } -> -> // Or when creating the component -> var myComp = new MyComponent(player, { -> children: { -> myChildComponent: { -> myChildOption: true -> } -> } -> }); -> -> The children option can also be an Array of child names or -> child options objects (that also include a 'name' key). -> -> var myComp = new MyComponent(player, { -> children: [ -> 'button', -> { -> name: 'button', -> someOtherOption: true -> } -> ] -> }); - -_inherited from_: [src/js/component.js#L481](https://github.com/videojs/video.js/blob/master/src/js/component.js#L481) - ---- - -### name() -> Get the component's name. The name is often used to reference the component. -> -> var name = myComponent.name(); - -##### RETURNS: -* `String` - -_inherited from_: [src/js/component.js#L277](https://github.com/videojs/video.js/blob/master/src/js/component.js#L277) - ---- - -### off( [first], [second], [third] ) -> Remove an event listener from this component's element -> -> myComponent.off('eventType', myFunc); -> -> If myFunc is excluded, ALL listeners for the event type will be removed. -> If eventType is excluded, ALL listeners will be removed from the component. -> -> Alternatively you can use `off` to remove listeners that were added to other -> elements or components using `myComponent.on(otherComponent...`. -> In this case both the event type and listener function are REQUIRED. -> -> myComponent.off(otherElement, 'eventType', myFunc); -> myComponent.off(otherComponent, 'eventType', myFunc); - -##### PARAMETERS: -* __first__ `String|vjs.Component` _(OPTIONAL)_ The event type or other component -* __second__ `Function|String` _(OPTIONAL)_ The listener function or event type -* __third__ `Function` _(OPTIONAL)_ The listener for other component - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L646](https://github.com/videojs/video.js/blob/master/src/js/component.js#L646) - ---- - -### on( first, second, third ) -> Add an event listener to this component's element -> -> var myFunc = function(){ -> var myComponent = this; -> // Do something when the event is fired -> }; -> -> myComponent.on('eventType', myFunc); -> -> The context of myFunc will be myComponent unless previously bound. -> -> Alternatively, you can add a listener to another element or component. -> -> myComponent.on(otherElement, 'eventName', myFunc); -> myComponent.on(otherComponent, 'eventName', myFunc); -> -> The benefit of using this over `vjs.on(otherElement, 'eventName', myFunc)` -> and `otherComponent.on('eventName', myFunc)` is that this way the listeners -> will be automatically cleaned up when either component is disposed. -> It will also bind myComponent as the context of myFunc. -> -> **NOTE**: When using this on elements in the page other than window -> and document (both permanent), if you remove the element from the DOM -> you need to call `vjs.trigger(el, 'dispose')` on it to clean up -> references to it and allow the browser to garbage collect it. - -##### PARAMETERS: -* __first__ `String|vjs.Component` The event type or other component -* __second__ `Function|String` The event handler or event type -* __third__ `Function` The event handler - -##### RETURNS: -* `vjs.Component` self - -_inherited from_: [src/js/component.js#L577](https://github.com/videojs/video.js/blob/master/src/js/component.js#L577) - ---- - -### one( first, second, [third] ) -> Add an event listener to be triggered only once and then removed -> -> myComponent.one('eventName', myFunc); -> -> Alternatively you can add a listener to another element or component -> that will be triggered only once. -> -> myComponent.one(otherElement, 'eventName', myFunc); -> myComponent.one(otherComponent, 'eventName', myFunc); - -##### PARAMETERS: -* __first__ `String|vjs.Component` The event type or other component -* __second__ `Function|String` The listener function or event type -* __third__ `Function` _(OPTIONAL)_ The listener function for other component - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L691](https://github.com/videojs/video.js/blob/master/src/js/component.js#L691) - ---- - -### options( obj ) -> Deep merge of options objects -> -> Whenever a property is an object on both options objects -> the two properties will be merged using vjs.obj.deepMerge. -> -> This is used for merging options for child components. We -> want it to be easy to override individual options on a child -> component without having to rewrite all the other default options. -> -> Parent.prototype.options_ = { -> children: { -> 'childOne': { 'foo': 'bar', 'asdf': 'fdsa' }, -> 'childTwo': {}, -> 'childThree': {} -> } -> } -> newOptions = { -> children: { -> 'childOne': { 'foo': 'baz', 'abc': '123' } -> 'childTwo': null, -> 'childFour': {} -> } -> } -> -> this.options(newOptions); -> -> RESULT -> -> { -> children: { -> 'childOne': { 'foo': 'baz', 'asdf': 'fdsa', 'abc': '123' }, -> 'childTwo': null, // Disabled. Won't be initialized. -> 'childThree': {}, -> 'childFour': {} -> } -> } - -##### PARAMETERS: -* __obj__ `Object` Object of new option values - -##### RETURNS: -* `Object` A NEW object of this.options_ and obj merged - -_inherited from_: [src/js/component.js#L179](https://github.com/videojs/video.js/blob/master/src/js/component.js#L179) - ---- - -### player() -> Return the component's player - -##### RETURNS: -* `vjs.Player` - -_inherited from_: [src/js/component.js#L126](https://github.com/videojs/video.js/blob/master/src/js/component.js#L126) - ---- - -### ready( fn ) -> Bind a listener to the component's ready state -> -> Different from event listeners in that if the ready event has already happened -> it will trigger the function immediately. - -##### PARAMETERS: -* __fn__ `Function` Ready listener - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L769](https://github.com/videojs/video.js/blob/master/src/js/component.js#L769) - ---- - -### removeChild( component ) -> Remove a child component from this component's list of children, and the -> child component's element from this component's element - -##### PARAMETERS: -* __component__ `vjs.Component` Component to remove - -_inherited from_: [src/js/component.js#L420](https://github.com/videojs/video.js/blob/master/src/js/component.js#L420) - ---- - -### removeClass( classToRemove ) -> Remove a CSS class name from the component's element - -##### PARAMETERS: -* __classToRemove__ `String` Classname to remove - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L837](https://github.com/videojs/video.js/blob/master/src/js/component.js#L837) - ---- - -### setInterval( fn, interval ) -> Creates an interval and sets up disposal automatically. - -##### PARAMETERS: -* __fn__ `Function` The function to run every N seconds. -* __interval__ `Number` Number of ms to delay before executing specified function. - -##### RETURNS: -* `Number` Returns the interval ID - -_inherited from_: [src/js/component.js#L1202](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1202) - ---- - -### setTimeout( fn, timeout ) -> Creates timeout and sets up disposal automatically. - -##### PARAMETERS: -* __fn__ `Function` The function to run after the timeout. -* __timeout__ `Number` Number of ms to delay before executing specified function. - -##### RETURNS: -* `Number` Returns the timeout ID - -_inherited from_: [src/js/component.js#L1162](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1162) - ---- - -### show() -> Show the component element if hidden - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L847](https://github.com/videojs/video.js/blob/master/src/js/component.js#L847) - ---- - -### trigger( event ) -> Trigger an event on an element -> -> myComponent.trigger('eventName'); -> myComponent.trigger({'type':'eventName'}); - -##### PARAMETERS: -* __event__ `Event|Object|String` A string (the type) or an event object with a type attribute - -##### RETURNS: -* `vjs.Component` self - -_inherited from_: [src/js/component.js#L724](https://github.com/videojs/video.js/blob/master/src/js/component.js#L724) - ---- - -### triggerReady() -> Trigger the ready listeners - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L788](https://github.com/videojs/video.js/blob/master/src/js/component.js#L788) - ---- - -### width( [num], skipListeners ) -> Set or get the width of the component (CSS values) -> -> Setting the video tag dimension values only works with values in pixels. -> Percent values will not work. -> Some percents can be used, but width()/height() will return the number + %, -> not the actual computed width/height. - -##### PARAMETERS: -* __num__ `Number|String` _(OPTIONAL)_ Optional width number -* __skipListeners__ `Boolean` Skip the 'resize' event trigger - -##### RETURNS: -* `vjs.Component` This component, when setting the width -* `Number|String` The width, when getting - -_inherited from_: [src/js/component.js#L910](https://github.com/videojs/video.js/blob/master/src/js/component.js#L910) - ---- - -## EVENTS - -### resize `EVENT` -> Fired when the width and/or height of the component changes - -_inherited from_: [src/js/component.js#L1020](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1020) - ---- - diff --git a/docs/api/vjs.Flash.md b/docs/api/vjs.Flash.md deleted file mode 100644 index c42f468113..0000000000 --- a/docs/api/vjs.Flash.md +++ /dev/null @@ -1,43 +0,0 @@ - - -# vjs.Flash - -__EXTENDS__: [vjs.MediaTechController](vjs.MediaTechController.md) -__DEFINED IN__: [src/js/media/flash.js#L15](https://github.com/videojs/video.js/blob/master/src/js/media/flash.js#L15) - -Flash Media Controller - Wrapper for fallback SWF API - ---- - -## INDEX - -- [METHODS](#methods) - - [init](#init-player-options-ready-) - -- [UNDEFINED](#undefined) - - [rtmpSourceHandler](#rtmpsourcehandler-static) - ---- - -## METHODS - -### init( player, options, ready ) - -##### PARAMETERS: -* __player__ -* __options__ -* __ready__ - -_defined in_: [src/js/media/flash.js#L17](https://github.com/videojs/video.js/blob/master/src/js/media/flash.js#L17) - ---- - -## UNDEFINED - -### rtmpSourceHandler `STATIC` -> A source handler for RTMP urls - -_defined in_: [src/js/media/flash.rtmp.js#L58](https://github.com/videojs/video.js/blob/master/src/js/media/flash.rtmp.js#L58) - ---- - diff --git a/docs/api/vjs.FullscreenToggle.md b/docs/api/vjs.FullscreenToggle.md deleted file mode 100644 index 716a7453ec..0000000000 --- a/docs/api/vjs.FullscreenToggle.md +++ /dev/null @@ -1,657 +0,0 @@ - - -# vjs.FullscreenToggle - -__EXTENDS__: [vjs.Button](vjs.Button.md) -__DEFINED IN__: [src/js/control-bar/fullscreen-toggle.js#L8](https://github.com/videojs/video.js/blob/master/src/js/control-bar/fullscreen-toggle.js#L8) - -Toggle fullscreen video - ---- - -## INDEX - -- [METHODS](#methods) - - [init](#init-player-options-) - - [addChild](#addchild-child-options-) _`inherited`_ - - [addClass](#addclass-classtoadd-) _`inherited`_ - - [buildCSSClass](#buildcssclass) _`inherited`_ - - [children](#children) _`inherited`_ - - [clearInterval](#clearinterval-intervalid-) _`inherited`_ - - [clearTimeout](#cleartimeout-timeoutid-) _`inherited`_ - - [contentEl](#contentel) _`inherited`_ - - [createEl](#createel-tagname-attributes-) _`inherited`_ - - [dimensions](#dimensions-width-height-) _`inherited`_ - - [dispose](#dispose) _`inherited`_ - - [el](#el) _`inherited`_ - - [enableTouchActivity](#enabletouchactivity) _`inherited`_ - - [getChild](#getchild-name-) _`inherited`_ - - [getChildById](#getchildbyid-id-) _`inherited`_ - - [hasClass](#hasclass-classtocheck-) _`inherited`_ - - [height](#height-num-skiplisteners-) _`inherited`_ - - [hide](#hide) _`inherited`_ - - [id](#id) _`inherited`_ - - [initChildren](#initchildren) _`inherited`_ - - [name](#name) _`inherited`_ - - [off](#off-first-second-third-) _`inherited`_ - - [on](#on-first-second-third-) _`inherited`_ - - [one](#one-first-second-third-) _`inherited`_ - - [options](#options-obj-) _`inherited`_ - - [player](#player) _`inherited`_ - - [ready](#ready-fn-) _`inherited`_ - - [removeChild](#removechild-component-) _`inherited`_ - - [removeClass](#removeclass-classtoremove-) _`inherited`_ - - [setInterval](#setinterval-fn-interval-) _`inherited`_ - - [setTimeout](#settimeout-fn-timeout-) _`inherited`_ - - [show](#show) _`inherited`_ - - [trigger](#trigger-event-) _`inherited`_ - - [triggerReady](#triggerready) _`inherited`_ - - [width](#width-num-skiplisteners-) _`inherited`_ - -- [EVENTS](#events) - - [resize](#resize-event) _`inherited`_ - ---- - -## METHODS - -### addChild( child, [options] ) -> Adds a child component inside this component -> -> myComponent.el(); -> // ->
-> myComonent.children(); -> // [empty array] -> -> var myButton = myComponent.addChild('MyButton'); -> // ->
myButton
-> // -> myButton === myComonent.children()[0]; -> -> Pass in options for child constructors and options for children of the child -> -> var myButton = myComponent.addChild('MyButton', { -> text: 'Press Me', -> children: { -> buttonChildExample: { -> buttonChildOption: true -> } -> } -> }); - -##### PARAMETERS: -* __child__ `String|vjs.Component` The class name or instance of a child to add -* __options__ `Object` _(OPTIONAL)_ Options, including options to be passed to children of the child. - -##### RETURNS: -* `vjs.Component` The child component (created by this process if a string was used) - -_inherited from_: [src/js/component.js#L362](https://github.com/videojs/video.js/blob/master/src/js/component.js#L362) - ---- - -### addClass( classToAdd ) -> Add a CSS class name to the component's element - -##### PARAMETERS: -* __classToAdd__ `String` Classname to add - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L826](https://github.com/videojs/video.js/blob/master/src/js/component.js#L826) - ---- - -### buildCSSClass() -> Allows sub components to stack CSS class names - -##### RETURNS: -* `String` The constructed class name - -_inherited from_: [src/js/component.js#L536](https://github.com/videojs/video.js/blob/master/src/js/component.js#L536) - ---- - -### children() -> Get an array of all child components -> -> var kids = myComponent.children(); - -##### RETURNS: -* `Array` The children - -_inherited from_: [src/js/component.js#L296](https://github.com/videojs/video.js/blob/master/src/js/component.js#L296) - ---- - -### clearInterval( intervalId ) -> Clears an interval and removes the associated dispose listener - -##### PARAMETERS: -* __intervalId__ `Number` The id of the interval to clear - -##### RETURNS: -* `Number` Returns the interval ID - -_inherited from_: [src/js/component.js#L1223](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1223) - ---- - -### clearTimeout( timeoutId ) -> Clears a timeout and removes the associated dispose listener - -##### PARAMETERS: -* __timeoutId__ `Number` The id of the timeout to clear - -##### RETURNS: -* `Number` Returns the timeout ID - -_inherited from_: [src/js/component.js#L1185](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1185) - ---- - -### contentEl() -> Return the component's DOM element for embedding content. -> Will either be el_ or a new element defined in createEl. - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L239](https://github.com/videojs/video.js/blob/master/src/js/component.js#L239) - ---- - -### createEl( [tagName], [attributes] ) -> Create the component's DOM element - -##### PARAMETERS: -* __tagName__ `String` _(OPTIONAL)_ Element's node type. e.g. 'div' -* __attributes__ `Object` _(OPTIONAL)_ An object of element attributes that should be set on the element - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L200](https://github.com/videojs/video.js/blob/master/src/js/component.js#L200) - ---- - -### dimensions( width, height ) -> Set both width and height at the same time - -##### PARAMETERS: -* __width__ `Number|String` -* __height__ `Number|String` - -##### RETURNS: -* `vjs.Component` The component - -_inherited from_: [src/js/component.js#L938](https://github.com/videojs/video.js/blob/master/src/js/component.js#L938) - ---- - -### dispose() -> Dispose of the component and all child components - -_inherited from_: [src/js/component.js#L84](https://github.com/videojs/video.js/blob/master/src/js/component.js#L84) - ---- - -### el() -> Get the component's DOM element -> -> var domEl = myComponent.el(); - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L220](https://github.com/videojs/video.js/blob/master/src/js/component.js#L220) - ---- - -### enableTouchActivity() -> Report user touch activity when touch events occur -> -> User activity is used to determine when controls should show/hide. It's -> relatively simple when it comes to mouse events, because any mouse event -> should show the controls. So we capture mouse events that bubble up to the -> player and report activity when that happens. -> -> With touch events it isn't as easy. We can't rely on touch events at the -> player level, because a tap (touchstart + touchend) on the video itself on -> mobile devices is meant to turn controls off (and on). User activity is -> checked asynchronously, so what could happen is a tap event on the video -> turns the controls off, then the touchend event bubbles up to the player, -> which if it reported user activity, would turn the controls right back on. -> (We also don't want to completely block touch events from bubbling up) -> -> Also a touchmove, touch+hold, and anything other than a tap is not supposed -> to turn the controls back on on a mobile device. -> -> Here we're setting the default component behavior to report user activity -> whenever touch events happen, and this can be turned off by components that -> want touch events to act differently. - -_inherited from_: [src/js/component.js#L1124](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1124) - ---- - -### getChild( name ) -> Returns a child component with the provided name - -##### PARAMETERS: -* __name__ - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L330](https://github.com/videojs/video.js/blob/master/src/js/component.js#L330) - ---- - -### getChildById( id ) -> Returns a child component with the provided ID - -##### PARAMETERS: -* __id__ - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L313](https://github.com/videojs/video.js/blob/master/src/js/component.js#L313) - ---- - -### hasClass( classToCheck ) -> Check if a component's element has a CSS class name - -##### PARAMETERS: -* __classToCheck__ `String` Classname to check - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L816](https://github.com/videojs/video.js/blob/master/src/js/component.js#L816) - ---- - -### height( [num], [skipListeners] ) -> Get or set the height of the component (CSS values) -> -> Setting the video tag dimension values only works with values in pixels. -> Percent values will not work. -> Some percents can be used, but width()/height() will return the number + %, -> not the actual computed width/height. - -##### PARAMETERS: -* __num__ `Number|String` _(OPTIONAL)_ New component height -* __skipListeners__ `Boolean` _(OPTIONAL)_ Skip the resize event trigger - -##### RETURNS: -* `vjs.Component` This component, when setting the height -* `Number|String` The height, when getting - -_inherited from_: [src/js/component.js#L927](https://github.com/videojs/video.js/blob/master/src/js/component.js#L927) - ---- - -### hide() -> Hide the component element if currently showing - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L857](https://github.com/videojs/video.js/blob/master/src/js/component.js#L857) - ---- - -### id() -> Get the component's ID -> -> var id = myComponent.id(); - -##### RETURNS: -* `String` - -_inherited from_: [src/js/component.js#L258](https://github.com/videojs/video.js/blob/master/src/js/component.js#L258) - ---- - -### init( player, options ) - -##### PARAMETERS: -* __player__ -* __options__ - -_defined in_: [src/js/control-bar/fullscreen-toggle.js#L14](https://github.com/videojs/video.js/blob/master/src/js/control-bar/fullscreen-toggle.js#L14) - ---- - -### initChildren() -> Add and initialize default child components from options -> -> // when an instance of MyComponent is created, all children in options -> // will be added to the instance by their name strings and options -> MyComponent.prototype.options_.children = { -> myChildComponent: { -> myChildOption: true -> } -> } -> -> // Or when creating the component -> var myComp = new MyComponent(player, { -> children: { -> myChildComponent: { -> myChildOption: true -> } -> } -> }); -> -> The children option can also be an Array of child names or -> child options objects (that also include a 'name' key). -> -> var myComp = new MyComponent(player, { -> children: [ -> 'button', -> { -> name: 'button', -> someOtherOption: true -> } -> ] -> }); - -_inherited from_: [src/js/component.js#L481](https://github.com/videojs/video.js/blob/master/src/js/component.js#L481) - ---- - -### name() -> Get the component's name. The name is often used to reference the component. -> -> var name = myComponent.name(); - -##### RETURNS: -* `String` - -_inherited from_: [src/js/component.js#L277](https://github.com/videojs/video.js/blob/master/src/js/component.js#L277) - ---- - -### off( [first], [second], [third] ) -> Remove an event listener from this component's element -> -> myComponent.off('eventType', myFunc); -> -> If myFunc is excluded, ALL listeners for the event type will be removed. -> If eventType is excluded, ALL listeners will be removed from the component. -> -> Alternatively you can use `off` to remove listeners that were added to other -> elements or components using `myComponent.on(otherComponent...`. -> In this case both the event type and listener function are REQUIRED. -> -> myComponent.off(otherElement, 'eventType', myFunc); -> myComponent.off(otherComponent, 'eventType', myFunc); - -##### PARAMETERS: -* __first__ `String|vjs.Component` _(OPTIONAL)_ The event type or other component -* __second__ `Function|String` _(OPTIONAL)_ The listener function or event type -* __third__ `Function` _(OPTIONAL)_ The listener for other component - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L646](https://github.com/videojs/video.js/blob/master/src/js/component.js#L646) - ---- - -### on( first, second, third ) -> Add an event listener to this component's element -> -> var myFunc = function(){ -> var myComponent = this; -> // Do something when the event is fired -> }; -> -> myComponent.on('eventType', myFunc); -> -> The context of myFunc will be myComponent unless previously bound. -> -> Alternatively, you can add a listener to another element or component. -> -> myComponent.on(otherElement, 'eventName', myFunc); -> myComponent.on(otherComponent, 'eventName', myFunc); -> -> The benefit of using this over `vjs.on(otherElement, 'eventName', myFunc)` -> and `otherComponent.on('eventName', myFunc)` is that this way the listeners -> will be automatically cleaned up when either component is disposed. -> It will also bind myComponent as the context of myFunc. -> -> **NOTE**: When using this on elements in the page other than window -> and document (both permanent), if you remove the element from the DOM -> you need to call `vjs.trigger(el, 'dispose')` on it to clean up -> references to it and allow the browser to garbage collect it. - -##### PARAMETERS: -* __first__ `String|vjs.Component` The event type or other component -* __second__ `Function|String` The event handler or event type -* __third__ `Function` The event handler - -##### RETURNS: -* `vjs.Component` self - -_inherited from_: [src/js/component.js#L577](https://github.com/videojs/video.js/blob/master/src/js/component.js#L577) - ---- - -### one( first, second, [third] ) -> Add an event listener to be triggered only once and then removed -> -> myComponent.one('eventName', myFunc); -> -> Alternatively you can add a listener to another element or component -> that will be triggered only once. -> -> myComponent.one(otherElement, 'eventName', myFunc); -> myComponent.one(otherComponent, 'eventName', myFunc); - -##### PARAMETERS: -* __first__ `String|vjs.Component` The event type or other component -* __second__ `Function|String` The listener function or event type -* __third__ `Function` _(OPTIONAL)_ The listener function for other component - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L691](https://github.com/videojs/video.js/blob/master/src/js/component.js#L691) - ---- - -### options( obj ) -> Deep merge of options objects -> -> Whenever a property is an object on both options objects -> the two properties will be merged using vjs.obj.deepMerge. -> -> This is used for merging options for child components. We -> want it to be easy to override individual options on a child -> component without having to rewrite all the other default options. -> -> Parent.prototype.options_ = { -> children: { -> 'childOne': { 'foo': 'bar', 'asdf': 'fdsa' }, -> 'childTwo': {}, -> 'childThree': {} -> } -> } -> newOptions = { -> children: { -> 'childOne': { 'foo': 'baz', 'abc': '123' } -> 'childTwo': null, -> 'childFour': {} -> } -> } -> -> this.options(newOptions); -> -> RESULT -> -> { -> children: { -> 'childOne': { 'foo': 'baz', 'asdf': 'fdsa', 'abc': '123' }, -> 'childTwo': null, // Disabled. Won't be initialized. -> 'childThree': {}, -> 'childFour': {} -> } -> } - -##### PARAMETERS: -* __obj__ `Object` Object of new option values - -##### RETURNS: -* `Object` A NEW object of this.options_ and obj merged - -_inherited from_: [src/js/component.js#L179](https://github.com/videojs/video.js/blob/master/src/js/component.js#L179) - ---- - -### player() -> Return the component's player - -##### RETURNS: -* `vjs.Player` - -_inherited from_: [src/js/component.js#L126](https://github.com/videojs/video.js/blob/master/src/js/component.js#L126) - ---- - -### ready( fn ) -> Bind a listener to the component's ready state -> -> Different from event listeners in that if the ready event has already happened -> it will trigger the function immediately. - -##### PARAMETERS: -* __fn__ `Function` Ready listener - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L769](https://github.com/videojs/video.js/blob/master/src/js/component.js#L769) - ---- - -### removeChild( component ) -> Remove a child component from this component's list of children, and the -> child component's element from this component's element - -##### PARAMETERS: -* __component__ `vjs.Component` Component to remove - -_inherited from_: [src/js/component.js#L420](https://github.com/videojs/video.js/blob/master/src/js/component.js#L420) - ---- - -### removeClass( classToRemove ) -> Remove a CSS class name from the component's element - -##### PARAMETERS: -* __classToRemove__ `String` Classname to remove - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L837](https://github.com/videojs/video.js/blob/master/src/js/component.js#L837) - ---- - -### setInterval( fn, interval ) -> Creates an interval and sets up disposal automatically. - -##### PARAMETERS: -* __fn__ `Function` The function to run every N seconds. -* __interval__ `Number` Number of ms to delay before executing specified function. - -##### RETURNS: -* `Number` Returns the interval ID - -_inherited from_: [src/js/component.js#L1202](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1202) - ---- - -### setTimeout( fn, timeout ) -> Creates timeout and sets up disposal automatically. - -##### PARAMETERS: -* __fn__ `Function` The function to run after the timeout. -* __timeout__ `Number` Number of ms to delay before executing specified function. - -##### RETURNS: -* `Number` Returns the timeout ID - -_inherited from_: [src/js/component.js#L1162](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1162) - ---- - -### show() -> Show the component element if hidden - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L847](https://github.com/videojs/video.js/blob/master/src/js/component.js#L847) - ---- - -### trigger( event ) -> Trigger an event on an element -> -> myComponent.trigger('eventName'); -> myComponent.trigger({'type':'eventName'}); - -##### PARAMETERS: -* __event__ `Event|Object|String` A string (the type) or an event object with a type attribute - -##### RETURNS: -* `vjs.Component` self - -_inherited from_: [src/js/component.js#L724](https://github.com/videojs/video.js/blob/master/src/js/component.js#L724) - ---- - -### triggerReady() -> Trigger the ready listeners - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L788](https://github.com/videojs/video.js/blob/master/src/js/component.js#L788) - ---- - -### width( [num], skipListeners ) -> Set or get the width of the component (CSS values) -> -> Setting the video tag dimension values only works with values in pixels. -> Percent values will not work. -> Some percents can be used, but width()/height() will return the number + %, -> not the actual computed width/height. - -##### PARAMETERS: -* __num__ `Number|String` _(OPTIONAL)_ Optional width number -* __skipListeners__ `Boolean` Skip the 'resize' event trigger - -##### RETURNS: -* `vjs.Component` This component, when setting the width -* `Number|String` The width, when getting - -_inherited from_: [src/js/component.js#L910](https://github.com/videojs/video.js/blob/master/src/js/component.js#L910) - ---- - -## EVENTS - -### resize `EVENT` -> Fired when the width and/or height of the component changes - -_inherited from_: [src/js/component.js#L1020](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1020) - ---- - diff --git a/docs/api/vjs.Html5.md b/docs/api/vjs.Html5.md deleted file mode 100644 index 45e9fad34c..0000000000 --- a/docs/api/vjs.Html5.md +++ /dev/null @@ -1,77 +0,0 @@ - - -# vjs.Html5 - -__EXTENDS__: [vjs.MediaTechController](vjs.MediaTechController.md) -__DEFINED IN__: [src/js/media/html5.js#L12](https://github.com/videojs/video.js/blob/master/src/js/media/html5.js#L12) - -HTML5 Media Controller - Wrapper for HTML5 Media API - ---- - -## INDEX - -- [METHODS](#methods) - - [canControlPlaybackRate](#cancontrolplaybackrate-static) - - [canControlVolume](#cancontrolvolume-static) - - [init](#init-player-options-ready-) - - [isSupported](#issupported-static) - - [supportsNativeTextTracks](#supportsnativetexttracks-static) - ---- - -## METHODS - -### canControlPlaybackRate() `STATIC` -> Check if playbackRate is supported in this browser/device. - -##### RETURNS: -* `[type]` [description] - -_defined in_: [src/js/media/html5.js#L548](https://github.com/videojs/video.js/blob/master/src/js/media/html5.js#L548) - ---- - -### canControlVolume() `STATIC` -> Check if the volume can be changed in this browser/device. -> Volume cannot be changed in a lot of mobile devices. -> Specifically, it can't be changed from 1 on iOS. - -##### RETURNS: -* `Boolean` - -_defined in_: [src/js/media/html5.js#L538](https://github.com/videojs/video.js/blob/master/src/js/media/html5.js#L538) - ---- - -### init( player, options, ready ) - -##### PARAMETERS: -* __player__ -* __options__ -* __ready__ - -_defined in_: [src/js/media/html5.js#L14](https://github.com/videojs/video.js/blob/master/src/js/media/html5.js#L14) - ---- - -### isSupported() `STATIC` -> Check if HTML5 video is supported by this browser/device - -##### RETURNS: -* `Boolean` - -_defined in_: [src/js/media/html5.js#L436](https://github.com/videojs/video.js/blob/master/src/js/media/html5.js#L436) - ---- - -### supportsNativeTextTracks() `STATIC` -> Check to see if native text tracks are supported by this browser/device - -##### RETURNS: -* `Boolean` - -_defined in_: [src/js/media/html5.js#L558](https://github.com/videojs/video.js/blob/master/src/js/media/html5.js#L558) - ---- - diff --git a/docs/api/vjs.JSON.md b/docs/api/vjs.JSON.md deleted file mode 100644 index 623ace82fe..0000000000 --- a/docs/api/vjs.JSON.md +++ /dev/null @@ -1,30 +0,0 @@ - - -# vjs.JSON - - ---- - -## INDEX - -- [METHODS](#methods) - - [parse](#parse-text-reviver-) - ---- - -## METHODS - -### parse( text, [reviver] ) -> parse the json - -##### PARAMETERS: -* __text__ `String` The JSON string to parse -* __reviver__ `Function` _(OPTIONAL)_ Optional function that can transform the results - -##### RETURNS: -* `Object|Array` The parsed JSON - -_defined in_: [src/js/json.js#L34](https://github.com/videojs/video.js/blob/master/src/js/json.js#L34) - ---- - diff --git a/docs/api/vjs.LoadProgressBar.md b/docs/api/vjs.LoadProgressBar.md deleted file mode 100644 index 38e63c1386..0000000000 --- a/docs/api/vjs.LoadProgressBar.md +++ /dev/null @@ -1,657 +0,0 @@ - - -# vjs.LoadProgressBar - -__EXTENDS__: [vjs.Component](vjs.Component.md) -__DEFINED IN__: [src/js/control-bar/progress-control.js#L119](https://github.com/videojs/video.js/blob/master/src/js/control-bar/progress-control.js#L119) - -Shows load progress - ---- - -## INDEX - -- [METHODS](#methods) - - [init](#init-player-options-) - - [addChild](#addchild-child-options-) _`inherited`_ - - [addClass](#addclass-classtoadd-) _`inherited`_ - - [buildCSSClass](#buildcssclass) _`inherited`_ - - [children](#children) _`inherited`_ - - [clearInterval](#clearinterval-intervalid-) _`inherited`_ - - [clearTimeout](#cleartimeout-timeoutid-) _`inherited`_ - - [contentEl](#contentel) _`inherited`_ - - [createEl](#createel-tagname-attributes-) _`inherited`_ - - [dimensions](#dimensions-width-height-) _`inherited`_ - - [dispose](#dispose) _`inherited`_ - - [el](#el) _`inherited`_ - - [enableTouchActivity](#enabletouchactivity) _`inherited`_ - - [getChild](#getchild-name-) _`inherited`_ - - [getChildById](#getchildbyid-id-) _`inherited`_ - - [hasClass](#hasclass-classtocheck-) _`inherited`_ - - [height](#height-num-skiplisteners-) _`inherited`_ - - [hide](#hide) _`inherited`_ - - [id](#id) _`inherited`_ - - [initChildren](#initchildren) _`inherited`_ - - [name](#name) _`inherited`_ - - [off](#off-first-second-third-) _`inherited`_ - - [on](#on-first-second-third-) _`inherited`_ - - [one](#one-first-second-third-) _`inherited`_ - - [options](#options-obj-) _`inherited`_ - - [player](#player) _`inherited`_ - - [ready](#ready-fn-) _`inherited`_ - - [removeChild](#removechild-component-) _`inherited`_ - - [removeClass](#removeclass-classtoremove-) _`inherited`_ - - [setInterval](#setinterval-fn-interval-) _`inherited`_ - - [setTimeout](#settimeout-fn-timeout-) _`inherited`_ - - [show](#show) _`inherited`_ - - [trigger](#trigger-event-) _`inherited`_ - - [triggerReady](#triggerready) _`inherited`_ - - [width](#width-num-skiplisteners-) _`inherited`_ - -- [EVENTS](#events) - - [resize](#resize-event) _`inherited`_ - ---- - -## METHODS - -### addChild( child, [options] ) -> Adds a child component inside this component -> -> myComponent.el(); -> // ->
-> myComonent.children(); -> // [empty array] -> -> var myButton = myComponent.addChild('MyButton'); -> // ->
myButton
-> // -> myButton === myComonent.children()[0]; -> -> Pass in options for child constructors and options for children of the child -> -> var myButton = myComponent.addChild('MyButton', { -> text: 'Press Me', -> children: { -> buttonChildExample: { -> buttonChildOption: true -> } -> } -> }); - -##### PARAMETERS: -* __child__ `String|vjs.Component` The class name or instance of a child to add -* __options__ `Object` _(OPTIONAL)_ Options, including options to be passed to children of the child. - -##### RETURNS: -* `vjs.Component` The child component (created by this process if a string was used) - -_inherited from_: [src/js/component.js#L362](https://github.com/videojs/video.js/blob/master/src/js/component.js#L362) - ---- - -### addClass( classToAdd ) -> Add a CSS class name to the component's element - -##### PARAMETERS: -* __classToAdd__ `String` Classname to add - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L826](https://github.com/videojs/video.js/blob/master/src/js/component.js#L826) - ---- - -### buildCSSClass() -> Allows sub components to stack CSS class names - -##### RETURNS: -* `String` The constructed class name - -_inherited from_: [src/js/component.js#L536](https://github.com/videojs/video.js/blob/master/src/js/component.js#L536) - ---- - -### children() -> Get an array of all child components -> -> var kids = myComponent.children(); - -##### RETURNS: -* `Array` The children - -_inherited from_: [src/js/component.js#L296](https://github.com/videojs/video.js/blob/master/src/js/component.js#L296) - ---- - -### clearInterval( intervalId ) -> Clears an interval and removes the associated dispose listener - -##### PARAMETERS: -* __intervalId__ `Number` The id of the interval to clear - -##### RETURNS: -* `Number` Returns the interval ID - -_inherited from_: [src/js/component.js#L1223](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1223) - ---- - -### clearTimeout( timeoutId ) -> Clears a timeout and removes the associated dispose listener - -##### PARAMETERS: -* __timeoutId__ `Number` The id of the timeout to clear - -##### RETURNS: -* `Number` Returns the timeout ID - -_inherited from_: [src/js/component.js#L1185](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1185) - ---- - -### contentEl() -> Return the component's DOM element for embedding content. -> Will either be el_ or a new element defined in createEl. - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L239](https://github.com/videojs/video.js/blob/master/src/js/component.js#L239) - ---- - -### createEl( [tagName], [attributes] ) -> Create the component's DOM element - -##### PARAMETERS: -* __tagName__ `String` _(OPTIONAL)_ Element's node type. e.g. 'div' -* __attributes__ `Object` _(OPTIONAL)_ An object of element attributes that should be set on the element - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L200](https://github.com/videojs/video.js/blob/master/src/js/component.js#L200) - ---- - -### dimensions( width, height ) -> Set both width and height at the same time - -##### PARAMETERS: -* __width__ `Number|String` -* __height__ `Number|String` - -##### RETURNS: -* `vjs.Component` The component - -_inherited from_: [src/js/component.js#L938](https://github.com/videojs/video.js/blob/master/src/js/component.js#L938) - ---- - -### dispose() -> Dispose of the component and all child components - -_inherited from_: [src/js/component.js#L84](https://github.com/videojs/video.js/blob/master/src/js/component.js#L84) - ---- - -### el() -> Get the component's DOM element -> -> var domEl = myComponent.el(); - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L220](https://github.com/videojs/video.js/blob/master/src/js/component.js#L220) - ---- - -### enableTouchActivity() -> Report user touch activity when touch events occur -> -> User activity is used to determine when controls should show/hide. It's -> relatively simple when it comes to mouse events, because any mouse event -> should show the controls. So we capture mouse events that bubble up to the -> player and report activity when that happens. -> -> With touch events it isn't as easy. We can't rely on touch events at the -> player level, because a tap (touchstart + touchend) on the video itself on -> mobile devices is meant to turn controls off (and on). User activity is -> checked asynchronously, so what could happen is a tap event on the video -> turns the controls off, then the touchend event bubbles up to the player, -> which if it reported user activity, would turn the controls right back on. -> (We also don't want to completely block touch events from bubbling up) -> -> Also a touchmove, touch+hold, and anything other than a tap is not supposed -> to turn the controls back on on a mobile device. -> -> Here we're setting the default component behavior to report user activity -> whenever touch events happen, and this can be turned off by components that -> want touch events to act differently. - -_inherited from_: [src/js/component.js#L1124](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1124) - ---- - -### getChild( name ) -> Returns a child component with the provided name - -##### PARAMETERS: -* __name__ - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L330](https://github.com/videojs/video.js/blob/master/src/js/component.js#L330) - ---- - -### getChildById( id ) -> Returns a child component with the provided ID - -##### PARAMETERS: -* __id__ - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L313](https://github.com/videojs/video.js/blob/master/src/js/component.js#L313) - ---- - -### hasClass( classToCheck ) -> Check if a component's element has a CSS class name - -##### PARAMETERS: -* __classToCheck__ `String` Classname to check - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L816](https://github.com/videojs/video.js/blob/master/src/js/component.js#L816) - ---- - -### height( [num], [skipListeners] ) -> Get or set the height of the component (CSS values) -> -> Setting the video tag dimension values only works with values in pixels. -> Percent values will not work. -> Some percents can be used, but width()/height() will return the number + %, -> not the actual computed width/height. - -##### PARAMETERS: -* __num__ `Number|String` _(OPTIONAL)_ New component height -* __skipListeners__ `Boolean` _(OPTIONAL)_ Skip the resize event trigger - -##### RETURNS: -* `vjs.Component` This component, when setting the height -* `Number|String` The height, when getting - -_inherited from_: [src/js/component.js#L927](https://github.com/videojs/video.js/blob/master/src/js/component.js#L927) - ---- - -### hide() -> Hide the component element if currently showing - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L857](https://github.com/videojs/video.js/blob/master/src/js/component.js#L857) - ---- - -### id() -> Get the component's ID -> -> var id = myComponent.id(); - -##### RETURNS: -* `String` - -_inherited from_: [src/js/component.js#L258](https://github.com/videojs/video.js/blob/master/src/js/component.js#L258) - ---- - -### init( player, options ) - -##### PARAMETERS: -* __player__ -* __options__ - -_defined in_: [src/js/control-bar/progress-control.js#L121](https://github.com/videojs/video.js/blob/master/src/js/control-bar/progress-control.js#L121) - ---- - -### initChildren() -> Add and initialize default child components from options -> -> // when an instance of MyComponent is created, all children in options -> // will be added to the instance by their name strings and options -> MyComponent.prototype.options_.children = { -> myChildComponent: { -> myChildOption: true -> } -> } -> -> // Or when creating the component -> var myComp = new MyComponent(player, { -> children: { -> myChildComponent: { -> myChildOption: true -> } -> } -> }); -> -> The children option can also be an Array of child names or -> child options objects (that also include a 'name' key). -> -> var myComp = new MyComponent(player, { -> children: [ -> 'button', -> { -> name: 'button', -> someOtherOption: true -> } -> ] -> }); - -_inherited from_: [src/js/component.js#L481](https://github.com/videojs/video.js/blob/master/src/js/component.js#L481) - ---- - -### name() -> Get the component's name. The name is often used to reference the component. -> -> var name = myComponent.name(); - -##### RETURNS: -* `String` - -_inherited from_: [src/js/component.js#L277](https://github.com/videojs/video.js/blob/master/src/js/component.js#L277) - ---- - -### off( [first], [second], [third] ) -> Remove an event listener from this component's element -> -> myComponent.off('eventType', myFunc); -> -> If myFunc is excluded, ALL listeners for the event type will be removed. -> If eventType is excluded, ALL listeners will be removed from the component. -> -> Alternatively you can use `off` to remove listeners that were added to other -> elements or components using `myComponent.on(otherComponent...`. -> In this case both the event type and listener function are REQUIRED. -> -> myComponent.off(otherElement, 'eventType', myFunc); -> myComponent.off(otherComponent, 'eventType', myFunc); - -##### PARAMETERS: -* __first__ `String|vjs.Component` _(OPTIONAL)_ The event type or other component -* __second__ `Function|String` _(OPTIONAL)_ The listener function or event type -* __third__ `Function` _(OPTIONAL)_ The listener for other component - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L646](https://github.com/videojs/video.js/blob/master/src/js/component.js#L646) - ---- - -### on( first, second, third ) -> Add an event listener to this component's element -> -> var myFunc = function(){ -> var myComponent = this; -> // Do something when the event is fired -> }; -> -> myComponent.on('eventType', myFunc); -> -> The context of myFunc will be myComponent unless previously bound. -> -> Alternatively, you can add a listener to another element or component. -> -> myComponent.on(otherElement, 'eventName', myFunc); -> myComponent.on(otherComponent, 'eventName', myFunc); -> -> The benefit of using this over `vjs.on(otherElement, 'eventName', myFunc)` -> and `otherComponent.on('eventName', myFunc)` is that this way the listeners -> will be automatically cleaned up when either component is disposed. -> It will also bind myComponent as the context of myFunc. -> -> **NOTE**: When using this on elements in the page other than window -> and document (both permanent), if you remove the element from the DOM -> you need to call `vjs.trigger(el, 'dispose')` on it to clean up -> references to it and allow the browser to garbage collect it. - -##### PARAMETERS: -* __first__ `String|vjs.Component` The event type or other component -* __second__ `Function|String` The event handler or event type -* __third__ `Function` The event handler - -##### RETURNS: -* `vjs.Component` self - -_inherited from_: [src/js/component.js#L577](https://github.com/videojs/video.js/blob/master/src/js/component.js#L577) - ---- - -### one( first, second, [third] ) -> Add an event listener to be triggered only once and then removed -> -> myComponent.one('eventName', myFunc); -> -> Alternatively you can add a listener to another element or component -> that will be triggered only once. -> -> myComponent.one(otherElement, 'eventName', myFunc); -> myComponent.one(otherComponent, 'eventName', myFunc); - -##### PARAMETERS: -* __first__ `String|vjs.Component` The event type or other component -* __second__ `Function|String` The listener function or event type -* __third__ `Function` _(OPTIONAL)_ The listener function for other component - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L691](https://github.com/videojs/video.js/blob/master/src/js/component.js#L691) - ---- - -### options( obj ) -> Deep merge of options objects -> -> Whenever a property is an object on both options objects -> the two properties will be merged using vjs.obj.deepMerge. -> -> This is used for merging options for child components. We -> want it to be easy to override individual options on a child -> component without having to rewrite all the other default options. -> -> Parent.prototype.options_ = { -> children: { -> 'childOne': { 'foo': 'bar', 'asdf': 'fdsa' }, -> 'childTwo': {}, -> 'childThree': {} -> } -> } -> newOptions = { -> children: { -> 'childOne': { 'foo': 'baz', 'abc': '123' } -> 'childTwo': null, -> 'childFour': {} -> } -> } -> -> this.options(newOptions); -> -> RESULT -> -> { -> children: { -> 'childOne': { 'foo': 'baz', 'asdf': 'fdsa', 'abc': '123' }, -> 'childTwo': null, // Disabled. Won't be initialized. -> 'childThree': {}, -> 'childFour': {} -> } -> } - -##### PARAMETERS: -* __obj__ `Object` Object of new option values - -##### RETURNS: -* `Object` A NEW object of this.options_ and obj merged - -_inherited from_: [src/js/component.js#L179](https://github.com/videojs/video.js/blob/master/src/js/component.js#L179) - ---- - -### player() -> Return the component's player - -##### RETURNS: -* `vjs.Player` - -_inherited from_: [src/js/component.js#L126](https://github.com/videojs/video.js/blob/master/src/js/component.js#L126) - ---- - -### ready( fn ) -> Bind a listener to the component's ready state -> -> Different from event listeners in that if the ready event has already happened -> it will trigger the function immediately. - -##### PARAMETERS: -* __fn__ `Function` Ready listener - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L769](https://github.com/videojs/video.js/blob/master/src/js/component.js#L769) - ---- - -### removeChild( component ) -> Remove a child component from this component's list of children, and the -> child component's element from this component's element - -##### PARAMETERS: -* __component__ `vjs.Component` Component to remove - -_inherited from_: [src/js/component.js#L420](https://github.com/videojs/video.js/blob/master/src/js/component.js#L420) - ---- - -### removeClass( classToRemove ) -> Remove a CSS class name from the component's element - -##### PARAMETERS: -* __classToRemove__ `String` Classname to remove - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L837](https://github.com/videojs/video.js/blob/master/src/js/component.js#L837) - ---- - -### setInterval( fn, interval ) -> Creates an interval and sets up disposal automatically. - -##### PARAMETERS: -* __fn__ `Function` The function to run every N seconds. -* __interval__ `Number` Number of ms to delay before executing specified function. - -##### RETURNS: -* `Number` Returns the interval ID - -_inherited from_: [src/js/component.js#L1202](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1202) - ---- - -### setTimeout( fn, timeout ) -> Creates timeout and sets up disposal automatically. - -##### PARAMETERS: -* __fn__ `Function` The function to run after the timeout. -* __timeout__ `Number` Number of ms to delay before executing specified function. - -##### RETURNS: -* `Number` Returns the timeout ID - -_inherited from_: [src/js/component.js#L1162](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1162) - ---- - -### show() -> Show the component element if hidden - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L847](https://github.com/videojs/video.js/blob/master/src/js/component.js#L847) - ---- - -### trigger( event ) -> Trigger an event on an element -> -> myComponent.trigger('eventName'); -> myComponent.trigger({'type':'eventName'}); - -##### PARAMETERS: -* __event__ `Event|Object|String` A string (the type) or an event object with a type attribute - -##### RETURNS: -* `vjs.Component` self - -_inherited from_: [src/js/component.js#L724](https://github.com/videojs/video.js/blob/master/src/js/component.js#L724) - ---- - -### triggerReady() -> Trigger the ready listeners - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L788](https://github.com/videojs/video.js/blob/master/src/js/component.js#L788) - ---- - -### width( [num], skipListeners ) -> Set or get the width of the component (CSS values) -> -> Setting the video tag dimension values only works with values in pixels. -> Percent values will not work. -> Some percents can be used, but width()/height() will return the number + %, -> not the actual computed width/height. - -##### PARAMETERS: -* __num__ `Number|String` _(OPTIONAL)_ Optional width number -* __skipListeners__ `Boolean` Skip the 'resize' event trigger - -##### RETURNS: -* `vjs.Component` This component, when setting the width -* `Number|String` The width, when getting - -_inherited from_: [src/js/component.js#L910](https://github.com/videojs/video.js/blob/master/src/js/component.js#L910) - ---- - -## EVENTS - -### resize `EVENT` -> Fired when the width and/or height of the component changes - -_inherited from_: [src/js/component.js#L1020](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1020) - ---- - diff --git a/docs/api/vjs.LoadingSpinner.md b/docs/api/vjs.LoadingSpinner.md deleted file mode 100644 index cdb4635474..0000000000 --- a/docs/api/vjs.LoadingSpinner.md +++ /dev/null @@ -1,657 +0,0 @@ - - -# vjs.LoadingSpinner - -__EXTENDS__: [vjs.Component](vjs.Component.md) -__DEFINED IN__: [src/js/loading-spinner.js#L10](https://github.com/videojs/video.js/blob/master/src/js/loading-spinner.js#L10) - -Loading spinner for waiting events - ---- - -## INDEX - -- [METHODS](#methods) - - [init](#init-player-options-) - - [addChild](#addchild-child-options-) _`inherited`_ - - [addClass](#addclass-classtoadd-) _`inherited`_ - - [buildCSSClass](#buildcssclass) _`inherited`_ - - [children](#children) _`inherited`_ - - [clearInterval](#clearinterval-intervalid-) _`inherited`_ - - [clearTimeout](#cleartimeout-timeoutid-) _`inherited`_ - - [contentEl](#contentel) _`inherited`_ - - [createEl](#createel-tagname-attributes-) _`inherited`_ - - [dimensions](#dimensions-width-height-) _`inherited`_ - - [dispose](#dispose) _`inherited`_ - - [el](#el) _`inherited`_ - - [enableTouchActivity](#enabletouchactivity) _`inherited`_ - - [getChild](#getchild-name-) _`inherited`_ - - [getChildById](#getchildbyid-id-) _`inherited`_ - - [hasClass](#hasclass-classtocheck-) _`inherited`_ - - [height](#height-num-skiplisteners-) _`inherited`_ - - [hide](#hide) _`inherited`_ - - [id](#id) _`inherited`_ - - [initChildren](#initchildren) _`inherited`_ - - [name](#name) _`inherited`_ - - [off](#off-first-second-third-) _`inherited`_ - - [on](#on-first-second-third-) _`inherited`_ - - [one](#one-first-second-third-) _`inherited`_ - - [options](#options-obj-) _`inherited`_ - - [player](#player) _`inherited`_ - - [ready](#ready-fn-) _`inherited`_ - - [removeChild](#removechild-component-) _`inherited`_ - - [removeClass](#removeclass-classtoremove-) _`inherited`_ - - [setInterval](#setinterval-fn-interval-) _`inherited`_ - - [setTimeout](#settimeout-fn-timeout-) _`inherited`_ - - [show](#show) _`inherited`_ - - [trigger](#trigger-event-) _`inherited`_ - - [triggerReady](#triggerready) _`inherited`_ - - [width](#width-num-skiplisteners-) _`inherited`_ - -- [EVENTS](#events) - - [resize](#resize-event) _`inherited`_ - ---- - -## METHODS - -### addChild( child, [options] ) -> Adds a child component inside this component -> -> myComponent.el(); -> // ->
-> myComonent.children(); -> // [empty array] -> -> var myButton = myComponent.addChild('MyButton'); -> // ->
myButton
-> // -> myButton === myComonent.children()[0]; -> -> Pass in options for child constructors and options for children of the child -> -> var myButton = myComponent.addChild('MyButton', { -> text: 'Press Me', -> children: { -> buttonChildExample: { -> buttonChildOption: true -> } -> } -> }); - -##### PARAMETERS: -* __child__ `String|vjs.Component` The class name or instance of a child to add -* __options__ `Object` _(OPTIONAL)_ Options, including options to be passed to children of the child. - -##### RETURNS: -* `vjs.Component` The child component (created by this process if a string was used) - -_inherited from_: [src/js/component.js#L362](https://github.com/videojs/video.js/blob/master/src/js/component.js#L362) - ---- - -### addClass( classToAdd ) -> Add a CSS class name to the component's element - -##### PARAMETERS: -* __classToAdd__ `String` Classname to add - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L826](https://github.com/videojs/video.js/blob/master/src/js/component.js#L826) - ---- - -### buildCSSClass() -> Allows sub components to stack CSS class names - -##### RETURNS: -* `String` The constructed class name - -_inherited from_: [src/js/component.js#L536](https://github.com/videojs/video.js/blob/master/src/js/component.js#L536) - ---- - -### children() -> Get an array of all child components -> -> var kids = myComponent.children(); - -##### RETURNS: -* `Array` The children - -_inherited from_: [src/js/component.js#L296](https://github.com/videojs/video.js/blob/master/src/js/component.js#L296) - ---- - -### clearInterval( intervalId ) -> Clears an interval and removes the associated dispose listener - -##### PARAMETERS: -* __intervalId__ `Number` The id of the interval to clear - -##### RETURNS: -* `Number` Returns the interval ID - -_inherited from_: [src/js/component.js#L1223](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1223) - ---- - -### clearTimeout( timeoutId ) -> Clears a timeout and removes the associated dispose listener - -##### PARAMETERS: -* __timeoutId__ `Number` The id of the timeout to clear - -##### RETURNS: -* `Number` Returns the timeout ID - -_inherited from_: [src/js/component.js#L1185](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1185) - ---- - -### contentEl() -> Return the component's DOM element for embedding content. -> Will either be el_ or a new element defined in createEl. - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L239](https://github.com/videojs/video.js/blob/master/src/js/component.js#L239) - ---- - -### createEl( [tagName], [attributes] ) -> Create the component's DOM element - -##### PARAMETERS: -* __tagName__ `String` _(OPTIONAL)_ Element's node type. e.g. 'div' -* __attributes__ `Object` _(OPTIONAL)_ An object of element attributes that should be set on the element - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L200](https://github.com/videojs/video.js/blob/master/src/js/component.js#L200) - ---- - -### dimensions( width, height ) -> Set both width and height at the same time - -##### PARAMETERS: -* __width__ `Number|String` -* __height__ `Number|String` - -##### RETURNS: -* `vjs.Component` The component - -_inherited from_: [src/js/component.js#L938](https://github.com/videojs/video.js/blob/master/src/js/component.js#L938) - ---- - -### dispose() -> Dispose of the component and all child components - -_inherited from_: [src/js/component.js#L84](https://github.com/videojs/video.js/blob/master/src/js/component.js#L84) - ---- - -### el() -> Get the component's DOM element -> -> var domEl = myComponent.el(); - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L220](https://github.com/videojs/video.js/blob/master/src/js/component.js#L220) - ---- - -### enableTouchActivity() -> Report user touch activity when touch events occur -> -> User activity is used to determine when controls should show/hide. It's -> relatively simple when it comes to mouse events, because any mouse event -> should show the controls. So we capture mouse events that bubble up to the -> player and report activity when that happens. -> -> With touch events it isn't as easy. We can't rely on touch events at the -> player level, because a tap (touchstart + touchend) on the video itself on -> mobile devices is meant to turn controls off (and on). User activity is -> checked asynchronously, so what could happen is a tap event on the video -> turns the controls off, then the touchend event bubbles up to the player, -> which if it reported user activity, would turn the controls right back on. -> (We also don't want to completely block touch events from bubbling up) -> -> Also a touchmove, touch+hold, and anything other than a tap is not supposed -> to turn the controls back on on a mobile device. -> -> Here we're setting the default component behavior to report user activity -> whenever touch events happen, and this can be turned off by components that -> want touch events to act differently. - -_inherited from_: [src/js/component.js#L1124](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1124) - ---- - -### getChild( name ) -> Returns a child component with the provided name - -##### PARAMETERS: -* __name__ - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L330](https://github.com/videojs/video.js/blob/master/src/js/component.js#L330) - ---- - -### getChildById( id ) -> Returns a child component with the provided ID - -##### PARAMETERS: -* __id__ - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L313](https://github.com/videojs/video.js/blob/master/src/js/component.js#L313) - ---- - -### hasClass( classToCheck ) -> Check if a component's element has a CSS class name - -##### PARAMETERS: -* __classToCheck__ `String` Classname to check - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L816](https://github.com/videojs/video.js/blob/master/src/js/component.js#L816) - ---- - -### height( [num], [skipListeners] ) -> Get or set the height of the component (CSS values) -> -> Setting the video tag dimension values only works with values in pixels. -> Percent values will not work. -> Some percents can be used, but width()/height() will return the number + %, -> not the actual computed width/height. - -##### PARAMETERS: -* __num__ `Number|String` _(OPTIONAL)_ New component height -* __skipListeners__ `Boolean` _(OPTIONAL)_ Skip the resize event trigger - -##### RETURNS: -* `vjs.Component` This component, when setting the height -* `Number|String` The height, when getting - -_inherited from_: [src/js/component.js#L927](https://github.com/videojs/video.js/blob/master/src/js/component.js#L927) - ---- - -### hide() -> Hide the component element if currently showing - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L857](https://github.com/videojs/video.js/blob/master/src/js/component.js#L857) - ---- - -### id() -> Get the component's ID -> -> var id = myComponent.id(); - -##### RETURNS: -* `String` - -_inherited from_: [src/js/component.js#L258](https://github.com/videojs/video.js/blob/master/src/js/component.js#L258) - ---- - -### init( player, options ) - -##### PARAMETERS: -* __player__ -* __options__ - -_defined in_: [src/js/loading-spinner.js#L12](https://github.com/videojs/video.js/blob/master/src/js/loading-spinner.js#L12) - ---- - -### initChildren() -> Add and initialize default child components from options -> -> // when an instance of MyComponent is created, all children in options -> // will be added to the instance by their name strings and options -> MyComponent.prototype.options_.children = { -> myChildComponent: { -> myChildOption: true -> } -> } -> -> // Or when creating the component -> var myComp = new MyComponent(player, { -> children: { -> myChildComponent: { -> myChildOption: true -> } -> } -> }); -> -> The children option can also be an Array of child names or -> child options objects (that also include a 'name' key). -> -> var myComp = new MyComponent(player, { -> children: [ -> 'button', -> { -> name: 'button', -> someOtherOption: true -> } -> ] -> }); - -_inherited from_: [src/js/component.js#L481](https://github.com/videojs/video.js/blob/master/src/js/component.js#L481) - ---- - -### name() -> Get the component's name. The name is often used to reference the component. -> -> var name = myComponent.name(); - -##### RETURNS: -* `String` - -_inherited from_: [src/js/component.js#L277](https://github.com/videojs/video.js/blob/master/src/js/component.js#L277) - ---- - -### off( [first], [second], [third] ) -> Remove an event listener from this component's element -> -> myComponent.off('eventType', myFunc); -> -> If myFunc is excluded, ALL listeners for the event type will be removed. -> If eventType is excluded, ALL listeners will be removed from the component. -> -> Alternatively you can use `off` to remove listeners that were added to other -> elements or components using `myComponent.on(otherComponent...`. -> In this case both the event type and listener function are REQUIRED. -> -> myComponent.off(otherElement, 'eventType', myFunc); -> myComponent.off(otherComponent, 'eventType', myFunc); - -##### PARAMETERS: -* __first__ `String|vjs.Component` _(OPTIONAL)_ The event type or other component -* __second__ `Function|String` _(OPTIONAL)_ The listener function or event type -* __third__ `Function` _(OPTIONAL)_ The listener for other component - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L646](https://github.com/videojs/video.js/blob/master/src/js/component.js#L646) - ---- - -### on( first, second, third ) -> Add an event listener to this component's element -> -> var myFunc = function(){ -> var myComponent = this; -> // Do something when the event is fired -> }; -> -> myComponent.on('eventType', myFunc); -> -> The context of myFunc will be myComponent unless previously bound. -> -> Alternatively, you can add a listener to another element or component. -> -> myComponent.on(otherElement, 'eventName', myFunc); -> myComponent.on(otherComponent, 'eventName', myFunc); -> -> The benefit of using this over `vjs.on(otherElement, 'eventName', myFunc)` -> and `otherComponent.on('eventName', myFunc)` is that this way the listeners -> will be automatically cleaned up when either component is disposed. -> It will also bind myComponent as the context of myFunc. -> -> **NOTE**: When using this on elements in the page other than window -> and document (both permanent), if you remove the element from the DOM -> you need to call `vjs.trigger(el, 'dispose')` on it to clean up -> references to it and allow the browser to garbage collect it. - -##### PARAMETERS: -* __first__ `String|vjs.Component` The event type or other component -* __second__ `Function|String` The event handler or event type -* __third__ `Function` The event handler - -##### RETURNS: -* `vjs.Component` self - -_inherited from_: [src/js/component.js#L577](https://github.com/videojs/video.js/blob/master/src/js/component.js#L577) - ---- - -### one( first, second, [third] ) -> Add an event listener to be triggered only once and then removed -> -> myComponent.one('eventName', myFunc); -> -> Alternatively you can add a listener to another element or component -> that will be triggered only once. -> -> myComponent.one(otherElement, 'eventName', myFunc); -> myComponent.one(otherComponent, 'eventName', myFunc); - -##### PARAMETERS: -* __first__ `String|vjs.Component` The event type or other component -* __second__ `Function|String` The listener function or event type -* __third__ `Function` _(OPTIONAL)_ The listener function for other component - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L691](https://github.com/videojs/video.js/blob/master/src/js/component.js#L691) - ---- - -### options( obj ) -> Deep merge of options objects -> -> Whenever a property is an object on both options objects -> the two properties will be merged using vjs.obj.deepMerge. -> -> This is used for merging options for child components. We -> want it to be easy to override individual options on a child -> component without having to rewrite all the other default options. -> -> Parent.prototype.options_ = { -> children: { -> 'childOne': { 'foo': 'bar', 'asdf': 'fdsa' }, -> 'childTwo': {}, -> 'childThree': {} -> } -> } -> newOptions = { -> children: { -> 'childOne': { 'foo': 'baz', 'abc': '123' } -> 'childTwo': null, -> 'childFour': {} -> } -> } -> -> this.options(newOptions); -> -> RESULT -> -> { -> children: { -> 'childOne': { 'foo': 'baz', 'asdf': 'fdsa', 'abc': '123' }, -> 'childTwo': null, // Disabled. Won't be initialized. -> 'childThree': {}, -> 'childFour': {} -> } -> } - -##### PARAMETERS: -* __obj__ `Object` Object of new option values - -##### RETURNS: -* `Object` A NEW object of this.options_ and obj merged - -_inherited from_: [src/js/component.js#L179](https://github.com/videojs/video.js/blob/master/src/js/component.js#L179) - ---- - -### player() -> Return the component's player - -##### RETURNS: -* `vjs.Player` - -_inherited from_: [src/js/component.js#L126](https://github.com/videojs/video.js/blob/master/src/js/component.js#L126) - ---- - -### ready( fn ) -> Bind a listener to the component's ready state -> -> Different from event listeners in that if the ready event has already happened -> it will trigger the function immediately. - -##### PARAMETERS: -* __fn__ `Function` Ready listener - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L769](https://github.com/videojs/video.js/blob/master/src/js/component.js#L769) - ---- - -### removeChild( component ) -> Remove a child component from this component's list of children, and the -> child component's element from this component's element - -##### PARAMETERS: -* __component__ `vjs.Component` Component to remove - -_inherited from_: [src/js/component.js#L420](https://github.com/videojs/video.js/blob/master/src/js/component.js#L420) - ---- - -### removeClass( classToRemove ) -> Remove a CSS class name from the component's element - -##### PARAMETERS: -* __classToRemove__ `String` Classname to remove - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L837](https://github.com/videojs/video.js/blob/master/src/js/component.js#L837) - ---- - -### setInterval( fn, interval ) -> Creates an interval and sets up disposal automatically. - -##### PARAMETERS: -* __fn__ `Function` The function to run every N seconds. -* __interval__ `Number` Number of ms to delay before executing specified function. - -##### RETURNS: -* `Number` Returns the interval ID - -_inherited from_: [src/js/component.js#L1202](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1202) - ---- - -### setTimeout( fn, timeout ) -> Creates timeout and sets up disposal automatically. - -##### PARAMETERS: -* __fn__ `Function` The function to run after the timeout. -* __timeout__ `Number` Number of ms to delay before executing specified function. - -##### RETURNS: -* `Number` Returns the timeout ID - -_inherited from_: [src/js/component.js#L1162](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1162) - ---- - -### show() -> Show the component element if hidden - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L847](https://github.com/videojs/video.js/blob/master/src/js/component.js#L847) - ---- - -### trigger( event ) -> Trigger an event on an element -> -> myComponent.trigger('eventName'); -> myComponent.trigger({'type':'eventName'}); - -##### PARAMETERS: -* __event__ `Event|Object|String` A string (the type) or an event object with a type attribute - -##### RETURNS: -* `vjs.Component` self - -_inherited from_: [src/js/component.js#L724](https://github.com/videojs/video.js/blob/master/src/js/component.js#L724) - ---- - -### triggerReady() -> Trigger the ready listeners - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L788](https://github.com/videojs/video.js/blob/master/src/js/component.js#L788) - ---- - -### width( [num], skipListeners ) -> Set or get the width of the component (CSS values) -> -> Setting the video tag dimension values only works with values in pixels. -> Percent values will not work. -> Some percents can be used, but width()/height() will return the number + %, -> not the actual computed width/height. - -##### PARAMETERS: -* __num__ `Number|String` _(OPTIONAL)_ Optional width number -* __skipListeners__ `Boolean` Skip the 'resize' event trigger - -##### RETURNS: -* `vjs.Component` This component, when setting the width -* `Number|String` The width, when getting - -_inherited from_: [src/js/component.js#L910](https://github.com/videojs/video.js/blob/master/src/js/component.js#L910) - ---- - -## EVENTS - -### resize `EVENT` -> Fired when the width and/or height of the component changes - -_inherited from_: [src/js/component.js#L1020](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1020) - ---- - diff --git a/docs/api/vjs.MediaLoader.md b/docs/api/vjs.MediaLoader.md deleted file mode 100644 index 1b45889beb..0000000000 --- a/docs/api/vjs.MediaLoader.md +++ /dev/null @@ -1,659 +0,0 @@ - - -# vjs.MediaLoader - -__EXTENDS__: [vjs.Component](vjs.Component.md) -__DEFINED IN__: [src/js/media/loader.js#L7](https://github.com/videojs/video.js/blob/master/src/js/media/loader.js#L7) - -The Media Loader is the component that decides which playback technology to load -when the player is initialized. - ---- - -## INDEX - -- [METHODS](#methods) - - [init](#init-player-options-ready-) - - [addChild](#addchild-child-options-) _`inherited`_ - - [addClass](#addclass-classtoadd-) _`inherited`_ - - [buildCSSClass](#buildcssclass) _`inherited`_ - - [children](#children) _`inherited`_ - - [clearInterval](#clearinterval-intervalid-) _`inherited`_ - - [clearTimeout](#cleartimeout-timeoutid-) _`inherited`_ - - [contentEl](#contentel) _`inherited`_ - - [createEl](#createel-tagname-attributes-) _`inherited`_ - - [dimensions](#dimensions-width-height-) _`inherited`_ - - [dispose](#dispose) _`inherited`_ - - [el](#el) _`inherited`_ - - [enableTouchActivity](#enabletouchactivity) _`inherited`_ - - [getChild](#getchild-name-) _`inherited`_ - - [getChildById](#getchildbyid-id-) _`inherited`_ - - [hasClass](#hasclass-classtocheck-) _`inherited`_ - - [height](#height-num-skiplisteners-) _`inherited`_ - - [hide](#hide) _`inherited`_ - - [id](#id) _`inherited`_ - - [initChildren](#initchildren) _`inherited`_ - - [name](#name) _`inherited`_ - - [off](#off-first-second-third-) _`inherited`_ - - [on](#on-first-second-third-) _`inherited`_ - - [one](#one-first-second-third-) _`inherited`_ - - [options](#options-obj-) _`inherited`_ - - [player](#player) _`inherited`_ - - [ready](#ready-fn-) _`inherited`_ - - [removeChild](#removechild-component-) _`inherited`_ - - [removeClass](#removeclass-classtoremove-) _`inherited`_ - - [setInterval](#setinterval-fn-interval-) _`inherited`_ - - [setTimeout](#settimeout-fn-timeout-) _`inherited`_ - - [show](#show) _`inherited`_ - - [trigger](#trigger-event-) _`inherited`_ - - [triggerReady](#triggerready) _`inherited`_ - - [width](#width-num-skiplisteners-) _`inherited`_ - -- [EVENTS](#events) - - [resize](#resize-event) _`inherited`_ - ---- - -## METHODS - -### addChild( child, [options] ) -> Adds a child component inside this component -> -> myComponent.el(); -> // ->
-> myComonent.children(); -> // [empty array] -> -> var myButton = myComponent.addChild('MyButton'); -> // ->
myButton
-> // -> myButton === myComonent.children()[0]; -> -> Pass in options for child constructors and options for children of the child -> -> var myButton = myComponent.addChild('MyButton', { -> text: 'Press Me', -> children: { -> buttonChildExample: { -> buttonChildOption: true -> } -> } -> }); - -##### PARAMETERS: -* __child__ `String|vjs.Component` The class name or instance of a child to add -* __options__ `Object` _(OPTIONAL)_ Options, including options to be passed to children of the child. - -##### RETURNS: -* `vjs.Component` The child component (created by this process if a string was used) - -_inherited from_: [src/js/component.js#L362](https://github.com/videojs/video.js/blob/master/src/js/component.js#L362) - ---- - -### addClass( classToAdd ) -> Add a CSS class name to the component's element - -##### PARAMETERS: -* __classToAdd__ `String` Classname to add - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L826](https://github.com/videojs/video.js/blob/master/src/js/component.js#L826) - ---- - -### buildCSSClass() -> Allows sub components to stack CSS class names - -##### RETURNS: -* `String` The constructed class name - -_inherited from_: [src/js/component.js#L536](https://github.com/videojs/video.js/blob/master/src/js/component.js#L536) - ---- - -### children() -> Get an array of all child components -> -> var kids = myComponent.children(); - -##### RETURNS: -* `Array` The children - -_inherited from_: [src/js/component.js#L296](https://github.com/videojs/video.js/blob/master/src/js/component.js#L296) - ---- - -### clearInterval( intervalId ) -> Clears an interval and removes the associated dispose listener - -##### PARAMETERS: -* __intervalId__ `Number` The id of the interval to clear - -##### RETURNS: -* `Number` Returns the interval ID - -_inherited from_: [src/js/component.js#L1223](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1223) - ---- - -### clearTimeout( timeoutId ) -> Clears a timeout and removes the associated dispose listener - -##### PARAMETERS: -* __timeoutId__ `Number` The id of the timeout to clear - -##### RETURNS: -* `Number` Returns the timeout ID - -_inherited from_: [src/js/component.js#L1185](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1185) - ---- - -### contentEl() -> Return the component's DOM element for embedding content. -> Will either be el_ or a new element defined in createEl. - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L239](https://github.com/videojs/video.js/blob/master/src/js/component.js#L239) - ---- - -### createEl( [tagName], [attributes] ) -> Create the component's DOM element - -##### PARAMETERS: -* __tagName__ `String` _(OPTIONAL)_ Element's node type. e.g. 'div' -* __attributes__ `Object` _(OPTIONAL)_ An object of element attributes that should be set on the element - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L200](https://github.com/videojs/video.js/blob/master/src/js/component.js#L200) - ---- - -### dimensions( width, height ) -> Set both width and height at the same time - -##### PARAMETERS: -* __width__ `Number|String` -* __height__ `Number|String` - -##### RETURNS: -* `vjs.Component` The component - -_inherited from_: [src/js/component.js#L938](https://github.com/videojs/video.js/blob/master/src/js/component.js#L938) - ---- - -### dispose() -> Dispose of the component and all child components - -_inherited from_: [src/js/component.js#L84](https://github.com/videojs/video.js/blob/master/src/js/component.js#L84) - ---- - -### el() -> Get the component's DOM element -> -> var domEl = myComponent.el(); - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L220](https://github.com/videojs/video.js/blob/master/src/js/component.js#L220) - ---- - -### enableTouchActivity() -> Report user touch activity when touch events occur -> -> User activity is used to determine when controls should show/hide. It's -> relatively simple when it comes to mouse events, because any mouse event -> should show the controls. So we capture mouse events that bubble up to the -> player and report activity when that happens. -> -> With touch events it isn't as easy. We can't rely on touch events at the -> player level, because a tap (touchstart + touchend) on the video itself on -> mobile devices is meant to turn controls off (and on). User activity is -> checked asynchronously, so what could happen is a tap event on the video -> turns the controls off, then the touchend event bubbles up to the player, -> which if it reported user activity, would turn the controls right back on. -> (We also don't want to completely block touch events from bubbling up) -> -> Also a touchmove, touch+hold, and anything other than a tap is not supposed -> to turn the controls back on on a mobile device. -> -> Here we're setting the default component behavior to report user activity -> whenever touch events happen, and this can be turned off by components that -> want touch events to act differently. - -_inherited from_: [src/js/component.js#L1124](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1124) - ---- - -### getChild( name ) -> Returns a child component with the provided name - -##### PARAMETERS: -* __name__ - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L330](https://github.com/videojs/video.js/blob/master/src/js/component.js#L330) - ---- - -### getChildById( id ) -> Returns a child component with the provided ID - -##### PARAMETERS: -* __id__ - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L313](https://github.com/videojs/video.js/blob/master/src/js/component.js#L313) - ---- - -### hasClass( classToCheck ) -> Check if a component's element has a CSS class name - -##### PARAMETERS: -* __classToCheck__ `String` Classname to check - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L816](https://github.com/videojs/video.js/blob/master/src/js/component.js#L816) - ---- - -### height( [num], [skipListeners] ) -> Get or set the height of the component (CSS values) -> -> Setting the video tag dimension values only works with values in pixels. -> Percent values will not work. -> Some percents can be used, but width()/height() will return the number + %, -> not the actual computed width/height. - -##### PARAMETERS: -* __num__ `Number|String` _(OPTIONAL)_ New component height -* __skipListeners__ `Boolean` _(OPTIONAL)_ Skip the resize event trigger - -##### RETURNS: -* `vjs.Component` This component, when setting the height -* `Number|String` The height, when getting - -_inherited from_: [src/js/component.js#L927](https://github.com/videojs/video.js/blob/master/src/js/component.js#L927) - ---- - -### hide() -> Hide the component element if currently showing - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L857](https://github.com/videojs/video.js/blob/master/src/js/component.js#L857) - ---- - -### id() -> Get the component's ID -> -> var id = myComponent.id(); - -##### RETURNS: -* `String` - -_inherited from_: [src/js/component.js#L258](https://github.com/videojs/video.js/blob/master/src/js/component.js#L258) - ---- - -### init( player, options, ready ) - -##### PARAMETERS: -* __player__ -* __options__ -* __ready__ - -_defined in_: [src/js/media/loader.js#L9](https://github.com/videojs/video.js/blob/master/src/js/media/loader.js#L9) - ---- - -### initChildren() -> Add and initialize default child components from options -> -> // when an instance of MyComponent is created, all children in options -> // will be added to the instance by their name strings and options -> MyComponent.prototype.options_.children = { -> myChildComponent: { -> myChildOption: true -> } -> } -> -> // Or when creating the component -> var myComp = new MyComponent(player, { -> children: { -> myChildComponent: { -> myChildOption: true -> } -> } -> }); -> -> The children option can also be an Array of child names or -> child options objects (that also include a 'name' key). -> -> var myComp = new MyComponent(player, { -> children: [ -> 'button', -> { -> name: 'button', -> someOtherOption: true -> } -> ] -> }); - -_inherited from_: [src/js/component.js#L481](https://github.com/videojs/video.js/blob/master/src/js/component.js#L481) - ---- - -### name() -> Get the component's name. The name is often used to reference the component. -> -> var name = myComponent.name(); - -##### RETURNS: -* `String` - -_inherited from_: [src/js/component.js#L277](https://github.com/videojs/video.js/blob/master/src/js/component.js#L277) - ---- - -### off( [first], [second], [third] ) -> Remove an event listener from this component's element -> -> myComponent.off('eventType', myFunc); -> -> If myFunc is excluded, ALL listeners for the event type will be removed. -> If eventType is excluded, ALL listeners will be removed from the component. -> -> Alternatively you can use `off` to remove listeners that were added to other -> elements or components using `myComponent.on(otherComponent...`. -> In this case both the event type and listener function are REQUIRED. -> -> myComponent.off(otherElement, 'eventType', myFunc); -> myComponent.off(otherComponent, 'eventType', myFunc); - -##### PARAMETERS: -* __first__ `String|vjs.Component` _(OPTIONAL)_ The event type or other component -* __second__ `Function|String` _(OPTIONAL)_ The listener function or event type -* __third__ `Function` _(OPTIONAL)_ The listener for other component - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L646](https://github.com/videojs/video.js/blob/master/src/js/component.js#L646) - ---- - -### on( first, second, third ) -> Add an event listener to this component's element -> -> var myFunc = function(){ -> var myComponent = this; -> // Do something when the event is fired -> }; -> -> myComponent.on('eventType', myFunc); -> -> The context of myFunc will be myComponent unless previously bound. -> -> Alternatively, you can add a listener to another element or component. -> -> myComponent.on(otherElement, 'eventName', myFunc); -> myComponent.on(otherComponent, 'eventName', myFunc); -> -> The benefit of using this over `vjs.on(otherElement, 'eventName', myFunc)` -> and `otherComponent.on('eventName', myFunc)` is that this way the listeners -> will be automatically cleaned up when either component is disposed. -> It will also bind myComponent as the context of myFunc. -> -> **NOTE**: When using this on elements in the page other than window -> and document (both permanent), if you remove the element from the DOM -> you need to call `vjs.trigger(el, 'dispose')` on it to clean up -> references to it and allow the browser to garbage collect it. - -##### PARAMETERS: -* __first__ `String|vjs.Component` The event type or other component -* __second__ `Function|String` The event handler or event type -* __third__ `Function` The event handler - -##### RETURNS: -* `vjs.Component` self - -_inherited from_: [src/js/component.js#L577](https://github.com/videojs/video.js/blob/master/src/js/component.js#L577) - ---- - -### one( first, second, [third] ) -> Add an event listener to be triggered only once and then removed -> -> myComponent.one('eventName', myFunc); -> -> Alternatively you can add a listener to another element or component -> that will be triggered only once. -> -> myComponent.one(otherElement, 'eventName', myFunc); -> myComponent.one(otherComponent, 'eventName', myFunc); - -##### PARAMETERS: -* __first__ `String|vjs.Component` The event type or other component -* __second__ `Function|String` The listener function or event type -* __third__ `Function` _(OPTIONAL)_ The listener function for other component - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L691](https://github.com/videojs/video.js/blob/master/src/js/component.js#L691) - ---- - -### options( obj ) -> Deep merge of options objects -> -> Whenever a property is an object on both options objects -> the two properties will be merged using vjs.obj.deepMerge. -> -> This is used for merging options for child components. We -> want it to be easy to override individual options on a child -> component without having to rewrite all the other default options. -> -> Parent.prototype.options_ = { -> children: { -> 'childOne': { 'foo': 'bar', 'asdf': 'fdsa' }, -> 'childTwo': {}, -> 'childThree': {} -> } -> } -> newOptions = { -> children: { -> 'childOne': { 'foo': 'baz', 'abc': '123' } -> 'childTwo': null, -> 'childFour': {} -> } -> } -> -> this.options(newOptions); -> -> RESULT -> -> { -> children: { -> 'childOne': { 'foo': 'baz', 'asdf': 'fdsa', 'abc': '123' }, -> 'childTwo': null, // Disabled. Won't be initialized. -> 'childThree': {}, -> 'childFour': {} -> } -> } - -##### PARAMETERS: -* __obj__ `Object` Object of new option values - -##### RETURNS: -* `Object` A NEW object of this.options_ and obj merged - -_inherited from_: [src/js/component.js#L179](https://github.com/videojs/video.js/blob/master/src/js/component.js#L179) - ---- - -### player() -> Return the component's player - -##### RETURNS: -* `vjs.Player` - -_inherited from_: [src/js/component.js#L126](https://github.com/videojs/video.js/blob/master/src/js/component.js#L126) - ---- - -### ready( fn ) -> Bind a listener to the component's ready state -> -> Different from event listeners in that if the ready event has already happened -> it will trigger the function immediately. - -##### PARAMETERS: -* __fn__ `Function` Ready listener - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L769](https://github.com/videojs/video.js/blob/master/src/js/component.js#L769) - ---- - -### removeChild( component ) -> Remove a child component from this component's list of children, and the -> child component's element from this component's element - -##### PARAMETERS: -* __component__ `vjs.Component` Component to remove - -_inherited from_: [src/js/component.js#L420](https://github.com/videojs/video.js/blob/master/src/js/component.js#L420) - ---- - -### removeClass( classToRemove ) -> Remove a CSS class name from the component's element - -##### PARAMETERS: -* __classToRemove__ `String` Classname to remove - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L837](https://github.com/videojs/video.js/blob/master/src/js/component.js#L837) - ---- - -### setInterval( fn, interval ) -> Creates an interval and sets up disposal automatically. - -##### PARAMETERS: -* __fn__ `Function` The function to run every N seconds. -* __interval__ `Number` Number of ms to delay before executing specified function. - -##### RETURNS: -* `Number` Returns the interval ID - -_inherited from_: [src/js/component.js#L1202](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1202) - ---- - -### setTimeout( fn, timeout ) -> Creates timeout and sets up disposal automatically. - -##### PARAMETERS: -* __fn__ `Function` The function to run after the timeout. -* __timeout__ `Number` Number of ms to delay before executing specified function. - -##### RETURNS: -* `Number` Returns the timeout ID - -_inherited from_: [src/js/component.js#L1162](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1162) - ---- - -### show() -> Show the component element if hidden - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L847](https://github.com/videojs/video.js/blob/master/src/js/component.js#L847) - ---- - -### trigger( event ) -> Trigger an event on an element -> -> myComponent.trigger('eventName'); -> myComponent.trigger({'type':'eventName'}); - -##### PARAMETERS: -* __event__ `Event|Object|String` A string (the type) or an event object with a type attribute - -##### RETURNS: -* `vjs.Component` self - -_inherited from_: [src/js/component.js#L724](https://github.com/videojs/video.js/blob/master/src/js/component.js#L724) - ---- - -### triggerReady() -> Trigger the ready listeners - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L788](https://github.com/videojs/video.js/blob/master/src/js/component.js#L788) - ---- - -### width( [num], skipListeners ) -> Set or get the width of the component (CSS values) -> -> Setting the video tag dimension values only works with values in pixels. -> Percent values will not work. -> Some percents can be used, but width()/height() will return the number + %, -> not the actual computed width/height. - -##### PARAMETERS: -* __num__ `Number|String` _(OPTIONAL)_ Optional width number -* __skipListeners__ `Boolean` Skip the 'resize' event trigger - -##### RETURNS: -* `vjs.Component` This component, when setting the width -* `Number|String` The width, when getting - -_inherited from_: [src/js/component.js#L910](https://github.com/videojs/video.js/blob/master/src/js/component.js#L910) - ---- - -## EVENTS - -### resize `EVENT` -> Fired when the width and/or height of the component changes - -_inherited from_: [src/js/component.js#L1020](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1020) - ---- - diff --git a/docs/api/vjs.MediaTechController.md b/docs/api/vjs.MediaTechController.md deleted file mode 100644 index 78c8f4a9a9..0000000000 --- a/docs/api/vjs.MediaTechController.md +++ /dev/null @@ -1,33 +0,0 @@ - - -# vjs.MediaTechController - -__DEFINED IN__: [src/js/media/media.js#L14](https://github.com/videojs/video.js/blob/master/src/js/media/media.js#L14) - -Base class for media (HTML5 Video, Flash) controllers - ---- - -## INDEX - -- [METHODS](#methods) - - [withSourceHandlers](#withsourcehandlers-tech--static) - ---- - -## METHODS - -### withSourceHandlers( Tech ) `STATIC` -> A functional mixin for techs that want to use the Source Handler pattern. -> -> ##### EXAMPLE: -> -> videojs.MediaTechController.withSourceHandlers.call(MyTech); - -##### PARAMETERS: -* __Tech__ - -_defined in_: [src/js/media/media.js#L428](https://github.com/videojs/video.js/blob/master/src/js/media/media.js#L428) - ---- - diff --git a/docs/api/vjs.Menu.md b/docs/api/vjs.Menu.md deleted file mode 100644 index 690b226159..0000000000 --- a/docs/api/vjs.Menu.md +++ /dev/null @@ -1,668 +0,0 @@ - - -# vjs.Menu - -__EXTENDS__: [vjs.Component](vjs.Component.md) -__DEFINED IN__: [src/js/menu.js#L12](https://github.com/videojs/video.js/blob/master/src/js/menu.js#L12) - -The Menu component is used to build pop up menus, including subtitle and -captions selection menus. - ---- - -## INDEX - -- [METHODS](#methods) - - [addItem](#additem-component-) - - [createEl](#createel-tagname-attributes-) - - [addChild](#addchild-child-options-) _`inherited`_ - - [addClass](#addclass-classtoadd-) _`inherited`_ - - [buildCSSClass](#buildcssclass) _`inherited`_ - - [children](#children) _`inherited`_ - - [clearInterval](#clearinterval-intervalid-) _`inherited`_ - - [clearTimeout](#cleartimeout-timeoutid-) _`inherited`_ - - [contentEl](#contentel) _`inherited`_ - - [dimensions](#dimensions-width-height-) _`inherited`_ - - [dispose](#dispose) _`inherited`_ - - [el](#el) _`inherited`_ - - [enableTouchActivity](#enabletouchactivity) _`inherited`_ - - [getChild](#getchild-name-) _`inherited`_ - - [getChildById](#getchildbyid-id-) _`inherited`_ - - [hasClass](#hasclass-classtocheck-) _`inherited`_ - - [height](#height-num-skiplisteners-) _`inherited`_ - - [hide](#hide) _`inherited`_ - - [id](#id) _`inherited`_ - - [init](#init-player-options-ready-) _`inherited`_ - - [initChildren](#initchildren) _`inherited`_ - - [name](#name) _`inherited`_ - - [off](#off-first-second-third-) _`inherited`_ - - [on](#on-first-second-third-) _`inherited`_ - - [one](#one-first-second-third-) _`inherited`_ - - [options](#options-obj-) _`inherited`_ - - [player](#player) _`inherited`_ - - [ready](#ready-fn-) _`inherited`_ - - [removeChild](#removechild-component-) _`inherited`_ - - [removeClass](#removeclass-classtoremove-) _`inherited`_ - - [setInterval](#setinterval-fn-interval-) _`inherited`_ - - [setTimeout](#settimeout-fn-timeout-) _`inherited`_ - - [show](#show) _`inherited`_ - - [trigger](#trigger-event-) _`inherited`_ - - [triggerReady](#triggerready) _`inherited`_ - - [width](#width-num-skiplisteners-) _`inherited`_ - -- [EVENTS](#events) - - [resize](#resize-event) _`inherited`_ - ---- - -## METHODS - -### addChild( child, [options] ) -> Adds a child component inside this component -> -> myComponent.el(); -> // ->
-> myComonent.children(); -> // [empty array] -> -> var myButton = myComponent.addChild('MyButton'); -> // ->
myButton
-> // -> myButton === myComonent.children()[0]; -> -> Pass in options for child constructors and options for children of the child -> -> var myButton = myComponent.addChild('MyButton', { -> text: 'Press Me', -> children: { -> buttonChildExample: { -> buttonChildOption: true -> } -> } -> }); - -##### PARAMETERS: -* __child__ `String|vjs.Component` The class name or instance of a child to add -* __options__ `Object` _(OPTIONAL)_ Options, including options to be passed to children of the child. - -##### RETURNS: -* `vjs.Component` The child component (created by this process if a string was used) - -_inherited from_: [src/js/component.js#L362](https://github.com/videojs/video.js/blob/master/src/js/component.js#L362) - ---- - -### addClass( classToAdd ) -> Add a CSS class name to the component's element - -##### PARAMETERS: -* __classToAdd__ `String` Classname to add - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L826](https://github.com/videojs/video.js/blob/master/src/js/component.js#L826) - ---- - -### addItem( component ) -> Add a menu item to the menu - -##### PARAMETERS: -* __component__ `Object|String` Component or component type to add - -_defined in_: [src/js/menu.js#L18](https://github.com/videojs/video.js/blob/master/src/js/menu.js#L18) - ---- - -### buildCSSClass() -> Allows sub components to stack CSS class names - -##### RETURNS: -* `String` The constructed class name - -_inherited from_: [src/js/component.js#L536](https://github.com/videojs/video.js/blob/master/src/js/component.js#L536) - ---- - -### children() -> Get an array of all child components -> -> var kids = myComponent.children(); - -##### RETURNS: -* `Array` The children - -_inherited from_: [src/js/component.js#L296](https://github.com/videojs/video.js/blob/master/src/js/component.js#L296) - ---- - -### clearInterval( intervalId ) -> Clears an interval and removes the associated dispose listener - -##### PARAMETERS: -* __intervalId__ `Number` The id of the interval to clear - -##### RETURNS: -* `Number` Returns the interval ID - -_inherited from_: [src/js/component.js#L1223](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1223) - ---- - -### clearTimeout( timeoutId ) -> Clears a timeout and removes the associated dispose listener - -##### PARAMETERS: -* __timeoutId__ `Number` The id of the timeout to clear - -##### RETURNS: -* `Number` Returns the timeout ID - -_inherited from_: [src/js/component.js#L1185](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1185) - ---- - -### contentEl() -> Return the component's DOM element for embedding content. -> Will either be el_ or a new element defined in createEl. - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L239](https://github.com/videojs/video.js/blob/master/src/js/component.js#L239) - ---- - -### createEl( [tagName], [attributes] ) -> Create the component's DOM element - -##### PARAMETERS: -* __tagName__ `String` _(OPTIONAL)_ Element's node type. e.g. 'div' -* __attributes__ `Object` _(OPTIONAL)_ An object of element attributes that should be set on the element - -_defined in_: [src/js/menu.js#L26](https://github.com/videojs/video.js/blob/master/src/js/menu.js#L26) - ---- - -### dimensions( width, height ) -> Set both width and height at the same time - -##### PARAMETERS: -* __width__ `Number|String` -* __height__ `Number|String` - -##### RETURNS: -* `vjs.Component` The component - -_inherited from_: [src/js/component.js#L938](https://github.com/videojs/video.js/blob/master/src/js/component.js#L938) - ---- - -### dispose() -> Dispose of the component and all child components - -_inherited from_: [src/js/component.js#L84](https://github.com/videojs/video.js/blob/master/src/js/component.js#L84) - ---- - -### el() -> Get the component's DOM element -> -> var domEl = myComponent.el(); - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L220](https://github.com/videojs/video.js/blob/master/src/js/component.js#L220) - ---- - -### enableTouchActivity() -> Report user touch activity when touch events occur -> -> User activity is used to determine when controls should show/hide. It's -> relatively simple when it comes to mouse events, because any mouse event -> should show the controls. So we capture mouse events that bubble up to the -> player and report activity when that happens. -> -> With touch events it isn't as easy. We can't rely on touch events at the -> player level, because a tap (touchstart + touchend) on the video itself on -> mobile devices is meant to turn controls off (and on). User activity is -> checked asynchronously, so what could happen is a tap event on the video -> turns the controls off, then the touchend event bubbles up to the player, -> which if it reported user activity, would turn the controls right back on. -> (We also don't want to completely block touch events from bubbling up) -> -> Also a touchmove, touch+hold, and anything other than a tap is not supposed -> to turn the controls back on on a mobile device. -> -> Here we're setting the default component behavior to report user activity -> whenever touch events happen, and this can be turned off by components that -> want touch events to act differently. - -_inherited from_: [src/js/component.js#L1124](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1124) - ---- - -### getChild( name ) -> Returns a child component with the provided name - -##### PARAMETERS: -* __name__ - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L330](https://github.com/videojs/video.js/blob/master/src/js/component.js#L330) - ---- - -### getChildById( id ) -> Returns a child component with the provided ID - -##### PARAMETERS: -* __id__ - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L313](https://github.com/videojs/video.js/blob/master/src/js/component.js#L313) - ---- - -### hasClass( classToCheck ) -> Check if a component's element has a CSS class name - -##### PARAMETERS: -* __classToCheck__ `String` Classname to check - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L816](https://github.com/videojs/video.js/blob/master/src/js/component.js#L816) - ---- - -### height( [num], [skipListeners] ) -> Get or set the height of the component (CSS values) -> -> Setting the video tag dimension values only works with values in pixels. -> Percent values will not work. -> Some percents can be used, but width()/height() will return the number + %, -> not the actual computed width/height. - -##### PARAMETERS: -* __num__ `Number|String` _(OPTIONAL)_ New component height -* __skipListeners__ `Boolean` _(OPTIONAL)_ Skip the resize event trigger - -##### RETURNS: -* `vjs.Component` This component, when setting the height -* `Number|String` The height, when getting - -_inherited from_: [src/js/component.js#L927](https://github.com/videojs/video.js/blob/master/src/js/component.js#L927) - ---- - -### hide() -> Hide the component element if currently showing - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L857](https://github.com/videojs/video.js/blob/master/src/js/component.js#L857) - ---- - -### id() -> Get the component's ID -> -> var id = myComponent.id(); - -##### RETURNS: -* `String` - -_inherited from_: [src/js/component.js#L258](https://github.com/videojs/video.js/blob/master/src/js/component.js#L258) - ---- - -### init( player, options, ready ) -> the constructor function for the class - -##### PARAMETERS: -* __player__ -* __options__ -* __ready__ - -_inherited from_: [src/js/component.js#L41](https://github.com/videojs/video.js/blob/master/src/js/component.js#L41) - ---- - -### initChildren() -> Add and initialize default child components from options -> -> // when an instance of MyComponent is created, all children in options -> // will be added to the instance by their name strings and options -> MyComponent.prototype.options_.children = { -> myChildComponent: { -> myChildOption: true -> } -> } -> -> // Or when creating the component -> var myComp = new MyComponent(player, { -> children: { -> myChildComponent: { -> myChildOption: true -> } -> } -> }); -> -> The children option can also be an Array of child names or -> child options objects (that also include a 'name' key). -> -> var myComp = new MyComponent(player, { -> children: [ -> 'button', -> { -> name: 'button', -> someOtherOption: true -> } -> ] -> }); - -_inherited from_: [src/js/component.js#L481](https://github.com/videojs/video.js/blob/master/src/js/component.js#L481) - ---- - -### name() -> Get the component's name. The name is often used to reference the component. -> -> var name = myComponent.name(); - -##### RETURNS: -* `String` - -_inherited from_: [src/js/component.js#L277](https://github.com/videojs/video.js/blob/master/src/js/component.js#L277) - ---- - -### off( [first], [second], [third] ) -> Remove an event listener from this component's element -> -> myComponent.off('eventType', myFunc); -> -> If myFunc is excluded, ALL listeners for the event type will be removed. -> If eventType is excluded, ALL listeners will be removed from the component. -> -> Alternatively you can use `off` to remove listeners that were added to other -> elements or components using `myComponent.on(otherComponent...`. -> In this case both the event type and listener function are REQUIRED. -> -> myComponent.off(otherElement, 'eventType', myFunc); -> myComponent.off(otherComponent, 'eventType', myFunc); - -##### PARAMETERS: -* __first__ `String|vjs.Component` _(OPTIONAL)_ The event type or other component -* __second__ `Function|String` _(OPTIONAL)_ The listener function or event type -* __third__ `Function` _(OPTIONAL)_ The listener for other component - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L646](https://github.com/videojs/video.js/blob/master/src/js/component.js#L646) - ---- - -### on( first, second, third ) -> Add an event listener to this component's element -> -> var myFunc = function(){ -> var myComponent = this; -> // Do something when the event is fired -> }; -> -> myComponent.on('eventType', myFunc); -> -> The context of myFunc will be myComponent unless previously bound. -> -> Alternatively, you can add a listener to another element or component. -> -> myComponent.on(otherElement, 'eventName', myFunc); -> myComponent.on(otherComponent, 'eventName', myFunc); -> -> The benefit of using this over `vjs.on(otherElement, 'eventName', myFunc)` -> and `otherComponent.on('eventName', myFunc)` is that this way the listeners -> will be automatically cleaned up when either component is disposed. -> It will also bind myComponent as the context of myFunc. -> -> **NOTE**: When using this on elements in the page other than window -> and document (both permanent), if you remove the element from the DOM -> you need to call `vjs.trigger(el, 'dispose')` on it to clean up -> references to it and allow the browser to garbage collect it. - -##### PARAMETERS: -* __first__ `String|vjs.Component` The event type or other component -* __second__ `Function|String` The event handler or event type -* __third__ `Function` The event handler - -##### RETURNS: -* `vjs.Component` self - -_inherited from_: [src/js/component.js#L577](https://github.com/videojs/video.js/blob/master/src/js/component.js#L577) - ---- - -### one( first, second, [third] ) -> Add an event listener to be triggered only once and then removed -> -> myComponent.one('eventName', myFunc); -> -> Alternatively you can add a listener to another element or component -> that will be triggered only once. -> -> myComponent.one(otherElement, 'eventName', myFunc); -> myComponent.one(otherComponent, 'eventName', myFunc); - -##### PARAMETERS: -* __first__ `String|vjs.Component` The event type or other component -* __second__ `Function|String` The listener function or event type -* __third__ `Function` _(OPTIONAL)_ The listener function for other component - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L691](https://github.com/videojs/video.js/blob/master/src/js/component.js#L691) - ---- - -### options( obj ) -> Deep merge of options objects -> -> Whenever a property is an object on both options objects -> the two properties will be merged using vjs.obj.deepMerge. -> -> This is used for merging options for child components. We -> want it to be easy to override individual options on a child -> component without having to rewrite all the other default options. -> -> Parent.prototype.options_ = { -> children: { -> 'childOne': { 'foo': 'bar', 'asdf': 'fdsa' }, -> 'childTwo': {}, -> 'childThree': {} -> } -> } -> newOptions = { -> children: { -> 'childOne': { 'foo': 'baz', 'abc': '123' } -> 'childTwo': null, -> 'childFour': {} -> } -> } -> -> this.options(newOptions); -> -> RESULT -> -> { -> children: { -> 'childOne': { 'foo': 'baz', 'asdf': 'fdsa', 'abc': '123' }, -> 'childTwo': null, // Disabled. Won't be initialized. -> 'childThree': {}, -> 'childFour': {} -> } -> } - -##### PARAMETERS: -* __obj__ `Object` Object of new option values - -##### RETURNS: -* `Object` A NEW object of this.options_ and obj merged - -_inherited from_: [src/js/component.js#L179](https://github.com/videojs/video.js/blob/master/src/js/component.js#L179) - ---- - -### player() -> Return the component's player - -##### RETURNS: -* `vjs.Player` - -_inherited from_: [src/js/component.js#L126](https://github.com/videojs/video.js/blob/master/src/js/component.js#L126) - ---- - -### ready( fn ) -> Bind a listener to the component's ready state -> -> Different from event listeners in that if the ready event has already happened -> it will trigger the function immediately. - -##### PARAMETERS: -* __fn__ `Function` Ready listener - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L769](https://github.com/videojs/video.js/blob/master/src/js/component.js#L769) - ---- - -### removeChild( component ) -> Remove a child component from this component's list of children, and the -> child component's element from this component's element - -##### PARAMETERS: -* __component__ `vjs.Component` Component to remove - -_inherited from_: [src/js/component.js#L420](https://github.com/videojs/video.js/blob/master/src/js/component.js#L420) - ---- - -### removeClass( classToRemove ) -> Remove a CSS class name from the component's element - -##### PARAMETERS: -* __classToRemove__ `String` Classname to remove - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L837](https://github.com/videojs/video.js/blob/master/src/js/component.js#L837) - ---- - -### setInterval( fn, interval ) -> Creates an interval and sets up disposal automatically. - -##### PARAMETERS: -* __fn__ `Function` The function to run every N seconds. -* __interval__ `Number` Number of ms to delay before executing specified function. - -##### RETURNS: -* `Number` Returns the interval ID - -_inherited from_: [src/js/component.js#L1202](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1202) - ---- - -### setTimeout( fn, timeout ) -> Creates timeout and sets up disposal automatically. - -##### PARAMETERS: -* __fn__ `Function` The function to run after the timeout. -* __timeout__ `Number` Number of ms to delay before executing specified function. - -##### RETURNS: -* `Number` Returns the timeout ID - -_inherited from_: [src/js/component.js#L1162](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1162) - ---- - -### show() -> Show the component element if hidden - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L847](https://github.com/videojs/video.js/blob/master/src/js/component.js#L847) - ---- - -### trigger( event ) -> Trigger an event on an element -> -> myComponent.trigger('eventName'); -> myComponent.trigger({'type':'eventName'}); - -##### PARAMETERS: -* __event__ `Event|Object|String` A string (the type) or an event object with a type attribute - -##### RETURNS: -* `vjs.Component` self - -_inherited from_: [src/js/component.js#L724](https://github.com/videojs/video.js/blob/master/src/js/component.js#L724) - ---- - -### triggerReady() -> Trigger the ready listeners - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L788](https://github.com/videojs/video.js/blob/master/src/js/component.js#L788) - ---- - -### width( [num], skipListeners ) -> Set or get the width of the component (CSS values) -> -> Setting the video tag dimension values only works with values in pixels. -> Percent values will not work. -> Some percents can be used, but width()/height() will return the number + %, -> not the actual computed width/height. - -##### PARAMETERS: -* __num__ `Number|String` _(OPTIONAL)_ Optional width number -* __skipListeners__ `Boolean` Skip the 'resize' event trigger - -##### RETURNS: -* `vjs.Component` This component, when setting the width -* `Number|String` The width, when getting - -_inherited from_: [src/js/component.js#L910](https://github.com/videojs/video.js/blob/master/src/js/component.js#L910) - ---- - -## EVENTS - -### resize `EVENT` -> Fired when the width and/or height of the component changes - -_inherited from_: [src/js/component.js#L1020](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1020) - ---- - diff --git a/docs/api/vjs.MenuButton.md b/docs/api/vjs.MenuButton.md deleted file mode 100644 index 26f89a09e7..0000000000 --- a/docs/api/vjs.MenuButton.md +++ /dev/null @@ -1,662 +0,0 @@ - - -# vjs.MenuButton - -__EXTENDS__: [vjs.Button](vjs.Button.md) -__DEFINED IN__: [src/js/menu.js#L99](https://github.com/videojs/video.js/blob/master/src/js/menu.js#L99) - -A button class with a popup menu - ---- - -## INDEX - -- [METHODS](#methods) - - [buildCSSClass](#buildcssclass) - - [createItems](#createitems) - - [init](#init-player-options-) - - [addChild](#addchild-child-options-) _`inherited`_ - - [addClass](#addclass-classtoadd-) _`inherited`_ - - [children](#children) _`inherited`_ - - [clearInterval](#clearinterval-intervalid-) _`inherited`_ - - [clearTimeout](#cleartimeout-timeoutid-) _`inherited`_ - - [contentEl](#contentel) _`inherited`_ - - [createEl](#createel-tagname-attributes-) _`inherited`_ - - [dimensions](#dimensions-width-height-) _`inherited`_ - - [dispose](#dispose) _`inherited`_ - - [el](#el) _`inherited`_ - - [enableTouchActivity](#enabletouchactivity) _`inherited`_ - - [getChild](#getchild-name-) _`inherited`_ - - [getChildById](#getchildbyid-id-) _`inherited`_ - - [hasClass](#hasclass-classtocheck-) _`inherited`_ - - [height](#height-num-skiplisteners-) _`inherited`_ - - [hide](#hide) _`inherited`_ - - [id](#id) _`inherited`_ - - [initChildren](#initchildren) _`inherited`_ - - [name](#name) _`inherited`_ - - [off](#off-first-second-third-) _`inherited`_ - - [on](#on-first-second-third-) _`inherited`_ - - [one](#one-first-second-third-) _`inherited`_ - - [options](#options-obj-) _`inherited`_ - - [player](#player) _`inherited`_ - - [ready](#ready-fn-) _`inherited`_ - - [removeChild](#removechild-component-) _`inherited`_ - - [removeClass](#removeclass-classtoremove-) _`inherited`_ - - [setInterval](#setinterval-fn-interval-) _`inherited`_ - - [setTimeout](#settimeout-fn-timeout-) _`inherited`_ - - [show](#show) _`inherited`_ - - [trigger](#trigger-event-) _`inherited`_ - - [triggerReady](#triggerready) _`inherited`_ - - [width](#width-num-skiplisteners-) _`inherited`_ - -- [EVENTS](#events) - - [resize](#resize-event) _`inherited`_ - ---- - -## METHODS - -### addChild( child, [options] ) -> Adds a child component inside this component -> -> myComponent.el(); -> // ->
-> myComonent.children(); -> // [empty array] -> -> var myButton = myComponent.addChild('MyButton'); -> // ->
myButton
-> // -> myButton === myComonent.children()[0]; -> -> Pass in options for child constructors and options for children of the child -> -> var myButton = myComponent.addChild('MyButton', { -> text: 'Press Me', -> children: { -> buttonChildExample: { -> buttonChildOption: true -> } -> } -> }); - -##### PARAMETERS: -* __child__ `String|vjs.Component` The class name or instance of a child to add -* __options__ `Object` _(OPTIONAL)_ Options, including options to be passed to children of the child. - -##### RETURNS: -* `vjs.Component` The child component (created by this process if a string was used) - -_inherited from_: [src/js/component.js#L362](https://github.com/videojs/video.js/blob/master/src/js/component.js#L362) - ---- - -### addClass( classToAdd ) -> Add a CSS class name to the component's element - -##### PARAMETERS: -* __classToAdd__ `String` Classname to add - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L826](https://github.com/videojs/video.js/blob/master/src/js/component.js#L826) - ---- - -### buildCSSClass() -> Allows sub components to stack CSS class names - -_defined in_: [src/js/menu.js#L166](https://github.com/videojs/video.js/blob/master/src/js/menu.js#L166) - ---- - -### children() -> Get an array of all child components -> -> var kids = myComponent.children(); - -##### RETURNS: -* `Array` The children - -_inherited from_: [src/js/component.js#L296](https://github.com/videojs/video.js/blob/master/src/js/component.js#L296) - ---- - -### clearInterval( intervalId ) -> Clears an interval and removes the associated dispose listener - -##### PARAMETERS: -* __intervalId__ `Number` The id of the interval to clear - -##### RETURNS: -* `Number` Returns the interval ID - -_inherited from_: [src/js/component.js#L1223](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1223) - ---- - -### clearTimeout( timeoutId ) -> Clears a timeout and removes the associated dispose listener - -##### PARAMETERS: -* __timeoutId__ `Number` The id of the timeout to clear - -##### RETURNS: -* `Number` Returns the timeout ID - -_inherited from_: [src/js/component.js#L1185](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1185) - ---- - -### contentEl() -> Return the component's DOM element for embedding content. -> Will either be el_ or a new element defined in createEl. - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L239](https://github.com/videojs/video.js/blob/master/src/js/component.js#L239) - ---- - -### createEl( [tagName], [attributes] ) -> Create the component's DOM element - -##### PARAMETERS: -* __tagName__ `String` _(OPTIONAL)_ Element's node type. e.g. 'div' -* __attributes__ `Object` _(OPTIONAL)_ An object of element attributes that should be set on the element - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L200](https://github.com/videojs/video.js/blob/master/src/js/component.js#L200) - ---- - -### createItems() -> Create the list of menu items. Specific to each subclass. - -_defined in_: [src/js/menu.js#L163](https://github.com/videojs/video.js/blob/master/src/js/menu.js#L163) - ---- - -### dimensions( width, height ) -> Set both width and height at the same time - -##### PARAMETERS: -* __width__ `Number|String` -* __height__ `Number|String` - -##### RETURNS: -* `vjs.Component` The component - -_inherited from_: [src/js/component.js#L938](https://github.com/videojs/video.js/blob/master/src/js/component.js#L938) - ---- - -### dispose() -> Dispose of the component and all child components - -_inherited from_: [src/js/component.js#L84](https://github.com/videojs/video.js/blob/master/src/js/component.js#L84) - ---- - -### el() -> Get the component's DOM element -> -> var domEl = myComponent.el(); - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L220](https://github.com/videojs/video.js/blob/master/src/js/component.js#L220) - ---- - -### enableTouchActivity() -> Report user touch activity when touch events occur -> -> User activity is used to determine when controls should show/hide. It's -> relatively simple when it comes to mouse events, because any mouse event -> should show the controls. So we capture mouse events that bubble up to the -> player and report activity when that happens. -> -> With touch events it isn't as easy. We can't rely on touch events at the -> player level, because a tap (touchstart + touchend) on the video itself on -> mobile devices is meant to turn controls off (and on). User activity is -> checked asynchronously, so what could happen is a tap event on the video -> turns the controls off, then the touchend event bubbles up to the player, -> which if it reported user activity, would turn the controls right back on. -> (We also don't want to completely block touch events from bubbling up) -> -> Also a touchmove, touch+hold, and anything other than a tap is not supposed -> to turn the controls back on on a mobile device. -> -> Here we're setting the default component behavior to report user activity -> whenever touch events happen, and this can be turned off by components that -> want touch events to act differently. - -_inherited from_: [src/js/component.js#L1124](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1124) - ---- - -### getChild( name ) -> Returns a child component with the provided name - -##### PARAMETERS: -* __name__ - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L330](https://github.com/videojs/video.js/blob/master/src/js/component.js#L330) - ---- - -### getChildById( id ) -> Returns a child component with the provided ID - -##### PARAMETERS: -* __id__ - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L313](https://github.com/videojs/video.js/blob/master/src/js/component.js#L313) - ---- - -### hasClass( classToCheck ) -> Check if a component's element has a CSS class name - -##### PARAMETERS: -* __classToCheck__ `String` Classname to check - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L816](https://github.com/videojs/video.js/blob/master/src/js/component.js#L816) - ---- - -### height( [num], [skipListeners] ) -> Get or set the height of the component (CSS values) -> -> Setting the video tag dimension values only works with values in pixels. -> Percent values will not work. -> Some percents can be used, but width()/height() will return the number + %, -> not the actual computed width/height. - -##### PARAMETERS: -* __num__ `Number|String` _(OPTIONAL)_ New component height -* __skipListeners__ `Boolean` _(OPTIONAL)_ Skip the resize event trigger - -##### RETURNS: -* `vjs.Component` This component, when setting the height -* `Number|String` The height, when getting - -_inherited from_: [src/js/component.js#L927](https://github.com/videojs/video.js/blob/master/src/js/component.js#L927) - ---- - -### hide() -> Hide the component element if currently showing - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L857](https://github.com/videojs/video.js/blob/master/src/js/component.js#L857) - ---- - -### id() -> Get the component's ID -> -> var id = myComponent.id(); - -##### RETURNS: -* `String` - -_inherited from_: [src/js/component.js#L258](https://github.com/videojs/video.js/blob/master/src/js/component.js#L258) - ---- - -### init( player, options ) - -##### PARAMETERS: -* __player__ -* __options__ - -_defined in_: [src/js/menu.js#L101](https://github.com/videojs/video.js/blob/master/src/js/menu.js#L101) - ---- - -### initChildren() -> Add and initialize default child components from options -> -> // when an instance of MyComponent is created, all children in options -> // will be added to the instance by their name strings and options -> MyComponent.prototype.options_.children = { -> myChildComponent: { -> myChildOption: true -> } -> } -> -> // Or when creating the component -> var myComp = new MyComponent(player, { -> children: { -> myChildComponent: { -> myChildOption: true -> } -> } -> }); -> -> The children option can also be an Array of child names or -> child options objects (that also include a 'name' key). -> -> var myComp = new MyComponent(player, { -> children: [ -> 'button', -> { -> name: 'button', -> someOtherOption: true -> } -> ] -> }); - -_inherited from_: [src/js/component.js#L481](https://github.com/videojs/video.js/blob/master/src/js/component.js#L481) - ---- - -### name() -> Get the component's name. The name is often used to reference the component. -> -> var name = myComponent.name(); - -##### RETURNS: -* `String` - -_inherited from_: [src/js/component.js#L277](https://github.com/videojs/video.js/blob/master/src/js/component.js#L277) - ---- - -### off( [first], [second], [third] ) -> Remove an event listener from this component's element -> -> myComponent.off('eventType', myFunc); -> -> If myFunc is excluded, ALL listeners for the event type will be removed. -> If eventType is excluded, ALL listeners will be removed from the component. -> -> Alternatively you can use `off` to remove listeners that were added to other -> elements or components using `myComponent.on(otherComponent...`. -> In this case both the event type and listener function are REQUIRED. -> -> myComponent.off(otherElement, 'eventType', myFunc); -> myComponent.off(otherComponent, 'eventType', myFunc); - -##### PARAMETERS: -* __first__ `String|vjs.Component` _(OPTIONAL)_ The event type or other component -* __second__ `Function|String` _(OPTIONAL)_ The listener function or event type -* __third__ `Function` _(OPTIONAL)_ The listener for other component - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L646](https://github.com/videojs/video.js/blob/master/src/js/component.js#L646) - ---- - -### on( first, second, third ) -> Add an event listener to this component's element -> -> var myFunc = function(){ -> var myComponent = this; -> // Do something when the event is fired -> }; -> -> myComponent.on('eventType', myFunc); -> -> The context of myFunc will be myComponent unless previously bound. -> -> Alternatively, you can add a listener to another element or component. -> -> myComponent.on(otherElement, 'eventName', myFunc); -> myComponent.on(otherComponent, 'eventName', myFunc); -> -> The benefit of using this over `vjs.on(otherElement, 'eventName', myFunc)` -> and `otherComponent.on('eventName', myFunc)` is that this way the listeners -> will be automatically cleaned up when either component is disposed. -> It will also bind myComponent as the context of myFunc. -> -> **NOTE**: When using this on elements in the page other than window -> and document (both permanent), if you remove the element from the DOM -> you need to call `vjs.trigger(el, 'dispose')` on it to clean up -> references to it and allow the browser to garbage collect it. - -##### PARAMETERS: -* __first__ `String|vjs.Component` The event type or other component -* __second__ `Function|String` The event handler or event type -* __third__ `Function` The event handler - -##### RETURNS: -* `vjs.Component` self - -_inherited from_: [src/js/component.js#L577](https://github.com/videojs/video.js/blob/master/src/js/component.js#L577) - ---- - -### one( first, second, [third] ) -> Add an event listener to be triggered only once and then removed -> -> myComponent.one('eventName', myFunc); -> -> Alternatively you can add a listener to another element or component -> that will be triggered only once. -> -> myComponent.one(otherElement, 'eventName', myFunc); -> myComponent.one(otherComponent, 'eventName', myFunc); - -##### PARAMETERS: -* __first__ `String|vjs.Component` The event type or other component -* __second__ `Function|String` The listener function or event type -* __third__ `Function` _(OPTIONAL)_ The listener function for other component - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L691](https://github.com/videojs/video.js/blob/master/src/js/component.js#L691) - ---- - -### options( obj ) -> Deep merge of options objects -> -> Whenever a property is an object on both options objects -> the two properties will be merged using vjs.obj.deepMerge. -> -> This is used for merging options for child components. We -> want it to be easy to override individual options on a child -> component without having to rewrite all the other default options. -> -> Parent.prototype.options_ = { -> children: { -> 'childOne': { 'foo': 'bar', 'asdf': 'fdsa' }, -> 'childTwo': {}, -> 'childThree': {} -> } -> } -> newOptions = { -> children: { -> 'childOne': { 'foo': 'baz', 'abc': '123' } -> 'childTwo': null, -> 'childFour': {} -> } -> } -> -> this.options(newOptions); -> -> RESULT -> -> { -> children: { -> 'childOne': { 'foo': 'baz', 'asdf': 'fdsa', 'abc': '123' }, -> 'childTwo': null, // Disabled. Won't be initialized. -> 'childThree': {}, -> 'childFour': {} -> } -> } - -##### PARAMETERS: -* __obj__ `Object` Object of new option values - -##### RETURNS: -* `Object` A NEW object of this.options_ and obj merged - -_inherited from_: [src/js/component.js#L179](https://github.com/videojs/video.js/blob/master/src/js/component.js#L179) - ---- - -### player() -> Return the component's player - -##### RETURNS: -* `vjs.Player` - -_inherited from_: [src/js/component.js#L126](https://github.com/videojs/video.js/blob/master/src/js/component.js#L126) - ---- - -### ready( fn ) -> Bind a listener to the component's ready state -> -> Different from event listeners in that if the ready event has already happened -> it will trigger the function immediately. - -##### PARAMETERS: -* __fn__ `Function` Ready listener - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L769](https://github.com/videojs/video.js/blob/master/src/js/component.js#L769) - ---- - -### removeChild( component ) -> Remove a child component from this component's list of children, and the -> child component's element from this component's element - -##### PARAMETERS: -* __component__ `vjs.Component` Component to remove - -_inherited from_: [src/js/component.js#L420](https://github.com/videojs/video.js/blob/master/src/js/component.js#L420) - ---- - -### removeClass( classToRemove ) -> Remove a CSS class name from the component's element - -##### PARAMETERS: -* __classToRemove__ `String` Classname to remove - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L837](https://github.com/videojs/video.js/blob/master/src/js/component.js#L837) - ---- - -### setInterval( fn, interval ) -> Creates an interval and sets up disposal automatically. - -##### PARAMETERS: -* __fn__ `Function` The function to run every N seconds. -* __interval__ `Number` Number of ms to delay before executing specified function. - -##### RETURNS: -* `Number` Returns the interval ID - -_inherited from_: [src/js/component.js#L1202](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1202) - ---- - -### setTimeout( fn, timeout ) -> Creates timeout and sets up disposal automatically. - -##### PARAMETERS: -* __fn__ `Function` The function to run after the timeout. -* __timeout__ `Number` Number of ms to delay before executing specified function. - -##### RETURNS: -* `Number` Returns the timeout ID - -_inherited from_: [src/js/component.js#L1162](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1162) - ---- - -### show() -> Show the component element if hidden - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L847](https://github.com/videojs/video.js/blob/master/src/js/component.js#L847) - ---- - -### trigger( event ) -> Trigger an event on an element -> -> myComponent.trigger('eventName'); -> myComponent.trigger({'type':'eventName'}); - -##### PARAMETERS: -* __event__ `Event|Object|String` A string (the type) or an event object with a type attribute - -##### RETURNS: -* `vjs.Component` self - -_inherited from_: [src/js/component.js#L724](https://github.com/videojs/video.js/blob/master/src/js/component.js#L724) - ---- - -### triggerReady() -> Trigger the ready listeners - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L788](https://github.com/videojs/video.js/blob/master/src/js/component.js#L788) - ---- - -### width( [num], skipListeners ) -> Set or get the width of the component (CSS values) -> -> Setting the video tag dimension values only works with values in pixels. -> Percent values will not work. -> Some percents can be used, but width()/height() will return the number + %, -> not the actual computed width/height. - -##### PARAMETERS: -* __num__ `Number|String` _(OPTIONAL)_ Optional width number -* __skipListeners__ `Boolean` Skip the 'resize' event trigger - -##### RETURNS: -* `vjs.Component` This component, when setting the width -* `Number|String` The width, when getting - -_inherited from_: [src/js/component.js#L910](https://github.com/videojs/video.js/blob/master/src/js/component.js#L910) - ---- - -## EVENTS - -### resize `EVENT` -> Fired when the width and/or height of the component changes - -_inherited from_: [src/js/component.js#L1020](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1020) - ---- - diff --git a/docs/api/vjs.MenuItem.md b/docs/api/vjs.MenuItem.md deleted file mode 100644 index af86f48998..0000000000 --- a/docs/api/vjs.MenuItem.md +++ /dev/null @@ -1,673 +0,0 @@ - - -# vjs.MenuItem - -__EXTENDS__: [vjs.Button](vjs.Button.md) -__DEFINED IN__: [src/js/menu.js#L55](https://github.com/videojs/video.js/blob/master/src/js/menu.js#L55) - -The component for a menu item. `
  • ` - ---- - -## INDEX - -- [METHODS](#methods) - - [createEl](#createel-tagname-attributes-) - - [init](#init-player-options-) - - [onClick](#onclick) - - [selected](#selected-selected-) - - [addChild](#addchild-child-options-) _`inherited`_ - - [addClass](#addclass-classtoadd-) _`inherited`_ - - [buildCSSClass](#buildcssclass) _`inherited`_ - - [children](#children) _`inherited`_ - - [clearInterval](#clearinterval-intervalid-) _`inherited`_ - - [clearTimeout](#cleartimeout-timeoutid-) _`inherited`_ - - [contentEl](#contentel) _`inherited`_ - - [dimensions](#dimensions-width-height-) _`inherited`_ - - [dispose](#dispose) _`inherited`_ - - [el](#el) _`inherited`_ - - [enableTouchActivity](#enabletouchactivity) _`inherited`_ - - [getChild](#getchild-name-) _`inherited`_ - - [getChildById](#getchildbyid-id-) _`inherited`_ - - [hasClass](#hasclass-classtocheck-) _`inherited`_ - - [height](#height-num-skiplisteners-) _`inherited`_ - - [hide](#hide) _`inherited`_ - - [id](#id) _`inherited`_ - - [initChildren](#initchildren) _`inherited`_ - - [name](#name) _`inherited`_ - - [off](#off-first-second-third-) _`inherited`_ - - [on](#on-first-second-third-) _`inherited`_ - - [one](#one-first-second-third-) _`inherited`_ - - [options](#options-obj-) _`inherited`_ - - [player](#player) _`inherited`_ - - [ready](#ready-fn-) _`inherited`_ - - [removeChild](#removechild-component-) _`inherited`_ - - [removeClass](#removeclass-classtoremove-) _`inherited`_ - - [setInterval](#setinterval-fn-interval-) _`inherited`_ - - [setTimeout](#settimeout-fn-timeout-) _`inherited`_ - - [show](#show) _`inherited`_ - - [trigger](#trigger-event-) _`inherited`_ - - [triggerReady](#triggerready) _`inherited`_ - - [width](#width-num-skiplisteners-) _`inherited`_ - -- [EVENTS](#events) - - [resize](#resize-event) _`inherited`_ - ---- - -## METHODS - -### addChild( child, [options] ) -> Adds a child component inside this component -> -> myComponent.el(); -> // ->
    -> myComonent.children(); -> // [empty array] -> -> var myButton = myComponent.addChild('MyButton'); -> // ->
    myButton
    -> // -> myButton === myComonent.children()[0]; -> -> Pass in options for child constructors and options for children of the child -> -> var myButton = myComponent.addChild('MyButton', { -> text: 'Press Me', -> children: { -> buttonChildExample: { -> buttonChildOption: true -> } -> } -> }); - -##### PARAMETERS: -* __child__ `String|vjs.Component` The class name or instance of a child to add -* __options__ `Object` _(OPTIONAL)_ Options, including options to be passed to children of the child. - -##### RETURNS: -* `vjs.Component` The child component (created by this process if a string was used) - -_inherited from_: [src/js/component.js#L362](https://github.com/videojs/video.js/blob/master/src/js/component.js#L362) - ---- - -### addClass( classToAdd ) -> Add a CSS class name to the component's element - -##### PARAMETERS: -* __classToAdd__ `String` Classname to add - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L826](https://github.com/videojs/video.js/blob/master/src/js/component.js#L826) - ---- - -### buildCSSClass() -> Allows sub components to stack CSS class names - -##### RETURNS: -* `String` The constructed class name - -_inherited from_: [src/js/component.js#L536](https://github.com/videojs/video.js/blob/master/src/js/component.js#L536) - ---- - -### children() -> Get an array of all child components -> -> var kids = myComponent.children(); - -##### RETURNS: -* `Array` The children - -_inherited from_: [src/js/component.js#L296](https://github.com/videojs/video.js/blob/master/src/js/component.js#L296) - ---- - -### clearInterval( intervalId ) -> Clears an interval and removes the associated dispose listener - -##### PARAMETERS: -* __intervalId__ `Number` The id of the interval to clear - -##### RETURNS: -* `Number` Returns the interval ID - -_inherited from_: [src/js/component.js#L1223](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1223) - ---- - -### clearTimeout( timeoutId ) -> Clears a timeout and removes the associated dispose listener - -##### PARAMETERS: -* __timeoutId__ `Number` The id of the timeout to clear - -##### RETURNS: -* `Number` Returns the timeout ID - -_inherited from_: [src/js/component.js#L1185](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1185) - ---- - -### contentEl() -> Return the component's DOM element for embedding content. -> Will either be el_ or a new element defined in createEl. - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L239](https://github.com/videojs/video.js/blob/master/src/js/component.js#L239) - ---- - -### createEl( [tagName], [attributes] ) -> Create the component's DOM element - -##### PARAMETERS: -* __tagName__ `String` _(OPTIONAL)_ Element's node type. e.g. 'div' -* __attributes__ `Object` _(OPTIONAL)_ An object of element attributes that should be set on the element - -_defined in_: [src/js/menu.js#L64](https://github.com/videojs/video.js/blob/master/src/js/menu.js#L64) - ---- - -### dimensions( width, height ) -> Set both width and height at the same time - -##### PARAMETERS: -* __width__ `Number|String` -* __height__ `Number|String` - -##### RETURNS: -* `vjs.Component` The component - -_inherited from_: [src/js/component.js#L938](https://github.com/videojs/video.js/blob/master/src/js/component.js#L938) - ---- - -### dispose() -> Dispose of the component and all child components - -_inherited from_: [src/js/component.js#L84](https://github.com/videojs/video.js/blob/master/src/js/component.js#L84) - ---- - -### el() -> Get the component's DOM element -> -> var domEl = myComponent.el(); - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L220](https://github.com/videojs/video.js/blob/master/src/js/component.js#L220) - ---- - -### enableTouchActivity() -> Report user touch activity when touch events occur -> -> User activity is used to determine when controls should show/hide. It's -> relatively simple when it comes to mouse events, because any mouse event -> should show the controls. So we capture mouse events that bubble up to the -> player and report activity when that happens. -> -> With touch events it isn't as easy. We can't rely on touch events at the -> player level, because a tap (touchstart + touchend) on the video itself on -> mobile devices is meant to turn controls off (and on). User activity is -> checked asynchronously, so what could happen is a tap event on the video -> turns the controls off, then the touchend event bubbles up to the player, -> which if it reported user activity, would turn the controls right back on. -> (We also don't want to completely block touch events from bubbling up) -> -> Also a touchmove, touch+hold, and anything other than a tap is not supposed -> to turn the controls back on on a mobile device. -> -> Here we're setting the default component behavior to report user activity -> whenever touch events happen, and this can be turned off by components that -> want touch events to act differently. - -_inherited from_: [src/js/component.js#L1124](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1124) - ---- - -### getChild( name ) -> Returns a child component with the provided name - -##### PARAMETERS: -* __name__ - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L330](https://github.com/videojs/video.js/blob/master/src/js/component.js#L330) - ---- - -### getChildById( id ) -> Returns a child component with the provided ID - -##### PARAMETERS: -* __id__ - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L313](https://github.com/videojs/video.js/blob/master/src/js/component.js#L313) - ---- - -### hasClass( classToCheck ) -> Check if a component's element has a CSS class name - -##### PARAMETERS: -* __classToCheck__ `String` Classname to check - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L816](https://github.com/videojs/video.js/blob/master/src/js/component.js#L816) - ---- - -### height( [num], [skipListeners] ) -> Get or set the height of the component (CSS values) -> -> Setting the video tag dimension values only works with values in pixels. -> Percent values will not work. -> Some percents can be used, but width()/height() will return the number + %, -> not the actual computed width/height. - -##### PARAMETERS: -* __num__ `Number|String` _(OPTIONAL)_ New component height -* __skipListeners__ `Boolean` _(OPTIONAL)_ Skip the resize event trigger - -##### RETURNS: -* `vjs.Component` This component, when setting the height -* `Number|String` The height, when getting - -_inherited from_: [src/js/component.js#L927](https://github.com/videojs/video.js/blob/master/src/js/component.js#L927) - ---- - -### hide() -> Hide the component element if currently showing - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L857](https://github.com/videojs/video.js/blob/master/src/js/component.js#L857) - ---- - -### id() -> Get the component's ID -> -> var id = myComponent.id(); - -##### RETURNS: -* `String` - -_inherited from_: [src/js/component.js#L258](https://github.com/videojs/video.js/blob/master/src/js/component.js#L258) - ---- - -### init( player, options ) - -##### PARAMETERS: -* __player__ -* __options__ - -_defined in_: [src/js/menu.js#L57](https://github.com/videojs/video.js/blob/master/src/js/menu.js#L57) - ---- - -### initChildren() -> Add and initialize default child components from options -> -> // when an instance of MyComponent is created, all children in options -> // will be added to the instance by their name strings and options -> MyComponent.prototype.options_.children = { -> myChildComponent: { -> myChildOption: true -> } -> } -> -> // Or when creating the component -> var myComp = new MyComponent(player, { -> children: { -> myChildComponent: { -> myChildOption: true -> } -> } -> }); -> -> The children option can also be an Array of child names or -> child options objects (that also include a 'name' key). -> -> var myComp = new MyComponent(player, { -> children: [ -> 'button', -> { -> name: 'button', -> someOtherOption: true -> } -> ] -> }); - -_inherited from_: [src/js/component.js#L481](https://github.com/videojs/video.js/blob/master/src/js/component.js#L481) - ---- - -### name() -> Get the component's name. The name is often used to reference the component. -> -> var name = myComponent.name(); - -##### RETURNS: -* `String` - -_inherited from_: [src/js/component.js#L277](https://github.com/videojs/video.js/blob/master/src/js/component.js#L277) - ---- - -### off( [first], [second], [third] ) -> Remove an event listener from this component's element -> -> myComponent.off('eventType', myFunc); -> -> If myFunc is excluded, ALL listeners for the event type will be removed. -> If eventType is excluded, ALL listeners will be removed from the component. -> -> Alternatively you can use `off` to remove listeners that were added to other -> elements or components using `myComponent.on(otherComponent...`. -> In this case both the event type and listener function are REQUIRED. -> -> myComponent.off(otherElement, 'eventType', myFunc); -> myComponent.off(otherComponent, 'eventType', myFunc); - -##### PARAMETERS: -* __first__ `String|vjs.Component` _(OPTIONAL)_ The event type or other component -* __second__ `Function|String` _(OPTIONAL)_ The listener function or event type -* __third__ `Function` _(OPTIONAL)_ The listener for other component - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L646](https://github.com/videojs/video.js/blob/master/src/js/component.js#L646) - ---- - -### on( first, second, third ) -> Add an event listener to this component's element -> -> var myFunc = function(){ -> var myComponent = this; -> // Do something when the event is fired -> }; -> -> myComponent.on('eventType', myFunc); -> -> The context of myFunc will be myComponent unless previously bound. -> -> Alternatively, you can add a listener to another element or component. -> -> myComponent.on(otherElement, 'eventName', myFunc); -> myComponent.on(otherComponent, 'eventName', myFunc); -> -> The benefit of using this over `vjs.on(otherElement, 'eventName', myFunc)` -> and `otherComponent.on('eventName', myFunc)` is that this way the listeners -> will be automatically cleaned up when either component is disposed. -> It will also bind myComponent as the context of myFunc. -> -> **NOTE**: When using this on elements in the page other than window -> and document (both permanent), if you remove the element from the DOM -> you need to call `vjs.trigger(el, 'dispose')` on it to clean up -> references to it and allow the browser to garbage collect it. - -##### PARAMETERS: -* __first__ `String|vjs.Component` The event type or other component -* __second__ `Function|String` The event handler or event type -* __third__ `Function` The event handler - -##### RETURNS: -* `vjs.Component` self - -_inherited from_: [src/js/component.js#L577](https://github.com/videojs/video.js/blob/master/src/js/component.js#L577) - ---- - -### onClick() -> Handle a click on the menu item, and set it to selected - -_defined in_: [src/js/menu.js#L74](https://github.com/videojs/video.js/blob/master/src/js/menu.js#L74) - ---- - -### one( first, second, [third] ) -> Add an event listener to be triggered only once and then removed -> -> myComponent.one('eventName', myFunc); -> -> Alternatively you can add a listener to another element or component -> that will be triggered only once. -> -> myComponent.one(otherElement, 'eventName', myFunc); -> myComponent.one(otherComponent, 'eventName', myFunc); - -##### PARAMETERS: -* __first__ `String|vjs.Component` The event type or other component -* __second__ `Function|String` The listener function or event type -* __third__ `Function` _(OPTIONAL)_ The listener function for other component - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L691](https://github.com/videojs/video.js/blob/master/src/js/component.js#L691) - ---- - -### options( obj ) -> Deep merge of options objects -> -> Whenever a property is an object on both options objects -> the two properties will be merged using vjs.obj.deepMerge. -> -> This is used for merging options for child components. We -> want it to be easy to override individual options on a child -> component without having to rewrite all the other default options. -> -> Parent.prototype.options_ = { -> children: { -> 'childOne': { 'foo': 'bar', 'asdf': 'fdsa' }, -> 'childTwo': {}, -> 'childThree': {} -> } -> } -> newOptions = { -> children: { -> 'childOne': { 'foo': 'baz', 'abc': '123' } -> 'childTwo': null, -> 'childFour': {} -> } -> } -> -> this.options(newOptions); -> -> RESULT -> -> { -> children: { -> 'childOne': { 'foo': 'baz', 'asdf': 'fdsa', 'abc': '123' }, -> 'childTwo': null, // Disabled. Won't be initialized. -> 'childThree': {}, -> 'childFour': {} -> } -> } - -##### PARAMETERS: -* __obj__ `Object` Object of new option values - -##### RETURNS: -* `Object` A NEW object of this.options_ and obj merged - -_inherited from_: [src/js/component.js#L179](https://github.com/videojs/video.js/blob/master/src/js/component.js#L179) - ---- - -### player() -> Return the component's player - -##### RETURNS: -* `vjs.Player` - -_inherited from_: [src/js/component.js#L126](https://github.com/videojs/video.js/blob/master/src/js/component.js#L126) - ---- - -### ready( fn ) -> Bind a listener to the component's ready state -> -> Different from event listeners in that if the ready event has already happened -> it will trigger the function immediately. - -##### PARAMETERS: -* __fn__ `Function` Ready listener - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L769](https://github.com/videojs/video.js/blob/master/src/js/component.js#L769) - ---- - -### removeChild( component ) -> Remove a child component from this component's list of children, and the -> child component's element from this component's element - -##### PARAMETERS: -* __component__ `vjs.Component` Component to remove - -_inherited from_: [src/js/component.js#L420](https://github.com/videojs/video.js/blob/master/src/js/component.js#L420) - ---- - -### removeClass( classToRemove ) -> Remove a CSS class name from the component's element - -##### PARAMETERS: -* __classToRemove__ `String` Classname to remove - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L837](https://github.com/videojs/video.js/blob/master/src/js/component.js#L837) - ---- - -### selected( selected ) -> Set this menu item as selected or not - -##### PARAMETERS: -* __selected__ `Boolean` - -_defined in_: [src/js/menu.js#L82](https://github.com/videojs/video.js/blob/master/src/js/menu.js#L82) - ---- - -### setInterval( fn, interval ) -> Creates an interval and sets up disposal automatically. - -##### PARAMETERS: -* __fn__ `Function` The function to run every N seconds. -* __interval__ `Number` Number of ms to delay before executing specified function. - -##### RETURNS: -* `Number` Returns the interval ID - -_inherited from_: [src/js/component.js#L1202](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1202) - ---- - -### setTimeout( fn, timeout ) -> Creates timeout and sets up disposal automatically. - -##### PARAMETERS: -* __fn__ `Function` The function to run after the timeout. -* __timeout__ `Number` Number of ms to delay before executing specified function. - -##### RETURNS: -* `Number` Returns the timeout ID - -_inherited from_: [src/js/component.js#L1162](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1162) - ---- - -### show() -> Show the component element if hidden - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L847](https://github.com/videojs/video.js/blob/master/src/js/component.js#L847) - ---- - -### trigger( event ) -> Trigger an event on an element -> -> myComponent.trigger('eventName'); -> myComponent.trigger({'type':'eventName'}); - -##### PARAMETERS: -* __event__ `Event|Object|String` A string (the type) or an event object with a type attribute - -##### RETURNS: -* `vjs.Component` self - -_inherited from_: [src/js/component.js#L724](https://github.com/videojs/video.js/blob/master/src/js/component.js#L724) - ---- - -### triggerReady() -> Trigger the ready listeners - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L788](https://github.com/videojs/video.js/blob/master/src/js/component.js#L788) - ---- - -### width( [num], skipListeners ) -> Set or get the width of the component (CSS values) -> -> Setting the video tag dimension values only works with values in pixels. -> Percent values will not work. -> Some percents can be used, but width()/height() will return the number + %, -> not the actual computed width/height. - -##### PARAMETERS: -* __num__ `Number|String` _(OPTIONAL)_ Optional width number -* __skipListeners__ `Boolean` Skip the 'resize' event trigger - -##### RETURNS: -* `vjs.Component` This component, when setting the width -* `Number|String` The width, when getting - -_inherited from_: [src/js/component.js#L910](https://github.com/videojs/video.js/blob/master/src/js/component.js#L910) - ---- - -## EVENTS - -### resize `EVENT` -> Fired when the width and/or height of the component changes - -_inherited from_: [src/js/component.js#L1020](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1020) - ---- - diff --git a/docs/api/vjs.MuteToggle.md b/docs/api/vjs.MuteToggle.md deleted file mode 100644 index 49b3e58a35..0000000000 --- a/docs/api/vjs.MuteToggle.md +++ /dev/null @@ -1,657 +0,0 @@ - - -# vjs.MuteToggle - -__EXTENDS__: [vjs.Button](vjs.Button.md) -__DEFINED IN__: [src/js/control-bar/mute-toggle.js#L8](https://github.com/videojs/video.js/blob/master/src/js/control-bar/mute-toggle.js#L8) - -A button component for muting the audio - ---- - -## INDEX - -- [METHODS](#methods) - - [init](#init-player-options-) - - [addChild](#addchild-child-options-) _`inherited`_ - - [addClass](#addclass-classtoadd-) _`inherited`_ - - [buildCSSClass](#buildcssclass) _`inherited`_ - - [children](#children) _`inherited`_ - - [clearInterval](#clearinterval-intervalid-) _`inherited`_ - - [clearTimeout](#cleartimeout-timeoutid-) _`inherited`_ - - [contentEl](#contentel) _`inherited`_ - - [createEl](#createel-tagname-attributes-) _`inherited`_ - - [dimensions](#dimensions-width-height-) _`inherited`_ - - [dispose](#dispose) _`inherited`_ - - [el](#el) _`inherited`_ - - [enableTouchActivity](#enabletouchactivity) _`inherited`_ - - [getChild](#getchild-name-) _`inherited`_ - - [getChildById](#getchildbyid-id-) _`inherited`_ - - [hasClass](#hasclass-classtocheck-) _`inherited`_ - - [height](#height-num-skiplisteners-) _`inherited`_ - - [hide](#hide) _`inherited`_ - - [id](#id) _`inherited`_ - - [initChildren](#initchildren) _`inherited`_ - - [name](#name) _`inherited`_ - - [off](#off-first-second-third-) _`inherited`_ - - [on](#on-first-second-third-) _`inherited`_ - - [one](#one-first-second-third-) _`inherited`_ - - [options](#options-obj-) _`inherited`_ - - [player](#player) _`inherited`_ - - [ready](#ready-fn-) _`inherited`_ - - [removeChild](#removechild-component-) _`inherited`_ - - [removeClass](#removeclass-classtoremove-) _`inherited`_ - - [setInterval](#setinterval-fn-interval-) _`inherited`_ - - [setTimeout](#settimeout-fn-timeout-) _`inherited`_ - - [show](#show) _`inherited`_ - - [trigger](#trigger-event-) _`inherited`_ - - [triggerReady](#triggerready) _`inherited`_ - - [width](#width-num-skiplisteners-) _`inherited`_ - -- [EVENTS](#events) - - [resize](#resize-event) _`inherited`_ - ---- - -## METHODS - -### addChild( child, [options] ) -> Adds a child component inside this component -> -> myComponent.el(); -> // ->
    -> myComonent.children(); -> // [empty array] -> -> var myButton = myComponent.addChild('MyButton'); -> // ->
    myButton
    -> // -> myButton === myComonent.children()[0]; -> -> Pass in options for child constructors and options for children of the child -> -> var myButton = myComponent.addChild('MyButton', { -> text: 'Press Me', -> children: { -> buttonChildExample: { -> buttonChildOption: true -> } -> } -> }); - -##### PARAMETERS: -* __child__ `String|vjs.Component` The class name or instance of a child to add -* __options__ `Object` _(OPTIONAL)_ Options, including options to be passed to children of the child. - -##### RETURNS: -* `vjs.Component` The child component (created by this process if a string was used) - -_inherited from_: [src/js/component.js#L362](https://github.com/videojs/video.js/blob/master/src/js/component.js#L362) - ---- - -### addClass( classToAdd ) -> Add a CSS class name to the component's element - -##### PARAMETERS: -* __classToAdd__ `String` Classname to add - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L826](https://github.com/videojs/video.js/blob/master/src/js/component.js#L826) - ---- - -### buildCSSClass() -> Allows sub components to stack CSS class names - -##### RETURNS: -* `String` The constructed class name - -_inherited from_: [src/js/component.js#L536](https://github.com/videojs/video.js/blob/master/src/js/component.js#L536) - ---- - -### children() -> Get an array of all child components -> -> var kids = myComponent.children(); - -##### RETURNS: -* `Array` The children - -_inherited from_: [src/js/component.js#L296](https://github.com/videojs/video.js/blob/master/src/js/component.js#L296) - ---- - -### clearInterval( intervalId ) -> Clears an interval and removes the associated dispose listener - -##### PARAMETERS: -* __intervalId__ `Number` The id of the interval to clear - -##### RETURNS: -* `Number` Returns the interval ID - -_inherited from_: [src/js/component.js#L1223](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1223) - ---- - -### clearTimeout( timeoutId ) -> Clears a timeout and removes the associated dispose listener - -##### PARAMETERS: -* __timeoutId__ `Number` The id of the timeout to clear - -##### RETURNS: -* `Number` Returns the timeout ID - -_inherited from_: [src/js/component.js#L1185](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1185) - ---- - -### contentEl() -> Return the component's DOM element for embedding content. -> Will either be el_ or a new element defined in createEl. - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L239](https://github.com/videojs/video.js/blob/master/src/js/component.js#L239) - ---- - -### createEl( [tagName], [attributes] ) -> Create the component's DOM element - -##### PARAMETERS: -* __tagName__ `String` _(OPTIONAL)_ Element's node type. e.g. 'div' -* __attributes__ `Object` _(OPTIONAL)_ An object of element attributes that should be set on the element - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L200](https://github.com/videojs/video.js/blob/master/src/js/component.js#L200) - ---- - -### dimensions( width, height ) -> Set both width and height at the same time - -##### PARAMETERS: -* __width__ `Number|String` -* __height__ `Number|String` - -##### RETURNS: -* `vjs.Component` The component - -_inherited from_: [src/js/component.js#L938](https://github.com/videojs/video.js/blob/master/src/js/component.js#L938) - ---- - -### dispose() -> Dispose of the component and all child components - -_inherited from_: [src/js/component.js#L84](https://github.com/videojs/video.js/blob/master/src/js/component.js#L84) - ---- - -### el() -> Get the component's DOM element -> -> var domEl = myComponent.el(); - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L220](https://github.com/videojs/video.js/blob/master/src/js/component.js#L220) - ---- - -### enableTouchActivity() -> Report user touch activity when touch events occur -> -> User activity is used to determine when controls should show/hide. It's -> relatively simple when it comes to mouse events, because any mouse event -> should show the controls. So we capture mouse events that bubble up to the -> player and report activity when that happens. -> -> With touch events it isn't as easy. We can't rely on touch events at the -> player level, because a tap (touchstart + touchend) on the video itself on -> mobile devices is meant to turn controls off (and on). User activity is -> checked asynchronously, so what could happen is a tap event on the video -> turns the controls off, then the touchend event bubbles up to the player, -> which if it reported user activity, would turn the controls right back on. -> (We also don't want to completely block touch events from bubbling up) -> -> Also a touchmove, touch+hold, and anything other than a tap is not supposed -> to turn the controls back on on a mobile device. -> -> Here we're setting the default component behavior to report user activity -> whenever touch events happen, and this can be turned off by components that -> want touch events to act differently. - -_inherited from_: [src/js/component.js#L1124](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1124) - ---- - -### getChild( name ) -> Returns a child component with the provided name - -##### PARAMETERS: -* __name__ - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L330](https://github.com/videojs/video.js/blob/master/src/js/component.js#L330) - ---- - -### getChildById( id ) -> Returns a child component with the provided ID - -##### PARAMETERS: -* __id__ - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L313](https://github.com/videojs/video.js/blob/master/src/js/component.js#L313) - ---- - -### hasClass( classToCheck ) -> Check if a component's element has a CSS class name - -##### PARAMETERS: -* __classToCheck__ `String` Classname to check - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L816](https://github.com/videojs/video.js/blob/master/src/js/component.js#L816) - ---- - -### height( [num], [skipListeners] ) -> Get or set the height of the component (CSS values) -> -> Setting the video tag dimension values only works with values in pixels. -> Percent values will not work. -> Some percents can be used, but width()/height() will return the number + %, -> not the actual computed width/height. - -##### PARAMETERS: -* __num__ `Number|String` _(OPTIONAL)_ New component height -* __skipListeners__ `Boolean` _(OPTIONAL)_ Skip the resize event trigger - -##### RETURNS: -* `vjs.Component` This component, when setting the height -* `Number|String` The height, when getting - -_inherited from_: [src/js/component.js#L927](https://github.com/videojs/video.js/blob/master/src/js/component.js#L927) - ---- - -### hide() -> Hide the component element if currently showing - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L857](https://github.com/videojs/video.js/blob/master/src/js/component.js#L857) - ---- - -### id() -> Get the component's ID -> -> var id = myComponent.id(); - -##### RETURNS: -* `String` - -_inherited from_: [src/js/component.js#L258](https://github.com/videojs/video.js/blob/master/src/js/component.js#L258) - ---- - -### init( player, options ) - -##### PARAMETERS: -* __player__ -* __options__ - -_defined in_: [src/js/control-bar/mute-toggle.js#L10](https://github.com/videojs/video.js/blob/master/src/js/control-bar/mute-toggle.js#L10) - ---- - -### initChildren() -> Add and initialize default child components from options -> -> // when an instance of MyComponent is created, all children in options -> // will be added to the instance by their name strings and options -> MyComponent.prototype.options_.children = { -> myChildComponent: { -> myChildOption: true -> } -> } -> -> // Or when creating the component -> var myComp = new MyComponent(player, { -> children: { -> myChildComponent: { -> myChildOption: true -> } -> } -> }); -> -> The children option can also be an Array of child names or -> child options objects (that also include a 'name' key). -> -> var myComp = new MyComponent(player, { -> children: [ -> 'button', -> { -> name: 'button', -> someOtherOption: true -> } -> ] -> }); - -_inherited from_: [src/js/component.js#L481](https://github.com/videojs/video.js/blob/master/src/js/component.js#L481) - ---- - -### name() -> Get the component's name. The name is often used to reference the component. -> -> var name = myComponent.name(); - -##### RETURNS: -* `String` - -_inherited from_: [src/js/component.js#L277](https://github.com/videojs/video.js/blob/master/src/js/component.js#L277) - ---- - -### off( [first], [second], [third] ) -> Remove an event listener from this component's element -> -> myComponent.off('eventType', myFunc); -> -> If myFunc is excluded, ALL listeners for the event type will be removed. -> If eventType is excluded, ALL listeners will be removed from the component. -> -> Alternatively you can use `off` to remove listeners that were added to other -> elements or components using `myComponent.on(otherComponent...`. -> In this case both the event type and listener function are REQUIRED. -> -> myComponent.off(otherElement, 'eventType', myFunc); -> myComponent.off(otherComponent, 'eventType', myFunc); - -##### PARAMETERS: -* __first__ `String|vjs.Component` _(OPTIONAL)_ The event type or other component -* __second__ `Function|String` _(OPTIONAL)_ The listener function or event type -* __third__ `Function` _(OPTIONAL)_ The listener for other component - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L646](https://github.com/videojs/video.js/blob/master/src/js/component.js#L646) - ---- - -### on( first, second, third ) -> Add an event listener to this component's element -> -> var myFunc = function(){ -> var myComponent = this; -> // Do something when the event is fired -> }; -> -> myComponent.on('eventType', myFunc); -> -> The context of myFunc will be myComponent unless previously bound. -> -> Alternatively, you can add a listener to another element or component. -> -> myComponent.on(otherElement, 'eventName', myFunc); -> myComponent.on(otherComponent, 'eventName', myFunc); -> -> The benefit of using this over `vjs.on(otherElement, 'eventName', myFunc)` -> and `otherComponent.on('eventName', myFunc)` is that this way the listeners -> will be automatically cleaned up when either component is disposed. -> It will also bind myComponent as the context of myFunc. -> -> **NOTE**: When using this on elements in the page other than window -> and document (both permanent), if you remove the element from the DOM -> you need to call `vjs.trigger(el, 'dispose')` on it to clean up -> references to it and allow the browser to garbage collect it. - -##### PARAMETERS: -* __first__ `String|vjs.Component` The event type or other component -* __second__ `Function|String` The event handler or event type -* __third__ `Function` The event handler - -##### RETURNS: -* `vjs.Component` self - -_inherited from_: [src/js/component.js#L577](https://github.com/videojs/video.js/blob/master/src/js/component.js#L577) - ---- - -### one( first, second, [third] ) -> Add an event listener to be triggered only once and then removed -> -> myComponent.one('eventName', myFunc); -> -> Alternatively you can add a listener to another element or component -> that will be triggered only once. -> -> myComponent.one(otherElement, 'eventName', myFunc); -> myComponent.one(otherComponent, 'eventName', myFunc); - -##### PARAMETERS: -* __first__ `String|vjs.Component` The event type or other component -* __second__ `Function|String` The listener function or event type -* __third__ `Function` _(OPTIONAL)_ The listener function for other component - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L691](https://github.com/videojs/video.js/blob/master/src/js/component.js#L691) - ---- - -### options( obj ) -> Deep merge of options objects -> -> Whenever a property is an object on both options objects -> the two properties will be merged using vjs.obj.deepMerge. -> -> This is used for merging options for child components. We -> want it to be easy to override individual options on a child -> component without having to rewrite all the other default options. -> -> Parent.prototype.options_ = { -> children: { -> 'childOne': { 'foo': 'bar', 'asdf': 'fdsa' }, -> 'childTwo': {}, -> 'childThree': {} -> } -> } -> newOptions = { -> children: { -> 'childOne': { 'foo': 'baz', 'abc': '123' } -> 'childTwo': null, -> 'childFour': {} -> } -> } -> -> this.options(newOptions); -> -> RESULT -> -> { -> children: { -> 'childOne': { 'foo': 'baz', 'asdf': 'fdsa', 'abc': '123' }, -> 'childTwo': null, // Disabled. Won't be initialized. -> 'childThree': {}, -> 'childFour': {} -> } -> } - -##### PARAMETERS: -* __obj__ `Object` Object of new option values - -##### RETURNS: -* `Object` A NEW object of this.options_ and obj merged - -_inherited from_: [src/js/component.js#L179](https://github.com/videojs/video.js/blob/master/src/js/component.js#L179) - ---- - -### player() -> Return the component's player - -##### RETURNS: -* `vjs.Player` - -_inherited from_: [src/js/component.js#L126](https://github.com/videojs/video.js/blob/master/src/js/component.js#L126) - ---- - -### ready( fn ) -> Bind a listener to the component's ready state -> -> Different from event listeners in that if the ready event has already happened -> it will trigger the function immediately. - -##### PARAMETERS: -* __fn__ `Function` Ready listener - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L769](https://github.com/videojs/video.js/blob/master/src/js/component.js#L769) - ---- - -### removeChild( component ) -> Remove a child component from this component's list of children, and the -> child component's element from this component's element - -##### PARAMETERS: -* __component__ `vjs.Component` Component to remove - -_inherited from_: [src/js/component.js#L420](https://github.com/videojs/video.js/blob/master/src/js/component.js#L420) - ---- - -### removeClass( classToRemove ) -> Remove a CSS class name from the component's element - -##### PARAMETERS: -* __classToRemove__ `String` Classname to remove - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L837](https://github.com/videojs/video.js/blob/master/src/js/component.js#L837) - ---- - -### setInterval( fn, interval ) -> Creates an interval and sets up disposal automatically. - -##### PARAMETERS: -* __fn__ `Function` The function to run every N seconds. -* __interval__ `Number` Number of ms to delay before executing specified function. - -##### RETURNS: -* `Number` Returns the interval ID - -_inherited from_: [src/js/component.js#L1202](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1202) - ---- - -### setTimeout( fn, timeout ) -> Creates timeout and sets up disposal automatically. - -##### PARAMETERS: -* __fn__ `Function` The function to run after the timeout. -* __timeout__ `Number` Number of ms to delay before executing specified function. - -##### RETURNS: -* `Number` Returns the timeout ID - -_inherited from_: [src/js/component.js#L1162](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1162) - ---- - -### show() -> Show the component element if hidden - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L847](https://github.com/videojs/video.js/blob/master/src/js/component.js#L847) - ---- - -### trigger( event ) -> Trigger an event on an element -> -> myComponent.trigger('eventName'); -> myComponent.trigger({'type':'eventName'}); - -##### PARAMETERS: -* __event__ `Event|Object|String` A string (the type) or an event object with a type attribute - -##### RETURNS: -* `vjs.Component` self - -_inherited from_: [src/js/component.js#L724](https://github.com/videojs/video.js/blob/master/src/js/component.js#L724) - ---- - -### triggerReady() -> Trigger the ready listeners - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L788](https://github.com/videojs/video.js/blob/master/src/js/component.js#L788) - ---- - -### width( [num], skipListeners ) -> Set or get the width of the component (CSS values) -> -> Setting the video tag dimension values only works with values in pixels. -> Percent values will not work. -> Some percents can be used, but width()/height() will return the number + %, -> not the actual computed width/height. - -##### PARAMETERS: -* __num__ `Number|String` _(OPTIONAL)_ Optional width number -* __skipListeners__ `Boolean` Skip the 'resize' event trigger - -##### RETURNS: -* `vjs.Component` This component, when setting the width -* `Number|String` The width, when getting - -_inherited from_: [src/js/component.js#L910](https://github.com/videojs/video.js/blob/master/src/js/component.js#L910) - ---- - -## EVENTS - -### resize `EVENT` -> Fired when the width and/or height of the component changes - -_inherited from_: [src/js/component.js#L1020](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1020) - ---- - diff --git a/docs/api/vjs.OffTextTrackMenuItem.md b/docs/api/vjs.OffTextTrackMenuItem.md deleted file mode 100644 index e71a520403..0000000000 --- a/docs/api/vjs.OffTextTrackMenuItem.md +++ /dev/null @@ -1,10 +0,0 @@ - - -# vjs.OffTextTrackMenuItem - -__DEFINED IN__: [src/js/tracks/text-track-controls.js#L296](https://github.com/videojs/video.js/blob/master/src/js/tracks/text-track-controls.js#L296) - -A special menu item for turning of a specific type of text track - ---- - diff --git a/docs/api/vjs.PlayProgressBar.md b/docs/api/vjs.PlayProgressBar.md deleted file mode 100644 index bae0a4023d..0000000000 --- a/docs/api/vjs.PlayProgressBar.md +++ /dev/null @@ -1,657 +0,0 @@ - - -# vjs.PlayProgressBar - -__EXTENDS__: [vjs.Component](vjs.Component.md) -__DEFINED IN__: [src/js/control-bar/progress-control.js#L177](https://github.com/videojs/video.js/blob/master/src/js/control-bar/progress-control.js#L177) - -Shows play progress - ---- - -## INDEX - -- [METHODS](#methods) - - [init](#init-player-options-) - - [addChild](#addchild-child-options-) _`inherited`_ - - [addClass](#addclass-classtoadd-) _`inherited`_ - - [buildCSSClass](#buildcssclass) _`inherited`_ - - [children](#children) _`inherited`_ - - [clearInterval](#clearinterval-intervalid-) _`inherited`_ - - [clearTimeout](#cleartimeout-timeoutid-) _`inherited`_ - - [contentEl](#contentel) _`inherited`_ - - [createEl](#createel-tagname-attributes-) _`inherited`_ - - [dimensions](#dimensions-width-height-) _`inherited`_ - - [dispose](#dispose) _`inherited`_ - - [el](#el) _`inherited`_ - - [enableTouchActivity](#enabletouchactivity) _`inherited`_ - - [getChild](#getchild-name-) _`inherited`_ - - [getChildById](#getchildbyid-id-) _`inherited`_ - - [hasClass](#hasclass-classtocheck-) _`inherited`_ - - [height](#height-num-skiplisteners-) _`inherited`_ - - [hide](#hide) _`inherited`_ - - [id](#id) _`inherited`_ - - [initChildren](#initchildren) _`inherited`_ - - [name](#name) _`inherited`_ - - [off](#off-first-second-third-) _`inherited`_ - - [on](#on-first-second-third-) _`inherited`_ - - [one](#one-first-second-third-) _`inherited`_ - - [options](#options-obj-) _`inherited`_ - - [player](#player) _`inherited`_ - - [ready](#ready-fn-) _`inherited`_ - - [removeChild](#removechild-component-) _`inherited`_ - - [removeClass](#removeclass-classtoremove-) _`inherited`_ - - [setInterval](#setinterval-fn-interval-) _`inherited`_ - - [setTimeout](#settimeout-fn-timeout-) _`inherited`_ - - [show](#show) _`inherited`_ - - [trigger](#trigger-event-) _`inherited`_ - - [triggerReady](#triggerready) _`inherited`_ - - [width](#width-num-skiplisteners-) _`inherited`_ - -- [EVENTS](#events) - - [resize](#resize-event) _`inherited`_ - ---- - -## METHODS - -### addChild( child, [options] ) -> Adds a child component inside this component -> -> myComponent.el(); -> // ->
    -> myComonent.children(); -> // [empty array] -> -> var myButton = myComponent.addChild('MyButton'); -> // ->
    myButton
    -> // -> myButton === myComonent.children()[0]; -> -> Pass in options for child constructors and options for children of the child -> -> var myButton = myComponent.addChild('MyButton', { -> text: 'Press Me', -> children: { -> buttonChildExample: { -> buttonChildOption: true -> } -> } -> }); - -##### PARAMETERS: -* __child__ `String|vjs.Component` The class name or instance of a child to add -* __options__ `Object` _(OPTIONAL)_ Options, including options to be passed to children of the child. - -##### RETURNS: -* `vjs.Component` The child component (created by this process if a string was used) - -_inherited from_: [src/js/component.js#L362](https://github.com/videojs/video.js/blob/master/src/js/component.js#L362) - ---- - -### addClass( classToAdd ) -> Add a CSS class name to the component's element - -##### PARAMETERS: -* __classToAdd__ `String` Classname to add - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L826](https://github.com/videojs/video.js/blob/master/src/js/component.js#L826) - ---- - -### buildCSSClass() -> Allows sub components to stack CSS class names - -##### RETURNS: -* `String` The constructed class name - -_inherited from_: [src/js/component.js#L536](https://github.com/videojs/video.js/blob/master/src/js/component.js#L536) - ---- - -### children() -> Get an array of all child components -> -> var kids = myComponent.children(); - -##### RETURNS: -* `Array` The children - -_inherited from_: [src/js/component.js#L296](https://github.com/videojs/video.js/blob/master/src/js/component.js#L296) - ---- - -### clearInterval( intervalId ) -> Clears an interval and removes the associated dispose listener - -##### PARAMETERS: -* __intervalId__ `Number` The id of the interval to clear - -##### RETURNS: -* `Number` Returns the interval ID - -_inherited from_: [src/js/component.js#L1223](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1223) - ---- - -### clearTimeout( timeoutId ) -> Clears a timeout and removes the associated dispose listener - -##### PARAMETERS: -* __timeoutId__ `Number` The id of the timeout to clear - -##### RETURNS: -* `Number` Returns the timeout ID - -_inherited from_: [src/js/component.js#L1185](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1185) - ---- - -### contentEl() -> Return the component's DOM element for embedding content. -> Will either be el_ or a new element defined in createEl. - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L239](https://github.com/videojs/video.js/blob/master/src/js/component.js#L239) - ---- - -### createEl( [tagName], [attributes] ) -> Create the component's DOM element - -##### PARAMETERS: -* __tagName__ `String` _(OPTIONAL)_ Element's node type. e.g. 'div' -* __attributes__ `Object` _(OPTIONAL)_ An object of element attributes that should be set on the element - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L200](https://github.com/videojs/video.js/blob/master/src/js/component.js#L200) - ---- - -### dimensions( width, height ) -> Set both width and height at the same time - -##### PARAMETERS: -* __width__ `Number|String` -* __height__ `Number|String` - -##### RETURNS: -* `vjs.Component` The component - -_inherited from_: [src/js/component.js#L938](https://github.com/videojs/video.js/blob/master/src/js/component.js#L938) - ---- - -### dispose() -> Dispose of the component and all child components - -_inherited from_: [src/js/component.js#L84](https://github.com/videojs/video.js/blob/master/src/js/component.js#L84) - ---- - -### el() -> Get the component's DOM element -> -> var domEl = myComponent.el(); - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L220](https://github.com/videojs/video.js/blob/master/src/js/component.js#L220) - ---- - -### enableTouchActivity() -> Report user touch activity when touch events occur -> -> User activity is used to determine when controls should show/hide. It's -> relatively simple when it comes to mouse events, because any mouse event -> should show the controls. So we capture mouse events that bubble up to the -> player and report activity when that happens. -> -> With touch events it isn't as easy. We can't rely on touch events at the -> player level, because a tap (touchstart + touchend) on the video itself on -> mobile devices is meant to turn controls off (and on). User activity is -> checked asynchronously, so what could happen is a tap event on the video -> turns the controls off, then the touchend event bubbles up to the player, -> which if it reported user activity, would turn the controls right back on. -> (We also don't want to completely block touch events from bubbling up) -> -> Also a touchmove, touch+hold, and anything other than a tap is not supposed -> to turn the controls back on on a mobile device. -> -> Here we're setting the default component behavior to report user activity -> whenever touch events happen, and this can be turned off by components that -> want touch events to act differently. - -_inherited from_: [src/js/component.js#L1124](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1124) - ---- - -### getChild( name ) -> Returns a child component with the provided name - -##### PARAMETERS: -* __name__ - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L330](https://github.com/videojs/video.js/blob/master/src/js/component.js#L330) - ---- - -### getChildById( id ) -> Returns a child component with the provided ID - -##### PARAMETERS: -* __id__ - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L313](https://github.com/videojs/video.js/blob/master/src/js/component.js#L313) - ---- - -### hasClass( classToCheck ) -> Check if a component's element has a CSS class name - -##### PARAMETERS: -* __classToCheck__ `String` Classname to check - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L816](https://github.com/videojs/video.js/blob/master/src/js/component.js#L816) - ---- - -### height( [num], [skipListeners] ) -> Get or set the height of the component (CSS values) -> -> Setting the video tag dimension values only works with values in pixels. -> Percent values will not work. -> Some percents can be used, but width()/height() will return the number + %, -> not the actual computed width/height. - -##### PARAMETERS: -* __num__ `Number|String` _(OPTIONAL)_ New component height -* __skipListeners__ `Boolean` _(OPTIONAL)_ Skip the resize event trigger - -##### RETURNS: -* `vjs.Component` This component, when setting the height -* `Number|String` The height, when getting - -_inherited from_: [src/js/component.js#L927](https://github.com/videojs/video.js/blob/master/src/js/component.js#L927) - ---- - -### hide() -> Hide the component element if currently showing - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L857](https://github.com/videojs/video.js/blob/master/src/js/component.js#L857) - ---- - -### id() -> Get the component's ID -> -> var id = myComponent.id(); - -##### RETURNS: -* `String` - -_inherited from_: [src/js/component.js#L258](https://github.com/videojs/video.js/blob/master/src/js/component.js#L258) - ---- - -### init( player, options ) - -##### PARAMETERS: -* __player__ -* __options__ - -_defined in_: [src/js/control-bar/progress-control.js#L179](https://github.com/videojs/video.js/blob/master/src/js/control-bar/progress-control.js#L179) - ---- - -### initChildren() -> Add and initialize default child components from options -> -> // when an instance of MyComponent is created, all children in options -> // will be added to the instance by their name strings and options -> MyComponent.prototype.options_.children = { -> myChildComponent: { -> myChildOption: true -> } -> } -> -> // Or when creating the component -> var myComp = new MyComponent(player, { -> children: { -> myChildComponent: { -> myChildOption: true -> } -> } -> }); -> -> The children option can also be an Array of child names or -> child options objects (that also include a 'name' key). -> -> var myComp = new MyComponent(player, { -> children: [ -> 'button', -> { -> name: 'button', -> someOtherOption: true -> } -> ] -> }); - -_inherited from_: [src/js/component.js#L481](https://github.com/videojs/video.js/blob/master/src/js/component.js#L481) - ---- - -### name() -> Get the component's name. The name is often used to reference the component. -> -> var name = myComponent.name(); - -##### RETURNS: -* `String` - -_inherited from_: [src/js/component.js#L277](https://github.com/videojs/video.js/blob/master/src/js/component.js#L277) - ---- - -### off( [first], [second], [third] ) -> Remove an event listener from this component's element -> -> myComponent.off('eventType', myFunc); -> -> If myFunc is excluded, ALL listeners for the event type will be removed. -> If eventType is excluded, ALL listeners will be removed from the component. -> -> Alternatively you can use `off` to remove listeners that were added to other -> elements or components using `myComponent.on(otherComponent...`. -> In this case both the event type and listener function are REQUIRED. -> -> myComponent.off(otherElement, 'eventType', myFunc); -> myComponent.off(otherComponent, 'eventType', myFunc); - -##### PARAMETERS: -* __first__ `String|vjs.Component` _(OPTIONAL)_ The event type or other component -* __second__ `Function|String` _(OPTIONAL)_ The listener function or event type -* __third__ `Function` _(OPTIONAL)_ The listener for other component - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L646](https://github.com/videojs/video.js/blob/master/src/js/component.js#L646) - ---- - -### on( first, second, third ) -> Add an event listener to this component's element -> -> var myFunc = function(){ -> var myComponent = this; -> // Do something when the event is fired -> }; -> -> myComponent.on('eventType', myFunc); -> -> The context of myFunc will be myComponent unless previously bound. -> -> Alternatively, you can add a listener to another element or component. -> -> myComponent.on(otherElement, 'eventName', myFunc); -> myComponent.on(otherComponent, 'eventName', myFunc); -> -> The benefit of using this over `vjs.on(otherElement, 'eventName', myFunc)` -> and `otherComponent.on('eventName', myFunc)` is that this way the listeners -> will be automatically cleaned up when either component is disposed. -> It will also bind myComponent as the context of myFunc. -> -> **NOTE**: When using this on elements in the page other than window -> and document (both permanent), if you remove the element from the DOM -> you need to call `vjs.trigger(el, 'dispose')` on it to clean up -> references to it and allow the browser to garbage collect it. - -##### PARAMETERS: -* __first__ `String|vjs.Component` The event type or other component -* __second__ `Function|String` The event handler or event type -* __third__ `Function` The event handler - -##### RETURNS: -* `vjs.Component` self - -_inherited from_: [src/js/component.js#L577](https://github.com/videojs/video.js/blob/master/src/js/component.js#L577) - ---- - -### one( first, second, [third] ) -> Add an event listener to be triggered only once and then removed -> -> myComponent.one('eventName', myFunc); -> -> Alternatively you can add a listener to another element or component -> that will be triggered only once. -> -> myComponent.one(otherElement, 'eventName', myFunc); -> myComponent.one(otherComponent, 'eventName', myFunc); - -##### PARAMETERS: -* __first__ `String|vjs.Component` The event type or other component -* __second__ `Function|String` The listener function or event type -* __third__ `Function` _(OPTIONAL)_ The listener function for other component - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L691](https://github.com/videojs/video.js/blob/master/src/js/component.js#L691) - ---- - -### options( obj ) -> Deep merge of options objects -> -> Whenever a property is an object on both options objects -> the two properties will be merged using vjs.obj.deepMerge. -> -> This is used for merging options for child components. We -> want it to be easy to override individual options on a child -> component without having to rewrite all the other default options. -> -> Parent.prototype.options_ = { -> children: { -> 'childOne': { 'foo': 'bar', 'asdf': 'fdsa' }, -> 'childTwo': {}, -> 'childThree': {} -> } -> } -> newOptions = { -> children: { -> 'childOne': { 'foo': 'baz', 'abc': '123' } -> 'childTwo': null, -> 'childFour': {} -> } -> } -> -> this.options(newOptions); -> -> RESULT -> -> { -> children: { -> 'childOne': { 'foo': 'baz', 'asdf': 'fdsa', 'abc': '123' }, -> 'childTwo': null, // Disabled. Won't be initialized. -> 'childThree': {}, -> 'childFour': {} -> } -> } - -##### PARAMETERS: -* __obj__ `Object` Object of new option values - -##### RETURNS: -* `Object` A NEW object of this.options_ and obj merged - -_inherited from_: [src/js/component.js#L179](https://github.com/videojs/video.js/blob/master/src/js/component.js#L179) - ---- - -### player() -> Return the component's player - -##### RETURNS: -* `vjs.Player` - -_inherited from_: [src/js/component.js#L126](https://github.com/videojs/video.js/blob/master/src/js/component.js#L126) - ---- - -### ready( fn ) -> Bind a listener to the component's ready state -> -> Different from event listeners in that if the ready event has already happened -> it will trigger the function immediately. - -##### PARAMETERS: -* __fn__ `Function` Ready listener - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L769](https://github.com/videojs/video.js/blob/master/src/js/component.js#L769) - ---- - -### removeChild( component ) -> Remove a child component from this component's list of children, and the -> child component's element from this component's element - -##### PARAMETERS: -* __component__ `vjs.Component` Component to remove - -_inherited from_: [src/js/component.js#L420](https://github.com/videojs/video.js/blob/master/src/js/component.js#L420) - ---- - -### removeClass( classToRemove ) -> Remove a CSS class name from the component's element - -##### PARAMETERS: -* __classToRemove__ `String` Classname to remove - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L837](https://github.com/videojs/video.js/blob/master/src/js/component.js#L837) - ---- - -### setInterval( fn, interval ) -> Creates an interval and sets up disposal automatically. - -##### PARAMETERS: -* __fn__ `Function` The function to run every N seconds. -* __interval__ `Number` Number of ms to delay before executing specified function. - -##### RETURNS: -* `Number` Returns the interval ID - -_inherited from_: [src/js/component.js#L1202](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1202) - ---- - -### setTimeout( fn, timeout ) -> Creates timeout and sets up disposal automatically. - -##### PARAMETERS: -* __fn__ `Function` The function to run after the timeout. -* __timeout__ `Number` Number of ms to delay before executing specified function. - -##### RETURNS: -* `Number` Returns the timeout ID - -_inherited from_: [src/js/component.js#L1162](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1162) - ---- - -### show() -> Show the component element if hidden - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L847](https://github.com/videojs/video.js/blob/master/src/js/component.js#L847) - ---- - -### trigger( event ) -> Trigger an event on an element -> -> myComponent.trigger('eventName'); -> myComponent.trigger({'type':'eventName'}); - -##### PARAMETERS: -* __event__ `Event|Object|String` A string (the type) or an event object with a type attribute - -##### RETURNS: -* `vjs.Component` self - -_inherited from_: [src/js/component.js#L724](https://github.com/videojs/video.js/blob/master/src/js/component.js#L724) - ---- - -### triggerReady() -> Trigger the ready listeners - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L788](https://github.com/videojs/video.js/blob/master/src/js/component.js#L788) - ---- - -### width( [num], skipListeners ) -> Set or get the width of the component (CSS values) -> -> Setting the video tag dimension values only works with values in pixels. -> Percent values will not work. -> Some percents can be used, but width()/height() will return the number + %, -> not the actual computed width/height. - -##### PARAMETERS: -* __num__ `Number|String` _(OPTIONAL)_ Optional width number -* __skipListeners__ `Boolean` Skip the 'resize' event trigger - -##### RETURNS: -* `vjs.Component` This component, when setting the width -* `Number|String` The width, when getting - -_inherited from_: [src/js/component.js#L910](https://github.com/videojs/video.js/blob/master/src/js/component.js#L910) - ---- - -## EVENTS - -### resize `EVENT` -> Fired when the width and/or height of the component changes - -_inherited from_: [src/js/component.js#L1020](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1020) - ---- - diff --git a/docs/api/vjs.PlayToggle.md b/docs/api/vjs.PlayToggle.md deleted file mode 100644 index b15812a243..0000000000 --- a/docs/api/vjs.PlayToggle.md +++ /dev/null @@ -1,657 +0,0 @@ - - -# vjs.PlayToggle - -__EXTENDS__: [vjs.Button](vjs.Button.md) -__DEFINED IN__: [src/js/control-bar/play-toggle.js#L8](https://github.com/videojs/video.js/blob/master/src/js/control-bar/play-toggle.js#L8) - -Button to toggle between play and pause - ---- - -## INDEX - -- [METHODS](#methods) - - [init](#init-player-options-) - - [addChild](#addchild-child-options-) _`inherited`_ - - [addClass](#addclass-classtoadd-) _`inherited`_ - - [buildCSSClass](#buildcssclass) _`inherited`_ - - [children](#children) _`inherited`_ - - [clearInterval](#clearinterval-intervalid-) _`inherited`_ - - [clearTimeout](#cleartimeout-timeoutid-) _`inherited`_ - - [contentEl](#contentel) _`inherited`_ - - [createEl](#createel-tagname-attributes-) _`inherited`_ - - [dimensions](#dimensions-width-height-) _`inherited`_ - - [dispose](#dispose) _`inherited`_ - - [el](#el) _`inherited`_ - - [enableTouchActivity](#enabletouchactivity) _`inherited`_ - - [getChild](#getchild-name-) _`inherited`_ - - [getChildById](#getchildbyid-id-) _`inherited`_ - - [hasClass](#hasclass-classtocheck-) _`inherited`_ - - [height](#height-num-skiplisteners-) _`inherited`_ - - [hide](#hide) _`inherited`_ - - [id](#id) _`inherited`_ - - [initChildren](#initchildren) _`inherited`_ - - [name](#name) _`inherited`_ - - [off](#off-first-second-third-) _`inherited`_ - - [on](#on-first-second-third-) _`inherited`_ - - [one](#one-first-second-third-) _`inherited`_ - - [options](#options-obj-) _`inherited`_ - - [player](#player) _`inherited`_ - - [ready](#ready-fn-) _`inherited`_ - - [removeChild](#removechild-component-) _`inherited`_ - - [removeClass](#removeclass-classtoremove-) _`inherited`_ - - [setInterval](#setinterval-fn-interval-) _`inherited`_ - - [setTimeout](#settimeout-fn-timeout-) _`inherited`_ - - [show](#show) _`inherited`_ - - [trigger](#trigger-event-) _`inherited`_ - - [triggerReady](#triggerready) _`inherited`_ - - [width](#width-num-skiplisteners-) _`inherited`_ - -- [EVENTS](#events) - - [resize](#resize-event) _`inherited`_ - ---- - -## METHODS - -### addChild( child, [options] ) -> Adds a child component inside this component -> -> myComponent.el(); -> // ->
    -> myComonent.children(); -> // [empty array] -> -> var myButton = myComponent.addChild('MyButton'); -> // ->
    myButton
    -> // -> myButton === myComonent.children()[0]; -> -> Pass in options for child constructors and options for children of the child -> -> var myButton = myComponent.addChild('MyButton', { -> text: 'Press Me', -> children: { -> buttonChildExample: { -> buttonChildOption: true -> } -> } -> }); - -##### PARAMETERS: -* __child__ `String|vjs.Component` The class name or instance of a child to add -* __options__ `Object` _(OPTIONAL)_ Options, including options to be passed to children of the child. - -##### RETURNS: -* `vjs.Component` The child component (created by this process if a string was used) - -_inherited from_: [src/js/component.js#L362](https://github.com/videojs/video.js/blob/master/src/js/component.js#L362) - ---- - -### addClass( classToAdd ) -> Add a CSS class name to the component's element - -##### PARAMETERS: -* __classToAdd__ `String` Classname to add - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L826](https://github.com/videojs/video.js/blob/master/src/js/component.js#L826) - ---- - -### buildCSSClass() -> Allows sub components to stack CSS class names - -##### RETURNS: -* `String` The constructed class name - -_inherited from_: [src/js/component.js#L536](https://github.com/videojs/video.js/blob/master/src/js/component.js#L536) - ---- - -### children() -> Get an array of all child components -> -> var kids = myComponent.children(); - -##### RETURNS: -* `Array` The children - -_inherited from_: [src/js/component.js#L296](https://github.com/videojs/video.js/blob/master/src/js/component.js#L296) - ---- - -### clearInterval( intervalId ) -> Clears an interval and removes the associated dispose listener - -##### PARAMETERS: -* __intervalId__ `Number` The id of the interval to clear - -##### RETURNS: -* `Number` Returns the interval ID - -_inherited from_: [src/js/component.js#L1223](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1223) - ---- - -### clearTimeout( timeoutId ) -> Clears a timeout and removes the associated dispose listener - -##### PARAMETERS: -* __timeoutId__ `Number` The id of the timeout to clear - -##### RETURNS: -* `Number` Returns the timeout ID - -_inherited from_: [src/js/component.js#L1185](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1185) - ---- - -### contentEl() -> Return the component's DOM element for embedding content. -> Will either be el_ or a new element defined in createEl. - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L239](https://github.com/videojs/video.js/blob/master/src/js/component.js#L239) - ---- - -### createEl( [tagName], [attributes] ) -> Create the component's DOM element - -##### PARAMETERS: -* __tagName__ `String` _(OPTIONAL)_ Element's node type. e.g. 'div' -* __attributes__ `Object` _(OPTIONAL)_ An object of element attributes that should be set on the element - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L200](https://github.com/videojs/video.js/blob/master/src/js/component.js#L200) - ---- - -### dimensions( width, height ) -> Set both width and height at the same time - -##### PARAMETERS: -* __width__ `Number|String` -* __height__ `Number|String` - -##### RETURNS: -* `vjs.Component` The component - -_inherited from_: [src/js/component.js#L938](https://github.com/videojs/video.js/blob/master/src/js/component.js#L938) - ---- - -### dispose() -> Dispose of the component and all child components - -_inherited from_: [src/js/component.js#L84](https://github.com/videojs/video.js/blob/master/src/js/component.js#L84) - ---- - -### el() -> Get the component's DOM element -> -> var domEl = myComponent.el(); - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L220](https://github.com/videojs/video.js/blob/master/src/js/component.js#L220) - ---- - -### enableTouchActivity() -> Report user touch activity when touch events occur -> -> User activity is used to determine when controls should show/hide. It's -> relatively simple when it comes to mouse events, because any mouse event -> should show the controls. So we capture mouse events that bubble up to the -> player and report activity when that happens. -> -> With touch events it isn't as easy. We can't rely on touch events at the -> player level, because a tap (touchstart + touchend) on the video itself on -> mobile devices is meant to turn controls off (and on). User activity is -> checked asynchronously, so what could happen is a tap event on the video -> turns the controls off, then the touchend event bubbles up to the player, -> which if it reported user activity, would turn the controls right back on. -> (We also don't want to completely block touch events from bubbling up) -> -> Also a touchmove, touch+hold, and anything other than a tap is not supposed -> to turn the controls back on on a mobile device. -> -> Here we're setting the default component behavior to report user activity -> whenever touch events happen, and this can be turned off by components that -> want touch events to act differently. - -_inherited from_: [src/js/component.js#L1124](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1124) - ---- - -### getChild( name ) -> Returns a child component with the provided name - -##### PARAMETERS: -* __name__ - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L330](https://github.com/videojs/video.js/blob/master/src/js/component.js#L330) - ---- - -### getChildById( id ) -> Returns a child component with the provided ID - -##### PARAMETERS: -* __id__ - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L313](https://github.com/videojs/video.js/blob/master/src/js/component.js#L313) - ---- - -### hasClass( classToCheck ) -> Check if a component's element has a CSS class name - -##### PARAMETERS: -* __classToCheck__ `String` Classname to check - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L816](https://github.com/videojs/video.js/blob/master/src/js/component.js#L816) - ---- - -### height( [num], [skipListeners] ) -> Get or set the height of the component (CSS values) -> -> Setting the video tag dimension values only works with values in pixels. -> Percent values will not work. -> Some percents can be used, but width()/height() will return the number + %, -> not the actual computed width/height. - -##### PARAMETERS: -* __num__ `Number|String` _(OPTIONAL)_ New component height -* __skipListeners__ `Boolean` _(OPTIONAL)_ Skip the resize event trigger - -##### RETURNS: -* `vjs.Component` This component, when setting the height -* `Number|String` The height, when getting - -_inherited from_: [src/js/component.js#L927](https://github.com/videojs/video.js/blob/master/src/js/component.js#L927) - ---- - -### hide() -> Hide the component element if currently showing - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L857](https://github.com/videojs/video.js/blob/master/src/js/component.js#L857) - ---- - -### id() -> Get the component's ID -> -> var id = myComponent.id(); - -##### RETURNS: -* `String` - -_inherited from_: [src/js/component.js#L258](https://github.com/videojs/video.js/blob/master/src/js/component.js#L258) - ---- - -### init( player, options ) - -##### PARAMETERS: -* __player__ -* __options__ - -_defined in_: [src/js/control-bar/play-toggle.js#L10](https://github.com/videojs/video.js/blob/master/src/js/control-bar/play-toggle.js#L10) - ---- - -### initChildren() -> Add and initialize default child components from options -> -> // when an instance of MyComponent is created, all children in options -> // will be added to the instance by their name strings and options -> MyComponent.prototype.options_.children = { -> myChildComponent: { -> myChildOption: true -> } -> } -> -> // Or when creating the component -> var myComp = new MyComponent(player, { -> children: { -> myChildComponent: { -> myChildOption: true -> } -> } -> }); -> -> The children option can also be an Array of child names or -> child options objects (that also include a 'name' key). -> -> var myComp = new MyComponent(player, { -> children: [ -> 'button', -> { -> name: 'button', -> someOtherOption: true -> } -> ] -> }); - -_inherited from_: [src/js/component.js#L481](https://github.com/videojs/video.js/blob/master/src/js/component.js#L481) - ---- - -### name() -> Get the component's name. The name is often used to reference the component. -> -> var name = myComponent.name(); - -##### RETURNS: -* `String` - -_inherited from_: [src/js/component.js#L277](https://github.com/videojs/video.js/blob/master/src/js/component.js#L277) - ---- - -### off( [first], [second], [third] ) -> Remove an event listener from this component's element -> -> myComponent.off('eventType', myFunc); -> -> If myFunc is excluded, ALL listeners for the event type will be removed. -> If eventType is excluded, ALL listeners will be removed from the component. -> -> Alternatively you can use `off` to remove listeners that were added to other -> elements or components using `myComponent.on(otherComponent...`. -> In this case both the event type and listener function are REQUIRED. -> -> myComponent.off(otherElement, 'eventType', myFunc); -> myComponent.off(otherComponent, 'eventType', myFunc); - -##### PARAMETERS: -* __first__ `String|vjs.Component` _(OPTIONAL)_ The event type or other component -* __second__ `Function|String` _(OPTIONAL)_ The listener function or event type -* __third__ `Function` _(OPTIONAL)_ The listener for other component - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L646](https://github.com/videojs/video.js/blob/master/src/js/component.js#L646) - ---- - -### on( first, second, third ) -> Add an event listener to this component's element -> -> var myFunc = function(){ -> var myComponent = this; -> // Do something when the event is fired -> }; -> -> myComponent.on('eventType', myFunc); -> -> The context of myFunc will be myComponent unless previously bound. -> -> Alternatively, you can add a listener to another element or component. -> -> myComponent.on(otherElement, 'eventName', myFunc); -> myComponent.on(otherComponent, 'eventName', myFunc); -> -> The benefit of using this over `vjs.on(otherElement, 'eventName', myFunc)` -> and `otherComponent.on('eventName', myFunc)` is that this way the listeners -> will be automatically cleaned up when either component is disposed. -> It will also bind myComponent as the context of myFunc. -> -> **NOTE**: When using this on elements in the page other than window -> and document (both permanent), if you remove the element from the DOM -> you need to call `vjs.trigger(el, 'dispose')` on it to clean up -> references to it and allow the browser to garbage collect it. - -##### PARAMETERS: -* __first__ `String|vjs.Component` The event type or other component -* __second__ `Function|String` The event handler or event type -* __third__ `Function` The event handler - -##### RETURNS: -* `vjs.Component` self - -_inherited from_: [src/js/component.js#L577](https://github.com/videojs/video.js/blob/master/src/js/component.js#L577) - ---- - -### one( first, second, [third] ) -> Add an event listener to be triggered only once and then removed -> -> myComponent.one('eventName', myFunc); -> -> Alternatively you can add a listener to another element or component -> that will be triggered only once. -> -> myComponent.one(otherElement, 'eventName', myFunc); -> myComponent.one(otherComponent, 'eventName', myFunc); - -##### PARAMETERS: -* __first__ `String|vjs.Component` The event type or other component -* __second__ `Function|String` The listener function or event type -* __third__ `Function` _(OPTIONAL)_ The listener function for other component - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L691](https://github.com/videojs/video.js/blob/master/src/js/component.js#L691) - ---- - -### options( obj ) -> Deep merge of options objects -> -> Whenever a property is an object on both options objects -> the two properties will be merged using vjs.obj.deepMerge. -> -> This is used for merging options for child components. We -> want it to be easy to override individual options on a child -> component without having to rewrite all the other default options. -> -> Parent.prototype.options_ = { -> children: { -> 'childOne': { 'foo': 'bar', 'asdf': 'fdsa' }, -> 'childTwo': {}, -> 'childThree': {} -> } -> } -> newOptions = { -> children: { -> 'childOne': { 'foo': 'baz', 'abc': '123' } -> 'childTwo': null, -> 'childFour': {} -> } -> } -> -> this.options(newOptions); -> -> RESULT -> -> { -> children: { -> 'childOne': { 'foo': 'baz', 'asdf': 'fdsa', 'abc': '123' }, -> 'childTwo': null, // Disabled. Won't be initialized. -> 'childThree': {}, -> 'childFour': {} -> } -> } - -##### PARAMETERS: -* __obj__ `Object` Object of new option values - -##### RETURNS: -* `Object` A NEW object of this.options_ and obj merged - -_inherited from_: [src/js/component.js#L179](https://github.com/videojs/video.js/blob/master/src/js/component.js#L179) - ---- - -### player() -> Return the component's player - -##### RETURNS: -* `vjs.Player` - -_inherited from_: [src/js/component.js#L126](https://github.com/videojs/video.js/blob/master/src/js/component.js#L126) - ---- - -### ready( fn ) -> Bind a listener to the component's ready state -> -> Different from event listeners in that if the ready event has already happened -> it will trigger the function immediately. - -##### PARAMETERS: -* __fn__ `Function` Ready listener - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L769](https://github.com/videojs/video.js/blob/master/src/js/component.js#L769) - ---- - -### removeChild( component ) -> Remove a child component from this component's list of children, and the -> child component's element from this component's element - -##### PARAMETERS: -* __component__ `vjs.Component` Component to remove - -_inherited from_: [src/js/component.js#L420](https://github.com/videojs/video.js/blob/master/src/js/component.js#L420) - ---- - -### removeClass( classToRemove ) -> Remove a CSS class name from the component's element - -##### PARAMETERS: -* __classToRemove__ `String` Classname to remove - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L837](https://github.com/videojs/video.js/blob/master/src/js/component.js#L837) - ---- - -### setInterval( fn, interval ) -> Creates an interval and sets up disposal automatically. - -##### PARAMETERS: -* __fn__ `Function` The function to run every N seconds. -* __interval__ `Number` Number of ms to delay before executing specified function. - -##### RETURNS: -* `Number` Returns the interval ID - -_inherited from_: [src/js/component.js#L1202](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1202) - ---- - -### setTimeout( fn, timeout ) -> Creates timeout and sets up disposal automatically. - -##### PARAMETERS: -* __fn__ `Function` The function to run after the timeout. -* __timeout__ `Number` Number of ms to delay before executing specified function. - -##### RETURNS: -* `Number` Returns the timeout ID - -_inherited from_: [src/js/component.js#L1162](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1162) - ---- - -### show() -> Show the component element if hidden - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L847](https://github.com/videojs/video.js/blob/master/src/js/component.js#L847) - ---- - -### trigger( event ) -> Trigger an event on an element -> -> myComponent.trigger('eventName'); -> myComponent.trigger({'type':'eventName'}); - -##### PARAMETERS: -* __event__ `Event|Object|String` A string (the type) or an event object with a type attribute - -##### RETURNS: -* `vjs.Component` self - -_inherited from_: [src/js/component.js#L724](https://github.com/videojs/video.js/blob/master/src/js/component.js#L724) - ---- - -### triggerReady() -> Trigger the ready listeners - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L788](https://github.com/videojs/video.js/blob/master/src/js/component.js#L788) - ---- - -### width( [num], skipListeners ) -> Set or get the width of the component (CSS values) -> -> Setting the video tag dimension values only works with values in pixels. -> Percent values will not work. -> Some percents can be used, but width()/height() will return the number + %, -> not the actual computed width/height. - -##### PARAMETERS: -* __num__ `Number|String` _(OPTIONAL)_ Optional width number -* __skipListeners__ `Boolean` Skip the 'resize' event trigger - -##### RETURNS: -* `vjs.Component` This component, when setting the width -* `Number|String` The width, when getting - -_inherited from_: [src/js/component.js#L910](https://github.com/videojs/video.js/blob/master/src/js/component.js#L910) - ---- - -## EVENTS - -### resize `EVENT` -> Fired when the width and/or height of the component changes - -_inherited from_: [src/js/component.js#L1020](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1020) - ---- - diff --git a/docs/api/vjs.Player.md b/docs/api/vjs.Player.md deleted file mode 100644 index cfd9420137..0000000000 --- a/docs/api/vjs.Player.md +++ /dev/null @@ -1,1419 +0,0 @@ - - -# vjs.Player - -__EXTENDS__: [vjs.Component](vjs.Component.md) -__DEFINED IN__: [src/js/player.js#L21](https://github.com/videojs/video.js/blob/master/src/js/player.js#L21) - -An instance of the `vjs.Player` class is created when any of the Video.js setup methods are used to initialize a video. - -```js -var myPlayer = videojs('example_video_1'); -``` - -In the following example, the `data-setup` attribute tells the Video.js library to create a player instance when the library is ready. - -```html - -``` - -After an instance has been created it can be accessed globally using `Video('example_video_1')`. - ---- - -## INDEX - -- [METHODS](#methods) - - [addTextTrack](#addtexttrack-kind-label-language-) - - [autoplay](#autoplay-value-) - - [buffered](#buffered) - - [bufferedEnd](#bufferedend) - - [bufferedPercent](#bufferedpercent) - - [cancelFullScreen](#cancelfullscreen) _`deprecated`_ - - [controls](#controls-controls-) - - [currentSrc](#currentsrc) - - [currentTime](#currenttime-seconds-) - - [currentType](#currenttype) - - [dispose](#dispose) - - [duration](#duration-seconds-) - - [ended](#ended) - - [error](#error-err-) - - [exitFullscreen](#exitfullscreen) - - [init](#init-tag-options-ready-) - - [isFullScreen](#isfullscreen-isfs-) _`deprecated`_ - - [isFullscreen](#isfullscreen-isfs-) - - [language](#language-languagecode-) - - [load](#load) - - [loop](#loop-value-) - - [muted](#muted-muted-) - - [networkState](#networkstate) - - [pause](#pause) - - [paused](#paused) - - [play](#play) - - [playbackRate](#playbackrate-rate-) - - [poster](#poster-src-) - - [preload](#preload-value-) - - [readyState](#readystate) - - [remainingTime](#remainingtime) - - [requestFullScreen](#requestfullscreen) _`deprecated`_ - - [requestFullscreen](#requestfullscreen) - - [seekable](#seekable) - - [seeking](#seeking) - - [src](#src-source-) - - [textTracks](#texttracks) - - [volume](#volume-percentasdecimal-) - - [addChild](#addchild-child-options-) _`inherited`_ - - [addClass](#addclass-classtoadd-) _`inherited`_ - - [buildCSSClass](#buildcssclass) _`inherited`_ - - [children](#children) _`inherited`_ - - [clearInterval](#clearinterval-intervalid-) _`inherited`_ - - [clearTimeout](#cleartimeout-timeoutid-) _`inherited`_ - - [contentEl](#contentel) _`inherited`_ - - [createEl](#createel-tagname-attributes-) _`inherited`_ - - [dimensions](#dimensions-width-height-) _`inherited`_ - - [el](#el) _`inherited`_ - - [enableTouchActivity](#enabletouchactivity) _`inherited`_ - - [getChild](#getchild-name-) _`inherited`_ - - [getChildById](#getchildbyid-id-) _`inherited`_ - - [hasClass](#hasclass-classtocheck-) _`inherited`_ - - [height](#height-num-skiplisteners-) _`inherited`_ - - [hide](#hide) _`inherited`_ - - [id](#id) _`inherited`_ - - [initChildren](#initchildren) _`inherited`_ - - [name](#name) _`inherited`_ - - [off](#off-first-second-third-) _`inherited`_ - - [on](#on-first-second-third-) _`inherited`_ - - [one](#one-first-second-third-) _`inherited`_ - - [options](#options-obj-) _`inherited`_ - - [player](#player) _`inherited`_ - - [ready](#ready-fn-) _`inherited`_ - - [removeChild](#removechild-component-) _`inherited`_ - - [removeClass](#removeclass-classtoremove-) _`inherited`_ - - [setInterval](#setinterval-fn-interval-) _`inherited`_ - - [setTimeout](#settimeout-fn-timeout-) _`inherited`_ - - [show](#show) _`inherited`_ - - [trigger](#trigger-event-) _`inherited`_ - - [triggerReady](#triggerready) _`inherited`_ - - [width](#width-num-skiplisteners-) _`inherited`_ - -- [EVENTS](#events) - - [durationchange](#durationchange-event) - - [ended](#ended-event) - - [error](#error-event) - - [firstplay](#firstplay-event) - - [fullscreenchange](#fullscreenchange-event) - - [loadedalldata](#loadedalldata-event) - - [loadeddata](#loadeddata-event) - - [loadedmetadata](#loadedmetadata-event) - - [loadstart](#loadstart-event) - - [pause](#pause-event) - - [play](#play-event) - - [progress](#progress-event) - - [seeked](#seeked-event) - - [seeking](#seeking-event) - - [timeupdate](#timeupdate-event) - - [volumechange](#volumechange-event) - - [waiting](#waiting-event) - - [resize](#resize-event) _`inherited`_ - ---- - -## METHODS - -### addChild( child, [options] ) -> Adds a child component inside this component -> -> myComponent.el(); -> // ->
    -> myComonent.children(); -> // [empty array] -> -> var myButton = myComponent.addChild('MyButton'); -> // ->
    myButton
    -> // -> myButton === myComonent.children()[0]; -> -> Pass in options for child constructors and options for children of the child -> -> var myButton = myComponent.addChild('MyButton', { -> text: 'Press Me', -> children: { -> buttonChildExample: { -> buttonChildOption: true -> } -> } -> }); - -##### PARAMETERS: -* __child__ `String|vjs.Component` The class name or instance of a child to add -* __options__ `Object` _(OPTIONAL)_ Options, including options to be passed to children of the child. - -##### RETURNS: -* `vjs.Component` The child component (created by this process if a string was used) - -_inherited from_: [src/js/component.js#L362](https://github.com/videojs/video.js/blob/master/src/js/component.js#L362) - ---- - -### addClass( classToAdd ) -> Add a CSS class name to the component's element - -##### PARAMETERS: -* __classToAdd__ `String` Classname to add - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L826](https://github.com/videojs/video.js/blob/master/src/js/component.js#L826) - ---- - -### addTextTrack( kind, [label], [language] ) -> Add a text track -> In addition to the W3C settings we allow adding additional info through options. -> http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-media-addtexttrack - -##### PARAMETERS: -* __kind__ `String` Captions, subtitles, chapters, descriptions, or metadata -* __label__ `String` _(OPTIONAL)_ Optional label -* __language__ `String` _(OPTIONAL)_ Optional language - -_defined in_: [src/js/player.js#L1729](https://github.com/videojs/video.js/blob/master/src/js/player.js#L1729) - ---- - -### autoplay( value ) -> Get or set the autoplay attribute. - -##### PARAMETERS: -* __value__ - -##### RETURNS: -* `String` The autoplay attribute value when getting -* `vjs.Player` Returns the player when setting - -_defined in_: [src/js/player.js#L1263](https://github.com/videojs/video.js/blob/master/src/js/player.js#L1263) - ---- - -### buffered() -> Get a TimeRange object with the times of the video that have been downloaded -> -> If you just want the percent of the video that's been downloaded, -> use bufferedPercent. -> -> // Number of different ranges of time have been buffered. Usually 1. -> numberOfRanges = bufferedTimeRange.length, -> -> // Time in seconds when the first range starts. Usually 0. -> firstRangeStart = bufferedTimeRange.start(0), -> -> // Time in seconds when the first range ends -> firstRangeEnd = bufferedTimeRange.end(0), -> -> // Length in seconds of the first time range -> firstRangeLength = firstRangeEnd - firstRangeStart; - -##### RETURNS: -* `Object` A mock TimeRange object (following HTML spec) - -_defined in_: [src/js/player.js#L770](https://github.com/videojs/video.js/blob/master/src/js/player.js#L770) - ---- - -### bufferedEnd() -> Get the ending time of the last buffered time range -> -> This is used in the progress bar to encapsulate all time ranges. - -##### RETURNS: -* `Number` The end of the last buffered time range - -_defined in_: [src/js/player.js#L821](https://github.com/videojs/video.js/blob/master/src/js/player.js#L821) - ---- - -### bufferedPercent() -> Get the percent (as a decimal) of the video that's been downloaded -> -> var howMuchIsDownloaded = myPlayer.bufferedPercent(); -> -> 0 means none, 1 means all. -> (This method isn't in the HTML5 spec, but it's very convenient) - -##### RETURNS: -* `Number` A decimal between 0 and 1 representing the percent - -_defined in_: [src/js/player.js#L790](https://github.com/videojs/video.js/blob/master/src/js/player.js#L790) - ---- - -### buildCSSClass() -> Allows sub components to stack CSS class names - -##### RETURNS: -* `String` The constructed class name - -_inherited from_: [src/js/component.js#L536](https://github.com/videojs/video.js/blob/master/src/js/component.js#L536) - ---- - -### cancelFullScreen() -> Old naming for exitFullscreen -**Deprecated** true - -_defined in_: [src/js/player.js#L1026](https://github.com/videojs/video.js/blob/master/src/js/player.js#L1026) - ---- - -### children() -> Get an array of all child components -> -> var kids = myComponent.children(); - -##### RETURNS: -* `Array` The children - -_inherited from_: [src/js/component.js#L296](https://github.com/videojs/video.js/blob/master/src/js/component.js#L296) - ---- - -### clearInterval( intervalId ) -> Clears an interval and removes the associated dispose listener - -##### PARAMETERS: -* __intervalId__ `Number` The id of the interval to clear - -##### RETURNS: -* `Number` Returns the interval ID - -_inherited from_: [src/js/component.js#L1223](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1223) - ---- - -### clearTimeout( timeoutId ) -> Clears a timeout and removes the associated dispose listener - -##### PARAMETERS: -* __timeoutId__ `Number` The id of the timeout to clear - -##### RETURNS: -* `Number` Returns the timeout ID - -_inherited from_: [src/js/component.js#L1185](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1185) - ---- - -### contentEl() -> Return the component's DOM element for embedding content. -> Will either be el_ or a new element defined in createEl. - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L239](https://github.com/videojs/video.js/blob/master/src/js/component.js#L239) - ---- - -### controls( controls ) -> Get or set whether or not the controls are showing. - -##### PARAMETERS: -* __controls__ `Boolean` Set controls to showing or not - -##### RETURNS: -* `Boolean` Controls are showing - -_defined in_: [src/js/player.js#L1343](https://github.com/videojs/video.js/blob/master/src/js/player.js#L1343) - ---- - -### createEl( [tagName], [attributes] ) -> Create the component's DOM element - -##### PARAMETERS: -* __tagName__ `String` _(OPTIONAL)_ Element's node type. e.g. 'div' -* __attributes__ `Object` _(OPTIONAL)_ An object of element attributes that should be set on the element - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L200](https://github.com/videojs/video.js/blob/master/src/js/component.js#L200) - ---- - -### currentSrc() -> Returns the fully qualified URL of the current source value e.g. http://mysite.com/video.mp4 -> Can be used in conjuction with `currentType` to assist in rebuilding the current source object. - -##### RETURNS: -* `String` The current source - -_defined in_: [src/js/player.js#L1230](https://github.com/videojs/video.js/blob/master/src/js/player.js#L1230) - ---- - -### currentTime( [seconds] ) -> Get or set the current time (in seconds) -> -> // get -> var whereYouAt = myPlayer.currentTime(); -> -> // set -> myPlayer.currentTime(120); // 2 minutes into the video - -##### PARAMETERS: -* __seconds__ `Number|String` _(OPTIONAL)_ The time to seek to - -##### RETURNS: -* `Number` The time in seconds, when not setting -* `vjs.Player` self, when the current time is set - -_defined in_: [src/js/player.js#L690](https://github.com/videojs/video.js/blob/master/src/js/player.js#L690) - ---- - -### currentType() -> Get the current source type e.g. video/mp4 -> This can allow you rebuild the current source object so that you could load the same -> source and tech later - -##### RETURNS: -* `String` The source MIME type - -_defined in_: [src/js/player.js#L1240](https://github.com/videojs/video.js/blob/master/src/js/player.js#L1240) - ---- - -### dimensions( width, height ) -> Set both width and height at the same time - -##### PARAMETERS: -* __width__ `Number|String` -* __height__ `Number|String` - -##### RETURNS: -* `vjs.Component` The component - -_inherited from_: [src/js/component.js#L938](https://github.com/videojs/video.js/blob/master/src/js/component.js#L938) - ---- - -### dispose() -> Destroys the video player and does any necessary cleanup -> -> myPlayer.dispose(); -> -> This is especially helpful if you are dynamically adding and removing videos -> to/from the DOM. - -_defined in_: [src/js/player.js#L164](https://github.com/videojs/video.js/blob/master/src/js/player.js#L164) - ---- - -### duration( seconds ) -> Get the length in time of the video in seconds -> -> var lengthOfVideo = myPlayer.duration(); -> -> **NOTE**: The video must have started loading before the duration can be -> known, and in the case of Flash, may not be known until the video starts -> playing. - -##### PARAMETERS: -* __seconds__ - -##### RETURNS: -* `Number` The duration of the video in seconds - -_defined in_: [src/js/player.js#L718](https://github.com/videojs/video.js/blob/master/src/js/player.js#L718) - ---- - -### el() -> Get the component's DOM element -> -> var domEl = myComponent.el(); - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L220](https://github.com/videojs/video.js/blob/master/src/js/component.js#L220) - ---- - -### enableTouchActivity() -> Report user touch activity when touch events occur -> -> User activity is used to determine when controls should show/hide. It's -> relatively simple when it comes to mouse events, because any mouse event -> should show the controls. So we capture mouse events that bubble up to the -> player and report activity when that happens. -> -> With touch events it isn't as easy. We can't rely on touch events at the -> player level, because a tap (touchstart + touchend) on the video itself on -> mobile devices is meant to turn controls off (and on). User activity is -> checked asynchronously, so what could happen is a tap event on the video -> turns the controls off, then the touchend event bubbles up to the player, -> which if it reported user activity, would turn the controls right back on. -> (We also don't want to completely block touch events from bubbling up) -> -> Also a touchmove, touch+hold, and anything other than a tap is not supposed -> to turn the controls back on on a mobile device. -> -> Here we're setting the default component behavior to report user activity -> whenever touch events happen, and this can be turned off by components that -> want touch events to act differently. - -_inherited from_: [src/js/component.js#L1124](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1124) - ---- - -### ended() -> Returns whether or not the player is in the "ended" state. - -##### RETURNS: -* `Boolean` True if the player is in the ended state, false if not. - -_defined in_: [src/js/player.js#L1464](https://github.com/videojs/video.js/blob/master/src/js/player.js#L1464) - ---- - -### error( err ) -> Set or get the current MediaError - -##### PARAMETERS: -* __err__ `*` A MediaError or a String/Number to be turned into a MediaError - -##### RETURNS: -* `vjs.MediaError|null` when getting -* `vjs.Player` when setting - -_defined in_: [src/js/player.js#L1428](https://github.com/videojs/video.js/blob/master/src/js/player.js#L1428) - ---- - -### exitFullscreen() -> Return the video to its normal size after having been in full screen mode -> -> myPlayer.exitFullscreen(); - -##### RETURNS: -* `vjs.Player` self - -_defined in_: [src/js/player.js#L1005](https://github.com/videojs/video.js/blob/master/src/js/player.js#L1005) - ---- - -### getChild( name ) -> Returns a child component with the provided name - -##### PARAMETERS: -* __name__ - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L330](https://github.com/videojs/video.js/blob/master/src/js/component.js#L330) - ---- - -### getChildById( id ) -> Returns a child component with the provided ID - -##### PARAMETERS: -* __id__ - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L313](https://github.com/videojs/video.js/blob/master/src/js/component.js#L313) - ---- - -### hasClass( classToCheck ) -> Check if a component's element has a CSS class name - -##### PARAMETERS: -* __classToCheck__ `String` Classname to check - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L816](https://github.com/videojs/video.js/blob/master/src/js/component.js#L816) - ---- - -### height( [num], [skipListeners] ) -> Get or set the height of the component (CSS values) -> -> Setting the video tag dimension values only works with values in pixels. -> Percent values will not work. -> Some percents can be used, but width()/height() will return the number + %, -> not the actual computed width/height. - -##### PARAMETERS: -* __num__ `Number|String` _(OPTIONAL)_ New component height -* __skipListeners__ `Boolean` _(OPTIONAL)_ Skip the resize event trigger - -##### RETURNS: -* `vjs.Component` This component, when setting the height -* `Number|String` The height, when getting - -_inherited from_: [src/js/component.js#L927](https://github.com/videojs/video.js/blob/master/src/js/component.js#L927) - ---- - -### hide() -> Hide the component element if currently showing - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L857](https://github.com/videojs/video.js/blob/master/src/js/component.js#L857) - ---- - -### id() -> Get the component's ID -> -> var id = myComponent.id(); - -##### RETURNS: -* `String` - -_inherited from_: [src/js/component.js#L258](https://github.com/videojs/video.js/blob/master/src/js/component.js#L258) - ---- - -### init( tag, [options], [ready] ) -> player's constructor function - -##### PARAMETERS: -* __tag__ `Element` The original video tag used for configuring options -* __options__ `Object` _(OPTIONAL)_ Player options -* __ready__ `Function` _(OPTIONAL)_ Ready callback function - -_defined in_: [src/js/player.js#L32](https://github.com/videojs/video.js/blob/master/src/js/player.js#L32) - ---- - -### initChildren() -> Add and initialize default child components from options -> -> // when an instance of MyComponent is created, all children in options -> // will be added to the instance by their name strings and options -> MyComponent.prototype.options_.children = { -> myChildComponent: { -> myChildOption: true -> } -> } -> -> // Or when creating the component -> var myComp = new MyComponent(player, { -> children: { -> myChildComponent: { -> myChildOption: true -> } -> } -> }); -> -> The children option can also be an Array of child names or -> child options objects (that also include a 'name' key). -> -> var myComp = new MyComponent(player, { -> children: [ -> 'button', -> { -> name: 'button', -> someOtherOption: true -> } -> ] -> }); - -_inherited from_: [src/js/component.js#L481](https://github.com/videojs/video.js/blob/master/src/js/component.js#L481) - ---- - -### isFullScreen( isFS ) -> Old naming for isFullscreen() -**Deprecated** true - -##### PARAMETERS: -* __isFS__ - -_defined in_: [src/js/player.js#L928](https://github.com/videojs/video.js/blob/master/src/js/player.js#L928) - ---- - -### isFullscreen( [isFS] ) -> Check if the player is in fullscreen mode -> -> // get -> var fullscreenOrNot = myPlayer.isFullscreen(); -> -> // set -> myPlayer.isFullscreen(true); // tell the player it's in fullscreen -> -> NOTE: As of the latest HTML5 spec, isFullscreen is no longer an official -> property and instead document.fullscreenElement is used. But isFullscreen is -> still a valuable property for internal player workings. - -##### PARAMETERS: -* __isFS__ `Boolean` _(OPTIONAL)_ Update the player's fullscreen state - -##### RETURNS: -* `Boolean` true if fullscreen, false if not -* `vjs.Player` self, when setting - -_defined in_: [src/js/player.js#L916](https://github.com/videojs/video.js/blob/master/src/js/player.js#L916) - ---- - -### language( languageCode ) -> The player's language code - -##### PARAMETERS: -* __languageCode__ `String` The locale string - -##### RETURNS: -* `String` The locale string when getting -* `vjs.Player` self, when setting - -_defined in_: [src/js/player.js#L124](https://github.com/videojs/video.js/blob/master/src/js/player.js#L124) - ---- - -### load() -> Begin loading the src data. - -##### RETURNS: -* `vjs.Player` Returns the player - -_defined in_: [src/js/player.js#L1220](https://github.com/videojs/video.js/blob/master/src/js/player.js#L1220) - ---- - -### loop( value ) -> Get or set the loop attribute on the video element. - -##### PARAMETERS: -* __value__ - -##### RETURNS: -* `String` The loop attribute value when getting -* `vjs.Player` Returns the player when setting - -_defined in_: [src/js/player.js#L1277](https://github.com/videojs/video.js/blob/master/src/js/player.js#L1277) - ---- - -### muted( [muted] ) -> Get the current muted state, or turn mute on or off -> -> // get -> var isVolumeMuted = myPlayer.muted(); -> -> // set -> myPlayer.muted(true); // mute the volume - -##### PARAMETERS: -* __muted__ `Boolean` _(OPTIONAL)_ True to mute, false to unmute - -##### RETURNS: -* `Boolean` True if mute is on, false if not, when getting -* `vjs.Player` self, when setting mute - -_defined in_: [src/js/player.js#L878](https://github.com/videojs/video.js/blob/master/src/js/player.js#L878) - ---- - -### name() -> Get the component's name. The name is often used to reference the component. -> -> var name = myComponent.name(); - -##### RETURNS: -* `String` - -_inherited from_: [src/js/component.js#L277](https://github.com/videojs/video.js/blob/master/src/js/component.js#L277) - ---- - -### networkState() -> Returns the current state of network activity for the element, from -> the codes in the list below. -> - NETWORK_EMPTY (numeric value 0) -> The element has not yet been initialised. All attributes are in -> their initial states. -> - NETWORK_IDLE (numeric value 1) -> The element's resource selection algorithm is active and has -> selected a resource, but it is not actually using the network at -> this time. -> - NETWORK_LOADING (numeric value 2) -> The user agent is actively trying to download data. -> - NETWORK_NO_SOURCE (numeric value 3) -> The element's resource selection algorithm is active, but it has -> not yet found a resource to use. - -##### RETURNS: -* `Number` the current network activity state - -_defined in_: [src/js/player.js#L1669](https://github.com/videojs/video.js/blob/master/src/js/player.js#L1669) - ---- - -### off( [first], [second], [third] ) -> Remove an event listener from this component's element -> -> myComponent.off('eventType', myFunc); -> -> If myFunc is excluded, ALL listeners for the event type will be removed. -> If eventType is excluded, ALL listeners will be removed from the component. -> -> Alternatively you can use `off` to remove listeners that were added to other -> elements or components using `myComponent.on(otherComponent...`. -> In this case both the event type and listener function are REQUIRED. -> -> myComponent.off(otherElement, 'eventType', myFunc); -> myComponent.off(otherComponent, 'eventType', myFunc); - -##### PARAMETERS: -* __first__ `String|vjs.Component` _(OPTIONAL)_ The event type or other component -* __second__ `Function|String` _(OPTIONAL)_ The listener function or event type -* __third__ `Function` _(OPTIONAL)_ The listener for other component - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L646](https://github.com/videojs/video.js/blob/master/src/js/component.js#L646) - ---- - -### on( first, second, third ) -> Add an event listener to this component's element -> -> var myFunc = function(){ -> var myComponent = this; -> // Do something when the event is fired -> }; -> -> myComponent.on('eventType', myFunc); -> -> The context of myFunc will be myComponent unless previously bound. -> -> Alternatively, you can add a listener to another element or component. -> -> myComponent.on(otherElement, 'eventName', myFunc); -> myComponent.on(otherComponent, 'eventName', myFunc); -> -> The benefit of using this over `vjs.on(otherElement, 'eventName', myFunc)` -> and `otherComponent.on('eventName', myFunc)` is that this way the listeners -> will be automatically cleaned up when either component is disposed. -> It will also bind myComponent as the context of myFunc. -> -> **NOTE**: When using this on elements in the page other than window -> and document (both permanent), if you remove the element from the DOM -> you need to call `vjs.trigger(el, 'dispose')` on it to clean up -> references to it and allow the browser to garbage collect it. - -##### PARAMETERS: -* __first__ `String|vjs.Component` The event type or other component -* __second__ `Function|String` The event handler or event type -* __third__ `Function` The event handler - -##### RETURNS: -* `vjs.Component` self - -_inherited from_: [src/js/component.js#L577](https://github.com/videojs/video.js/blob/master/src/js/component.js#L577) - ---- - -### one( first, second, [third] ) -> Add an event listener to be triggered only once and then removed -> -> myComponent.one('eventName', myFunc); -> -> Alternatively you can add a listener to another element or component -> that will be triggered only once. -> -> myComponent.one(otherElement, 'eventName', myFunc); -> myComponent.one(otherComponent, 'eventName', myFunc); - -##### PARAMETERS: -* __first__ `String|vjs.Component` The event type or other component -* __second__ `Function|String` The listener function or event type -* __third__ `Function` _(OPTIONAL)_ The listener function for other component - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L691](https://github.com/videojs/video.js/blob/master/src/js/component.js#L691) - ---- - -### options( obj ) -> Deep merge of options objects -> -> Whenever a property is an object on both options objects -> the two properties will be merged using vjs.obj.deepMerge. -> -> This is used for merging options for child components. We -> want it to be easy to override individual options on a child -> component without having to rewrite all the other default options. -> -> Parent.prototype.options_ = { -> children: { -> 'childOne': { 'foo': 'bar', 'asdf': 'fdsa' }, -> 'childTwo': {}, -> 'childThree': {} -> } -> } -> newOptions = { -> children: { -> 'childOne': { 'foo': 'baz', 'abc': '123' } -> 'childTwo': null, -> 'childFour': {} -> } -> } -> -> this.options(newOptions); -> -> RESULT -> -> { -> children: { -> 'childOne': { 'foo': 'baz', 'asdf': 'fdsa', 'abc': '123' }, -> 'childTwo': null, // Disabled. Won't be initialized. -> 'childThree': {}, -> 'childFour': {} -> } -> } - -##### PARAMETERS: -* __obj__ `Object` Object of new option values - -##### RETURNS: -* `Object` A NEW object of this.options_ and obj merged - -_inherited from_: [src/js/component.js#L179](https://github.com/videojs/video.js/blob/master/src/js/component.js#L179) - ---- - -### pause() -> Pause the video playback -> -> myPlayer.pause(); - -##### RETURNS: -* `vjs.Player` self - -_defined in_: [src/js/player.js#L659](https://github.com/videojs/video.js/blob/master/src/js/player.js#L659) - ---- - -### paused() -> Check if the player is paused -> -> var isPaused = myPlayer.paused(); -> var isPlaying = !myPlayer.paused(); - -##### RETURNS: -* `Boolean` false if the media is currently playing, or true otherwise - -_defined in_: [src/js/player.js#L672](https://github.com/videojs/video.js/blob/master/src/js/player.js#L672) - ---- - -### play() -> start media playback -> -> myPlayer.play(); - -##### RETURNS: -* `vjs.Player` self - -_defined in_: [src/js/player.js#L647](https://github.com/videojs/video.js/blob/master/src/js/player.js#L647) - ---- - -### playbackRate( rate ) -> Gets or sets the current playback rate. - -##### PARAMETERS: -* __rate__ `Boolean` New playback rate to set. - -##### RETURNS: -* `Number` Returns the new playback rate when setting -* `Number` Returns the current playback rate when getting - -_defined in_: [src/js/player.js#L1613](https://github.com/videojs/video.js/blob/master/src/js/player.js#L1613) - ---- - -### player() -> Return the component's player - -##### RETURNS: -* `vjs.Player` - -_inherited from_: [src/js/component.js#L126](https://github.com/videojs/video.js/blob/master/src/js/component.js#L126) - ---- - -### poster( [src] ) -> get or set the poster image source url -> -> ##### EXAMPLE: -> -> // getting -> var currentPoster = myPlayer.poster(); -> -> // setting -> myPlayer.poster('http://example.com/myImage.jpg'); - -##### PARAMETERS: -* __src__ `String` _(OPTIONAL)_ Poster image source URL - -##### RETURNS: -* `String` poster URL when getting -* `vjs.Player` self when setting - -_defined in_: [src/js/player.js#L1308](https://github.com/videojs/video.js/blob/master/src/js/player.js#L1308) - ---- - -### preload( value ) -> Get or set the preload attribute. - -##### PARAMETERS: -* __value__ - -##### RETURNS: -* `String` The preload attribute value when getting -* `vjs.Player` Returns the player when setting - -_defined in_: [src/js/player.js#L1249](https://github.com/videojs/video.js/blob/master/src/js/player.js#L1249) - ---- - -### ready( fn ) -> Bind a listener to the component's ready state -> -> Different from event listeners in that if the ready event has already happened -> it will trigger the function immediately. - -##### PARAMETERS: -* __fn__ `Function` Ready listener - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L769](https://github.com/videojs/video.js/blob/master/src/js/component.js#L769) - ---- - -### readyState() -> Returns a value that expresses the current state of the element -> with respect to rendering the current playback position, from the -> codes in the list below. -> - HAVE_NOTHING (numeric value 0) -> No information regarding the media resource is available. -> - HAVE_METADATA (numeric value 1) -> Enough of the resource has been obtained that the duration of the -> resource is available. -> - HAVE_CURRENT_DATA (numeric value 2) -> Data for the immediate current playback position is available. -> - HAVE_FUTURE_DATA (numeric value 3) -> Data for the immediate current playback position is available, as -> well as enough data for the user agent to advance the current -> playback position in the direction of playback. -> - HAVE_ENOUGH_DATA (numeric value 4) -> The user agent estimates that enough data is available for -> playback to proceed uninterrupted. - -##### RETURNS: -* `Number` the current playback rendering state - -_defined in_: [src/js/player.js#L1694](https://github.com/videojs/video.js/blob/master/src/js/player.js#L1694) - ---- - -### remainingTime() -> Calculates how much time is left. -> -> var timeLeft = myPlayer.remainingTime(); -> -> Not a native video element function, but useful - -##### RETURNS: -* `Number` The time remaining in seconds - -_defined in_: [src/js/player.js#L742](https://github.com/videojs/video.js/blob/master/src/js/player.js#L742) - ---- - -### removeChild( component ) -> Remove a child component from this component's list of children, and the -> child component's element from this component's element - -##### PARAMETERS: -* __component__ `vjs.Component` Component to remove - -_inherited from_: [src/js/component.js#L420](https://github.com/videojs/video.js/blob/master/src/js/component.js#L420) - ---- - -### removeClass( classToRemove ) -> Remove a CSS class name from the component's element - -##### PARAMETERS: -* __classToRemove__ `String` Classname to remove - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L837](https://github.com/videojs/video.js/blob/master/src/js/component.js#L837) - ---- - -### requestFullScreen() -> Old naming for requestFullscreen -**Deprecated** true - -_defined in_: [src/js/player.js#L992](https://github.com/videojs/video.js/blob/master/src/js/player.js#L992) - ---- - -### requestFullscreen() -> Increase the size of the video to full screen -> -> myPlayer.requestFullscreen(); -> -> In some browsers, full screen is not supported natively, so it enters -> "full window mode", where the video fills the browser window. -> In browsers and devices that support native full screen, sometimes the -> browser's default controls will be shown, and not the Video.js custom skin. -> This includes most mobile devices (iOS, Android) and older versions of -> Safari. - -##### RETURNS: -* `vjs.Player` self - -_defined in_: [src/js/player.js#L947](https://github.com/videojs/video.js/blob/master/src/js/player.js#L947) - ---- - -### seekable() -> Returns the TimeRanges of the media that are currently available -> for seeking to. - -##### RETURNS: -* `TimeRanges` the seekable intervals of the media timeline - -_defined in_: [src/js/player.js#L1477](https://github.com/videojs/video.js/blob/master/src/js/player.js#L1477) - ---- - -### seeking() -> Returns whether or not the player is in the "seeking" state. - -##### RETURNS: -* `Boolean` True if the player is in the seeking state, false if not. - -_defined in_: [src/js/player.js#L1470](https://github.com/videojs/video.js/blob/master/src/js/player.js#L1470) - ---- - -### setInterval( fn, interval ) -> Creates an interval and sets up disposal automatically. - -##### PARAMETERS: -* __fn__ `Function` The function to run every N seconds. -* __interval__ `Number` Number of ms to delay before executing specified function. - -##### RETURNS: -* `Number` Returns the interval ID - -_inherited from_: [src/js/component.js#L1202](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1202) - ---- - -### setTimeout( fn, timeout ) -> Creates timeout and sets up disposal automatically. - -##### PARAMETERS: -* __fn__ `Function` The function to run after the timeout. -* __timeout__ `Number` Number of ms to delay before executing specified function. - -##### RETURNS: -* `Number` Returns the timeout ID - -_inherited from_: [src/js/component.js#L1162](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1162) - ---- - -### show() -> Show the component element if hidden - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L847](https://github.com/videojs/video.js/blob/master/src/js/component.js#L847) - ---- - -### src( [source] ) -> The source function updates the video source -> -> There are three types of variables you can pass as the argument. -> -> **URL String**: A URL to the the video file. Use this method if you are sure -> the current playback technology (HTML5/Flash) can support the source you -> provide. Currently only MP4 files can be used in both HTML5 and Flash. -> -> myPlayer.src("http://www.example.com/path/to/video.mp4"); -> -> **Source Object (or element):** A javascript object containing information -> about the source file. Use this method if you want the player to determine if -> it can support the file using the type information. -> -> myPlayer.src({ type: "video/mp4", src: "http://www.example.com/path/to/video.mp4" }); -> -> **Array of Source Objects:** To provide multiple versions of the source so -> that it can be played using HTML5 across browsers you can use an array of -> source objects. Video.js will detect which version is supported and load that -> file. -> -> myPlayer.src([ -> { type: "video/mp4", src: "http://www.example.com/path/to/video.mp4" }, -> { type: "video/webm", src: "http://www.example.com/path/to/video.webm" }, -> { type: "video/ogg", src: "http://www.example.com/path/to/video.ogv" } -> ]); - -##### PARAMETERS: -* __source__ `String|Object|Array` _(OPTIONAL)_ The source URL, object, or array of sources - -##### RETURNS: -* `String` The current video source when getting -* `String` The player when setting - -_defined in_: [src/js/player.js#L1135](https://github.com/videojs/video.js/blob/master/src/js/player.js#L1135) - ---- - -### textTracks() -> Get an array of associated text tracks. captions, subtitles, chapters, descriptions -> http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-media-texttracks - -##### RETURNS: -* `Array` Array of track objects - -_defined in_: [src/js/player.js#L1711](https://github.com/videojs/video.js/blob/master/src/js/player.js#L1711) - ---- - -### trigger( event ) -> Trigger an event on an element -> -> myComponent.trigger('eventName'); -> myComponent.trigger({'type':'eventName'}); - -##### PARAMETERS: -* __event__ `Event|Object|String` A string (the type) or an event object with a type attribute - -##### RETURNS: -* `vjs.Component` self - -_inherited from_: [src/js/component.js#L724](https://github.com/videojs/video.js/blob/master/src/js/component.js#L724) - ---- - -### triggerReady() -> Trigger the ready listeners - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L788](https://github.com/videojs/video.js/blob/master/src/js/component.js#L788) - ---- - -### volume( percentAsDecimal ) -> Get or set the current volume of the media -> -> // get -> var howLoudIsIt = myPlayer.volume(); -> -> // set -> myPlayer.volume(0.5); // Set volume to half -> -> 0 is off (muted), 1.0 is all the way up, 0.5 is half way. - -##### PARAMETERS: -* __percentAsDecimal__ `Number` The new volume as a decimal percent - -##### RETURNS: -* `Number` The current volume, when getting -* `vjs.Player` self, when setting - -_defined in_: [src/js/player.js#L848](https://github.com/videojs/video.js/blob/master/src/js/player.js#L848) - ---- - -### width( [num], skipListeners ) -> Set or get the width of the component (CSS values) -> -> Setting the video tag dimension values only works with values in pixels. -> Percent values will not work. -> Some percents can be used, but width()/height() will return the number + %, -> not the actual computed width/height. - -##### PARAMETERS: -* __num__ `Number|String` _(OPTIONAL)_ Optional width number -* __skipListeners__ `Boolean` Skip the 'resize' event trigger - -##### RETURNS: -* `vjs.Component` This component, when setting the width -* `Number|String` The width, when getting - -_inherited from_: [src/js/component.js#L910](https://github.com/videojs/video.js/blob/master/src/js/component.js#L910) - ---- - -## EVENTS - -### durationchange `EVENT` -> Fired when the duration of the media resource is first known or changed - -_defined in_: [src/js/player.js#L536](https://github.com/videojs/video.js/blob/master/src/js/player.js#L536) - ---- - -### ended `EVENT` -> Fired when the end of the media resource is reached (currentTime == duration) - -_defined in_: [src/js/player.js#L522](https://github.com/videojs/video.js/blob/master/src/js/player.js#L522) - ---- - -### error `EVENT` -> Fired when an error occurs - -_defined in_: [src/js/player.js#L577](https://github.com/videojs/video.js/blob/master/src/js/player.js#L577) - ---- - -### firstplay `EVENT` -> Fired the first time a video is played -> -> Not part of the HLS spec, and we're not sure if this is the best -> implementation yet, so use sparingly. If you don't have a reason to -> prevent playback, use `myPlayer.one('play');` instead. - -_defined in_: [src/js/player.js#L479](https://github.com/videojs/video.js/blob/master/src/js/player.js#L479) - ---- - -### fullscreenchange `EVENT` -> Fired when the player switches in or out of fullscreen mode - -_defined in_: [src/js/player.js#L565](https://github.com/videojs/video.js/blob/master/src/js/player.js#L565) - ---- - -### loadedalldata `EVENT` -> Fired when the player has finished downloading the source data - -_defined in_: [src/js/player.js#L421](https://github.com/videojs/video.js/blob/master/src/js/player.js#L421) - ---- - -### loadeddata `EVENT` -> Fired when the player has downloaded data at the current playback position - -_defined in_: [src/js/player.js#L415](https://github.com/videojs/video.js/blob/master/src/js/player.js#L415) - ---- - -### loadedmetadata `EVENT` -> Fired when the player has initial duration and dimension information - -_defined in_: [src/js/player.js#L409](https://github.com/videojs/video.js/blob/master/src/js/player.js#L409) - ---- - -### loadstart `EVENT` -> Fired when the user agent begins looking for media data - -_defined in_: [src/js/player.js#L366](https://github.com/videojs/video.js/blob/master/src/js/player.js#L366) - ---- - -### pause `EVENT` -> Fired whenever the media has been paused - -_defined in_: [src/js/player.js#L493](https://github.com/videojs/video.js/blob/master/src/js/player.js#L493) - ---- - -### play `EVENT` -> Fired whenever the media begins or resumes playback - -_defined in_: [src/js/player.js#L427](https://github.com/videojs/video.js/blob/master/src/js/player.js#L427) - ---- - -### progress `EVENT` -> Fired while the user agent is downloading media data - -_defined in_: [src/js/player.js#L511](https://github.com/videojs/video.js/blob/master/src/js/player.js#L511) - ---- - -### resize `EVENT` -> Fired when the width and/or height of the component changes - -_inherited from_: [src/js/component.js#L1020](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1020) - ---- - -### seeked `EVENT` -> Fired when the player has finished jumping to a new time - -_defined in_: [src/js/player.js#L466](https://github.com/videojs/video.js/blob/master/src/js/player.js#L466) - ---- - -### seeking `EVENT` -> Fired whenever the player is jumping to a new time - -_defined in_: [src/js/player.js#L458](https://github.com/videojs/video.js/blob/master/src/js/player.js#L458) - ---- - -### timeupdate `EVENT` -> Fired when the current playback position has changed -> -> During playback this is fired every 15-250 milliseconds, depending on the -> playback technology in use. - -_defined in_: [src/js/player.js#L505](https://github.com/videojs/video.js/blob/master/src/js/player.js#L505) - ---- - -### volumechange `EVENT` -> Fired when the volume changes - -_defined in_: [src/js/player.js#L559](https://github.com/videojs/video.js/blob/master/src/js/player.js#L559) - ---- - -### waiting `EVENT` -> Fired whenever the media begins waiting - -_defined in_: [src/js/player.js#L441](https://github.com/videojs/video.js/blob/master/src/js/player.js#L441) - ---- - diff --git a/docs/api/vjs.PosterImage.md b/docs/api/vjs.PosterImage.md deleted file mode 100644 index e49c773412..0000000000 --- a/docs/api/vjs.PosterImage.md +++ /dev/null @@ -1,680 +0,0 @@ - - -# vjs.PosterImage - -__EXTENDS__: [vjs.Button](vjs.Button.md) -__DEFINED IN__: [src/js/poster.js#L10](https://github.com/videojs/video.js/blob/master/src/js/poster.js#L10) - -The component that handles showing the poster image. - ---- - -## INDEX - -- [METHODS](#methods) - - [createEl](#createel) - - [dispose](#dispose) - - [init](#init-player-options-) - - [onClick](#onclick) - - [setSrc](#setsrc-url-) - - [update](#update) - - [addChild](#addchild-child-options-) _`inherited`_ - - [addClass](#addclass-classtoadd-) _`inherited`_ - - [buildCSSClass](#buildcssclass) _`inherited`_ - - [children](#children) _`inherited`_ - - [clearInterval](#clearinterval-intervalid-) _`inherited`_ - - [clearTimeout](#cleartimeout-timeoutid-) _`inherited`_ - - [contentEl](#contentel) _`inherited`_ - - [dimensions](#dimensions-width-height-) _`inherited`_ - - [el](#el) _`inherited`_ - - [enableTouchActivity](#enabletouchactivity) _`inherited`_ - - [getChild](#getchild-name-) _`inherited`_ - - [getChildById](#getchildbyid-id-) _`inherited`_ - - [hasClass](#hasclass-classtocheck-) _`inherited`_ - - [height](#height-num-skiplisteners-) _`inherited`_ - - [hide](#hide) _`inherited`_ - - [id](#id) _`inherited`_ - - [initChildren](#initchildren) _`inherited`_ - - [name](#name) _`inherited`_ - - [off](#off-first-second-third-) _`inherited`_ - - [on](#on-first-second-third-) _`inherited`_ - - [one](#one-first-second-third-) _`inherited`_ - - [options](#options-obj-) _`inherited`_ - - [player](#player) _`inherited`_ - - [ready](#ready-fn-) _`inherited`_ - - [removeChild](#removechild-component-) _`inherited`_ - - [removeClass](#removeclass-classtoremove-) _`inherited`_ - - [setInterval](#setinterval-fn-interval-) _`inherited`_ - - [setTimeout](#settimeout-fn-timeout-) _`inherited`_ - - [show](#show) _`inherited`_ - - [trigger](#trigger-event-) _`inherited`_ - - [triggerReady](#triggerready) _`inherited`_ - - [width](#width-num-skiplisteners-) _`inherited`_ - -- [EVENTS](#events) - - [resize](#resize-event) _`inherited`_ - ---- - -## METHODS - -### addChild( child, [options] ) -> Adds a child component inside this component -> -> myComponent.el(); -> // ->
    -> myComonent.children(); -> // [empty array] -> -> var myButton = myComponent.addChild('MyButton'); -> // ->
    myButton
    -> // -> myButton === myComonent.children()[0]; -> -> Pass in options for child constructors and options for children of the child -> -> var myButton = myComponent.addChild('MyButton', { -> text: 'Press Me', -> children: { -> buttonChildExample: { -> buttonChildOption: true -> } -> } -> }); - -##### PARAMETERS: -* __child__ `String|vjs.Component` The class name or instance of a child to add -* __options__ `Object` _(OPTIONAL)_ Options, including options to be passed to children of the child. - -##### RETURNS: -* `vjs.Component` The child component (created by this process if a string was used) - -_inherited from_: [src/js/component.js#L362](https://github.com/videojs/video.js/blob/master/src/js/component.js#L362) - ---- - -### addClass( classToAdd ) -> Add a CSS class name to the component's element - -##### PARAMETERS: -* __classToAdd__ `String` Classname to add - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L826](https://github.com/videojs/video.js/blob/master/src/js/component.js#L826) - ---- - -### buildCSSClass() -> Allows sub components to stack CSS class names - -##### RETURNS: -* `String` The constructed class name - -_inherited from_: [src/js/component.js#L536](https://github.com/videojs/video.js/blob/master/src/js/component.js#L536) - ---- - -### children() -> Get an array of all child components -> -> var kids = myComponent.children(); - -##### RETURNS: -* `Array` The children - -_inherited from_: [src/js/component.js#L296](https://github.com/videojs/video.js/blob/master/src/js/component.js#L296) - ---- - -### clearInterval( intervalId ) -> Clears an interval and removes the associated dispose listener - -##### PARAMETERS: -* __intervalId__ `Number` The id of the interval to clear - -##### RETURNS: -* `Number` Returns the interval ID - -_inherited from_: [src/js/component.js#L1223](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1223) - ---- - -### clearTimeout( timeoutId ) -> Clears a timeout and removes the associated dispose listener - -##### PARAMETERS: -* __timeoutId__ `Number` The id of the timeout to clear - -##### RETURNS: -* `Number` Returns the timeout ID - -_inherited from_: [src/js/component.js#L1185](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1185) - ---- - -### contentEl() -> Return the component's DOM element for embedding content. -> Will either be el_ or a new element defined in createEl. - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L239](https://github.com/videojs/video.js/blob/master/src/js/component.js#L239) - ---- - -### createEl() -> Create the poster image element - -##### RETURNS: -* `Element` - -_defined in_: [src/js/poster.js#L32](https://github.com/videojs/video.js/blob/master/src/js/poster.js#L32) - ---- - -### dimensions( width, height ) -> Set both width and height at the same time - -##### PARAMETERS: -* __width__ `Number|String` -* __height__ `Number|String` - -##### RETURNS: -* `vjs.Component` The component - -_inherited from_: [src/js/component.js#L938](https://github.com/videojs/video.js/blob/master/src/js/component.js#L938) - ---- - -### dispose() -> Clean up the poster image - -_defined in_: [src/js/poster.js#L23](https://github.com/videojs/video.js/blob/master/src/js/poster.js#L23) - ---- - -### el() -> Get the component's DOM element -> -> var domEl = myComponent.el(); - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L220](https://github.com/videojs/video.js/blob/master/src/js/component.js#L220) - ---- - -### enableTouchActivity() -> Report user touch activity when touch events occur -> -> User activity is used to determine when controls should show/hide. It's -> relatively simple when it comes to mouse events, because any mouse event -> should show the controls. So we capture mouse events that bubble up to the -> player and report activity when that happens. -> -> With touch events it isn't as easy. We can't rely on touch events at the -> player level, because a tap (touchstart + touchend) on the video itself on -> mobile devices is meant to turn controls off (and on). User activity is -> checked asynchronously, so what could happen is a tap event on the video -> turns the controls off, then the touchend event bubbles up to the player, -> which if it reported user activity, would turn the controls right back on. -> (We also don't want to completely block touch events from bubbling up) -> -> Also a touchmove, touch+hold, and anything other than a tap is not supposed -> to turn the controls back on on a mobile device. -> -> Here we're setting the default component behavior to report user activity -> whenever touch events happen, and this can be turned off by components that -> want touch events to act differently. - -_inherited from_: [src/js/component.js#L1124](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1124) - ---- - -### getChild( name ) -> Returns a child component with the provided name - -##### PARAMETERS: -* __name__ - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L330](https://github.com/videojs/video.js/blob/master/src/js/component.js#L330) - ---- - -### getChildById( id ) -> Returns a child component with the provided ID - -##### PARAMETERS: -* __id__ - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L313](https://github.com/videojs/video.js/blob/master/src/js/component.js#L313) - ---- - -### hasClass( classToCheck ) -> Check if a component's element has a CSS class name - -##### PARAMETERS: -* __classToCheck__ `String` Classname to check - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L816](https://github.com/videojs/video.js/blob/master/src/js/component.js#L816) - ---- - -### height( [num], [skipListeners] ) -> Get or set the height of the component (CSS values) -> -> Setting the video tag dimension values only works with values in pixels. -> Percent values will not work. -> Some percents can be used, but width()/height() will return the number + %, -> not the actual computed width/height. - -##### PARAMETERS: -* __num__ `Number|String` _(OPTIONAL)_ New component height -* __skipListeners__ `Boolean` _(OPTIONAL)_ Skip the resize event trigger - -##### RETURNS: -* `vjs.Component` This component, when setting the height -* `Number|String` The height, when getting - -_inherited from_: [src/js/component.js#L927](https://github.com/videojs/video.js/blob/master/src/js/component.js#L927) - ---- - -### hide() -> Hide the component element if currently showing - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L857](https://github.com/videojs/video.js/blob/master/src/js/component.js#L857) - ---- - -### id() -> Get the component's ID -> -> var id = myComponent.id(); - -##### RETURNS: -* `String` - -_inherited from_: [src/js/component.js#L258](https://github.com/videojs/video.js/blob/master/src/js/component.js#L258) - ---- - -### init( player, options ) - -##### PARAMETERS: -* __player__ -* __options__ - -_defined in_: [src/js/poster.js#L12](https://github.com/videojs/video.js/blob/master/src/js/poster.js#L12) - ---- - -### initChildren() -> Add and initialize default child components from options -> -> // when an instance of MyComponent is created, all children in options -> // will be added to the instance by their name strings and options -> MyComponent.prototype.options_.children = { -> myChildComponent: { -> myChildOption: true -> } -> } -> -> // Or when creating the component -> var myComp = new MyComponent(player, { -> children: { -> myChildComponent: { -> myChildOption: true -> } -> } -> }); -> -> The children option can also be an Array of child names or -> child options objects (that also include a 'name' key). -> -> var myComp = new MyComponent(player, { -> children: [ -> 'button', -> { -> name: 'button', -> someOtherOption: true -> } -> ] -> }); - -_inherited from_: [src/js/component.js#L481](https://github.com/videojs/video.js/blob/master/src/js/component.js#L481) - ---- - -### name() -> Get the component's name. The name is often used to reference the component. -> -> var name = myComponent.name(); - -##### RETURNS: -* `String` - -_inherited from_: [src/js/component.js#L277](https://github.com/videojs/video.js/blob/master/src/js/component.js#L277) - ---- - -### off( [first], [second], [third] ) -> Remove an event listener from this component's element -> -> myComponent.off('eventType', myFunc); -> -> If myFunc is excluded, ALL listeners for the event type will be removed. -> If eventType is excluded, ALL listeners will be removed from the component. -> -> Alternatively you can use `off` to remove listeners that were added to other -> elements or components using `myComponent.on(otherComponent...`. -> In this case both the event type and listener function are REQUIRED. -> -> myComponent.off(otherElement, 'eventType', myFunc); -> myComponent.off(otherComponent, 'eventType', myFunc); - -##### PARAMETERS: -* __first__ `String|vjs.Component` _(OPTIONAL)_ The event type or other component -* __second__ `Function|String` _(OPTIONAL)_ The listener function or event type -* __third__ `Function` _(OPTIONAL)_ The listener for other component - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L646](https://github.com/videojs/video.js/blob/master/src/js/component.js#L646) - ---- - -### on( first, second, third ) -> Add an event listener to this component's element -> -> var myFunc = function(){ -> var myComponent = this; -> // Do something when the event is fired -> }; -> -> myComponent.on('eventType', myFunc); -> -> The context of myFunc will be myComponent unless previously bound. -> -> Alternatively, you can add a listener to another element or component. -> -> myComponent.on(otherElement, 'eventName', myFunc); -> myComponent.on(otherComponent, 'eventName', myFunc); -> -> The benefit of using this over `vjs.on(otherElement, 'eventName', myFunc)` -> and `otherComponent.on('eventName', myFunc)` is that this way the listeners -> will be automatically cleaned up when either component is disposed. -> It will also bind myComponent as the context of myFunc. -> -> **NOTE**: When using this on elements in the page other than window -> and document (both permanent), if you remove the element from the DOM -> you need to call `vjs.trigger(el, 'dispose')` on it to clean up -> references to it and allow the browser to garbage collect it. - -##### PARAMETERS: -* __first__ `String|vjs.Component` The event type or other component -* __second__ `Function|String` The event handler or event type -* __third__ `Function` The event handler - -##### RETURNS: -* `vjs.Component` self - -_inherited from_: [src/js/component.js#L577](https://github.com/videojs/video.js/blob/master/src/js/component.js#L577) - ---- - -### onClick() -> Event handler for clicks on the poster image - -_defined in_: [src/js/poster.js#L92](https://github.com/videojs/video.js/blob/master/src/js/poster.js#L92) - ---- - -### one( first, second, [third] ) -> Add an event listener to be triggered only once and then removed -> -> myComponent.one('eventName', myFunc); -> -> Alternatively you can add a listener to another element or component -> that will be triggered only once. -> -> myComponent.one(otherElement, 'eventName', myFunc); -> myComponent.one(otherComponent, 'eventName', myFunc); - -##### PARAMETERS: -* __first__ `String|vjs.Component` The event type or other component -* __second__ `Function|String` The listener function or event type -* __third__ `Function` _(OPTIONAL)_ The listener function for other component - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L691](https://github.com/videojs/video.js/blob/master/src/js/component.js#L691) - ---- - -### options( obj ) -> Deep merge of options objects -> -> Whenever a property is an object on both options objects -> the two properties will be merged using vjs.obj.deepMerge. -> -> This is used for merging options for child components. We -> want it to be easy to override individual options on a child -> component without having to rewrite all the other default options. -> -> Parent.prototype.options_ = { -> children: { -> 'childOne': { 'foo': 'bar', 'asdf': 'fdsa' }, -> 'childTwo': {}, -> 'childThree': {} -> } -> } -> newOptions = { -> children: { -> 'childOne': { 'foo': 'baz', 'abc': '123' } -> 'childTwo': null, -> 'childFour': {} -> } -> } -> -> this.options(newOptions); -> -> RESULT -> -> { -> children: { -> 'childOne': { 'foo': 'baz', 'asdf': 'fdsa', 'abc': '123' }, -> 'childTwo': null, // Disabled. Won't be initialized. -> 'childThree': {}, -> 'childFour': {} -> } -> } - -##### PARAMETERS: -* __obj__ `Object` Object of new option values - -##### RETURNS: -* `Object` A NEW object of this.options_ and obj merged - -_inherited from_: [src/js/component.js#L179](https://github.com/videojs/video.js/blob/master/src/js/component.js#L179) - ---- - -### player() -> Return the component's player - -##### RETURNS: -* `vjs.Player` - -_inherited from_: [src/js/component.js#L126](https://github.com/videojs/video.js/blob/master/src/js/component.js#L126) - ---- - -### ready( fn ) -> Bind a listener to the component's ready state -> -> Different from event listeners in that if the ready event has already happened -> it will trigger the function immediately. - -##### PARAMETERS: -* __fn__ `Function` Ready listener - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L769](https://github.com/videojs/video.js/blob/master/src/js/component.js#L769) - ---- - -### removeChild( component ) -> Remove a child component from this component's list of children, and the -> child component's element from this component's element - -##### PARAMETERS: -* __component__ `vjs.Component` Component to remove - -_inherited from_: [src/js/component.js#L420](https://github.com/videojs/video.js/blob/master/src/js/component.js#L420) - ---- - -### removeClass( classToRemove ) -> Remove a CSS class name from the component's element - -##### PARAMETERS: -* __classToRemove__ `String` Classname to remove - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L837](https://github.com/videojs/video.js/blob/master/src/js/component.js#L837) - ---- - -### setInterval( fn, interval ) -> Creates an interval and sets up disposal automatically. - -##### PARAMETERS: -* __fn__ `Function` The function to run every N seconds. -* __interval__ `Number` Number of ms to delay before executing specified function. - -##### RETURNS: -* `Number` Returns the interval ID - -_inherited from_: [src/js/component.js#L1202](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1202) - ---- - -### setSrc( url ) -> Set the poster source depending on the display method - -##### PARAMETERS: -* __url__ - -_defined in_: [src/js/poster.js#L72](https://github.com/videojs/video.js/blob/master/src/js/poster.js#L72) - ---- - -### setTimeout( fn, timeout ) -> Creates timeout and sets up disposal automatically. - -##### PARAMETERS: -* __fn__ `Function` The function to run after the timeout. -* __timeout__ `Number` Number of ms to delay before executing specified function. - -##### RETURNS: -* `Number` Returns the timeout ID - -_inherited from_: [src/js/component.js#L1162](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1162) - ---- - -### show() -> Show the component element if hidden - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L847](https://github.com/videojs/video.js/blob/master/src/js/component.js#L847) - ---- - -### trigger( event ) -> Trigger an event on an element -> -> myComponent.trigger('eventName'); -> myComponent.trigger({'type':'eventName'}); - -##### PARAMETERS: -* __event__ `Event|Object|String` A string (the type) or an event object with a type attribute - -##### RETURNS: -* `vjs.Component` self - -_inherited from_: [src/js/component.js#L724](https://github.com/videojs/video.js/blob/master/src/js/component.js#L724) - ---- - -### triggerReady() -> Trigger the ready listeners - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L788](https://github.com/videojs/video.js/blob/master/src/js/component.js#L788) - ---- - -### update() -> Event handler for updates to the player's poster source - -_defined in_: [src/js/poster.js#L55](https://github.com/videojs/video.js/blob/master/src/js/poster.js#L55) - ---- - -### width( [num], skipListeners ) -> Set or get the width of the component (CSS values) -> -> Setting the video tag dimension values only works with values in pixels. -> Percent values will not work. -> Some percents can be used, but width()/height() will return the number + %, -> not the actual computed width/height. - -##### PARAMETERS: -* __num__ `Number|String` _(OPTIONAL)_ Optional width number -* __skipListeners__ `Boolean` Skip the 'resize' event trigger - -##### RETURNS: -* `vjs.Component` This component, when setting the width -* `Number|String` The width, when getting - -_inherited from_: [src/js/component.js#L910](https://github.com/videojs/video.js/blob/master/src/js/component.js#L910) - ---- - -## EVENTS - -### resize `EVENT` -> Fired when the width and/or height of the component changes - -_inherited from_: [src/js/component.js#L1020](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1020) - ---- - diff --git a/docs/api/vjs.ProgressControl.md b/docs/api/vjs.ProgressControl.md deleted file mode 100644 index 6827eceaf7..0000000000 --- a/docs/api/vjs.ProgressControl.md +++ /dev/null @@ -1,658 +0,0 @@ - - -# vjs.ProgressControl - -__EXTENDS__: [vjs.Component](vjs.Component.md) -__DEFINED IN__: [src/js/control-bar/progress-control.js#L9](https://github.com/videojs/video.js/blob/master/src/js/control-bar/progress-control.js#L9) - -The Progress Control component contains the seek bar, load progress, -and play progress - ---- - -## INDEX - -- [METHODS](#methods) - - [init](#init-player-options-) - - [addChild](#addchild-child-options-) _`inherited`_ - - [addClass](#addclass-classtoadd-) _`inherited`_ - - [buildCSSClass](#buildcssclass) _`inherited`_ - - [children](#children) _`inherited`_ - - [clearInterval](#clearinterval-intervalid-) _`inherited`_ - - [clearTimeout](#cleartimeout-timeoutid-) _`inherited`_ - - [contentEl](#contentel) _`inherited`_ - - [createEl](#createel-tagname-attributes-) _`inherited`_ - - [dimensions](#dimensions-width-height-) _`inherited`_ - - [dispose](#dispose) _`inherited`_ - - [el](#el) _`inherited`_ - - [enableTouchActivity](#enabletouchactivity) _`inherited`_ - - [getChild](#getchild-name-) _`inherited`_ - - [getChildById](#getchildbyid-id-) _`inherited`_ - - [hasClass](#hasclass-classtocheck-) _`inherited`_ - - [height](#height-num-skiplisteners-) _`inherited`_ - - [hide](#hide) _`inherited`_ - - [id](#id) _`inherited`_ - - [initChildren](#initchildren) _`inherited`_ - - [name](#name) _`inherited`_ - - [off](#off-first-second-third-) _`inherited`_ - - [on](#on-first-second-third-) _`inherited`_ - - [one](#one-first-second-third-) _`inherited`_ - - [options](#options-obj-) _`inherited`_ - - [player](#player) _`inherited`_ - - [ready](#ready-fn-) _`inherited`_ - - [removeChild](#removechild-component-) _`inherited`_ - - [removeClass](#removeclass-classtoremove-) _`inherited`_ - - [setInterval](#setinterval-fn-interval-) _`inherited`_ - - [setTimeout](#settimeout-fn-timeout-) _`inherited`_ - - [show](#show) _`inherited`_ - - [trigger](#trigger-event-) _`inherited`_ - - [triggerReady](#triggerready) _`inherited`_ - - [width](#width-num-skiplisteners-) _`inherited`_ - -- [EVENTS](#events) - - [resize](#resize-event) _`inherited`_ - ---- - -## METHODS - -### addChild( child, [options] ) -> Adds a child component inside this component -> -> myComponent.el(); -> // ->
    -> myComonent.children(); -> // [empty array] -> -> var myButton = myComponent.addChild('MyButton'); -> // ->
    myButton
    -> // -> myButton === myComonent.children()[0]; -> -> Pass in options for child constructors and options for children of the child -> -> var myButton = myComponent.addChild('MyButton', { -> text: 'Press Me', -> children: { -> buttonChildExample: { -> buttonChildOption: true -> } -> } -> }); - -##### PARAMETERS: -* __child__ `String|vjs.Component` The class name or instance of a child to add -* __options__ `Object` _(OPTIONAL)_ Options, including options to be passed to children of the child. - -##### RETURNS: -* `vjs.Component` The child component (created by this process if a string was used) - -_inherited from_: [src/js/component.js#L362](https://github.com/videojs/video.js/blob/master/src/js/component.js#L362) - ---- - -### addClass( classToAdd ) -> Add a CSS class name to the component's element - -##### PARAMETERS: -* __classToAdd__ `String` Classname to add - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L826](https://github.com/videojs/video.js/blob/master/src/js/component.js#L826) - ---- - -### buildCSSClass() -> Allows sub components to stack CSS class names - -##### RETURNS: -* `String` The constructed class name - -_inherited from_: [src/js/component.js#L536](https://github.com/videojs/video.js/blob/master/src/js/component.js#L536) - ---- - -### children() -> Get an array of all child components -> -> var kids = myComponent.children(); - -##### RETURNS: -* `Array` The children - -_inherited from_: [src/js/component.js#L296](https://github.com/videojs/video.js/blob/master/src/js/component.js#L296) - ---- - -### clearInterval( intervalId ) -> Clears an interval and removes the associated dispose listener - -##### PARAMETERS: -* __intervalId__ `Number` The id of the interval to clear - -##### RETURNS: -* `Number` Returns the interval ID - -_inherited from_: [src/js/component.js#L1223](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1223) - ---- - -### clearTimeout( timeoutId ) -> Clears a timeout and removes the associated dispose listener - -##### PARAMETERS: -* __timeoutId__ `Number` The id of the timeout to clear - -##### RETURNS: -* `Number` Returns the timeout ID - -_inherited from_: [src/js/component.js#L1185](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1185) - ---- - -### contentEl() -> Return the component's DOM element for embedding content. -> Will either be el_ or a new element defined in createEl. - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L239](https://github.com/videojs/video.js/blob/master/src/js/component.js#L239) - ---- - -### createEl( [tagName], [attributes] ) -> Create the component's DOM element - -##### PARAMETERS: -* __tagName__ `String` _(OPTIONAL)_ Element's node type. e.g. 'div' -* __attributes__ `Object` _(OPTIONAL)_ An object of element attributes that should be set on the element - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L200](https://github.com/videojs/video.js/blob/master/src/js/component.js#L200) - ---- - -### dimensions( width, height ) -> Set both width and height at the same time - -##### PARAMETERS: -* __width__ `Number|String` -* __height__ `Number|String` - -##### RETURNS: -* `vjs.Component` The component - -_inherited from_: [src/js/component.js#L938](https://github.com/videojs/video.js/blob/master/src/js/component.js#L938) - ---- - -### dispose() -> Dispose of the component and all child components - -_inherited from_: [src/js/component.js#L84](https://github.com/videojs/video.js/blob/master/src/js/component.js#L84) - ---- - -### el() -> Get the component's DOM element -> -> var domEl = myComponent.el(); - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L220](https://github.com/videojs/video.js/blob/master/src/js/component.js#L220) - ---- - -### enableTouchActivity() -> Report user touch activity when touch events occur -> -> User activity is used to determine when controls should show/hide. It's -> relatively simple when it comes to mouse events, because any mouse event -> should show the controls. So we capture mouse events that bubble up to the -> player and report activity when that happens. -> -> With touch events it isn't as easy. We can't rely on touch events at the -> player level, because a tap (touchstart + touchend) on the video itself on -> mobile devices is meant to turn controls off (and on). User activity is -> checked asynchronously, so what could happen is a tap event on the video -> turns the controls off, then the touchend event bubbles up to the player, -> which if it reported user activity, would turn the controls right back on. -> (We also don't want to completely block touch events from bubbling up) -> -> Also a touchmove, touch+hold, and anything other than a tap is not supposed -> to turn the controls back on on a mobile device. -> -> Here we're setting the default component behavior to report user activity -> whenever touch events happen, and this can be turned off by components that -> want touch events to act differently. - -_inherited from_: [src/js/component.js#L1124](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1124) - ---- - -### getChild( name ) -> Returns a child component with the provided name - -##### PARAMETERS: -* __name__ - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L330](https://github.com/videojs/video.js/blob/master/src/js/component.js#L330) - ---- - -### getChildById( id ) -> Returns a child component with the provided ID - -##### PARAMETERS: -* __id__ - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L313](https://github.com/videojs/video.js/blob/master/src/js/component.js#L313) - ---- - -### hasClass( classToCheck ) -> Check if a component's element has a CSS class name - -##### PARAMETERS: -* __classToCheck__ `String` Classname to check - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L816](https://github.com/videojs/video.js/blob/master/src/js/component.js#L816) - ---- - -### height( [num], [skipListeners] ) -> Get or set the height of the component (CSS values) -> -> Setting the video tag dimension values only works with values in pixels. -> Percent values will not work. -> Some percents can be used, but width()/height() will return the number + %, -> not the actual computed width/height. - -##### PARAMETERS: -* __num__ `Number|String` _(OPTIONAL)_ New component height -* __skipListeners__ `Boolean` _(OPTIONAL)_ Skip the resize event trigger - -##### RETURNS: -* `vjs.Component` This component, when setting the height -* `Number|String` The height, when getting - -_inherited from_: [src/js/component.js#L927](https://github.com/videojs/video.js/blob/master/src/js/component.js#L927) - ---- - -### hide() -> Hide the component element if currently showing - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L857](https://github.com/videojs/video.js/blob/master/src/js/component.js#L857) - ---- - -### id() -> Get the component's ID -> -> var id = myComponent.id(); - -##### RETURNS: -* `String` - -_inherited from_: [src/js/component.js#L258](https://github.com/videojs/video.js/blob/master/src/js/component.js#L258) - ---- - -### init( player, options ) - -##### PARAMETERS: -* __player__ -* __options__ - -_defined in_: [src/js/control-bar/progress-control.js#L11](https://github.com/videojs/video.js/blob/master/src/js/control-bar/progress-control.js#L11) - ---- - -### initChildren() -> Add and initialize default child components from options -> -> // when an instance of MyComponent is created, all children in options -> // will be added to the instance by their name strings and options -> MyComponent.prototype.options_.children = { -> myChildComponent: { -> myChildOption: true -> } -> } -> -> // Or when creating the component -> var myComp = new MyComponent(player, { -> children: { -> myChildComponent: { -> myChildOption: true -> } -> } -> }); -> -> The children option can also be an Array of child names or -> child options objects (that also include a 'name' key). -> -> var myComp = new MyComponent(player, { -> children: [ -> 'button', -> { -> name: 'button', -> someOtherOption: true -> } -> ] -> }); - -_inherited from_: [src/js/component.js#L481](https://github.com/videojs/video.js/blob/master/src/js/component.js#L481) - ---- - -### name() -> Get the component's name. The name is often used to reference the component. -> -> var name = myComponent.name(); - -##### RETURNS: -* `String` - -_inherited from_: [src/js/component.js#L277](https://github.com/videojs/video.js/blob/master/src/js/component.js#L277) - ---- - -### off( [first], [second], [third] ) -> Remove an event listener from this component's element -> -> myComponent.off('eventType', myFunc); -> -> If myFunc is excluded, ALL listeners for the event type will be removed. -> If eventType is excluded, ALL listeners will be removed from the component. -> -> Alternatively you can use `off` to remove listeners that were added to other -> elements or components using `myComponent.on(otherComponent...`. -> In this case both the event type and listener function are REQUIRED. -> -> myComponent.off(otherElement, 'eventType', myFunc); -> myComponent.off(otherComponent, 'eventType', myFunc); - -##### PARAMETERS: -* __first__ `String|vjs.Component` _(OPTIONAL)_ The event type or other component -* __second__ `Function|String` _(OPTIONAL)_ The listener function or event type -* __third__ `Function` _(OPTIONAL)_ The listener for other component - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L646](https://github.com/videojs/video.js/blob/master/src/js/component.js#L646) - ---- - -### on( first, second, third ) -> Add an event listener to this component's element -> -> var myFunc = function(){ -> var myComponent = this; -> // Do something when the event is fired -> }; -> -> myComponent.on('eventType', myFunc); -> -> The context of myFunc will be myComponent unless previously bound. -> -> Alternatively, you can add a listener to another element or component. -> -> myComponent.on(otherElement, 'eventName', myFunc); -> myComponent.on(otherComponent, 'eventName', myFunc); -> -> The benefit of using this over `vjs.on(otherElement, 'eventName', myFunc)` -> and `otherComponent.on('eventName', myFunc)` is that this way the listeners -> will be automatically cleaned up when either component is disposed. -> It will also bind myComponent as the context of myFunc. -> -> **NOTE**: When using this on elements in the page other than window -> and document (both permanent), if you remove the element from the DOM -> you need to call `vjs.trigger(el, 'dispose')` on it to clean up -> references to it and allow the browser to garbage collect it. - -##### PARAMETERS: -* __first__ `String|vjs.Component` The event type or other component -* __second__ `Function|String` The event handler or event type -* __third__ `Function` The event handler - -##### RETURNS: -* `vjs.Component` self - -_inherited from_: [src/js/component.js#L577](https://github.com/videojs/video.js/blob/master/src/js/component.js#L577) - ---- - -### one( first, second, [third] ) -> Add an event listener to be triggered only once and then removed -> -> myComponent.one('eventName', myFunc); -> -> Alternatively you can add a listener to another element or component -> that will be triggered only once. -> -> myComponent.one(otherElement, 'eventName', myFunc); -> myComponent.one(otherComponent, 'eventName', myFunc); - -##### PARAMETERS: -* __first__ `String|vjs.Component` The event type or other component -* __second__ `Function|String` The listener function or event type -* __third__ `Function` _(OPTIONAL)_ The listener function for other component - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L691](https://github.com/videojs/video.js/blob/master/src/js/component.js#L691) - ---- - -### options( obj ) -> Deep merge of options objects -> -> Whenever a property is an object on both options objects -> the two properties will be merged using vjs.obj.deepMerge. -> -> This is used for merging options for child components. We -> want it to be easy to override individual options on a child -> component without having to rewrite all the other default options. -> -> Parent.prototype.options_ = { -> children: { -> 'childOne': { 'foo': 'bar', 'asdf': 'fdsa' }, -> 'childTwo': {}, -> 'childThree': {} -> } -> } -> newOptions = { -> children: { -> 'childOne': { 'foo': 'baz', 'abc': '123' } -> 'childTwo': null, -> 'childFour': {} -> } -> } -> -> this.options(newOptions); -> -> RESULT -> -> { -> children: { -> 'childOne': { 'foo': 'baz', 'asdf': 'fdsa', 'abc': '123' }, -> 'childTwo': null, // Disabled. Won't be initialized. -> 'childThree': {}, -> 'childFour': {} -> } -> } - -##### PARAMETERS: -* __obj__ `Object` Object of new option values - -##### RETURNS: -* `Object` A NEW object of this.options_ and obj merged - -_inherited from_: [src/js/component.js#L179](https://github.com/videojs/video.js/blob/master/src/js/component.js#L179) - ---- - -### player() -> Return the component's player - -##### RETURNS: -* `vjs.Player` - -_inherited from_: [src/js/component.js#L126](https://github.com/videojs/video.js/blob/master/src/js/component.js#L126) - ---- - -### ready( fn ) -> Bind a listener to the component's ready state -> -> Different from event listeners in that if the ready event has already happened -> it will trigger the function immediately. - -##### PARAMETERS: -* __fn__ `Function` Ready listener - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L769](https://github.com/videojs/video.js/blob/master/src/js/component.js#L769) - ---- - -### removeChild( component ) -> Remove a child component from this component's list of children, and the -> child component's element from this component's element - -##### PARAMETERS: -* __component__ `vjs.Component` Component to remove - -_inherited from_: [src/js/component.js#L420](https://github.com/videojs/video.js/blob/master/src/js/component.js#L420) - ---- - -### removeClass( classToRemove ) -> Remove a CSS class name from the component's element - -##### PARAMETERS: -* __classToRemove__ `String` Classname to remove - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L837](https://github.com/videojs/video.js/blob/master/src/js/component.js#L837) - ---- - -### setInterval( fn, interval ) -> Creates an interval and sets up disposal automatically. - -##### PARAMETERS: -* __fn__ `Function` The function to run every N seconds. -* __interval__ `Number` Number of ms to delay before executing specified function. - -##### RETURNS: -* `Number` Returns the interval ID - -_inherited from_: [src/js/component.js#L1202](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1202) - ---- - -### setTimeout( fn, timeout ) -> Creates timeout and sets up disposal automatically. - -##### PARAMETERS: -* __fn__ `Function` The function to run after the timeout. -* __timeout__ `Number` Number of ms to delay before executing specified function. - -##### RETURNS: -* `Number` Returns the timeout ID - -_inherited from_: [src/js/component.js#L1162](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1162) - ---- - -### show() -> Show the component element if hidden - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L847](https://github.com/videojs/video.js/blob/master/src/js/component.js#L847) - ---- - -### trigger( event ) -> Trigger an event on an element -> -> myComponent.trigger('eventName'); -> myComponent.trigger({'type':'eventName'}); - -##### PARAMETERS: -* __event__ `Event|Object|String` A string (the type) or an event object with a type attribute - -##### RETURNS: -* `vjs.Component` self - -_inherited from_: [src/js/component.js#L724](https://github.com/videojs/video.js/blob/master/src/js/component.js#L724) - ---- - -### triggerReady() -> Trigger the ready listeners - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L788](https://github.com/videojs/video.js/blob/master/src/js/component.js#L788) - ---- - -### width( [num], skipListeners ) -> Set or get the width of the component (CSS values) -> -> Setting the video tag dimension values only works with values in pixels. -> Percent values will not work. -> Some percents can be used, but width()/height() will return the number + %, -> not the actual computed width/height. - -##### PARAMETERS: -* __num__ `Number|String` _(OPTIONAL)_ Optional width number -* __skipListeners__ `Boolean` Skip the 'resize' event trigger - -##### RETURNS: -* `vjs.Component` This component, when setting the width -* `Number|String` The width, when getting - -_inherited from_: [src/js/component.js#L910](https://github.com/videojs/video.js/blob/master/src/js/component.js#L910) - ---- - -## EVENTS - -### resize `EVENT` -> Fired when the width and/or height of the component changes - -_inherited from_: [src/js/component.js#L1020](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1020) - ---- - diff --git a/docs/api/vjs.RemainingTimeDisplay.md b/docs/api/vjs.RemainingTimeDisplay.md deleted file mode 100644 index 8c34d657d3..0000000000 --- a/docs/api/vjs.RemainingTimeDisplay.md +++ /dev/null @@ -1,657 +0,0 @@ - - -# vjs.RemainingTimeDisplay - -__EXTENDS__: [vjs.Component](vjs.Component.md) -__DEFINED IN__: [src/js/control-bar/time-display.js#L109](https://github.com/videojs/video.js/blob/master/src/js/control-bar/time-display.js#L109) - -Displays the time left in the video - ---- - -## INDEX - -- [METHODS](#methods) - - [init](#init-player-options-) - - [addChild](#addchild-child-options-) _`inherited`_ - - [addClass](#addclass-classtoadd-) _`inherited`_ - - [buildCSSClass](#buildcssclass) _`inherited`_ - - [children](#children) _`inherited`_ - - [clearInterval](#clearinterval-intervalid-) _`inherited`_ - - [clearTimeout](#cleartimeout-timeoutid-) _`inherited`_ - - [contentEl](#contentel) _`inherited`_ - - [createEl](#createel-tagname-attributes-) _`inherited`_ - - [dimensions](#dimensions-width-height-) _`inherited`_ - - [dispose](#dispose) _`inherited`_ - - [el](#el) _`inherited`_ - - [enableTouchActivity](#enabletouchactivity) _`inherited`_ - - [getChild](#getchild-name-) _`inherited`_ - - [getChildById](#getchildbyid-id-) _`inherited`_ - - [hasClass](#hasclass-classtocheck-) _`inherited`_ - - [height](#height-num-skiplisteners-) _`inherited`_ - - [hide](#hide) _`inherited`_ - - [id](#id) _`inherited`_ - - [initChildren](#initchildren) _`inherited`_ - - [name](#name) _`inherited`_ - - [off](#off-first-second-third-) _`inherited`_ - - [on](#on-first-second-third-) _`inherited`_ - - [one](#one-first-second-third-) _`inherited`_ - - [options](#options-obj-) _`inherited`_ - - [player](#player) _`inherited`_ - - [ready](#ready-fn-) _`inherited`_ - - [removeChild](#removechild-component-) _`inherited`_ - - [removeClass](#removeclass-classtoremove-) _`inherited`_ - - [setInterval](#setinterval-fn-interval-) _`inherited`_ - - [setTimeout](#settimeout-fn-timeout-) _`inherited`_ - - [show](#show) _`inherited`_ - - [trigger](#trigger-event-) _`inherited`_ - - [triggerReady](#triggerready) _`inherited`_ - - [width](#width-num-skiplisteners-) _`inherited`_ - -- [EVENTS](#events) - - [resize](#resize-event) _`inherited`_ - ---- - -## METHODS - -### addChild( child, [options] ) -> Adds a child component inside this component -> -> myComponent.el(); -> // ->
    -> myComonent.children(); -> // [empty array] -> -> var myButton = myComponent.addChild('MyButton'); -> // ->
    myButton
    -> // -> myButton === myComonent.children()[0]; -> -> Pass in options for child constructors and options for children of the child -> -> var myButton = myComponent.addChild('MyButton', { -> text: 'Press Me', -> children: { -> buttonChildExample: { -> buttonChildOption: true -> } -> } -> }); - -##### PARAMETERS: -* __child__ `String|vjs.Component` The class name or instance of a child to add -* __options__ `Object` _(OPTIONAL)_ Options, including options to be passed to children of the child. - -##### RETURNS: -* `vjs.Component` The child component (created by this process if a string was used) - -_inherited from_: [src/js/component.js#L362](https://github.com/videojs/video.js/blob/master/src/js/component.js#L362) - ---- - -### addClass( classToAdd ) -> Add a CSS class name to the component's element - -##### PARAMETERS: -* __classToAdd__ `String` Classname to add - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L826](https://github.com/videojs/video.js/blob/master/src/js/component.js#L826) - ---- - -### buildCSSClass() -> Allows sub components to stack CSS class names - -##### RETURNS: -* `String` The constructed class name - -_inherited from_: [src/js/component.js#L536](https://github.com/videojs/video.js/blob/master/src/js/component.js#L536) - ---- - -### children() -> Get an array of all child components -> -> var kids = myComponent.children(); - -##### RETURNS: -* `Array` The children - -_inherited from_: [src/js/component.js#L296](https://github.com/videojs/video.js/blob/master/src/js/component.js#L296) - ---- - -### clearInterval( intervalId ) -> Clears an interval and removes the associated dispose listener - -##### PARAMETERS: -* __intervalId__ `Number` The id of the interval to clear - -##### RETURNS: -* `Number` Returns the interval ID - -_inherited from_: [src/js/component.js#L1223](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1223) - ---- - -### clearTimeout( timeoutId ) -> Clears a timeout and removes the associated dispose listener - -##### PARAMETERS: -* __timeoutId__ `Number` The id of the timeout to clear - -##### RETURNS: -* `Number` Returns the timeout ID - -_inherited from_: [src/js/component.js#L1185](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1185) - ---- - -### contentEl() -> Return the component's DOM element for embedding content. -> Will either be el_ or a new element defined in createEl. - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L239](https://github.com/videojs/video.js/blob/master/src/js/component.js#L239) - ---- - -### createEl( [tagName], [attributes] ) -> Create the component's DOM element - -##### PARAMETERS: -* __tagName__ `String` _(OPTIONAL)_ Element's node type. e.g. 'div' -* __attributes__ `Object` _(OPTIONAL)_ An object of element attributes that should be set on the element - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L200](https://github.com/videojs/video.js/blob/master/src/js/component.js#L200) - ---- - -### dimensions( width, height ) -> Set both width and height at the same time - -##### PARAMETERS: -* __width__ `Number|String` -* __height__ `Number|String` - -##### RETURNS: -* `vjs.Component` The component - -_inherited from_: [src/js/component.js#L938](https://github.com/videojs/video.js/blob/master/src/js/component.js#L938) - ---- - -### dispose() -> Dispose of the component and all child components - -_inherited from_: [src/js/component.js#L84](https://github.com/videojs/video.js/blob/master/src/js/component.js#L84) - ---- - -### el() -> Get the component's DOM element -> -> var domEl = myComponent.el(); - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L220](https://github.com/videojs/video.js/blob/master/src/js/component.js#L220) - ---- - -### enableTouchActivity() -> Report user touch activity when touch events occur -> -> User activity is used to determine when controls should show/hide. It's -> relatively simple when it comes to mouse events, because any mouse event -> should show the controls. So we capture mouse events that bubble up to the -> player and report activity when that happens. -> -> With touch events it isn't as easy. We can't rely on touch events at the -> player level, because a tap (touchstart + touchend) on the video itself on -> mobile devices is meant to turn controls off (and on). User activity is -> checked asynchronously, so what could happen is a tap event on the video -> turns the controls off, then the touchend event bubbles up to the player, -> which if it reported user activity, would turn the controls right back on. -> (We also don't want to completely block touch events from bubbling up) -> -> Also a touchmove, touch+hold, and anything other than a tap is not supposed -> to turn the controls back on on a mobile device. -> -> Here we're setting the default component behavior to report user activity -> whenever touch events happen, and this can be turned off by components that -> want touch events to act differently. - -_inherited from_: [src/js/component.js#L1124](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1124) - ---- - -### getChild( name ) -> Returns a child component with the provided name - -##### PARAMETERS: -* __name__ - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L330](https://github.com/videojs/video.js/blob/master/src/js/component.js#L330) - ---- - -### getChildById( id ) -> Returns a child component with the provided ID - -##### PARAMETERS: -* __id__ - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L313](https://github.com/videojs/video.js/blob/master/src/js/component.js#L313) - ---- - -### hasClass( classToCheck ) -> Check if a component's element has a CSS class name - -##### PARAMETERS: -* __classToCheck__ `String` Classname to check - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L816](https://github.com/videojs/video.js/blob/master/src/js/component.js#L816) - ---- - -### height( [num], [skipListeners] ) -> Get or set the height of the component (CSS values) -> -> Setting the video tag dimension values only works with values in pixels. -> Percent values will not work. -> Some percents can be used, but width()/height() will return the number + %, -> not the actual computed width/height. - -##### PARAMETERS: -* __num__ `Number|String` _(OPTIONAL)_ New component height -* __skipListeners__ `Boolean` _(OPTIONAL)_ Skip the resize event trigger - -##### RETURNS: -* `vjs.Component` This component, when setting the height -* `Number|String` The height, when getting - -_inherited from_: [src/js/component.js#L927](https://github.com/videojs/video.js/blob/master/src/js/component.js#L927) - ---- - -### hide() -> Hide the component element if currently showing - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L857](https://github.com/videojs/video.js/blob/master/src/js/component.js#L857) - ---- - -### id() -> Get the component's ID -> -> var id = myComponent.id(); - -##### RETURNS: -* `String` - -_inherited from_: [src/js/component.js#L258](https://github.com/videojs/video.js/blob/master/src/js/component.js#L258) - ---- - -### init( player, options ) - -##### PARAMETERS: -* __player__ -* __options__ - -_defined in_: [src/js/control-bar/time-display.js#L111](https://github.com/videojs/video.js/blob/master/src/js/control-bar/time-display.js#L111) - ---- - -### initChildren() -> Add and initialize default child components from options -> -> // when an instance of MyComponent is created, all children in options -> // will be added to the instance by their name strings and options -> MyComponent.prototype.options_.children = { -> myChildComponent: { -> myChildOption: true -> } -> } -> -> // Or when creating the component -> var myComp = new MyComponent(player, { -> children: { -> myChildComponent: { -> myChildOption: true -> } -> } -> }); -> -> The children option can also be an Array of child names or -> child options objects (that also include a 'name' key). -> -> var myComp = new MyComponent(player, { -> children: [ -> 'button', -> { -> name: 'button', -> someOtherOption: true -> } -> ] -> }); - -_inherited from_: [src/js/component.js#L481](https://github.com/videojs/video.js/blob/master/src/js/component.js#L481) - ---- - -### name() -> Get the component's name. The name is often used to reference the component. -> -> var name = myComponent.name(); - -##### RETURNS: -* `String` - -_inherited from_: [src/js/component.js#L277](https://github.com/videojs/video.js/blob/master/src/js/component.js#L277) - ---- - -### off( [first], [second], [third] ) -> Remove an event listener from this component's element -> -> myComponent.off('eventType', myFunc); -> -> If myFunc is excluded, ALL listeners for the event type will be removed. -> If eventType is excluded, ALL listeners will be removed from the component. -> -> Alternatively you can use `off` to remove listeners that were added to other -> elements or components using `myComponent.on(otherComponent...`. -> In this case both the event type and listener function are REQUIRED. -> -> myComponent.off(otherElement, 'eventType', myFunc); -> myComponent.off(otherComponent, 'eventType', myFunc); - -##### PARAMETERS: -* __first__ `String|vjs.Component` _(OPTIONAL)_ The event type or other component -* __second__ `Function|String` _(OPTIONAL)_ The listener function or event type -* __third__ `Function` _(OPTIONAL)_ The listener for other component - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L646](https://github.com/videojs/video.js/blob/master/src/js/component.js#L646) - ---- - -### on( first, second, third ) -> Add an event listener to this component's element -> -> var myFunc = function(){ -> var myComponent = this; -> // Do something when the event is fired -> }; -> -> myComponent.on('eventType', myFunc); -> -> The context of myFunc will be myComponent unless previously bound. -> -> Alternatively, you can add a listener to another element or component. -> -> myComponent.on(otherElement, 'eventName', myFunc); -> myComponent.on(otherComponent, 'eventName', myFunc); -> -> The benefit of using this over `vjs.on(otherElement, 'eventName', myFunc)` -> and `otherComponent.on('eventName', myFunc)` is that this way the listeners -> will be automatically cleaned up when either component is disposed. -> It will also bind myComponent as the context of myFunc. -> -> **NOTE**: When using this on elements in the page other than window -> and document (both permanent), if you remove the element from the DOM -> you need to call `vjs.trigger(el, 'dispose')` on it to clean up -> references to it and allow the browser to garbage collect it. - -##### PARAMETERS: -* __first__ `String|vjs.Component` The event type or other component -* __second__ `Function|String` The event handler or event type -* __third__ `Function` The event handler - -##### RETURNS: -* `vjs.Component` self - -_inherited from_: [src/js/component.js#L577](https://github.com/videojs/video.js/blob/master/src/js/component.js#L577) - ---- - -### one( first, second, [third] ) -> Add an event listener to be triggered only once and then removed -> -> myComponent.one('eventName', myFunc); -> -> Alternatively you can add a listener to another element or component -> that will be triggered only once. -> -> myComponent.one(otherElement, 'eventName', myFunc); -> myComponent.one(otherComponent, 'eventName', myFunc); - -##### PARAMETERS: -* __first__ `String|vjs.Component` The event type or other component -* __second__ `Function|String` The listener function or event type -* __third__ `Function` _(OPTIONAL)_ The listener function for other component - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L691](https://github.com/videojs/video.js/blob/master/src/js/component.js#L691) - ---- - -### options( obj ) -> Deep merge of options objects -> -> Whenever a property is an object on both options objects -> the two properties will be merged using vjs.obj.deepMerge. -> -> This is used for merging options for child components. We -> want it to be easy to override individual options on a child -> component without having to rewrite all the other default options. -> -> Parent.prototype.options_ = { -> children: { -> 'childOne': { 'foo': 'bar', 'asdf': 'fdsa' }, -> 'childTwo': {}, -> 'childThree': {} -> } -> } -> newOptions = { -> children: { -> 'childOne': { 'foo': 'baz', 'abc': '123' } -> 'childTwo': null, -> 'childFour': {} -> } -> } -> -> this.options(newOptions); -> -> RESULT -> -> { -> children: { -> 'childOne': { 'foo': 'baz', 'asdf': 'fdsa', 'abc': '123' }, -> 'childTwo': null, // Disabled. Won't be initialized. -> 'childThree': {}, -> 'childFour': {} -> } -> } - -##### PARAMETERS: -* __obj__ `Object` Object of new option values - -##### RETURNS: -* `Object` A NEW object of this.options_ and obj merged - -_inherited from_: [src/js/component.js#L179](https://github.com/videojs/video.js/blob/master/src/js/component.js#L179) - ---- - -### player() -> Return the component's player - -##### RETURNS: -* `vjs.Player` - -_inherited from_: [src/js/component.js#L126](https://github.com/videojs/video.js/blob/master/src/js/component.js#L126) - ---- - -### ready( fn ) -> Bind a listener to the component's ready state -> -> Different from event listeners in that if the ready event has already happened -> it will trigger the function immediately. - -##### PARAMETERS: -* __fn__ `Function` Ready listener - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L769](https://github.com/videojs/video.js/blob/master/src/js/component.js#L769) - ---- - -### removeChild( component ) -> Remove a child component from this component's list of children, and the -> child component's element from this component's element - -##### PARAMETERS: -* __component__ `vjs.Component` Component to remove - -_inherited from_: [src/js/component.js#L420](https://github.com/videojs/video.js/blob/master/src/js/component.js#L420) - ---- - -### removeClass( classToRemove ) -> Remove a CSS class name from the component's element - -##### PARAMETERS: -* __classToRemove__ `String` Classname to remove - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L837](https://github.com/videojs/video.js/blob/master/src/js/component.js#L837) - ---- - -### setInterval( fn, interval ) -> Creates an interval and sets up disposal automatically. - -##### PARAMETERS: -* __fn__ `Function` The function to run every N seconds. -* __interval__ `Number` Number of ms to delay before executing specified function. - -##### RETURNS: -* `Number` Returns the interval ID - -_inherited from_: [src/js/component.js#L1202](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1202) - ---- - -### setTimeout( fn, timeout ) -> Creates timeout and sets up disposal automatically. - -##### PARAMETERS: -* __fn__ `Function` The function to run after the timeout. -* __timeout__ `Number` Number of ms to delay before executing specified function. - -##### RETURNS: -* `Number` Returns the timeout ID - -_inherited from_: [src/js/component.js#L1162](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1162) - ---- - -### show() -> Show the component element if hidden - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L847](https://github.com/videojs/video.js/blob/master/src/js/component.js#L847) - ---- - -### trigger( event ) -> Trigger an event on an element -> -> myComponent.trigger('eventName'); -> myComponent.trigger({'type':'eventName'}); - -##### PARAMETERS: -* __event__ `Event|Object|String` A string (the type) or an event object with a type attribute - -##### RETURNS: -* `vjs.Component` self - -_inherited from_: [src/js/component.js#L724](https://github.com/videojs/video.js/blob/master/src/js/component.js#L724) - ---- - -### triggerReady() -> Trigger the ready listeners - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L788](https://github.com/videojs/video.js/blob/master/src/js/component.js#L788) - ---- - -### width( [num], skipListeners ) -> Set or get the width of the component (CSS values) -> -> Setting the video tag dimension values only works with values in pixels. -> Percent values will not work. -> Some percents can be used, but width()/height() will return the number + %, -> not the actual computed width/height. - -##### PARAMETERS: -* __num__ `Number|String` _(OPTIONAL)_ Optional width number -* __skipListeners__ `Boolean` Skip the 'resize' event trigger - -##### RETURNS: -* `vjs.Component` This component, when setting the width -* `Number|String` The width, when getting - -_inherited from_: [src/js/component.js#L910](https://github.com/videojs/video.js/blob/master/src/js/component.js#L910) - ---- - -## EVENTS - -### resize `EVENT` -> Fired when the width and/or height of the component changes - -_inherited from_: [src/js/component.js#L1020](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1020) - ---- - diff --git a/docs/api/vjs.SeekBar.md b/docs/api/vjs.SeekBar.md deleted file mode 100644 index 563117e851..0000000000 --- a/docs/api/vjs.SeekBar.md +++ /dev/null @@ -1,669 +0,0 @@ - - -# vjs.SeekBar - -__EXTENDS__: [vjs.Slider](vjs.Slider.md) -__DEFINED IN__: [src/js/control-bar/progress-control.js#L35](https://github.com/videojs/video.js/blob/master/src/js/control-bar/progress-control.js#L35) - -Seek Bar and holder for the progress bars - ---- - -## INDEX - -- [METHODS](#methods) - - [init](#init-player-options-) - - [addChild](#addchild-child-options-) _`inherited`_ - - [addClass](#addclass-classtoadd-) _`inherited`_ - - [buildCSSClass](#buildcssclass) _`inherited`_ - - [children](#children) _`inherited`_ - - [clearInterval](#clearinterval-intervalid-) _`inherited`_ - - [clearTimeout](#cleartimeout-timeoutid-) _`inherited`_ - - [contentEl](#contentel) _`inherited`_ - - [createEl](#createel-tagname-attributes-) _`inherited`_ - - [dimensions](#dimensions-width-height-) _`inherited`_ - - [dispose](#dispose) _`inherited`_ - - [el](#el) _`inherited`_ - - [enableTouchActivity](#enabletouchactivity) _`inherited`_ - - [getChild](#getchild-name-) _`inherited`_ - - [getChildById](#getchildbyid-id-) _`inherited`_ - - [hasClass](#hasclass-classtocheck-) _`inherited`_ - - [height](#height-num-skiplisteners-) _`inherited`_ - - [hide](#hide) _`inherited`_ - - [id](#id) _`inherited`_ - - [initChildren](#initchildren) _`inherited`_ - - [name](#name) _`inherited`_ - - [off](#off-first-second-third-) _`inherited`_ - - [on](#on-first-second-third-) _`inherited`_ - - [onClick](#onclick-event-) _`inherited`_ - - [one](#one-first-second-third-) _`inherited`_ - - [options](#options-obj-) _`inherited`_ - - [player](#player) _`inherited`_ - - [ready](#ready-fn-) _`inherited`_ - - [removeChild](#removechild-component-) _`inherited`_ - - [removeClass](#removeclass-classtoremove-) _`inherited`_ - - [setInterval](#setinterval-fn-interval-) _`inherited`_ - - [setTimeout](#settimeout-fn-timeout-) _`inherited`_ - - [show](#show) _`inherited`_ - - [trigger](#trigger-event-) _`inherited`_ - - [triggerReady](#triggerready) _`inherited`_ - - [width](#width-num-skiplisteners-) _`inherited`_ - -- [EVENTS](#events) - - [resize](#resize-event) _`inherited`_ - ---- - -## METHODS - -### addChild( child, [options] ) -> Adds a child component inside this component -> -> myComponent.el(); -> // ->
    -> myComonent.children(); -> // [empty array] -> -> var myButton = myComponent.addChild('MyButton'); -> // ->
    myButton
    -> // -> myButton === myComonent.children()[0]; -> -> Pass in options for child constructors and options for children of the child -> -> var myButton = myComponent.addChild('MyButton', { -> text: 'Press Me', -> children: { -> buttonChildExample: { -> buttonChildOption: true -> } -> } -> }); - -##### PARAMETERS: -* __child__ `String|vjs.Component` The class name or instance of a child to add -* __options__ `Object` _(OPTIONAL)_ Options, including options to be passed to children of the child. - -##### RETURNS: -* `vjs.Component` The child component (created by this process if a string was used) - -_inherited from_: [src/js/component.js#L362](https://github.com/videojs/video.js/blob/master/src/js/component.js#L362) - ---- - -### addClass( classToAdd ) -> Add a CSS class name to the component's element - -##### PARAMETERS: -* __classToAdd__ `String` Classname to add - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L826](https://github.com/videojs/video.js/blob/master/src/js/component.js#L826) - ---- - -### buildCSSClass() -> Allows sub components to stack CSS class names - -##### RETURNS: -* `String` The constructed class name - -_inherited from_: [src/js/component.js#L536](https://github.com/videojs/video.js/blob/master/src/js/component.js#L536) - ---- - -### children() -> Get an array of all child components -> -> var kids = myComponent.children(); - -##### RETURNS: -* `Array` The children - -_inherited from_: [src/js/component.js#L296](https://github.com/videojs/video.js/blob/master/src/js/component.js#L296) - ---- - -### clearInterval( intervalId ) -> Clears an interval and removes the associated dispose listener - -##### PARAMETERS: -* __intervalId__ `Number` The id of the interval to clear - -##### RETURNS: -* `Number` Returns the interval ID - -_inherited from_: [src/js/component.js#L1223](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1223) - ---- - -### clearTimeout( timeoutId ) -> Clears a timeout and removes the associated dispose listener - -##### PARAMETERS: -* __timeoutId__ `Number` The id of the timeout to clear - -##### RETURNS: -* `Number` Returns the timeout ID - -_inherited from_: [src/js/component.js#L1185](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1185) - ---- - -### contentEl() -> Return the component's DOM element for embedding content. -> Will either be el_ or a new element defined in createEl. - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L239](https://github.com/videojs/video.js/blob/master/src/js/component.js#L239) - ---- - -### createEl( [tagName], [attributes] ) -> Create the component's DOM element - -##### PARAMETERS: -* __tagName__ `String` _(OPTIONAL)_ Element's node type. e.g. 'div' -* __attributes__ `Object` _(OPTIONAL)_ An object of element attributes that should be set on the element - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L200](https://github.com/videojs/video.js/blob/master/src/js/component.js#L200) - ---- - -### dimensions( width, height ) -> Set both width and height at the same time - -##### PARAMETERS: -* __width__ `Number|String` -* __height__ `Number|String` - -##### RETURNS: -* `vjs.Component` The component - -_inherited from_: [src/js/component.js#L938](https://github.com/videojs/video.js/blob/master/src/js/component.js#L938) - ---- - -### dispose() -> Dispose of the component and all child components - -_inherited from_: [src/js/component.js#L84](https://github.com/videojs/video.js/blob/master/src/js/component.js#L84) - ---- - -### el() -> Get the component's DOM element -> -> var domEl = myComponent.el(); - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L220](https://github.com/videojs/video.js/blob/master/src/js/component.js#L220) - ---- - -### enableTouchActivity() -> Report user touch activity when touch events occur -> -> User activity is used to determine when controls should show/hide. It's -> relatively simple when it comes to mouse events, because any mouse event -> should show the controls. So we capture mouse events that bubble up to the -> player and report activity when that happens. -> -> With touch events it isn't as easy. We can't rely on touch events at the -> player level, because a tap (touchstart + touchend) on the video itself on -> mobile devices is meant to turn controls off (and on). User activity is -> checked asynchronously, so what could happen is a tap event on the video -> turns the controls off, then the touchend event bubbles up to the player, -> which if it reported user activity, would turn the controls right back on. -> (We also don't want to completely block touch events from bubbling up) -> -> Also a touchmove, touch+hold, and anything other than a tap is not supposed -> to turn the controls back on on a mobile device. -> -> Here we're setting the default component behavior to report user activity -> whenever touch events happen, and this can be turned off by components that -> want touch events to act differently. - -_inherited from_: [src/js/component.js#L1124](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1124) - ---- - -### getChild( name ) -> Returns a child component with the provided name - -##### PARAMETERS: -* __name__ - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L330](https://github.com/videojs/video.js/blob/master/src/js/component.js#L330) - ---- - -### getChildById( id ) -> Returns a child component with the provided ID - -##### PARAMETERS: -* __id__ - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L313](https://github.com/videojs/video.js/blob/master/src/js/component.js#L313) - ---- - -### hasClass( classToCheck ) -> Check if a component's element has a CSS class name - -##### PARAMETERS: -* __classToCheck__ `String` Classname to check - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L816](https://github.com/videojs/video.js/blob/master/src/js/component.js#L816) - ---- - -### height( [num], [skipListeners] ) -> Get or set the height of the component (CSS values) -> -> Setting the video tag dimension values only works with values in pixels. -> Percent values will not work. -> Some percents can be used, but width()/height() will return the number + %, -> not the actual computed width/height. - -##### PARAMETERS: -* __num__ `Number|String` _(OPTIONAL)_ New component height -* __skipListeners__ `Boolean` _(OPTIONAL)_ Skip the resize event trigger - -##### RETURNS: -* `vjs.Component` This component, when setting the height -* `Number|String` The height, when getting - -_inherited from_: [src/js/component.js#L927](https://github.com/videojs/video.js/blob/master/src/js/component.js#L927) - ---- - -### hide() -> Hide the component element if currently showing - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L857](https://github.com/videojs/video.js/blob/master/src/js/component.js#L857) - ---- - -### id() -> Get the component's ID -> -> var id = myComponent.id(); - -##### RETURNS: -* `String` - -_inherited from_: [src/js/component.js#L258](https://github.com/videojs/video.js/blob/master/src/js/component.js#L258) - ---- - -### init( player, options ) - -##### PARAMETERS: -* __player__ -* __options__ - -_defined in_: [src/js/control-bar/progress-control.js#L37](https://github.com/videojs/video.js/blob/master/src/js/control-bar/progress-control.js#L37) - ---- - -### initChildren() -> Add and initialize default child components from options -> -> // when an instance of MyComponent is created, all children in options -> // will be added to the instance by their name strings and options -> MyComponent.prototype.options_.children = { -> myChildComponent: { -> myChildOption: true -> } -> } -> -> // Or when creating the component -> var myComp = new MyComponent(player, { -> children: { -> myChildComponent: { -> myChildOption: true -> } -> } -> }); -> -> The children option can also be an Array of child names or -> child options objects (that also include a 'name' key). -> -> var myComp = new MyComponent(player, { -> children: [ -> 'button', -> { -> name: 'button', -> someOtherOption: true -> } -> ] -> }); - -_inherited from_: [src/js/component.js#L481](https://github.com/videojs/video.js/blob/master/src/js/component.js#L481) - ---- - -### name() -> Get the component's name. The name is often used to reference the component. -> -> var name = myComponent.name(); - -##### RETURNS: -* `String` - -_inherited from_: [src/js/component.js#L277](https://github.com/videojs/video.js/blob/master/src/js/component.js#L277) - ---- - -### off( [first], [second], [third] ) -> Remove an event listener from this component's element -> -> myComponent.off('eventType', myFunc); -> -> If myFunc is excluded, ALL listeners for the event type will be removed. -> If eventType is excluded, ALL listeners will be removed from the component. -> -> Alternatively you can use `off` to remove listeners that were added to other -> elements or components using `myComponent.on(otherComponent...`. -> In this case both the event type and listener function are REQUIRED. -> -> myComponent.off(otherElement, 'eventType', myFunc); -> myComponent.off(otherComponent, 'eventType', myFunc); - -##### PARAMETERS: -* __first__ `String|vjs.Component` _(OPTIONAL)_ The event type or other component -* __second__ `Function|String` _(OPTIONAL)_ The listener function or event type -* __third__ `Function` _(OPTIONAL)_ The listener for other component - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L646](https://github.com/videojs/video.js/blob/master/src/js/component.js#L646) - ---- - -### on( first, second, third ) -> Add an event listener to this component's element -> -> var myFunc = function(){ -> var myComponent = this; -> // Do something when the event is fired -> }; -> -> myComponent.on('eventType', myFunc); -> -> The context of myFunc will be myComponent unless previously bound. -> -> Alternatively, you can add a listener to another element or component. -> -> myComponent.on(otherElement, 'eventName', myFunc); -> myComponent.on(otherComponent, 'eventName', myFunc); -> -> The benefit of using this over `vjs.on(otherElement, 'eventName', myFunc)` -> and `otherComponent.on('eventName', myFunc)` is that this way the listeners -> will be automatically cleaned up when either component is disposed. -> It will also bind myComponent as the context of myFunc. -> -> **NOTE**: When using this on elements in the page other than window -> and document (both permanent), if you remove the element from the DOM -> you need to call `vjs.trigger(el, 'dispose')` on it to clean up -> references to it and allow the browser to garbage collect it. - -##### PARAMETERS: -* __first__ `String|vjs.Component` The event type or other component -* __second__ `Function|String` The event handler or event type -* __third__ `Function` The event handler - -##### RETURNS: -* `vjs.Component` self - -_inherited from_: [src/js/component.js#L577](https://github.com/videojs/video.js/blob/master/src/js/component.js#L577) - ---- - -### onClick( event ) -> Listener for click events on slider, used to prevent clicks -> from bubbling up to parent elements like button menus. - -##### PARAMETERS: -* __event__ `Object` Event object - -_inherited from_: [src/js/slider.js#L202](https://github.com/videojs/video.js/blob/master/src/js/slider.js#L202) - ---- - -### one( first, second, [third] ) -> Add an event listener to be triggered only once and then removed -> -> myComponent.one('eventName', myFunc); -> -> Alternatively you can add a listener to another element or component -> that will be triggered only once. -> -> myComponent.one(otherElement, 'eventName', myFunc); -> myComponent.one(otherComponent, 'eventName', myFunc); - -##### PARAMETERS: -* __first__ `String|vjs.Component` The event type or other component -* __second__ `Function|String` The listener function or event type -* __third__ `Function` _(OPTIONAL)_ The listener function for other component - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L691](https://github.com/videojs/video.js/blob/master/src/js/component.js#L691) - ---- - -### options( obj ) -> Deep merge of options objects -> -> Whenever a property is an object on both options objects -> the two properties will be merged using vjs.obj.deepMerge. -> -> This is used for merging options for child components. We -> want it to be easy to override individual options on a child -> component without having to rewrite all the other default options. -> -> Parent.prototype.options_ = { -> children: { -> 'childOne': { 'foo': 'bar', 'asdf': 'fdsa' }, -> 'childTwo': {}, -> 'childThree': {} -> } -> } -> newOptions = { -> children: { -> 'childOne': { 'foo': 'baz', 'abc': '123' } -> 'childTwo': null, -> 'childFour': {} -> } -> } -> -> this.options(newOptions); -> -> RESULT -> -> { -> children: { -> 'childOne': { 'foo': 'baz', 'asdf': 'fdsa', 'abc': '123' }, -> 'childTwo': null, // Disabled. Won't be initialized. -> 'childThree': {}, -> 'childFour': {} -> } -> } - -##### PARAMETERS: -* __obj__ `Object` Object of new option values - -##### RETURNS: -* `Object` A NEW object of this.options_ and obj merged - -_inherited from_: [src/js/component.js#L179](https://github.com/videojs/video.js/blob/master/src/js/component.js#L179) - ---- - -### player() -> Return the component's player - -##### RETURNS: -* `vjs.Player` - -_inherited from_: [src/js/component.js#L126](https://github.com/videojs/video.js/blob/master/src/js/component.js#L126) - ---- - -### ready( fn ) -> Bind a listener to the component's ready state -> -> Different from event listeners in that if the ready event has already happened -> it will trigger the function immediately. - -##### PARAMETERS: -* __fn__ `Function` Ready listener - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L769](https://github.com/videojs/video.js/blob/master/src/js/component.js#L769) - ---- - -### removeChild( component ) -> Remove a child component from this component's list of children, and the -> child component's element from this component's element - -##### PARAMETERS: -* __component__ `vjs.Component` Component to remove - -_inherited from_: [src/js/component.js#L420](https://github.com/videojs/video.js/blob/master/src/js/component.js#L420) - ---- - -### removeClass( classToRemove ) -> Remove a CSS class name from the component's element - -##### PARAMETERS: -* __classToRemove__ `String` Classname to remove - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L837](https://github.com/videojs/video.js/blob/master/src/js/component.js#L837) - ---- - -### setInterval( fn, interval ) -> Creates an interval and sets up disposal automatically. - -##### PARAMETERS: -* __fn__ `Function` The function to run every N seconds. -* __interval__ `Number` Number of ms to delay before executing specified function. - -##### RETURNS: -* `Number` Returns the interval ID - -_inherited from_: [src/js/component.js#L1202](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1202) - ---- - -### setTimeout( fn, timeout ) -> Creates timeout and sets up disposal automatically. - -##### PARAMETERS: -* __fn__ `Function` The function to run after the timeout. -* __timeout__ `Number` Number of ms to delay before executing specified function. - -##### RETURNS: -* `Number` Returns the timeout ID - -_inherited from_: [src/js/component.js#L1162](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1162) - ---- - -### show() -> Show the component element if hidden - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L847](https://github.com/videojs/video.js/blob/master/src/js/component.js#L847) - ---- - -### trigger( event ) -> Trigger an event on an element -> -> myComponent.trigger('eventName'); -> myComponent.trigger({'type':'eventName'}); - -##### PARAMETERS: -* __event__ `Event|Object|String` A string (the type) or an event object with a type attribute - -##### RETURNS: -* `vjs.Component` self - -_inherited from_: [src/js/component.js#L724](https://github.com/videojs/video.js/blob/master/src/js/component.js#L724) - ---- - -### triggerReady() -> Trigger the ready listeners - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L788](https://github.com/videojs/video.js/blob/master/src/js/component.js#L788) - ---- - -### width( [num], skipListeners ) -> Set or get the width of the component (CSS values) -> -> Setting the video tag dimension values only works with values in pixels. -> Percent values will not work. -> Some percents can be used, but width()/height() will return the number + %, -> not the actual computed width/height. - -##### PARAMETERS: -* __num__ `Number|String` _(OPTIONAL)_ Optional width number -* __skipListeners__ `Boolean` Skip the 'resize' event trigger - -##### RETURNS: -* `vjs.Component` This component, when setting the width -* `Number|String` The width, when getting - -_inherited from_: [src/js/component.js#L910](https://github.com/videojs/video.js/blob/master/src/js/component.js#L910) - ---- - -## EVENTS - -### resize `EVENT` -> Fired when the width and/or height of the component changes - -_inherited from_: [src/js/component.js#L1020](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1020) - ---- - diff --git a/docs/api/vjs.SeekHandle.md b/docs/api/vjs.SeekHandle.md deleted file mode 100644 index 24730a5eff..0000000000 --- a/docs/api/vjs.SeekHandle.md +++ /dev/null @@ -1,657 +0,0 @@ - - -# vjs.SeekHandle - -__EXTENDS__: [vjs.SliderHandle](vjs.SliderHandle.md) -__DEFINED IN__: [src/js/control-bar/progress-control.js#L199](https://github.com/videojs/video.js/blob/master/src/js/control-bar/progress-control.js#L199) - -The Seek Handle shows the current position of the playhead during playback, -and can be dragged to adjust the playhead. - ---- - -## INDEX - -- [METHODS](#methods) - - [createEl](#createel-tagname-attributes-) - - [addChild](#addchild-child-options-) _`inherited`_ - - [addClass](#addclass-classtoadd-) _`inherited`_ - - [buildCSSClass](#buildcssclass) _`inherited`_ - - [children](#children) _`inherited`_ - - [clearInterval](#clearinterval-intervalid-) _`inherited`_ - - [clearTimeout](#cleartimeout-timeoutid-) _`inherited`_ - - [contentEl](#contentel) _`inherited`_ - - [dimensions](#dimensions-width-height-) _`inherited`_ - - [dispose](#dispose) _`inherited`_ - - [el](#el) _`inherited`_ - - [enableTouchActivity](#enabletouchactivity) _`inherited`_ - - [getChild](#getchild-name-) _`inherited`_ - - [getChildById](#getchildbyid-id-) _`inherited`_ - - [hasClass](#hasclass-classtocheck-) _`inherited`_ - - [height](#height-num-skiplisteners-) _`inherited`_ - - [hide](#hide) _`inherited`_ - - [id](#id) _`inherited`_ - - [init](#init-player-options-ready-) _`inherited`_ - - [initChildren](#initchildren) _`inherited`_ - - [name](#name) _`inherited`_ - - [off](#off-first-second-third-) _`inherited`_ - - [on](#on-first-second-third-) _`inherited`_ - - [one](#one-first-second-third-) _`inherited`_ - - [options](#options-obj-) _`inherited`_ - - [player](#player) _`inherited`_ - - [ready](#ready-fn-) _`inherited`_ - - [removeChild](#removechild-component-) _`inherited`_ - - [removeClass](#removeclass-classtoremove-) _`inherited`_ - - [setInterval](#setinterval-fn-interval-) _`inherited`_ - - [setTimeout](#settimeout-fn-timeout-) _`inherited`_ - - [show](#show) _`inherited`_ - - [trigger](#trigger-event-) _`inherited`_ - - [triggerReady](#triggerready) _`inherited`_ - - [width](#width-num-skiplisteners-) _`inherited`_ - -- [EVENTS](#events) - - [resize](#resize-event) _`inherited`_ - ---- - -## METHODS - -### addChild( child, [options] ) -> Adds a child component inside this component -> -> myComponent.el(); -> // ->
    -> myComonent.children(); -> // [empty array] -> -> var myButton = myComponent.addChild('MyButton'); -> // ->
    myButton
    -> // -> myButton === myComonent.children()[0]; -> -> Pass in options for child constructors and options for children of the child -> -> var myButton = myComponent.addChild('MyButton', { -> text: 'Press Me', -> children: { -> buttonChildExample: { -> buttonChildOption: true -> } -> } -> }); - -##### PARAMETERS: -* __child__ `String|vjs.Component` The class name or instance of a child to add -* __options__ `Object` _(OPTIONAL)_ Options, including options to be passed to children of the child. - -##### RETURNS: -* `vjs.Component` The child component (created by this process if a string was used) - -_inherited from_: [src/js/component.js#L362](https://github.com/videojs/video.js/blob/master/src/js/component.js#L362) - ---- - -### addClass( classToAdd ) -> Add a CSS class name to the component's element - -##### PARAMETERS: -* __classToAdd__ `String` Classname to add - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L826](https://github.com/videojs/video.js/blob/master/src/js/component.js#L826) - ---- - -### buildCSSClass() -> Allows sub components to stack CSS class names - -##### RETURNS: -* `String` The constructed class name - -_inherited from_: [src/js/component.js#L536](https://github.com/videojs/video.js/blob/master/src/js/component.js#L536) - ---- - -### children() -> Get an array of all child components -> -> var kids = myComponent.children(); - -##### RETURNS: -* `Array` The children - -_inherited from_: [src/js/component.js#L296](https://github.com/videojs/video.js/blob/master/src/js/component.js#L296) - ---- - -### clearInterval( intervalId ) -> Clears an interval and removes the associated dispose listener - -##### PARAMETERS: -* __intervalId__ `Number` The id of the interval to clear - -##### RETURNS: -* `Number` Returns the interval ID - -_inherited from_: [src/js/component.js#L1223](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1223) - ---- - -### clearTimeout( timeoutId ) -> Clears a timeout and removes the associated dispose listener - -##### PARAMETERS: -* __timeoutId__ `Number` The id of the timeout to clear - -##### RETURNS: -* `Number` Returns the timeout ID - -_inherited from_: [src/js/component.js#L1185](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1185) - ---- - -### contentEl() -> Return the component's DOM element for embedding content. -> Will either be el_ or a new element defined in createEl. - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L239](https://github.com/videojs/video.js/blob/master/src/js/component.js#L239) - ---- - -### createEl( [tagName], [attributes] ) -> Create the component's DOM element - -##### PARAMETERS: -* __tagName__ `String` _(OPTIONAL)_ Element's node type. e.g. 'div' -* __attributes__ `Object` _(OPTIONAL)_ An object of element attributes that should be set on the element - -_defined in_: [src/js/control-bar/progress-control.js#L215](https://github.com/videojs/video.js/blob/master/src/js/control-bar/progress-control.js#L215) - ---- - -### dimensions( width, height ) -> Set both width and height at the same time - -##### PARAMETERS: -* __width__ `Number|String` -* __height__ `Number|String` - -##### RETURNS: -* `vjs.Component` The component - -_inherited from_: [src/js/component.js#L938](https://github.com/videojs/video.js/blob/master/src/js/component.js#L938) - ---- - -### dispose() -> Dispose of the component and all child components - -_inherited from_: [src/js/component.js#L84](https://github.com/videojs/video.js/blob/master/src/js/component.js#L84) - ---- - -### el() -> Get the component's DOM element -> -> var domEl = myComponent.el(); - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L220](https://github.com/videojs/video.js/blob/master/src/js/component.js#L220) - ---- - -### enableTouchActivity() -> Report user touch activity when touch events occur -> -> User activity is used to determine when controls should show/hide. It's -> relatively simple when it comes to mouse events, because any mouse event -> should show the controls. So we capture mouse events that bubble up to the -> player and report activity when that happens. -> -> With touch events it isn't as easy. We can't rely on touch events at the -> player level, because a tap (touchstart + touchend) on the video itself on -> mobile devices is meant to turn controls off (and on). User activity is -> checked asynchronously, so what could happen is a tap event on the video -> turns the controls off, then the touchend event bubbles up to the player, -> which if it reported user activity, would turn the controls right back on. -> (We also don't want to completely block touch events from bubbling up) -> -> Also a touchmove, touch+hold, and anything other than a tap is not supposed -> to turn the controls back on on a mobile device. -> -> Here we're setting the default component behavior to report user activity -> whenever touch events happen, and this can be turned off by components that -> want touch events to act differently. - -_inherited from_: [src/js/component.js#L1124](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1124) - ---- - -### getChild( name ) -> Returns a child component with the provided name - -##### PARAMETERS: -* __name__ - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L330](https://github.com/videojs/video.js/blob/master/src/js/component.js#L330) - ---- - -### getChildById( id ) -> Returns a child component with the provided ID - -##### PARAMETERS: -* __id__ - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L313](https://github.com/videojs/video.js/blob/master/src/js/component.js#L313) - ---- - -### hasClass( classToCheck ) -> Check if a component's element has a CSS class name - -##### PARAMETERS: -* __classToCheck__ `String` Classname to check - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L816](https://github.com/videojs/video.js/blob/master/src/js/component.js#L816) - ---- - -### height( [num], [skipListeners] ) -> Get or set the height of the component (CSS values) -> -> Setting the video tag dimension values only works with values in pixels. -> Percent values will not work. -> Some percents can be used, but width()/height() will return the number + %, -> not the actual computed width/height. - -##### PARAMETERS: -* __num__ `Number|String` _(OPTIONAL)_ New component height -* __skipListeners__ `Boolean` _(OPTIONAL)_ Skip the resize event trigger - -##### RETURNS: -* `vjs.Component` This component, when setting the height -* `Number|String` The height, when getting - -_inherited from_: [src/js/component.js#L927](https://github.com/videojs/video.js/blob/master/src/js/component.js#L927) - ---- - -### hide() -> Hide the component element if currently showing - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L857](https://github.com/videojs/video.js/blob/master/src/js/component.js#L857) - ---- - -### id() -> Get the component's ID -> -> var id = myComponent.id(); - -##### RETURNS: -* `String` - -_inherited from_: [src/js/component.js#L258](https://github.com/videojs/video.js/blob/master/src/js/component.js#L258) - ---- - -### init( player, options, ready ) -> the constructor function for the class - -##### PARAMETERS: -* __player__ -* __options__ -* __ready__ - -_inherited from_: [src/js/component.js#L41](https://github.com/videojs/video.js/blob/master/src/js/component.js#L41) - ---- - -### initChildren() -> Add and initialize default child components from options -> -> // when an instance of MyComponent is created, all children in options -> // will be added to the instance by their name strings and options -> MyComponent.prototype.options_.children = { -> myChildComponent: { -> myChildOption: true -> } -> } -> -> // Or when creating the component -> var myComp = new MyComponent(player, { -> children: { -> myChildComponent: { -> myChildOption: true -> } -> } -> }); -> -> The children option can also be an Array of child names or -> child options objects (that also include a 'name' key). -> -> var myComp = new MyComponent(player, { -> children: [ -> 'button', -> { -> name: 'button', -> someOtherOption: true -> } -> ] -> }); - -_inherited from_: [src/js/component.js#L481](https://github.com/videojs/video.js/blob/master/src/js/component.js#L481) - ---- - -### name() -> Get the component's name. The name is often used to reference the component. -> -> var name = myComponent.name(); - -##### RETURNS: -* `String` - -_inherited from_: [src/js/component.js#L277](https://github.com/videojs/video.js/blob/master/src/js/component.js#L277) - ---- - -### off( [first], [second], [third] ) -> Remove an event listener from this component's element -> -> myComponent.off('eventType', myFunc); -> -> If myFunc is excluded, ALL listeners for the event type will be removed. -> If eventType is excluded, ALL listeners will be removed from the component. -> -> Alternatively you can use `off` to remove listeners that were added to other -> elements or components using `myComponent.on(otherComponent...`. -> In this case both the event type and listener function are REQUIRED. -> -> myComponent.off(otherElement, 'eventType', myFunc); -> myComponent.off(otherComponent, 'eventType', myFunc); - -##### PARAMETERS: -* __first__ `String|vjs.Component` _(OPTIONAL)_ The event type or other component -* __second__ `Function|String` _(OPTIONAL)_ The listener function or event type -* __third__ `Function` _(OPTIONAL)_ The listener for other component - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L646](https://github.com/videojs/video.js/blob/master/src/js/component.js#L646) - ---- - -### on( first, second, third ) -> Add an event listener to this component's element -> -> var myFunc = function(){ -> var myComponent = this; -> // Do something when the event is fired -> }; -> -> myComponent.on('eventType', myFunc); -> -> The context of myFunc will be myComponent unless previously bound. -> -> Alternatively, you can add a listener to another element or component. -> -> myComponent.on(otherElement, 'eventName', myFunc); -> myComponent.on(otherComponent, 'eventName', myFunc); -> -> The benefit of using this over `vjs.on(otherElement, 'eventName', myFunc)` -> and `otherComponent.on('eventName', myFunc)` is that this way the listeners -> will be automatically cleaned up when either component is disposed. -> It will also bind myComponent as the context of myFunc. -> -> **NOTE**: When using this on elements in the page other than window -> and document (both permanent), if you remove the element from the DOM -> you need to call `vjs.trigger(el, 'dispose')` on it to clean up -> references to it and allow the browser to garbage collect it. - -##### PARAMETERS: -* __first__ `String|vjs.Component` The event type or other component -* __second__ `Function|String` The event handler or event type -* __third__ `Function` The event handler - -##### RETURNS: -* `vjs.Component` self - -_inherited from_: [src/js/component.js#L577](https://github.com/videojs/video.js/blob/master/src/js/component.js#L577) - ---- - -### one( first, second, [third] ) -> Add an event listener to be triggered only once and then removed -> -> myComponent.one('eventName', myFunc); -> -> Alternatively you can add a listener to another element or component -> that will be triggered only once. -> -> myComponent.one(otherElement, 'eventName', myFunc); -> myComponent.one(otherComponent, 'eventName', myFunc); - -##### PARAMETERS: -* __first__ `String|vjs.Component` The event type or other component -* __second__ `Function|String` The listener function or event type -* __third__ `Function` _(OPTIONAL)_ The listener function for other component - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L691](https://github.com/videojs/video.js/blob/master/src/js/component.js#L691) - ---- - -### options( obj ) -> Deep merge of options objects -> -> Whenever a property is an object on both options objects -> the two properties will be merged using vjs.obj.deepMerge. -> -> This is used for merging options for child components. We -> want it to be easy to override individual options on a child -> component without having to rewrite all the other default options. -> -> Parent.prototype.options_ = { -> children: { -> 'childOne': { 'foo': 'bar', 'asdf': 'fdsa' }, -> 'childTwo': {}, -> 'childThree': {} -> } -> } -> newOptions = { -> children: { -> 'childOne': { 'foo': 'baz', 'abc': '123' } -> 'childTwo': null, -> 'childFour': {} -> } -> } -> -> this.options(newOptions); -> -> RESULT -> -> { -> children: { -> 'childOne': { 'foo': 'baz', 'asdf': 'fdsa', 'abc': '123' }, -> 'childTwo': null, // Disabled. Won't be initialized. -> 'childThree': {}, -> 'childFour': {} -> } -> } - -##### PARAMETERS: -* __obj__ `Object` Object of new option values - -##### RETURNS: -* `Object` A NEW object of this.options_ and obj merged - -_inherited from_: [src/js/component.js#L179](https://github.com/videojs/video.js/blob/master/src/js/component.js#L179) - ---- - -### player() -> Return the component's player - -##### RETURNS: -* `vjs.Player` - -_inherited from_: [src/js/component.js#L126](https://github.com/videojs/video.js/blob/master/src/js/component.js#L126) - ---- - -### ready( fn ) -> Bind a listener to the component's ready state -> -> Different from event listeners in that if the ready event has already happened -> it will trigger the function immediately. - -##### PARAMETERS: -* __fn__ `Function` Ready listener - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L769](https://github.com/videojs/video.js/blob/master/src/js/component.js#L769) - ---- - -### removeChild( component ) -> Remove a child component from this component's list of children, and the -> child component's element from this component's element - -##### PARAMETERS: -* __component__ `vjs.Component` Component to remove - -_inherited from_: [src/js/component.js#L420](https://github.com/videojs/video.js/blob/master/src/js/component.js#L420) - ---- - -### removeClass( classToRemove ) -> Remove a CSS class name from the component's element - -##### PARAMETERS: -* __classToRemove__ `String` Classname to remove - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L837](https://github.com/videojs/video.js/blob/master/src/js/component.js#L837) - ---- - -### setInterval( fn, interval ) -> Creates an interval and sets up disposal automatically. - -##### PARAMETERS: -* __fn__ `Function` The function to run every N seconds. -* __interval__ `Number` Number of ms to delay before executing specified function. - -##### RETURNS: -* `Number` Returns the interval ID - -_inherited from_: [src/js/component.js#L1202](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1202) - ---- - -### setTimeout( fn, timeout ) -> Creates timeout and sets up disposal automatically. - -##### PARAMETERS: -* __fn__ `Function` The function to run after the timeout. -* __timeout__ `Number` Number of ms to delay before executing specified function. - -##### RETURNS: -* `Number` Returns the timeout ID - -_inherited from_: [src/js/component.js#L1162](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1162) - ---- - -### show() -> Show the component element if hidden - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L847](https://github.com/videojs/video.js/blob/master/src/js/component.js#L847) - ---- - -### trigger( event ) -> Trigger an event on an element -> -> myComponent.trigger('eventName'); -> myComponent.trigger({'type':'eventName'}); - -##### PARAMETERS: -* __event__ `Event|Object|String` A string (the type) or an event object with a type attribute - -##### RETURNS: -* `vjs.Component` self - -_inherited from_: [src/js/component.js#L724](https://github.com/videojs/video.js/blob/master/src/js/component.js#L724) - ---- - -### triggerReady() -> Trigger the ready listeners - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L788](https://github.com/videojs/video.js/blob/master/src/js/component.js#L788) - ---- - -### width( [num], skipListeners ) -> Set or get the width of the component (CSS values) -> -> Setting the video tag dimension values only works with values in pixels. -> Percent values will not work. -> Some percents can be used, but width()/height() will return the number + %, -> not the actual computed width/height. - -##### PARAMETERS: -* __num__ `Number|String` _(OPTIONAL)_ Optional width number -* __skipListeners__ `Boolean` Skip the 'resize' event trigger - -##### RETURNS: -* `vjs.Component` This component, when setting the width -* `Number|String` The width, when getting - -_inherited from_: [src/js/component.js#L910](https://github.com/videojs/video.js/blob/master/src/js/component.js#L910) - ---- - -## EVENTS - -### resize `EVENT` -> Fired when the width and/or height of the component changes - -_inherited from_: [src/js/component.js#L1020](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1020) - ---- - diff --git a/docs/api/vjs.Slider.md b/docs/api/vjs.Slider.md deleted file mode 100644 index 6fc4081499..0000000000 --- a/docs/api/vjs.Slider.md +++ /dev/null @@ -1,669 +0,0 @@ - - -# vjs.Slider - -__EXTENDS__: [vjs.Component](vjs.Component.md) -__DEFINED IN__: [src/js/slider.js#L10](https://github.com/videojs/video.js/blob/master/src/js/slider.js#L10) - -The base functionality for sliders like the volume bar and seek bar - ---- - -## INDEX - -- [METHODS](#methods) - - [init](#init-player-options-) - - [onClick](#onclick-event-) - - [addChild](#addchild-child-options-) _`inherited`_ - - [addClass](#addclass-classtoadd-) _`inherited`_ - - [buildCSSClass](#buildcssclass) _`inherited`_ - - [children](#children) _`inherited`_ - - [clearInterval](#clearinterval-intervalid-) _`inherited`_ - - [clearTimeout](#cleartimeout-timeoutid-) _`inherited`_ - - [contentEl](#contentel) _`inherited`_ - - [createEl](#createel-tagname-attributes-) _`inherited`_ - - [dimensions](#dimensions-width-height-) _`inherited`_ - - [dispose](#dispose) _`inherited`_ - - [el](#el) _`inherited`_ - - [enableTouchActivity](#enabletouchactivity) _`inherited`_ - - [getChild](#getchild-name-) _`inherited`_ - - [getChildById](#getchildbyid-id-) _`inherited`_ - - [hasClass](#hasclass-classtocheck-) _`inherited`_ - - [height](#height-num-skiplisteners-) _`inherited`_ - - [hide](#hide) _`inherited`_ - - [id](#id) _`inherited`_ - - [initChildren](#initchildren) _`inherited`_ - - [name](#name) _`inherited`_ - - [off](#off-first-second-third-) _`inherited`_ - - [on](#on-first-second-third-) _`inherited`_ - - [one](#one-first-second-third-) _`inherited`_ - - [options](#options-obj-) _`inherited`_ - - [player](#player) _`inherited`_ - - [ready](#ready-fn-) _`inherited`_ - - [removeChild](#removechild-component-) _`inherited`_ - - [removeClass](#removeclass-classtoremove-) _`inherited`_ - - [setInterval](#setinterval-fn-interval-) _`inherited`_ - - [setTimeout](#settimeout-fn-timeout-) _`inherited`_ - - [show](#show) _`inherited`_ - - [trigger](#trigger-event-) _`inherited`_ - - [triggerReady](#triggerready) _`inherited`_ - - [width](#width-num-skiplisteners-) _`inherited`_ - -- [EVENTS](#events) - - [resize](#resize-event) _`inherited`_ - ---- - -## METHODS - -### addChild( child, [options] ) -> Adds a child component inside this component -> -> myComponent.el(); -> // ->
    -> myComonent.children(); -> // [empty array] -> -> var myButton = myComponent.addChild('MyButton'); -> // ->
    myButton
    -> // -> myButton === myComonent.children()[0]; -> -> Pass in options for child constructors and options for children of the child -> -> var myButton = myComponent.addChild('MyButton', { -> text: 'Press Me', -> children: { -> buttonChildExample: { -> buttonChildOption: true -> } -> } -> }); - -##### PARAMETERS: -* __child__ `String|vjs.Component` The class name or instance of a child to add -* __options__ `Object` _(OPTIONAL)_ Options, including options to be passed to children of the child. - -##### RETURNS: -* `vjs.Component` The child component (created by this process if a string was used) - -_inherited from_: [src/js/component.js#L362](https://github.com/videojs/video.js/blob/master/src/js/component.js#L362) - ---- - -### addClass( classToAdd ) -> Add a CSS class name to the component's element - -##### PARAMETERS: -* __classToAdd__ `String` Classname to add - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L826](https://github.com/videojs/video.js/blob/master/src/js/component.js#L826) - ---- - -### buildCSSClass() -> Allows sub components to stack CSS class names - -##### RETURNS: -* `String` The constructed class name - -_inherited from_: [src/js/component.js#L536](https://github.com/videojs/video.js/blob/master/src/js/component.js#L536) - ---- - -### children() -> Get an array of all child components -> -> var kids = myComponent.children(); - -##### RETURNS: -* `Array` The children - -_inherited from_: [src/js/component.js#L296](https://github.com/videojs/video.js/blob/master/src/js/component.js#L296) - ---- - -### clearInterval( intervalId ) -> Clears an interval and removes the associated dispose listener - -##### PARAMETERS: -* __intervalId__ `Number` The id of the interval to clear - -##### RETURNS: -* `Number` Returns the interval ID - -_inherited from_: [src/js/component.js#L1223](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1223) - ---- - -### clearTimeout( timeoutId ) -> Clears a timeout and removes the associated dispose listener - -##### PARAMETERS: -* __timeoutId__ `Number` The id of the timeout to clear - -##### RETURNS: -* `Number` Returns the timeout ID - -_inherited from_: [src/js/component.js#L1185](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1185) - ---- - -### contentEl() -> Return the component's DOM element for embedding content. -> Will either be el_ or a new element defined in createEl. - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L239](https://github.com/videojs/video.js/blob/master/src/js/component.js#L239) - ---- - -### createEl( [tagName], [attributes] ) -> Create the component's DOM element - -##### PARAMETERS: -* __tagName__ `String` _(OPTIONAL)_ Element's node type. e.g. 'div' -* __attributes__ `Object` _(OPTIONAL)_ An object of element attributes that should be set on the element - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L200](https://github.com/videojs/video.js/blob/master/src/js/component.js#L200) - ---- - -### dimensions( width, height ) -> Set both width and height at the same time - -##### PARAMETERS: -* __width__ `Number|String` -* __height__ `Number|String` - -##### RETURNS: -* `vjs.Component` The component - -_inherited from_: [src/js/component.js#L938](https://github.com/videojs/video.js/blob/master/src/js/component.js#L938) - ---- - -### dispose() -> Dispose of the component and all child components - -_inherited from_: [src/js/component.js#L84](https://github.com/videojs/video.js/blob/master/src/js/component.js#L84) - ---- - -### el() -> Get the component's DOM element -> -> var domEl = myComponent.el(); - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L220](https://github.com/videojs/video.js/blob/master/src/js/component.js#L220) - ---- - -### enableTouchActivity() -> Report user touch activity when touch events occur -> -> User activity is used to determine when controls should show/hide. It's -> relatively simple when it comes to mouse events, because any mouse event -> should show the controls. So we capture mouse events that bubble up to the -> player and report activity when that happens. -> -> With touch events it isn't as easy. We can't rely on touch events at the -> player level, because a tap (touchstart + touchend) on the video itself on -> mobile devices is meant to turn controls off (and on). User activity is -> checked asynchronously, so what could happen is a tap event on the video -> turns the controls off, then the touchend event bubbles up to the player, -> which if it reported user activity, would turn the controls right back on. -> (We also don't want to completely block touch events from bubbling up) -> -> Also a touchmove, touch+hold, and anything other than a tap is not supposed -> to turn the controls back on on a mobile device. -> -> Here we're setting the default component behavior to report user activity -> whenever touch events happen, and this can be turned off by components that -> want touch events to act differently. - -_inherited from_: [src/js/component.js#L1124](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1124) - ---- - -### getChild( name ) -> Returns a child component with the provided name - -##### PARAMETERS: -* __name__ - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L330](https://github.com/videojs/video.js/blob/master/src/js/component.js#L330) - ---- - -### getChildById( id ) -> Returns a child component with the provided ID - -##### PARAMETERS: -* __id__ - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L313](https://github.com/videojs/video.js/blob/master/src/js/component.js#L313) - ---- - -### hasClass( classToCheck ) -> Check if a component's element has a CSS class name - -##### PARAMETERS: -* __classToCheck__ `String` Classname to check - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L816](https://github.com/videojs/video.js/blob/master/src/js/component.js#L816) - ---- - -### height( [num], [skipListeners] ) -> Get or set the height of the component (CSS values) -> -> Setting the video tag dimension values only works with values in pixels. -> Percent values will not work. -> Some percents can be used, but width()/height() will return the number + %, -> not the actual computed width/height. - -##### PARAMETERS: -* __num__ `Number|String` _(OPTIONAL)_ New component height -* __skipListeners__ `Boolean` _(OPTIONAL)_ Skip the resize event trigger - -##### RETURNS: -* `vjs.Component` This component, when setting the height -* `Number|String` The height, when getting - -_inherited from_: [src/js/component.js#L927](https://github.com/videojs/video.js/blob/master/src/js/component.js#L927) - ---- - -### hide() -> Hide the component element if currently showing - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L857](https://github.com/videojs/video.js/blob/master/src/js/component.js#L857) - ---- - -### id() -> Get the component's ID -> -> var id = myComponent.id(); - -##### RETURNS: -* `String` - -_inherited from_: [src/js/component.js#L258](https://github.com/videojs/video.js/blob/master/src/js/component.js#L258) - ---- - -### init( player, options ) - -##### PARAMETERS: -* __player__ -* __options__ - -_defined in_: [src/js/slider.js#L12](https://github.com/videojs/video.js/blob/master/src/js/slider.js#L12) - ---- - -### initChildren() -> Add and initialize default child components from options -> -> // when an instance of MyComponent is created, all children in options -> // will be added to the instance by their name strings and options -> MyComponent.prototype.options_.children = { -> myChildComponent: { -> myChildOption: true -> } -> } -> -> // Or when creating the component -> var myComp = new MyComponent(player, { -> children: { -> myChildComponent: { -> myChildOption: true -> } -> } -> }); -> -> The children option can also be an Array of child names or -> child options objects (that also include a 'name' key). -> -> var myComp = new MyComponent(player, { -> children: [ -> 'button', -> { -> name: 'button', -> someOtherOption: true -> } -> ] -> }); - -_inherited from_: [src/js/component.js#L481](https://github.com/videojs/video.js/blob/master/src/js/component.js#L481) - ---- - -### name() -> Get the component's name. The name is often used to reference the component. -> -> var name = myComponent.name(); - -##### RETURNS: -* `String` - -_inherited from_: [src/js/component.js#L277](https://github.com/videojs/video.js/blob/master/src/js/component.js#L277) - ---- - -### off( [first], [second], [third] ) -> Remove an event listener from this component's element -> -> myComponent.off('eventType', myFunc); -> -> If myFunc is excluded, ALL listeners for the event type will be removed. -> If eventType is excluded, ALL listeners will be removed from the component. -> -> Alternatively you can use `off` to remove listeners that were added to other -> elements or components using `myComponent.on(otherComponent...`. -> In this case both the event type and listener function are REQUIRED. -> -> myComponent.off(otherElement, 'eventType', myFunc); -> myComponent.off(otherComponent, 'eventType', myFunc); - -##### PARAMETERS: -* __first__ `String|vjs.Component` _(OPTIONAL)_ The event type or other component -* __second__ `Function|String` _(OPTIONAL)_ The listener function or event type -* __third__ `Function` _(OPTIONAL)_ The listener for other component - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L646](https://github.com/videojs/video.js/blob/master/src/js/component.js#L646) - ---- - -### on( first, second, third ) -> Add an event listener to this component's element -> -> var myFunc = function(){ -> var myComponent = this; -> // Do something when the event is fired -> }; -> -> myComponent.on('eventType', myFunc); -> -> The context of myFunc will be myComponent unless previously bound. -> -> Alternatively, you can add a listener to another element or component. -> -> myComponent.on(otherElement, 'eventName', myFunc); -> myComponent.on(otherComponent, 'eventName', myFunc); -> -> The benefit of using this over `vjs.on(otherElement, 'eventName', myFunc)` -> and `otherComponent.on('eventName', myFunc)` is that this way the listeners -> will be automatically cleaned up when either component is disposed. -> It will also bind myComponent as the context of myFunc. -> -> **NOTE**: When using this on elements in the page other than window -> and document (both permanent), if you remove the element from the DOM -> you need to call `vjs.trigger(el, 'dispose')` on it to clean up -> references to it and allow the browser to garbage collect it. - -##### PARAMETERS: -* __first__ `String|vjs.Component` The event type or other component -* __second__ `Function|String` The event handler or event type -* __third__ `Function` The event handler - -##### RETURNS: -* `vjs.Component` self - -_inherited from_: [src/js/component.js#L577](https://github.com/videojs/video.js/blob/master/src/js/component.js#L577) - ---- - -### onClick( event ) -> Listener for click events on slider, used to prevent clicks -> from bubbling up to parent elements like button menus. - -##### PARAMETERS: -* __event__ `Object` Event object - -_defined in_: [src/js/slider.js#L202](https://github.com/videojs/video.js/blob/master/src/js/slider.js#L202) - ---- - -### one( first, second, [third] ) -> Add an event listener to be triggered only once and then removed -> -> myComponent.one('eventName', myFunc); -> -> Alternatively you can add a listener to another element or component -> that will be triggered only once. -> -> myComponent.one(otherElement, 'eventName', myFunc); -> myComponent.one(otherComponent, 'eventName', myFunc); - -##### PARAMETERS: -* __first__ `String|vjs.Component` The event type or other component -* __second__ `Function|String` The listener function or event type -* __third__ `Function` _(OPTIONAL)_ The listener function for other component - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L691](https://github.com/videojs/video.js/blob/master/src/js/component.js#L691) - ---- - -### options( obj ) -> Deep merge of options objects -> -> Whenever a property is an object on both options objects -> the two properties will be merged using vjs.obj.deepMerge. -> -> This is used for merging options for child components. We -> want it to be easy to override individual options on a child -> component without having to rewrite all the other default options. -> -> Parent.prototype.options_ = { -> children: { -> 'childOne': { 'foo': 'bar', 'asdf': 'fdsa' }, -> 'childTwo': {}, -> 'childThree': {} -> } -> } -> newOptions = { -> children: { -> 'childOne': { 'foo': 'baz', 'abc': '123' } -> 'childTwo': null, -> 'childFour': {} -> } -> } -> -> this.options(newOptions); -> -> RESULT -> -> { -> children: { -> 'childOne': { 'foo': 'baz', 'asdf': 'fdsa', 'abc': '123' }, -> 'childTwo': null, // Disabled. Won't be initialized. -> 'childThree': {}, -> 'childFour': {} -> } -> } - -##### PARAMETERS: -* __obj__ `Object` Object of new option values - -##### RETURNS: -* `Object` A NEW object of this.options_ and obj merged - -_inherited from_: [src/js/component.js#L179](https://github.com/videojs/video.js/blob/master/src/js/component.js#L179) - ---- - -### player() -> Return the component's player - -##### RETURNS: -* `vjs.Player` - -_inherited from_: [src/js/component.js#L126](https://github.com/videojs/video.js/blob/master/src/js/component.js#L126) - ---- - -### ready( fn ) -> Bind a listener to the component's ready state -> -> Different from event listeners in that if the ready event has already happened -> it will trigger the function immediately. - -##### PARAMETERS: -* __fn__ `Function` Ready listener - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L769](https://github.com/videojs/video.js/blob/master/src/js/component.js#L769) - ---- - -### removeChild( component ) -> Remove a child component from this component's list of children, and the -> child component's element from this component's element - -##### PARAMETERS: -* __component__ `vjs.Component` Component to remove - -_inherited from_: [src/js/component.js#L420](https://github.com/videojs/video.js/blob/master/src/js/component.js#L420) - ---- - -### removeClass( classToRemove ) -> Remove a CSS class name from the component's element - -##### PARAMETERS: -* __classToRemove__ `String` Classname to remove - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L837](https://github.com/videojs/video.js/blob/master/src/js/component.js#L837) - ---- - -### setInterval( fn, interval ) -> Creates an interval and sets up disposal automatically. - -##### PARAMETERS: -* __fn__ `Function` The function to run every N seconds. -* __interval__ `Number` Number of ms to delay before executing specified function. - -##### RETURNS: -* `Number` Returns the interval ID - -_inherited from_: [src/js/component.js#L1202](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1202) - ---- - -### setTimeout( fn, timeout ) -> Creates timeout and sets up disposal automatically. - -##### PARAMETERS: -* __fn__ `Function` The function to run after the timeout. -* __timeout__ `Number` Number of ms to delay before executing specified function. - -##### RETURNS: -* `Number` Returns the timeout ID - -_inherited from_: [src/js/component.js#L1162](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1162) - ---- - -### show() -> Show the component element if hidden - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L847](https://github.com/videojs/video.js/blob/master/src/js/component.js#L847) - ---- - -### trigger( event ) -> Trigger an event on an element -> -> myComponent.trigger('eventName'); -> myComponent.trigger({'type':'eventName'}); - -##### PARAMETERS: -* __event__ `Event|Object|String` A string (the type) or an event object with a type attribute - -##### RETURNS: -* `vjs.Component` self - -_inherited from_: [src/js/component.js#L724](https://github.com/videojs/video.js/blob/master/src/js/component.js#L724) - ---- - -### triggerReady() -> Trigger the ready listeners - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L788](https://github.com/videojs/video.js/blob/master/src/js/component.js#L788) - ---- - -### width( [num], skipListeners ) -> Set or get the width of the component (CSS values) -> -> Setting the video tag dimension values only works with values in pixels. -> Percent values will not work. -> Some percents can be used, but width()/height() will return the number + %, -> not the actual computed width/height. - -##### PARAMETERS: -* __num__ `Number|String` _(OPTIONAL)_ Optional width number -* __skipListeners__ `Boolean` Skip the 'resize' event trigger - -##### RETURNS: -* `vjs.Component` This component, when setting the width -* `Number|String` The width, when getting - -_inherited from_: [src/js/component.js#L910](https://github.com/videojs/video.js/blob/master/src/js/component.js#L910) - ---- - -## EVENTS - -### resize `EVENT` -> Fired when the width and/or height of the component changes - -_inherited from_: [src/js/component.js#L1020](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1020) - ---- - diff --git a/docs/api/vjs.SliderHandle.md b/docs/api/vjs.SliderHandle.md deleted file mode 100644 index e6338868d4..0000000000 --- a/docs/api/vjs.SliderHandle.md +++ /dev/null @@ -1,657 +0,0 @@ - - -# vjs.SliderHandle - -__EXTENDS__: [vjs.Component](vjs.Component.md) -__DEFINED IN__: [src/js/slider.js#L214](https://github.com/videojs/video.js/blob/master/src/js/slider.js#L214) - -SeekBar Behavior includes play progress bar, and seek handle -Needed so it can determine seek position based on handle position/size - ---- - -## INDEX - -- [METHODS](#methods) - - [createEl](#createel-tagname-attributes-) - - [addChild](#addchild-child-options-) _`inherited`_ - - [addClass](#addclass-classtoadd-) _`inherited`_ - - [buildCSSClass](#buildcssclass) _`inherited`_ - - [children](#children) _`inherited`_ - - [clearInterval](#clearinterval-intervalid-) _`inherited`_ - - [clearTimeout](#cleartimeout-timeoutid-) _`inherited`_ - - [contentEl](#contentel) _`inherited`_ - - [dimensions](#dimensions-width-height-) _`inherited`_ - - [dispose](#dispose) _`inherited`_ - - [el](#el) _`inherited`_ - - [enableTouchActivity](#enabletouchactivity) _`inherited`_ - - [getChild](#getchild-name-) _`inherited`_ - - [getChildById](#getchildbyid-id-) _`inherited`_ - - [hasClass](#hasclass-classtocheck-) _`inherited`_ - - [height](#height-num-skiplisteners-) _`inherited`_ - - [hide](#hide) _`inherited`_ - - [id](#id) _`inherited`_ - - [init](#init-player-options-ready-) _`inherited`_ - - [initChildren](#initchildren) _`inherited`_ - - [name](#name) _`inherited`_ - - [off](#off-first-second-third-) _`inherited`_ - - [on](#on-first-second-third-) _`inherited`_ - - [one](#one-first-second-third-) _`inherited`_ - - [options](#options-obj-) _`inherited`_ - - [player](#player) _`inherited`_ - - [ready](#ready-fn-) _`inherited`_ - - [removeChild](#removechild-component-) _`inherited`_ - - [removeClass](#removeclass-classtoremove-) _`inherited`_ - - [setInterval](#setinterval-fn-interval-) _`inherited`_ - - [setTimeout](#settimeout-fn-timeout-) _`inherited`_ - - [show](#show) _`inherited`_ - - [trigger](#trigger-event-) _`inherited`_ - - [triggerReady](#triggerready) _`inherited`_ - - [width](#width-num-skiplisteners-) _`inherited`_ - -- [EVENTS](#events) - - [resize](#resize-event) _`inherited`_ - ---- - -## METHODS - -### addChild( child, [options] ) -> Adds a child component inside this component -> -> myComponent.el(); -> // ->
    -> myComonent.children(); -> // [empty array] -> -> var myButton = myComponent.addChild('MyButton'); -> // ->
    myButton
    -> // -> myButton === myComonent.children()[0]; -> -> Pass in options for child constructors and options for children of the child -> -> var myButton = myComponent.addChild('MyButton', { -> text: 'Press Me', -> children: { -> buttonChildExample: { -> buttonChildOption: true -> } -> } -> }); - -##### PARAMETERS: -* __child__ `String|vjs.Component` The class name or instance of a child to add -* __options__ `Object` _(OPTIONAL)_ Options, including options to be passed to children of the child. - -##### RETURNS: -* `vjs.Component` The child component (created by this process if a string was used) - -_inherited from_: [src/js/component.js#L362](https://github.com/videojs/video.js/blob/master/src/js/component.js#L362) - ---- - -### addClass( classToAdd ) -> Add a CSS class name to the component's element - -##### PARAMETERS: -* __classToAdd__ `String` Classname to add - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L826](https://github.com/videojs/video.js/blob/master/src/js/component.js#L826) - ---- - -### buildCSSClass() -> Allows sub components to stack CSS class names - -##### RETURNS: -* `String` The constructed class name - -_inherited from_: [src/js/component.js#L536](https://github.com/videojs/video.js/blob/master/src/js/component.js#L536) - ---- - -### children() -> Get an array of all child components -> -> var kids = myComponent.children(); - -##### RETURNS: -* `Array` The children - -_inherited from_: [src/js/component.js#L296](https://github.com/videojs/video.js/blob/master/src/js/component.js#L296) - ---- - -### clearInterval( intervalId ) -> Clears an interval and removes the associated dispose listener - -##### PARAMETERS: -* __intervalId__ `Number` The id of the interval to clear - -##### RETURNS: -* `Number` Returns the interval ID - -_inherited from_: [src/js/component.js#L1223](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1223) - ---- - -### clearTimeout( timeoutId ) -> Clears a timeout and removes the associated dispose listener - -##### PARAMETERS: -* __timeoutId__ `Number` The id of the timeout to clear - -##### RETURNS: -* `Number` Returns the timeout ID - -_inherited from_: [src/js/component.js#L1185](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1185) - ---- - -### contentEl() -> Return the component's DOM element for embedding content. -> Will either be el_ or a new element defined in createEl. - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L239](https://github.com/videojs/video.js/blob/master/src/js/component.js#L239) - ---- - -### createEl( [tagName], [attributes] ) -> Create the component's DOM element - -##### PARAMETERS: -* __tagName__ `String` _(OPTIONAL)_ Element's node type. e.g. 'div' -* __attributes__ `Object` _(OPTIONAL)_ An object of element attributes that should be set on the element - -_defined in_: [src/js/slider.js#L225](https://github.com/videojs/video.js/blob/master/src/js/slider.js#L225) - ---- - -### dimensions( width, height ) -> Set both width and height at the same time - -##### PARAMETERS: -* __width__ `Number|String` -* __height__ `Number|String` - -##### RETURNS: -* `vjs.Component` The component - -_inherited from_: [src/js/component.js#L938](https://github.com/videojs/video.js/blob/master/src/js/component.js#L938) - ---- - -### dispose() -> Dispose of the component and all child components - -_inherited from_: [src/js/component.js#L84](https://github.com/videojs/video.js/blob/master/src/js/component.js#L84) - ---- - -### el() -> Get the component's DOM element -> -> var domEl = myComponent.el(); - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L220](https://github.com/videojs/video.js/blob/master/src/js/component.js#L220) - ---- - -### enableTouchActivity() -> Report user touch activity when touch events occur -> -> User activity is used to determine when controls should show/hide. It's -> relatively simple when it comes to mouse events, because any mouse event -> should show the controls. So we capture mouse events that bubble up to the -> player and report activity when that happens. -> -> With touch events it isn't as easy. We can't rely on touch events at the -> player level, because a tap (touchstart + touchend) on the video itself on -> mobile devices is meant to turn controls off (and on). User activity is -> checked asynchronously, so what could happen is a tap event on the video -> turns the controls off, then the touchend event bubbles up to the player, -> which if it reported user activity, would turn the controls right back on. -> (We also don't want to completely block touch events from bubbling up) -> -> Also a touchmove, touch+hold, and anything other than a tap is not supposed -> to turn the controls back on on a mobile device. -> -> Here we're setting the default component behavior to report user activity -> whenever touch events happen, and this can be turned off by components that -> want touch events to act differently. - -_inherited from_: [src/js/component.js#L1124](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1124) - ---- - -### getChild( name ) -> Returns a child component with the provided name - -##### PARAMETERS: -* __name__ - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L330](https://github.com/videojs/video.js/blob/master/src/js/component.js#L330) - ---- - -### getChildById( id ) -> Returns a child component with the provided ID - -##### PARAMETERS: -* __id__ - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L313](https://github.com/videojs/video.js/blob/master/src/js/component.js#L313) - ---- - -### hasClass( classToCheck ) -> Check if a component's element has a CSS class name - -##### PARAMETERS: -* __classToCheck__ `String` Classname to check - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L816](https://github.com/videojs/video.js/blob/master/src/js/component.js#L816) - ---- - -### height( [num], [skipListeners] ) -> Get or set the height of the component (CSS values) -> -> Setting the video tag dimension values only works with values in pixels. -> Percent values will not work. -> Some percents can be used, but width()/height() will return the number + %, -> not the actual computed width/height. - -##### PARAMETERS: -* __num__ `Number|String` _(OPTIONAL)_ New component height -* __skipListeners__ `Boolean` _(OPTIONAL)_ Skip the resize event trigger - -##### RETURNS: -* `vjs.Component` This component, when setting the height -* `Number|String` The height, when getting - -_inherited from_: [src/js/component.js#L927](https://github.com/videojs/video.js/blob/master/src/js/component.js#L927) - ---- - -### hide() -> Hide the component element if currently showing - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L857](https://github.com/videojs/video.js/blob/master/src/js/component.js#L857) - ---- - -### id() -> Get the component's ID -> -> var id = myComponent.id(); - -##### RETURNS: -* `String` - -_inherited from_: [src/js/component.js#L258](https://github.com/videojs/video.js/blob/master/src/js/component.js#L258) - ---- - -### init( player, options, ready ) -> the constructor function for the class - -##### PARAMETERS: -* __player__ -* __options__ -* __ready__ - -_inherited from_: [src/js/component.js#L41](https://github.com/videojs/video.js/blob/master/src/js/component.js#L41) - ---- - -### initChildren() -> Add and initialize default child components from options -> -> // when an instance of MyComponent is created, all children in options -> // will be added to the instance by their name strings and options -> MyComponent.prototype.options_.children = { -> myChildComponent: { -> myChildOption: true -> } -> } -> -> // Or when creating the component -> var myComp = new MyComponent(player, { -> children: { -> myChildComponent: { -> myChildOption: true -> } -> } -> }); -> -> The children option can also be an Array of child names or -> child options objects (that also include a 'name' key). -> -> var myComp = new MyComponent(player, { -> children: [ -> 'button', -> { -> name: 'button', -> someOtherOption: true -> } -> ] -> }); - -_inherited from_: [src/js/component.js#L481](https://github.com/videojs/video.js/blob/master/src/js/component.js#L481) - ---- - -### name() -> Get the component's name. The name is often used to reference the component. -> -> var name = myComponent.name(); - -##### RETURNS: -* `String` - -_inherited from_: [src/js/component.js#L277](https://github.com/videojs/video.js/blob/master/src/js/component.js#L277) - ---- - -### off( [first], [second], [third] ) -> Remove an event listener from this component's element -> -> myComponent.off('eventType', myFunc); -> -> If myFunc is excluded, ALL listeners for the event type will be removed. -> If eventType is excluded, ALL listeners will be removed from the component. -> -> Alternatively you can use `off` to remove listeners that were added to other -> elements or components using `myComponent.on(otherComponent...`. -> In this case both the event type and listener function are REQUIRED. -> -> myComponent.off(otherElement, 'eventType', myFunc); -> myComponent.off(otherComponent, 'eventType', myFunc); - -##### PARAMETERS: -* __first__ `String|vjs.Component` _(OPTIONAL)_ The event type or other component -* __second__ `Function|String` _(OPTIONAL)_ The listener function or event type -* __third__ `Function` _(OPTIONAL)_ The listener for other component - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L646](https://github.com/videojs/video.js/blob/master/src/js/component.js#L646) - ---- - -### on( first, second, third ) -> Add an event listener to this component's element -> -> var myFunc = function(){ -> var myComponent = this; -> // Do something when the event is fired -> }; -> -> myComponent.on('eventType', myFunc); -> -> The context of myFunc will be myComponent unless previously bound. -> -> Alternatively, you can add a listener to another element or component. -> -> myComponent.on(otherElement, 'eventName', myFunc); -> myComponent.on(otherComponent, 'eventName', myFunc); -> -> The benefit of using this over `vjs.on(otherElement, 'eventName', myFunc)` -> and `otherComponent.on('eventName', myFunc)` is that this way the listeners -> will be automatically cleaned up when either component is disposed. -> It will also bind myComponent as the context of myFunc. -> -> **NOTE**: When using this on elements in the page other than window -> and document (both permanent), if you remove the element from the DOM -> you need to call `vjs.trigger(el, 'dispose')` on it to clean up -> references to it and allow the browser to garbage collect it. - -##### PARAMETERS: -* __first__ `String|vjs.Component` The event type or other component -* __second__ `Function|String` The event handler or event type -* __third__ `Function` The event handler - -##### RETURNS: -* `vjs.Component` self - -_inherited from_: [src/js/component.js#L577](https://github.com/videojs/video.js/blob/master/src/js/component.js#L577) - ---- - -### one( first, second, [third] ) -> Add an event listener to be triggered only once and then removed -> -> myComponent.one('eventName', myFunc); -> -> Alternatively you can add a listener to another element or component -> that will be triggered only once. -> -> myComponent.one(otherElement, 'eventName', myFunc); -> myComponent.one(otherComponent, 'eventName', myFunc); - -##### PARAMETERS: -* __first__ `String|vjs.Component` The event type or other component -* __second__ `Function|String` The listener function or event type -* __third__ `Function` _(OPTIONAL)_ The listener function for other component - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L691](https://github.com/videojs/video.js/blob/master/src/js/component.js#L691) - ---- - -### options( obj ) -> Deep merge of options objects -> -> Whenever a property is an object on both options objects -> the two properties will be merged using vjs.obj.deepMerge. -> -> This is used for merging options for child components. We -> want it to be easy to override individual options on a child -> component without having to rewrite all the other default options. -> -> Parent.prototype.options_ = { -> children: { -> 'childOne': { 'foo': 'bar', 'asdf': 'fdsa' }, -> 'childTwo': {}, -> 'childThree': {} -> } -> } -> newOptions = { -> children: { -> 'childOne': { 'foo': 'baz', 'abc': '123' } -> 'childTwo': null, -> 'childFour': {} -> } -> } -> -> this.options(newOptions); -> -> RESULT -> -> { -> children: { -> 'childOne': { 'foo': 'baz', 'asdf': 'fdsa', 'abc': '123' }, -> 'childTwo': null, // Disabled. Won't be initialized. -> 'childThree': {}, -> 'childFour': {} -> } -> } - -##### PARAMETERS: -* __obj__ `Object` Object of new option values - -##### RETURNS: -* `Object` A NEW object of this.options_ and obj merged - -_inherited from_: [src/js/component.js#L179](https://github.com/videojs/video.js/blob/master/src/js/component.js#L179) - ---- - -### player() -> Return the component's player - -##### RETURNS: -* `vjs.Player` - -_inherited from_: [src/js/component.js#L126](https://github.com/videojs/video.js/blob/master/src/js/component.js#L126) - ---- - -### ready( fn ) -> Bind a listener to the component's ready state -> -> Different from event listeners in that if the ready event has already happened -> it will trigger the function immediately. - -##### PARAMETERS: -* __fn__ `Function` Ready listener - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L769](https://github.com/videojs/video.js/blob/master/src/js/component.js#L769) - ---- - -### removeChild( component ) -> Remove a child component from this component's list of children, and the -> child component's element from this component's element - -##### PARAMETERS: -* __component__ `vjs.Component` Component to remove - -_inherited from_: [src/js/component.js#L420](https://github.com/videojs/video.js/blob/master/src/js/component.js#L420) - ---- - -### removeClass( classToRemove ) -> Remove a CSS class name from the component's element - -##### PARAMETERS: -* __classToRemove__ `String` Classname to remove - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L837](https://github.com/videojs/video.js/blob/master/src/js/component.js#L837) - ---- - -### setInterval( fn, interval ) -> Creates an interval and sets up disposal automatically. - -##### PARAMETERS: -* __fn__ `Function` The function to run every N seconds. -* __interval__ `Number` Number of ms to delay before executing specified function. - -##### RETURNS: -* `Number` Returns the interval ID - -_inherited from_: [src/js/component.js#L1202](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1202) - ---- - -### setTimeout( fn, timeout ) -> Creates timeout and sets up disposal automatically. - -##### PARAMETERS: -* __fn__ `Function` The function to run after the timeout. -* __timeout__ `Number` Number of ms to delay before executing specified function. - -##### RETURNS: -* `Number` Returns the timeout ID - -_inherited from_: [src/js/component.js#L1162](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1162) - ---- - -### show() -> Show the component element if hidden - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L847](https://github.com/videojs/video.js/blob/master/src/js/component.js#L847) - ---- - -### trigger( event ) -> Trigger an event on an element -> -> myComponent.trigger('eventName'); -> myComponent.trigger({'type':'eventName'}); - -##### PARAMETERS: -* __event__ `Event|Object|String` A string (the type) or an event object with a type attribute - -##### RETURNS: -* `vjs.Component` self - -_inherited from_: [src/js/component.js#L724](https://github.com/videojs/video.js/blob/master/src/js/component.js#L724) - ---- - -### triggerReady() -> Trigger the ready listeners - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L788](https://github.com/videojs/video.js/blob/master/src/js/component.js#L788) - ---- - -### width( [num], skipListeners ) -> Set or get the width of the component (CSS values) -> -> Setting the video tag dimension values only works with values in pixels. -> Percent values will not work. -> Some percents can be used, but width()/height() will return the number + %, -> not the actual computed width/height. - -##### PARAMETERS: -* __num__ `Number|String` _(OPTIONAL)_ Optional width number -* __skipListeners__ `Boolean` Skip the 'resize' event trigger - -##### RETURNS: -* `vjs.Component` This component, when setting the width -* `Number|String` The width, when getting - -_inherited from_: [src/js/component.js#L910](https://github.com/videojs/video.js/blob/master/src/js/component.js#L910) - ---- - -## EVENTS - -### resize `EVENT` -> Fired when the width and/or height of the component changes - -_inherited from_: [src/js/component.js#L1020](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1020) - ---- - diff --git a/docs/api/vjs.SubtitlesButton.md b/docs/api/vjs.SubtitlesButton.md deleted file mode 100644 index 32e729b869..0000000000 --- a/docs/api/vjs.SubtitlesButton.md +++ /dev/null @@ -1,10 +0,0 @@ - - -# vjs.SubtitlesButton - -__DEFINED IN__: [src/js/tracks/text-track-controls.js#L433](https://github.com/videojs/video.js/blob/master/src/js/tracks/text-track-controls.js#L433) - -The button component for toggling and selecting subtitles - ---- - diff --git a/docs/api/vjs.SubtitlesTrack.md b/docs/api/vjs.SubtitlesTrack.md deleted file mode 100644 index 344c0d70a9..0000000000 --- a/docs/api/vjs.SubtitlesTrack.md +++ /dev/null @@ -1,793 +0,0 @@ - - -# vjs.SubtitlesTrack - -__EXTENDS__: [vjs.TextTrack](vjs.TextTrack.md) -__DEFINED IN__: [src/js/tracks.js#L686](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L686) - -The track component for managing the hiding and showing of subtitles - ---- - -## INDEX - -- [METHODS](#methods) - - [activate](#activate) _`inherited`_ - - [activeCues](#activecues) _`inherited`_ - - [addChild](#addchild-child-options-) _`inherited`_ - - [addClass](#addclass-classtoadd-) _`inherited`_ - - [buildCSSClass](#buildcssclass) _`inherited`_ - - [children](#children) _`inherited`_ - - [clearInterval](#clearinterval-intervalid-) _`inherited`_ - - [clearTimeout](#cleartimeout-timeoutid-) _`inherited`_ - - [contentEl](#contentel) _`inherited`_ - - [createEl](#createel) _`inherited`_ - - [cues](#cues) _`inherited`_ - - [deactivate](#deactivate) _`inherited`_ - - [dflt](#dflt) _`inherited`_ - - [dimensions](#dimensions-width-height-) _`inherited`_ - - [disable](#disable) _`inherited`_ - - [dispose](#dispose) _`inherited`_ - - [el](#el) _`inherited`_ - - [enableTouchActivity](#enabletouchactivity) _`inherited`_ - - [getChild](#getchild-name-) _`inherited`_ - - [getChildById](#getchildbyid-id-) _`inherited`_ - - [hasClass](#hasclass-classtocheck-) _`inherited`_ - - [height](#height-num-skiplisteners-) _`inherited`_ - - [hide](#hide) _`inherited`_ - - [id](#id) _`inherited`_ - - [init](#init-player-options-) _`inherited`_ - - [initChildren](#initchildren) _`inherited`_ - - [kind](#kind) _`inherited`_ - - [label](#label) _`inherited`_ - - [language](#language) _`inherited`_ - - [mode](#mode) _`inherited`_ - - [name](#name) _`inherited`_ - - [off](#off-first-second-third-) _`inherited`_ - - [on](#on-first-second-third-) _`inherited`_ - - [one](#one-first-second-third-) _`inherited`_ - - [options](#options-obj-) _`inherited`_ - - [player](#player) _`inherited`_ - - [ready](#ready-fn-) _`inherited`_ - - [readyState](#readystate) _`inherited`_ - - [removeChild](#removechild-component-) _`inherited`_ - - [removeClass](#removeclass-classtoremove-) _`inherited`_ - - [setInterval](#setinterval-fn-interval-) _`inherited`_ - - [setTimeout](#settimeout-fn-timeout-) _`inherited`_ - - [show](#show) _`inherited`_ - - [src](#src) _`inherited`_ - - [title](#title) _`inherited`_ - - [trigger](#trigger-event-) _`inherited`_ - - [triggerReady](#triggerready) _`inherited`_ - - [width](#width-num-skiplisteners-) _`inherited`_ - -- [EVENTS](#events) - - [resize](#resize-event) _`inherited`_ - ---- - -## METHODS - -### activate() -> Turn on cue tracking. Tracks that are showing OR hidden are active. - -_inherited from_: [src/js/tracks.js#L375](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L375) - ---- - -### activeCues() -> Get the track active cues - -##### RETURNS: -* `Array` - -_inherited from_: [src/js/tracks.js#L270](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L270) - ---- - -### addChild( child, [options] ) -> Adds a child component inside this component -> -> myComponent.el(); -> // ->
    -> myComonent.children(); -> // [empty array] -> -> var myButton = myComponent.addChild('MyButton'); -> // ->
    myButton
    -> // -> myButton === myComonent.children()[0]; -> -> Pass in options for child constructors and options for children of the child -> -> var myButton = myComponent.addChild('MyButton', { -> text: 'Press Me', -> children: { -> buttonChildExample: { -> buttonChildOption: true -> } -> } -> }); - -##### PARAMETERS: -* __child__ `String|vjs.Component` The class name or instance of a child to add -* __options__ `Object` _(OPTIONAL)_ Options, including options to be passed to children of the child. - -##### RETURNS: -* `vjs.Component` The child component (created by this process if a string was used) - -_inherited from_: [src/js/component.js#L362](https://github.com/videojs/video.js/blob/master/src/js/component.js#L362) - ---- - -### addClass( classToAdd ) -> Add a CSS class name to the component's element - -##### PARAMETERS: -* __classToAdd__ `String` Classname to add - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L826](https://github.com/videojs/video.js/blob/master/src/js/component.js#L826) - ---- - -### buildCSSClass() -> Allows sub components to stack CSS class names - -##### RETURNS: -* `String` The constructed class name - -_inherited from_: [src/js/component.js#L536](https://github.com/videojs/video.js/blob/master/src/js/component.js#L536) - ---- - -### children() -> Get an array of all child components -> -> var kids = myComponent.children(); - -##### RETURNS: -* `Array` The children - -_inherited from_: [src/js/component.js#L296](https://github.com/videojs/video.js/blob/master/src/js/component.js#L296) - ---- - -### clearInterval( intervalId ) -> Clears an interval and removes the associated dispose listener - -##### PARAMETERS: -* __intervalId__ `Number` The id of the interval to clear - -##### RETURNS: -* `Number` Returns the interval ID - -_inherited from_: [src/js/component.js#L1219](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1219) - ---- - -### clearTimeout( timeoutId ) -> Clears a timeout and removes the associated dispose listener - -##### PARAMETERS: -* __timeoutId__ `Number` The id of the timeout to clear - -##### RETURNS: -* `Number` Returns the timeout ID - -_inherited from_: [src/js/component.js#L1181](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1181) - ---- - -### contentEl() -> Return the component's DOM element for embedding content. -> Will either be el_ or a new element defined in createEl. - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L239](https://github.com/videojs/video.js/blob/master/src/js/component.js#L239) - ---- - -### createEl() -> Create basic div to hold cue text - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/tracks.js#L315](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L315) - ---- - -### cues() -> Get the track cues - -##### RETURNS: -* `Array` - -_inherited from_: [src/js/tracks.js#L255](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L255) - ---- - -### deactivate() -> Turn off cue tracking. - -_inherited from_: [src/js/tracks.js#L398](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L398) - ---- - -### dflt() -> Get the track default value. ('default' is a reserved keyword) - -##### RETURNS: -* `Boolean` - -_inherited from_: [src/js/tracks.js#L196](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L196) - ---- - -### dimensions( width, height ) -> Set both width and height at the same time - -##### PARAMETERS: -* __width__ `Number|String` -* __height__ `Number|String` - -##### RETURNS: -* `vjs.Component` The component - -_inherited from_: [src/js/component.js#L938](https://github.com/videojs/video.js/blob/master/src/js/component.js#L938) - ---- - -### disable() -> Disable: Mode Off/Disable (0) -> Indicates that the text track is not active. Other than for the purposes of exposing the track in the DOM, the user agent is ignoring the text track. -> No cues are active, no events are fired, and the user agent will not attempt to obtain the track's cues. - -_inherited from_: [src/js/tracks.js#L361](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L361) - ---- - -### dispose() -> Dispose of the component and all child components - -_inherited from_: [src/js/component.js#L84](https://github.com/videojs/video.js/blob/master/src/js/component.js#L84) - ---- - -### el() -> Get the component's DOM element -> -> var domEl = myComponent.el(); - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L220](https://github.com/videojs/video.js/blob/master/src/js/component.js#L220) - ---- - -### enableTouchActivity() -> Report user touch activity when touch events occur -> -> User activity is used to determine when controls should show/hide. It's -> relatively simple when it comes to mouse events, because any mouse event -> should show the controls. So we capture mouse events that bubble up to the -> player and report activity when that happens. -> -> With touch events it isn't as easy. We can't rely on touch events at the -> player level, because a tap (touchstart + touchend) on the video itself on -> mobile devices is meant to turn controls off (and on). User activity is -> checked asynchronously, so what could happen is a tap event on the video -> turns the controls off, then the touchend event bubbles up to the player, -> which if it reported user activity, would turn the controls right back on. -> (We also don't want to completely block touch events from bubbling up) -> -> Also a touchmove, touch+hold, and anything other than a tap is not supposed -> to turn the controls back on on a mobile device. -> -> Here we're setting the default component behavior to report user activity -> whenever touch events happen, and this can be turned off by components that -> want touch events to act differently. - -_inherited from_: [src/js/component.js#L1120](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1120) - ---- - -### getChild( name ) -> Returns a child component with the provided name - -##### PARAMETERS: -* __name__ - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L330](https://github.com/videojs/video.js/blob/master/src/js/component.js#L330) - ---- - -### getChildById( id ) -> Returns a child component with the provided ID - -##### PARAMETERS: -* __id__ - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L313](https://github.com/videojs/video.js/blob/master/src/js/component.js#L313) - ---- - -### hasClass( classToCheck ) -> Check if a component's element has a CSS class name - -##### PARAMETERS: -* __classToCheck__ `String` Classname to check - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L816](https://github.com/videojs/video.js/blob/master/src/js/component.js#L816) - ---- - -### height( [num], [skipListeners] ) -> Get or set the height of the component (CSS values) -> -> Setting the video tag dimension values only works with values in pixels. -> Percent values will not work. -> Some percents can be used, but width()/height() will return the number + %, -> not the actual computed width/height. - -##### PARAMETERS: -* __num__ `Number|String` _(OPTIONAL)_ New component height -* __skipListeners__ `Boolean` _(OPTIONAL)_ Skip the resize event trigger - -##### RETURNS: -* `vjs.Component` This component, when setting the height -* `Number|String` The height, when getting - -_inherited from_: [src/js/component.js#L927](https://github.com/videojs/video.js/blob/master/src/js/component.js#L927) - ---- - -### hide() -> Hide: Mode Hidden (1) -> Indicates that the text track is active, but that the user agent is not actively displaying the cues. -> If no attempt has yet been made to obtain the track's cues, the user agent will perform such an attempt momentarily. -> The user agent is maintaining a list of which cues are active, and events are being fired accordingly. - -_inherited from_: [src/js/tracks.js#L346](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L346) - ---- - -### id() -> Get the component's ID -> -> var id = myComponent.id(); - -##### RETURNS: -* `String` - -_inherited from_: [src/js/component.js#L258](https://github.com/videojs/video.js/blob/master/src/js/component.js#L258) - ---- - -### init( player, options ) - -##### PARAMETERS: -* __player__ -* __options__ - -_inherited from_: [src/js/tracks.js#L134](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L134) - ---- - -### initChildren() -> Add and initialize default child components from options -> -> // when an instance of MyComponent is created, all children in options -> // will be added to the instance by their name strings and options -> MyComponent.prototype.options_.children = { -> myChildComponent: { -> myChildOption: true -> } -> } -> -> // Or when creating the component -> var myComp = new MyComponent(player, { -> children: { -> myChildComponent: { -> myChildOption: true -> } -> } -> }); -> -> The children option can also be an Array of child names or -> child options objects (that also include a 'name' key). -> -> var myComp = new MyComponent(player, { -> children: [ -> 'button', -> { -> name: 'button', -> someOtherOption: true -> } -> ] -> }); - -_inherited from_: [src/js/component.js#L481](https://github.com/videojs/video.js/blob/master/src/js/component.js#L481) - ---- - -### kind() -> Get the track kind value - -##### RETURNS: -* `String` - -_inherited from_: [src/js/tracks.js#L167](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L167) - ---- - -### label() -> Get the track label value - -##### RETURNS: -* `String` - -_inherited from_: [src/js/tracks.js#L240](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L240) - ---- - -### language() -> Get the track language value - -##### RETURNS: -* `String` - -_inherited from_: [src/js/tracks.js#L225](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L225) - ---- - -### mode() -> Get the track mode - -##### RETURNS: -* `Number` - -_inherited from_: [src/js/tracks.js#L307](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L307) - ---- - -### name() -> Get the component's name. The name is often used to reference the component. -> -> var name = myComponent.name(); - -##### RETURNS: -* `String` - -_inherited from_: [src/js/component.js#L277](https://github.com/videojs/video.js/blob/master/src/js/component.js#L277) - ---- - -### off( [first], [second], [third] ) -> Remove an event listener from this component's element -> -> myComponent.off('eventType', myFunc); -> -> If myFunc is excluded, ALL listeners for the event type will be removed. -> If eventType is excluded, ALL listeners will be removed from the component. -> -> Alternatively you can use `off` to remove listeners that were added to other -> elements or components using `myComponent.on(otherComponent...`. -> In this case both the event type and listener function are REQUIRED. -> -> myComponent.off(otherElement, 'eventType', myFunc); -> myComponent.off(otherComponent, 'eventType', myFunc); - -##### PARAMETERS: -* __first__ `String|vjs.Component` _(OPTIONAL)_ The event type or other component -* __second__ `Function|String` _(OPTIONAL)_ The listener function or event type -* __third__ `Function` _(OPTIONAL)_ The listener for other component - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L646](https://github.com/videojs/video.js/blob/master/src/js/component.js#L646) - ---- - -### on( first, second, third ) -> Add an event listener to this component's element -> -> var myFunc = function(){ -> var myComponent = this; -> // Do something when the event is fired -> }; -> -> myComponent.on('eventType', myFunc); -> -> The context of myFunc will be myComponent unless previously bound. -> -> Alternatively, you can add a listener to another element or component. -> -> myComponent.on(otherElement, 'eventName', myFunc); -> myComponent.on(otherComponent, 'eventName', myFunc); -> -> The benefit of using this over `vjs.on(otherElement, 'eventName', myFunc)` -> and `otherComponent.on('eventName', myFunc)` is that this way the listeners -> will be automatically cleaned up when either component is disposed. -> It will also bind myComponent as the context of myFunc. -> -> **NOTE**: When using this on elements in the page other than window -> and document (both permanent), if you remove the element from the DOM -> you need to call `vjs.trigger(el, 'dispose')` on it to clean up -> references to it and allow the browser to garbage collect it. - -##### PARAMETERS: -* __first__ `String|vjs.Component` The event type or other component -* __second__ `Function|String` The event handler or event type -* __third__ `Function` The event handler - -##### RETURNS: -* `vjs.Component` self - -_inherited from_: [src/js/component.js#L577](https://github.com/videojs/video.js/blob/master/src/js/component.js#L577) - ---- - -### one( first, second, [third] ) -> Add an event listener to be triggered only once and then removed -> -> myComponent.one('eventName', myFunc); -> -> Alternatively you can add a listener to another element or component -> that will be triggered only once. -> -> myComponent.one(otherElement, 'eventName', myFunc); -> myComponent.one(otherComponent, 'eventName', myFunc); - -##### PARAMETERS: -* __first__ `String|vjs.Component` The event type or other component -* __second__ `Function|String` The listener function or event type -* __third__ `Function` _(OPTIONAL)_ The listener function for other component - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L691](https://github.com/videojs/video.js/blob/master/src/js/component.js#L691) - ---- - -### options( obj ) -> Deep merge of options objects -> -> Whenever a property is an object on both options objects -> the two properties will be merged using vjs.obj.deepMerge. -> -> This is used for merging options for child components. We -> want it to be easy to override individual options on a child -> component without having to rewrite all the other default options. -> -> Parent.prototype.options_ = { -> children: { -> 'childOne': { 'foo': 'bar', 'asdf': 'fdsa' }, -> 'childTwo': {}, -> 'childThree': {} -> } -> } -> newOptions = { -> children: { -> 'childOne': { 'foo': 'baz', 'abc': '123' } -> 'childTwo': null, -> 'childFour': {} -> } -> } -> -> this.options(newOptions); -> -> RESULT -> -> { -> children: { -> 'childOne': { 'foo': 'baz', 'asdf': 'fdsa', 'abc': '123' }, -> 'childTwo': null, // Disabled. Won't be initialized. -> 'childThree': {}, -> 'childFour': {} -> } -> } - -##### PARAMETERS: -* __obj__ `Object` Object of new option values - -##### RETURNS: -* `Object` A NEW object of this.options_ and obj merged - -_inherited from_: [src/js/component.js#L179](https://github.com/videojs/video.js/blob/master/src/js/component.js#L179) - ---- - -### player() -> Return the component's player - -##### RETURNS: -* `vjs.Player` - -_inherited from_: [src/js/component.js#L126](https://github.com/videojs/video.js/blob/master/src/js/component.js#L126) - ---- - -### ready( fn ) -> Bind a listener to the component's ready state -> -> Different from event listeners in that if the ready event has already happened -> it will trigger the function immediately. - -##### PARAMETERS: -* __fn__ `Function` Ready listener - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L769](https://github.com/videojs/video.js/blob/master/src/js/component.js#L769) - ---- - -### readyState() -> Get the track readyState - -##### RETURNS: -* `Number` - -_inherited from_: [src/js/tracks.js#L289](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L289) - ---- - -### removeChild( component ) -> Remove a child component from this component's list of children, and the -> child component's element from this component's element - -##### PARAMETERS: -* __component__ `vjs.Component` Component to remove - -_inherited from_: [src/js/component.js#L420](https://github.com/videojs/video.js/blob/master/src/js/component.js#L420) - ---- - -### removeClass( classToRemove ) -> Remove a CSS class name from the component's element - -##### PARAMETERS: -* __classToRemove__ `String` Classname to remove - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L837](https://github.com/videojs/video.js/blob/master/src/js/component.js#L837) - ---- - -### setInterval( fn, interval ) -> Creates an interval and sets up disposal automatically. - -##### PARAMETERS: -* __fn__ `Function` The function to run every N seconds. -* __interval__ `Number` Number of ms to delay before executing specified function. - -##### RETURNS: -* `Number` Returns the interval ID - -_inherited from_: [src/js/component.js#L1198](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1198) - ---- - -### setTimeout( fn, timeout ) -> Creates timeout and sets up disposal automatically. - -##### PARAMETERS: -* __fn__ `Function` The function to run after the timeout. -* __timeout__ `Number` Number of ms to delay before executing specified function. - -##### RETURNS: -* `Number` Returns the timeout ID - -_inherited from_: [src/js/component.js#L1158](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1158) - ---- - -### show() -> Show: Mode Showing (2) -> Indicates that the text track is active. If no attempt has yet been made to obtain the track's cues, the user agent will perform such an attempt momentarily. -> The user agent is maintaining a list of which cues are active, and events are being fired accordingly. -> In addition, for text tracks whose kind is subtitles or captions, the cues are being displayed over the video as appropriate; -> for text tracks whose kind is descriptions, the user agent is making the cues available to the user in a non-visual fashion; -> and for text tracks whose kind is chapters, the user agent is making available to the user a mechanism by which the user can navigate to any point in the media resource by selecting a cue. -> The showing by default state is used in conjunction with the default attribute on track elements to indicate that the text track was enabled due to that attribute. -> This allows the user agent to override the state if a later track is discovered that is more appropriate per the user's preferences. - -_inherited from_: [src/js/tracks.js#L331](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L331) - ---- - -### src() -> Get the track src value - -##### RETURNS: -* `String` - -_inherited from_: [src/js/tracks.js#L181](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L181) - ---- - -### title() -> Get the track title value - -##### RETURNS: -* `String` - -_inherited from_: [src/js/tracks.js#L210](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L210) - ---- - -### trigger( event ) -> Trigger an event on an element -> -> myComponent.trigger('eventName'); -> myComponent.trigger({'type':'eventName'}); - -##### PARAMETERS: -* __event__ `Event|Object|String` A string (the type) or an event object with a type attribute - -##### RETURNS: -* `vjs.Component` self - -_inherited from_: [src/js/component.js#L724](https://github.com/videojs/video.js/blob/master/src/js/component.js#L724) - ---- - -### triggerReady() -> Trigger the ready listeners - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L788](https://github.com/videojs/video.js/blob/master/src/js/component.js#L788) - ---- - -### width( [num], skipListeners ) -> Set or get the width of the component (CSS values) -> -> Setting the video tag dimension values only works with values in pixels. -> Percent values will not work. -> Some percents can be used, but width()/height() will return the number + %, -> not the actual computed width/height. - -##### PARAMETERS: -* __num__ `Number|String` _(OPTIONAL)_ Optional width number -* __skipListeners__ `Boolean` Skip the 'resize' event trigger - -##### RETURNS: -* `vjs.Component` This component, when setting the width -* `Number|String` The width, when getting - -_inherited from_: [src/js/component.js#L910](https://github.com/videojs/video.js/blob/master/src/js/component.js#L910) - ---- - -## EVENTS - -### resize `EVENT` -> Fired when the width and/or height of the component changes - -_inherited from_: [src/js/component.js#L1020](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1020) - ---- - diff --git a/docs/api/vjs.TextTrack.md b/docs/api/vjs.TextTrack.md deleted file mode 100644 index 80ead7f614..0000000000 --- a/docs/api/vjs.TextTrack.md +++ /dev/null @@ -1,795 +0,0 @@ - - -# vjs.TextTrack - -__EXTENDS__: [vjs.Component](vjs.Component.md) -__DEFINED IN__: [src/js/tracks.js#L132](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L132) - -The base class for all text tracks - -Handles the parsing, hiding, and showing of text track cues - ---- - -## INDEX - -- [METHODS](#methods) - - [activate](#activate) - - [activeCues](#activecues) - - [createEl](#createel) - - [cues](#cues) - - [deactivate](#deactivate) - - [dflt](#dflt) - - [disable](#disable) - - [hide](#hide) - - [init](#init-player-options-) - - [kind](#kind) - - [label](#label) - - [language](#language) - - [mode](#mode) - - [readyState](#readystate) - - [show](#show) - - [src](#src) - - [title](#title) - - [addChild](#addchild-child-options-) _`inherited`_ - - [addClass](#addclass-classtoadd-) _`inherited`_ - - [buildCSSClass](#buildcssclass) _`inherited`_ - - [children](#children) _`inherited`_ - - [clearInterval](#clearinterval-intervalid-) _`inherited`_ - - [clearTimeout](#cleartimeout-timeoutid-) _`inherited`_ - - [contentEl](#contentel) _`inherited`_ - - [dimensions](#dimensions-width-height-) _`inherited`_ - - [dispose](#dispose) _`inherited`_ - - [el](#el) _`inherited`_ - - [enableTouchActivity](#enabletouchactivity) _`inherited`_ - - [getChild](#getchild-name-) _`inherited`_ - - [getChildById](#getchildbyid-id-) _`inherited`_ - - [hasClass](#hasclass-classtocheck-) _`inherited`_ - - [height](#height-num-skiplisteners-) _`inherited`_ - - [id](#id) _`inherited`_ - - [initChildren](#initchildren) _`inherited`_ - - [name](#name) _`inherited`_ - - [off](#off-first-second-third-) _`inherited`_ - - [on](#on-first-second-third-) _`inherited`_ - - [one](#one-first-second-third-) _`inherited`_ - - [options](#options-obj-) _`inherited`_ - - [player](#player) _`inherited`_ - - [ready](#ready-fn-) _`inherited`_ - - [removeChild](#removechild-component-) _`inherited`_ - - [removeClass](#removeclass-classtoremove-) _`inherited`_ - - [setInterval](#setinterval-fn-interval-) _`inherited`_ - - [setTimeout](#settimeout-fn-timeout-) _`inherited`_ - - [trigger](#trigger-event-) _`inherited`_ - - [triggerReady](#triggerready) _`inherited`_ - - [width](#width-num-skiplisteners-) _`inherited`_ - -- [EVENTS](#events) - - [resize](#resize-event) _`inherited`_ - ---- - -## METHODS - -### activate() -> Turn on cue tracking. Tracks that are showing OR hidden are active. - -_defined in_: [src/js/tracks.js#L375](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L375) - ---- - -### activeCues() -> Get the track active cues - -##### RETURNS: -* `Array` - -_defined in_: [src/js/tracks.js#L270](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L270) - ---- - -### addChild( child, [options] ) -> Adds a child component inside this component -> -> myComponent.el(); -> // ->
    -> myComonent.children(); -> // [empty array] -> -> var myButton = myComponent.addChild('MyButton'); -> // ->
    myButton
    -> // -> myButton === myComonent.children()[0]; -> -> Pass in options for child constructors and options for children of the child -> -> var myButton = myComponent.addChild('MyButton', { -> text: 'Press Me', -> children: { -> buttonChildExample: { -> buttonChildOption: true -> } -> } -> }); - -##### PARAMETERS: -* __child__ `String|vjs.Component` The class name or instance of a child to add -* __options__ `Object` _(OPTIONAL)_ Options, including options to be passed to children of the child. - -##### RETURNS: -* `vjs.Component` The child component (created by this process if a string was used) - -_inherited from_: [src/js/component.js#L362](https://github.com/videojs/video.js/blob/master/src/js/component.js#L362) - ---- - -### addClass( classToAdd ) -> Add a CSS class name to the component's element - -##### PARAMETERS: -* __classToAdd__ `String` Classname to add - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L826](https://github.com/videojs/video.js/blob/master/src/js/component.js#L826) - ---- - -### buildCSSClass() -> Allows sub components to stack CSS class names - -##### RETURNS: -* `String` The constructed class name - -_inherited from_: [src/js/component.js#L536](https://github.com/videojs/video.js/blob/master/src/js/component.js#L536) - ---- - -### children() -> Get an array of all child components -> -> var kids = myComponent.children(); - -##### RETURNS: -* `Array` The children - -_inherited from_: [src/js/component.js#L296](https://github.com/videojs/video.js/blob/master/src/js/component.js#L296) - ---- - -### clearInterval( intervalId ) -> Clears an interval and removes the associated dispose listener - -##### PARAMETERS: -* __intervalId__ `Number` The id of the interval to clear - -##### RETURNS: -* `Number` Returns the interval ID - -_inherited from_: [src/js/component.js#L1219](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1219) - ---- - -### clearTimeout( timeoutId ) -> Clears a timeout and removes the associated dispose listener - -##### PARAMETERS: -* __timeoutId__ `Number` The id of the timeout to clear - -##### RETURNS: -* `Number` Returns the timeout ID - -_inherited from_: [src/js/component.js#L1181](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1181) - ---- - -### contentEl() -> Return the component's DOM element for embedding content. -> Will either be el_ or a new element defined in createEl. - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L239](https://github.com/videojs/video.js/blob/master/src/js/component.js#L239) - ---- - -### createEl() -> Create basic div to hold cue text - -##### RETURNS: -* `Element` - -_defined in_: [src/js/tracks.js#L315](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L315) - ---- - -### cues() -> Get the track cues - -##### RETURNS: -* `Array` - -_defined in_: [src/js/tracks.js#L255](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L255) - ---- - -### deactivate() -> Turn off cue tracking. - -_defined in_: [src/js/tracks.js#L398](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L398) - ---- - -### dflt() -> Get the track default value. ('default' is a reserved keyword) - -##### RETURNS: -* `Boolean` - -_defined in_: [src/js/tracks.js#L196](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L196) - ---- - -### dimensions( width, height ) -> Set both width and height at the same time - -##### PARAMETERS: -* __width__ `Number|String` -* __height__ `Number|String` - -##### RETURNS: -* `vjs.Component` The component - -_inherited from_: [src/js/component.js#L938](https://github.com/videojs/video.js/blob/master/src/js/component.js#L938) - ---- - -### disable() -> Disable: Mode Off/Disable (0) -> Indicates that the text track is not active. Other than for the purposes of exposing the track in the DOM, the user agent is ignoring the text track. -> No cues are active, no events are fired, and the user agent will not attempt to obtain the track's cues. - -_defined in_: [src/js/tracks.js#L361](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L361) - ---- - -### dispose() -> Dispose of the component and all child components - -_inherited from_: [src/js/component.js#L84](https://github.com/videojs/video.js/blob/master/src/js/component.js#L84) - ---- - -### el() -> Get the component's DOM element -> -> var domEl = myComponent.el(); - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L220](https://github.com/videojs/video.js/blob/master/src/js/component.js#L220) - ---- - -### enableTouchActivity() -> Report user touch activity when touch events occur -> -> User activity is used to determine when controls should show/hide. It's -> relatively simple when it comes to mouse events, because any mouse event -> should show the controls. So we capture mouse events that bubble up to the -> player and report activity when that happens. -> -> With touch events it isn't as easy. We can't rely on touch events at the -> player level, because a tap (touchstart + touchend) on the video itself on -> mobile devices is meant to turn controls off (and on). User activity is -> checked asynchronously, so what could happen is a tap event on the video -> turns the controls off, then the touchend event bubbles up to the player, -> which if it reported user activity, would turn the controls right back on. -> (We also don't want to completely block touch events from bubbling up) -> -> Also a touchmove, touch+hold, and anything other than a tap is not supposed -> to turn the controls back on on a mobile device. -> -> Here we're setting the default component behavior to report user activity -> whenever touch events happen, and this can be turned off by components that -> want touch events to act differently. - -_inherited from_: [src/js/component.js#L1120](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1120) - ---- - -### getChild( name ) -> Returns a child component with the provided name - -##### PARAMETERS: -* __name__ - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L330](https://github.com/videojs/video.js/blob/master/src/js/component.js#L330) - ---- - -### getChildById( id ) -> Returns a child component with the provided ID - -##### PARAMETERS: -* __id__ - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L313](https://github.com/videojs/video.js/blob/master/src/js/component.js#L313) - ---- - -### hasClass( classToCheck ) -> Check if a component's element has a CSS class name - -##### PARAMETERS: -* __classToCheck__ `String` Classname to check - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L816](https://github.com/videojs/video.js/blob/master/src/js/component.js#L816) - ---- - -### height( [num], [skipListeners] ) -> Get or set the height of the component (CSS values) -> -> Setting the video tag dimension values only works with values in pixels. -> Percent values will not work. -> Some percents can be used, but width()/height() will return the number + %, -> not the actual computed width/height. - -##### PARAMETERS: -* __num__ `Number|String` _(OPTIONAL)_ New component height -* __skipListeners__ `Boolean` _(OPTIONAL)_ Skip the resize event trigger - -##### RETURNS: -* `vjs.Component` This component, when setting the height -* `Number|String` The height, when getting - -_inherited from_: [src/js/component.js#L927](https://github.com/videojs/video.js/blob/master/src/js/component.js#L927) - ---- - -### hide() -> Hide: Mode Hidden (1) -> Indicates that the text track is active, but that the user agent is not actively displaying the cues. -> If no attempt has yet been made to obtain the track's cues, the user agent will perform such an attempt momentarily. -> The user agent is maintaining a list of which cues are active, and events are being fired accordingly. - -_defined in_: [src/js/tracks.js#L346](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L346) - ---- - -### id() -> Get the component's ID -> -> var id = myComponent.id(); - -##### RETURNS: -* `String` - -_inherited from_: [src/js/component.js#L258](https://github.com/videojs/video.js/blob/master/src/js/component.js#L258) - ---- - -### init( player, options ) - -##### PARAMETERS: -* __player__ -* __options__ - -_defined in_: [src/js/tracks.js#L134](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L134) - ---- - -### initChildren() -> Add and initialize default child components from options -> -> // when an instance of MyComponent is created, all children in options -> // will be added to the instance by their name strings and options -> MyComponent.prototype.options_.children = { -> myChildComponent: { -> myChildOption: true -> } -> } -> -> // Or when creating the component -> var myComp = new MyComponent(player, { -> children: { -> myChildComponent: { -> myChildOption: true -> } -> } -> }); -> -> The children option can also be an Array of child names or -> child options objects (that also include a 'name' key). -> -> var myComp = new MyComponent(player, { -> children: [ -> 'button', -> { -> name: 'button', -> someOtherOption: true -> } -> ] -> }); - -_inherited from_: [src/js/component.js#L481](https://github.com/videojs/video.js/blob/master/src/js/component.js#L481) - ---- - -### kind() -> Get the track kind value - -##### RETURNS: -* `String` - -_defined in_: [src/js/tracks.js#L167](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L167) - ---- - -### label() -> Get the track label value - -##### RETURNS: -* `String` - -_defined in_: [src/js/tracks.js#L240](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L240) - ---- - -### language() -> Get the track language value - -##### RETURNS: -* `String` - -_defined in_: [src/js/tracks.js#L225](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L225) - ---- - -### mode() -> Get the track mode - -##### RETURNS: -* `Number` - -_defined in_: [src/js/tracks.js#L307](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L307) - ---- - -### name() -> Get the component's name. The name is often used to reference the component. -> -> var name = myComponent.name(); - -##### RETURNS: -* `String` - -_inherited from_: [src/js/component.js#L277](https://github.com/videojs/video.js/blob/master/src/js/component.js#L277) - ---- - -### off( [first], [second], [third] ) -> Remove an event listener from this component's element -> -> myComponent.off('eventType', myFunc); -> -> If myFunc is excluded, ALL listeners for the event type will be removed. -> If eventType is excluded, ALL listeners will be removed from the component. -> -> Alternatively you can use `off` to remove listeners that were added to other -> elements or components using `myComponent.on(otherComponent...`. -> In this case both the event type and listener function are REQUIRED. -> -> myComponent.off(otherElement, 'eventType', myFunc); -> myComponent.off(otherComponent, 'eventType', myFunc); - -##### PARAMETERS: -* __first__ `String|vjs.Component` _(OPTIONAL)_ The event type or other component -* __second__ `Function|String` _(OPTIONAL)_ The listener function or event type -* __third__ `Function` _(OPTIONAL)_ The listener for other component - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L646](https://github.com/videojs/video.js/blob/master/src/js/component.js#L646) - ---- - -### on( first, second, third ) -> Add an event listener to this component's element -> -> var myFunc = function(){ -> var myComponent = this; -> // Do something when the event is fired -> }; -> -> myComponent.on('eventType', myFunc); -> -> The context of myFunc will be myComponent unless previously bound. -> -> Alternatively, you can add a listener to another element or component. -> -> myComponent.on(otherElement, 'eventName', myFunc); -> myComponent.on(otherComponent, 'eventName', myFunc); -> -> The benefit of using this over `vjs.on(otherElement, 'eventName', myFunc)` -> and `otherComponent.on('eventName', myFunc)` is that this way the listeners -> will be automatically cleaned up when either component is disposed. -> It will also bind myComponent as the context of myFunc. -> -> **NOTE**: When using this on elements in the page other than window -> and document (both permanent), if you remove the element from the DOM -> you need to call `vjs.trigger(el, 'dispose')` on it to clean up -> references to it and allow the browser to garbage collect it. - -##### PARAMETERS: -* __first__ `String|vjs.Component` The event type or other component -* __second__ `Function|String` The event handler or event type -* __third__ `Function` The event handler - -##### RETURNS: -* `vjs.Component` self - -_inherited from_: [src/js/component.js#L577](https://github.com/videojs/video.js/blob/master/src/js/component.js#L577) - ---- - -### one( first, second, [third] ) -> Add an event listener to be triggered only once and then removed -> -> myComponent.one('eventName', myFunc); -> -> Alternatively you can add a listener to another element or component -> that will be triggered only once. -> -> myComponent.one(otherElement, 'eventName', myFunc); -> myComponent.one(otherComponent, 'eventName', myFunc); - -##### PARAMETERS: -* __first__ `String|vjs.Component` The event type or other component -* __second__ `Function|String` The listener function or event type -* __third__ `Function` _(OPTIONAL)_ The listener function for other component - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L691](https://github.com/videojs/video.js/blob/master/src/js/component.js#L691) - ---- - -### options( obj ) -> Deep merge of options objects -> -> Whenever a property is an object on both options objects -> the two properties will be merged using vjs.obj.deepMerge. -> -> This is used for merging options for child components. We -> want it to be easy to override individual options on a child -> component without having to rewrite all the other default options. -> -> Parent.prototype.options_ = { -> children: { -> 'childOne': { 'foo': 'bar', 'asdf': 'fdsa' }, -> 'childTwo': {}, -> 'childThree': {} -> } -> } -> newOptions = { -> children: { -> 'childOne': { 'foo': 'baz', 'abc': '123' } -> 'childTwo': null, -> 'childFour': {} -> } -> } -> -> this.options(newOptions); -> -> RESULT -> -> { -> children: { -> 'childOne': { 'foo': 'baz', 'asdf': 'fdsa', 'abc': '123' }, -> 'childTwo': null, // Disabled. Won't be initialized. -> 'childThree': {}, -> 'childFour': {} -> } -> } - -##### PARAMETERS: -* __obj__ `Object` Object of new option values - -##### RETURNS: -* `Object` A NEW object of this.options_ and obj merged - -_inherited from_: [src/js/component.js#L179](https://github.com/videojs/video.js/blob/master/src/js/component.js#L179) - ---- - -### player() -> Return the component's player - -##### RETURNS: -* `vjs.Player` - -_inherited from_: [src/js/component.js#L126](https://github.com/videojs/video.js/blob/master/src/js/component.js#L126) - ---- - -### ready( fn ) -> Bind a listener to the component's ready state -> -> Different from event listeners in that if the ready event has already happened -> it will trigger the function immediately. - -##### PARAMETERS: -* __fn__ `Function` Ready listener - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L769](https://github.com/videojs/video.js/blob/master/src/js/component.js#L769) - ---- - -### readyState() -> Get the track readyState - -##### RETURNS: -* `Number` - -_defined in_: [src/js/tracks.js#L289](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L289) - ---- - -### removeChild( component ) -> Remove a child component from this component's list of children, and the -> child component's element from this component's element - -##### PARAMETERS: -* __component__ `vjs.Component` Component to remove - -_inherited from_: [src/js/component.js#L420](https://github.com/videojs/video.js/blob/master/src/js/component.js#L420) - ---- - -### removeClass( classToRemove ) -> Remove a CSS class name from the component's element - -##### PARAMETERS: -* __classToRemove__ `String` Classname to remove - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L837](https://github.com/videojs/video.js/blob/master/src/js/component.js#L837) - ---- - -### setInterval( fn, interval ) -> Creates an interval and sets up disposal automatically. - -##### PARAMETERS: -* __fn__ `Function` The function to run every N seconds. -* __interval__ `Number` Number of ms to delay before executing specified function. - -##### RETURNS: -* `Number` Returns the interval ID - -_inherited from_: [src/js/component.js#L1198](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1198) - ---- - -### setTimeout( fn, timeout ) -> Creates timeout and sets up disposal automatically. - -##### PARAMETERS: -* __fn__ `Function` The function to run after the timeout. -* __timeout__ `Number` Number of ms to delay before executing specified function. - -##### RETURNS: -* `Number` Returns the timeout ID - -_inherited from_: [src/js/component.js#L1158](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1158) - ---- - -### show() -> Show: Mode Showing (2) -> Indicates that the text track is active. If no attempt has yet been made to obtain the track's cues, the user agent will perform such an attempt momentarily. -> The user agent is maintaining a list of which cues are active, and events are being fired accordingly. -> In addition, for text tracks whose kind is subtitles or captions, the cues are being displayed over the video as appropriate; -> for text tracks whose kind is descriptions, the user agent is making the cues available to the user in a non-visual fashion; -> and for text tracks whose kind is chapters, the user agent is making available to the user a mechanism by which the user can navigate to any point in the media resource by selecting a cue. -> The showing by default state is used in conjunction with the default attribute on track elements to indicate that the text track was enabled due to that attribute. -> This allows the user agent to override the state if a later track is discovered that is more appropriate per the user's preferences. - -_defined in_: [src/js/tracks.js#L331](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L331) - ---- - -### src() -> Get the track src value - -##### RETURNS: -* `String` - -_defined in_: [src/js/tracks.js#L181](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L181) - ---- - -### title() -> Get the track title value - -##### RETURNS: -* `String` - -_defined in_: [src/js/tracks.js#L210](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L210) - ---- - -### trigger( event ) -> Trigger an event on an element -> -> myComponent.trigger('eventName'); -> myComponent.trigger({'type':'eventName'}); - -##### PARAMETERS: -* __event__ `Event|Object|String` A string (the type) or an event object with a type attribute - -##### RETURNS: -* `vjs.Component` self - -_inherited from_: [src/js/component.js#L724](https://github.com/videojs/video.js/blob/master/src/js/component.js#L724) - ---- - -### triggerReady() -> Trigger the ready listeners - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L788](https://github.com/videojs/video.js/blob/master/src/js/component.js#L788) - ---- - -### width( [num], skipListeners ) -> Set or get the width of the component (CSS values) -> -> Setting the video tag dimension values only works with values in pixels. -> Percent values will not work. -> Some percents can be used, but width()/height() will return the number + %, -> not the actual computed width/height. - -##### PARAMETERS: -* __num__ `Number|String` _(OPTIONAL)_ Optional width number -* __skipListeners__ `Boolean` Skip the 'resize' event trigger - -##### RETURNS: -* `vjs.Component` This component, when setting the width -* `Number|String` The width, when getting - -_inherited from_: [src/js/component.js#L910](https://github.com/videojs/video.js/blob/master/src/js/component.js#L910) - ---- - -## EVENTS - -### resize `EVENT` -> Fired when the width and/or height of the component changes - -_inherited from_: [src/js/component.js#L1020](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1020) - ---- - diff --git a/docs/api/vjs.TextTrackButton.md b/docs/api/vjs.TextTrackButton.md deleted file mode 100644 index c67e73cc26..0000000000 --- a/docs/api/vjs.TextTrackButton.md +++ /dev/null @@ -1,10 +0,0 @@ - - -# vjs.TextTrackButton - -__DEFINED IN__: [src/js/tracks/text-track-controls.js#L337](https://github.com/videojs/video.js/blob/master/src/js/tracks/text-track-controls.js#L337) - -The base class for buttons that toggle specific text track types (e.g. subtitles) - ---- - diff --git a/docs/api/vjs.TextTrackDisplay.md b/docs/api/vjs.TextTrackDisplay.md deleted file mode 100644 index 7dcff3e116..0000000000 --- a/docs/api/vjs.TextTrackDisplay.md +++ /dev/null @@ -1,10 +0,0 @@ - - -# vjs.TextTrackDisplay - -__DEFINED IN__: [src/js/tracks/text-track-controls.js#L13](https://github.com/videojs/video.js/blob/master/src/js/tracks/text-track-controls.js#L13) - -The component for displaying text track cues - ---- - diff --git a/docs/api/vjs.TextTrackMenuItem.md b/docs/api/vjs.TextTrackMenuItem.md deleted file mode 100644 index 43d9db970b..0000000000 --- a/docs/api/vjs.TextTrackMenuItem.md +++ /dev/null @@ -1,10 +0,0 @@ - - -# vjs.TextTrackMenuItem - -__DEFINED IN__: [src/js/tracks/text-track-controls.js#L194](https://github.com/videojs/video.js/blob/master/src/js/tracks/text-track-controls.js#L194) - -The specific menu item type for selecting a language within a text track kind - ---- - diff --git a/docs/api/vjs.TimeDivider.md b/docs/api/vjs.TimeDivider.md deleted file mode 100644 index 848a17d652..0000000000 --- a/docs/api/vjs.TimeDivider.md +++ /dev/null @@ -1,659 +0,0 @@ - - -# vjs.TimeDivider - -__EXTENDS__: [vjs.Component](vjs.Component.md) -__DEFINED IN__: [src/js/control-bar/time-display.js#L89](https://github.com/videojs/video.js/blob/master/src/js/control-bar/time-display.js#L89) - -The separator between the current time and duration - -Can be hidden if it's not needed in the design. - ---- - -## INDEX - -- [METHODS](#methods) - - [init](#init-player-options-) - - [addChild](#addchild-child-options-) _`inherited`_ - - [addClass](#addclass-classtoadd-) _`inherited`_ - - [buildCSSClass](#buildcssclass) _`inherited`_ - - [children](#children) _`inherited`_ - - [clearInterval](#clearinterval-intervalid-) _`inherited`_ - - [clearTimeout](#cleartimeout-timeoutid-) _`inherited`_ - - [contentEl](#contentel) _`inherited`_ - - [createEl](#createel-tagname-attributes-) _`inherited`_ - - [dimensions](#dimensions-width-height-) _`inherited`_ - - [dispose](#dispose) _`inherited`_ - - [el](#el) _`inherited`_ - - [enableTouchActivity](#enabletouchactivity) _`inherited`_ - - [getChild](#getchild-name-) _`inherited`_ - - [getChildById](#getchildbyid-id-) _`inherited`_ - - [hasClass](#hasclass-classtocheck-) _`inherited`_ - - [height](#height-num-skiplisteners-) _`inherited`_ - - [hide](#hide) _`inherited`_ - - [id](#id) _`inherited`_ - - [initChildren](#initchildren) _`inherited`_ - - [name](#name) _`inherited`_ - - [off](#off-first-second-third-) _`inherited`_ - - [on](#on-first-second-third-) _`inherited`_ - - [one](#one-first-second-third-) _`inherited`_ - - [options](#options-obj-) _`inherited`_ - - [player](#player) _`inherited`_ - - [ready](#ready-fn-) _`inherited`_ - - [removeChild](#removechild-component-) _`inherited`_ - - [removeClass](#removeclass-classtoremove-) _`inherited`_ - - [setInterval](#setinterval-fn-interval-) _`inherited`_ - - [setTimeout](#settimeout-fn-timeout-) _`inherited`_ - - [show](#show) _`inherited`_ - - [trigger](#trigger-event-) _`inherited`_ - - [triggerReady](#triggerready) _`inherited`_ - - [width](#width-num-skiplisteners-) _`inherited`_ - -- [EVENTS](#events) - - [resize](#resize-event) _`inherited`_ - ---- - -## METHODS - -### addChild( child, [options] ) -> Adds a child component inside this component -> -> myComponent.el(); -> // ->
    -> myComonent.children(); -> // [empty array] -> -> var myButton = myComponent.addChild('MyButton'); -> // ->
    myButton
    -> // -> myButton === myComonent.children()[0]; -> -> Pass in options for child constructors and options for children of the child -> -> var myButton = myComponent.addChild('MyButton', { -> text: 'Press Me', -> children: { -> buttonChildExample: { -> buttonChildOption: true -> } -> } -> }); - -##### PARAMETERS: -* __child__ `String|vjs.Component` The class name or instance of a child to add -* __options__ `Object` _(OPTIONAL)_ Options, including options to be passed to children of the child. - -##### RETURNS: -* `vjs.Component` The child component (created by this process if a string was used) - -_inherited from_: [src/js/component.js#L362](https://github.com/videojs/video.js/blob/master/src/js/component.js#L362) - ---- - -### addClass( classToAdd ) -> Add a CSS class name to the component's element - -##### PARAMETERS: -* __classToAdd__ `String` Classname to add - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L826](https://github.com/videojs/video.js/blob/master/src/js/component.js#L826) - ---- - -### buildCSSClass() -> Allows sub components to stack CSS class names - -##### RETURNS: -* `String` The constructed class name - -_inherited from_: [src/js/component.js#L536](https://github.com/videojs/video.js/blob/master/src/js/component.js#L536) - ---- - -### children() -> Get an array of all child components -> -> var kids = myComponent.children(); - -##### RETURNS: -* `Array` The children - -_inherited from_: [src/js/component.js#L296](https://github.com/videojs/video.js/blob/master/src/js/component.js#L296) - ---- - -### clearInterval( intervalId ) -> Clears an interval and removes the associated dispose listener - -##### PARAMETERS: -* __intervalId__ `Number` The id of the interval to clear - -##### RETURNS: -* `Number` Returns the interval ID - -_inherited from_: [src/js/component.js#L1223](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1223) - ---- - -### clearTimeout( timeoutId ) -> Clears a timeout and removes the associated dispose listener - -##### PARAMETERS: -* __timeoutId__ `Number` The id of the timeout to clear - -##### RETURNS: -* `Number` Returns the timeout ID - -_inherited from_: [src/js/component.js#L1185](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1185) - ---- - -### contentEl() -> Return the component's DOM element for embedding content. -> Will either be el_ or a new element defined in createEl. - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L239](https://github.com/videojs/video.js/blob/master/src/js/component.js#L239) - ---- - -### createEl( [tagName], [attributes] ) -> Create the component's DOM element - -##### PARAMETERS: -* __tagName__ `String` _(OPTIONAL)_ Element's node type. e.g. 'div' -* __attributes__ `Object` _(OPTIONAL)_ An object of element attributes that should be set on the element - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L200](https://github.com/videojs/video.js/blob/master/src/js/component.js#L200) - ---- - -### dimensions( width, height ) -> Set both width and height at the same time - -##### PARAMETERS: -* __width__ `Number|String` -* __height__ `Number|String` - -##### RETURNS: -* `vjs.Component` The component - -_inherited from_: [src/js/component.js#L938](https://github.com/videojs/video.js/blob/master/src/js/component.js#L938) - ---- - -### dispose() -> Dispose of the component and all child components - -_inherited from_: [src/js/component.js#L84](https://github.com/videojs/video.js/blob/master/src/js/component.js#L84) - ---- - -### el() -> Get the component's DOM element -> -> var domEl = myComponent.el(); - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L220](https://github.com/videojs/video.js/blob/master/src/js/component.js#L220) - ---- - -### enableTouchActivity() -> Report user touch activity when touch events occur -> -> User activity is used to determine when controls should show/hide. It's -> relatively simple when it comes to mouse events, because any mouse event -> should show the controls. So we capture mouse events that bubble up to the -> player and report activity when that happens. -> -> With touch events it isn't as easy. We can't rely on touch events at the -> player level, because a tap (touchstart + touchend) on the video itself on -> mobile devices is meant to turn controls off (and on). User activity is -> checked asynchronously, so what could happen is a tap event on the video -> turns the controls off, then the touchend event bubbles up to the player, -> which if it reported user activity, would turn the controls right back on. -> (We also don't want to completely block touch events from bubbling up) -> -> Also a touchmove, touch+hold, and anything other than a tap is not supposed -> to turn the controls back on on a mobile device. -> -> Here we're setting the default component behavior to report user activity -> whenever touch events happen, and this can be turned off by components that -> want touch events to act differently. - -_inherited from_: [src/js/component.js#L1124](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1124) - ---- - -### getChild( name ) -> Returns a child component with the provided name - -##### PARAMETERS: -* __name__ - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L330](https://github.com/videojs/video.js/blob/master/src/js/component.js#L330) - ---- - -### getChildById( id ) -> Returns a child component with the provided ID - -##### PARAMETERS: -* __id__ - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L313](https://github.com/videojs/video.js/blob/master/src/js/component.js#L313) - ---- - -### hasClass( classToCheck ) -> Check if a component's element has a CSS class name - -##### PARAMETERS: -* __classToCheck__ `String` Classname to check - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L816](https://github.com/videojs/video.js/blob/master/src/js/component.js#L816) - ---- - -### height( [num], [skipListeners] ) -> Get or set the height of the component (CSS values) -> -> Setting the video tag dimension values only works with values in pixels. -> Percent values will not work. -> Some percents can be used, but width()/height() will return the number + %, -> not the actual computed width/height. - -##### PARAMETERS: -* __num__ `Number|String` _(OPTIONAL)_ New component height -* __skipListeners__ `Boolean` _(OPTIONAL)_ Skip the resize event trigger - -##### RETURNS: -* `vjs.Component` This component, when setting the height -* `Number|String` The height, when getting - -_inherited from_: [src/js/component.js#L927](https://github.com/videojs/video.js/blob/master/src/js/component.js#L927) - ---- - -### hide() -> Hide the component element if currently showing - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L857](https://github.com/videojs/video.js/blob/master/src/js/component.js#L857) - ---- - -### id() -> Get the component's ID -> -> var id = myComponent.id(); - -##### RETURNS: -* `String` - -_inherited from_: [src/js/component.js#L258](https://github.com/videojs/video.js/blob/master/src/js/component.js#L258) - ---- - -### init( player, options ) - -##### PARAMETERS: -* __player__ -* __options__ - -_defined in_: [src/js/control-bar/time-display.js#L91](https://github.com/videojs/video.js/blob/master/src/js/control-bar/time-display.js#L91) - ---- - -### initChildren() -> Add and initialize default child components from options -> -> // when an instance of MyComponent is created, all children in options -> // will be added to the instance by their name strings and options -> MyComponent.prototype.options_.children = { -> myChildComponent: { -> myChildOption: true -> } -> } -> -> // Or when creating the component -> var myComp = new MyComponent(player, { -> children: { -> myChildComponent: { -> myChildOption: true -> } -> } -> }); -> -> The children option can also be an Array of child names or -> child options objects (that also include a 'name' key). -> -> var myComp = new MyComponent(player, { -> children: [ -> 'button', -> { -> name: 'button', -> someOtherOption: true -> } -> ] -> }); - -_inherited from_: [src/js/component.js#L481](https://github.com/videojs/video.js/blob/master/src/js/component.js#L481) - ---- - -### name() -> Get the component's name. The name is often used to reference the component. -> -> var name = myComponent.name(); - -##### RETURNS: -* `String` - -_inherited from_: [src/js/component.js#L277](https://github.com/videojs/video.js/blob/master/src/js/component.js#L277) - ---- - -### off( [first], [second], [third] ) -> Remove an event listener from this component's element -> -> myComponent.off('eventType', myFunc); -> -> If myFunc is excluded, ALL listeners for the event type will be removed. -> If eventType is excluded, ALL listeners will be removed from the component. -> -> Alternatively you can use `off` to remove listeners that were added to other -> elements or components using `myComponent.on(otherComponent...`. -> In this case both the event type and listener function are REQUIRED. -> -> myComponent.off(otherElement, 'eventType', myFunc); -> myComponent.off(otherComponent, 'eventType', myFunc); - -##### PARAMETERS: -* __first__ `String|vjs.Component` _(OPTIONAL)_ The event type or other component -* __second__ `Function|String` _(OPTIONAL)_ The listener function or event type -* __third__ `Function` _(OPTIONAL)_ The listener for other component - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L646](https://github.com/videojs/video.js/blob/master/src/js/component.js#L646) - ---- - -### on( first, second, third ) -> Add an event listener to this component's element -> -> var myFunc = function(){ -> var myComponent = this; -> // Do something when the event is fired -> }; -> -> myComponent.on('eventType', myFunc); -> -> The context of myFunc will be myComponent unless previously bound. -> -> Alternatively, you can add a listener to another element or component. -> -> myComponent.on(otherElement, 'eventName', myFunc); -> myComponent.on(otherComponent, 'eventName', myFunc); -> -> The benefit of using this over `vjs.on(otherElement, 'eventName', myFunc)` -> and `otherComponent.on('eventName', myFunc)` is that this way the listeners -> will be automatically cleaned up when either component is disposed. -> It will also bind myComponent as the context of myFunc. -> -> **NOTE**: When using this on elements in the page other than window -> and document (both permanent), if you remove the element from the DOM -> you need to call `vjs.trigger(el, 'dispose')` on it to clean up -> references to it and allow the browser to garbage collect it. - -##### PARAMETERS: -* __first__ `String|vjs.Component` The event type or other component -* __second__ `Function|String` The event handler or event type -* __third__ `Function` The event handler - -##### RETURNS: -* `vjs.Component` self - -_inherited from_: [src/js/component.js#L577](https://github.com/videojs/video.js/blob/master/src/js/component.js#L577) - ---- - -### one( first, second, [third] ) -> Add an event listener to be triggered only once and then removed -> -> myComponent.one('eventName', myFunc); -> -> Alternatively you can add a listener to another element or component -> that will be triggered only once. -> -> myComponent.one(otherElement, 'eventName', myFunc); -> myComponent.one(otherComponent, 'eventName', myFunc); - -##### PARAMETERS: -* __first__ `String|vjs.Component` The event type or other component -* __second__ `Function|String` The listener function or event type -* __third__ `Function` _(OPTIONAL)_ The listener function for other component - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L691](https://github.com/videojs/video.js/blob/master/src/js/component.js#L691) - ---- - -### options( obj ) -> Deep merge of options objects -> -> Whenever a property is an object on both options objects -> the two properties will be merged using vjs.obj.deepMerge. -> -> This is used for merging options for child components. We -> want it to be easy to override individual options on a child -> component without having to rewrite all the other default options. -> -> Parent.prototype.options_ = { -> children: { -> 'childOne': { 'foo': 'bar', 'asdf': 'fdsa' }, -> 'childTwo': {}, -> 'childThree': {} -> } -> } -> newOptions = { -> children: { -> 'childOne': { 'foo': 'baz', 'abc': '123' } -> 'childTwo': null, -> 'childFour': {} -> } -> } -> -> this.options(newOptions); -> -> RESULT -> -> { -> children: { -> 'childOne': { 'foo': 'baz', 'asdf': 'fdsa', 'abc': '123' }, -> 'childTwo': null, // Disabled. Won't be initialized. -> 'childThree': {}, -> 'childFour': {} -> } -> } - -##### PARAMETERS: -* __obj__ `Object` Object of new option values - -##### RETURNS: -* `Object` A NEW object of this.options_ and obj merged - -_inherited from_: [src/js/component.js#L179](https://github.com/videojs/video.js/blob/master/src/js/component.js#L179) - ---- - -### player() -> Return the component's player - -##### RETURNS: -* `vjs.Player` - -_inherited from_: [src/js/component.js#L126](https://github.com/videojs/video.js/blob/master/src/js/component.js#L126) - ---- - -### ready( fn ) -> Bind a listener to the component's ready state -> -> Different from event listeners in that if the ready event has already happened -> it will trigger the function immediately. - -##### PARAMETERS: -* __fn__ `Function` Ready listener - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L769](https://github.com/videojs/video.js/blob/master/src/js/component.js#L769) - ---- - -### removeChild( component ) -> Remove a child component from this component's list of children, and the -> child component's element from this component's element - -##### PARAMETERS: -* __component__ `vjs.Component` Component to remove - -_inherited from_: [src/js/component.js#L420](https://github.com/videojs/video.js/blob/master/src/js/component.js#L420) - ---- - -### removeClass( classToRemove ) -> Remove a CSS class name from the component's element - -##### PARAMETERS: -* __classToRemove__ `String` Classname to remove - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L837](https://github.com/videojs/video.js/blob/master/src/js/component.js#L837) - ---- - -### setInterval( fn, interval ) -> Creates an interval and sets up disposal automatically. - -##### PARAMETERS: -* __fn__ `Function` The function to run every N seconds. -* __interval__ `Number` Number of ms to delay before executing specified function. - -##### RETURNS: -* `Number` Returns the interval ID - -_inherited from_: [src/js/component.js#L1202](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1202) - ---- - -### setTimeout( fn, timeout ) -> Creates timeout and sets up disposal automatically. - -##### PARAMETERS: -* __fn__ `Function` The function to run after the timeout. -* __timeout__ `Number` Number of ms to delay before executing specified function. - -##### RETURNS: -* `Number` Returns the timeout ID - -_inherited from_: [src/js/component.js#L1162](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1162) - ---- - -### show() -> Show the component element if hidden - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L847](https://github.com/videojs/video.js/blob/master/src/js/component.js#L847) - ---- - -### trigger( event ) -> Trigger an event on an element -> -> myComponent.trigger('eventName'); -> myComponent.trigger({'type':'eventName'}); - -##### PARAMETERS: -* __event__ `Event|Object|String` A string (the type) or an event object with a type attribute - -##### RETURNS: -* `vjs.Component` self - -_inherited from_: [src/js/component.js#L724](https://github.com/videojs/video.js/blob/master/src/js/component.js#L724) - ---- - -### triggerReady() -> Trigger the ready listeners - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L788](https://github.com/videojs/video.js/blob/master/src/js/component.js#L788) - ---- - -### width( [num], skipListeners ) -> Set or get the width of the component (CSS values) -> -> Setting the video tag dimension values only works with values in pixels. -> Percent values will not work. -> Some percents can be used, but width()/height() will return the number + %, -> not the actual computed width/height. - -##### PARAMETERS: -* __num__ `Number|String` _(OPTIONAL)_ Optional width number -* __skipListeners__ `Boolean` Skip the 'resize' event trigger - -##### RETURNS: -* `vjs.Component` This component, when setting the width -* `Number|String` The width, when getting - -_inherited from_: [src/js/component.js#L910](https://github.com/videojs/video.js/blob/master/src/js/component.js#L910) - ---- - -## EVENTS - -### resize `EVENT` -> Fired when the width and/or height of the component changes - -_inherited from_: [src/js/component.js#L1020](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1020) - ---- - diff --git a/docs/api/vjs.VolumeBar.md b/docs/api/vjs.VolumeBar.md deleted file mode 100644 index b444efb7db..0000000000 --- a/docs/api/vjs.VolumeBar.md +++ /dev/null @@ -1,669 +0,0 @@ - - -# vjs.VolumeBar - -__EXTENDS__: [vjs.Slider](vjs.Slider.md) -__DEFINED IN__: [src/js/control-bar/volume-control.js#L46](https://github.com/videojs/video.js/blob/master/src/js/control-bar/volume-control.js#L46) - -The bar that contains the volume level and can be clicked on to adjust the level - ---- - -## INDEX - -- [METHODS](#methods) - - [init](#init-player-options-) - - [addChild](#addchild-child-options-) _`inherited`_ - - [addClass](#addclass-classtoadd-) _`inherited`_ - - [buildCSSClass](#buildcssclass) _`inherited`_ - - [children](#children) _`inherited`_ - - [clearInterval](#clearinterval-intervalid-) _`inherited`_ - - [clearTimeout](#cleartimeout-timeoutid-) _`inherited`_ - - [contentEl](#contentel) _`inherited`_ - - [createEl](#createel-tagname-attributes-) _`inherited`_ - - [dimensions](#dimensions-width-height-) _`inherited`_ - - [dispose](#dispose) _`inherited`_ - - [el](#el) _`inherited`_ - - [enableTouchActivity](#enabletouchactivity) _`inherited`_ - - [getChild](#getchild-name-) _`inherited`_ - - [getChildById](#getchildbyid-id-) _`inherited`_ - - [hasClass](#hasclass-classtocheck-) _`inherited`_ - - [height](#height-num-skiplisteners-) _`inherited`_ - - [hide](#hide) _`inherited`_ - - [id](#id) _`inherited`_ - - [initChildren](#initchildren) _`inherited`_ - - [name](#name) _`inherited`_ - - [off](#off-first-second-third-) _`inherited`_ - - [on](#on-first-second-third-) _`inherited`_ - - [onClick](#onclick-event-) _`inherited`_ - - [one](#one-first-second-third-) _`inherited`_ - - [options](#options-obj-) _`inherited`_ - - [player](#player) _`inherited`_ - - [ready](#ready-fn-) _`inherited`_ - - [removeChild](#removechild-component-) _`inherited`_ - - [removeClass](#removeclass-classtoremove-) _`inherited`_ - - [setInterval](#setinterval-fn-interval-) _`inherited`_ - - [setTimeout](#settimeout-fn-timeout-) _`inherited`_ - - [show](#show) _`inherited`_ - - [trigger](#trigger-event-) _`inherited`_ - - [triggerReady](#triggerready) _`inherited`_ - - [width](#width-num-skiplisteners-) _`inherited`_ - -- [EVENTS](#events) - - [resize](#resize-event) _`inherited`_ - ---- - -## METHODS - -### addChild( child, [options] ) -> Adds a child component inside this component -> -> myComponent.el(); -> // ->
    -> myComonent.children(); -> // [empty array] -> -> var myButton = myComponent.addChild('MyButton'); -> // ->
    myButton
    -> // -> myButton === myComonent.children()[0]; -> -> Pass in options for child constructors and options for children of the child -> -> var myButton = myComponent.addChild('MyButton', { -> text: 'Press Me', -> children: { -> buttonChildExample: { -> buttonChildOption: true -> } -> } -> }); - -##### PARAMETERS: -* __child__ `String|vjs.Component` The class name or instance of a child to add -* __options__ `Object` _(OPTIONAL)_ Options, including options to be passed to children of the child. - -##### RETURNS: -* `vjs.Component` The child component (created by this process if a string was used) - -_inherited from_: [src/js/component.js#L362](https://github.com/videojs/video.js/blob/master/src/js/component.js#L362) - ---- - -### addClass( classToAdd ) -> Add a CSS class name to the component's element - -##### PARAMETERS: -* __classToAdd__ `String` Classname to add - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L826](https://github.com/videojs/video.js/blob/master/src/js/component.js#L826) - ---- - -### buildCSSClass() -> Allows sub components to stack CSS class names - -##### RETURNS: -* `String` The constructed class name - -_inherited from_: [src/js/component.js#L536](https://github.com/videojs/video.js/blob/master/src/js/component.js#L536) - ---- - -### children() -> Get an array of all child components -> -> var kids = myComponent.children(); - -##### RETURNS: -* `Array` The children - -_inherited from_: [src/js/component.js#L296](https://github.com/videojs/video.js/blob/master/src/js/component.js#L296) - ---- - -### clearInterval( intervalId ) -> Clears an interval and removes the associated dispose listener - -##### PARAMETERS: -* __intervalId__ `Number` The id of the interval to clear - -##### RETURNS: -* `Number` Returns the interval ID - -_inherited from_: [src/js/component.js#L1223](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1223) - ---- - -### clearTimeout( timeoutId ) -> Clears a timeout and removes the associated dispose listener - -##### PARAMETERS: -* __timeoutId__ `Number` The id of the timeout to clear - -##### RETURNS: -* `Number` Returns the timeout ID - -_inherited from_: [src/js/component.js#L1185](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1185) - ---- - -### contentEl() -> Return the component's DOM element for embedding content. -> Will either be el_ or a new element defined in createEl. - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L239](https://github.com/videojs/video.js/blob/master/src/js/component.js#L239) - ---- - -### createEl( [tagName], [attributes] ) -> Create the component's DOM element - -##### PARAMETERS: -* __tagName__ `String` _(OPTIONAL)_ Element's node type. e.g. 'div' -* __attributes__ `Object` _(OPTIONAL)_ An object of element attributes that should be set on the element - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L200](https://github.com/videojs/video.js/blob/master/src/js/component.js#L200) - ---- - -### dimensions( width, height ) -> Set both width and height at the same time - -##### PARAMETERS: -* __width__ `Number|String` -* __height__ `Number|String` - -##### RETURNS: -* `vjs.Component` The component - -_inherited from_: [src/js/component.js#L938](https://github.com/videojs/video.js/blob/master/src/js/component.js#L938) - ---- - -### dispose() -> Dispose of the component and all child components - -_inherited from_: [src/js/component.js#L84](https://github.com/videojs/video.js/blob/master/src/js/component.js#L84) - ---- - -### el() -> Get the component's DOM element -> -> var domEl = myComponent.el(); - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L220](https://github.com/videojs/video.js/blob/master/src/js/component.js#L220) - ---- - -### enableTouchActivity() -> Report user touch activity when touch events occur -> -> User activity is used to determine when controls should show/hide. It's -> relatively simple when it comes to mouse events, because any mouse event -> should show the controls. So we capture mouse events that bubble up to the -> player and report activity when that happens. -> -> With touch events it isn't as easy. We can't rely on touch events at the -> player level, because a tap (touchstart + touchend) on the video itself on -> mobile devices is meant to turn controls off (and on). User activity is -> checked asynchronously, so what could happen is a tap event on the video -> turns the controls off, then the touchend event bubbles up to the player, -> which if it reported user activity, would turn the controls right back on. -> (We also don't want to completely block touch events from bubbling up) -> -> Also a touchmove, touch+hold, and anything other than a tap is not supposed -> to turn the controls back on on a mobile device. -> -> Here we're setting the default component behavior to report user activity -> whenever touch events happen, and this can be turned off by components that -> want touch events to act differently. - -_inherited from_: [src/js/component.js#L1124](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1124) - ---- - -### getChild( name ) -> Returns a child component with the provided name - -##### PARAMETERS: -* __name__ - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L330](https://github.com/videojs/video.js/blob/master/src/js/component.js#L330) - ---- - -### getChildById( id ) -> Returns a child component with the provided ID - -##### PARAMETERS: -* __id__ - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L313](https://github.com/videojs/video.js/blob/master/src/js/component.js#L313) - ---- - -### hasClass( classToCheck ) -> Check if a component's element has a CSS class name - -##### PARAMETERS: -* __classToCheck__ `String` Classname to check - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L816](https://github.com/videojs/video.js/blob/master/src/js/component.js#L816) - ---- - -### height( [num], [skipListeners] ) -> Get or set the height of the component (CSS values) -> -> Setting the video tag dimension values only works with values in pixels. -> Percent values will not work. -> Some percents can be used, but width()/height() will return the number + %, -> not the actual computed width/height. - -##### PARAMETERS: -* __num__ `Number|String` _(OPTIONAL)_ New component height -* __skipListeners__ `Boolean` _(OPTIONAL)_ Skip the resize event trigger - -##### RETURNS: -* `vjs.Component` This component, when setting the height -* `Number|String` The height, when getting - -_inherited from_: [src/js/component.js#L927](https://github.com/videojs/video.js/blob/master/src/js/component.js#L927) - ---- - -### hide() -> Hide the component element if currently showing - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L857](https://github.com/videojs/video.js/blob/master/src/js/component.js#L857) - ---- - -### id() -> Get the component's ID -> -> var id = myComponent.id(); - -##### RETURNS: -* `String` - -_inherited from_: [src/js/component.js#L258](https://github.com/videojs/video.js/blob/master/src/js/component.js#L258) - ---- - -### init( player, options ) - -##### PARAMETERS: -* __player__ -* __options__ - -_defined in_: [src/js/control-bar/volume-control.js#L48](https://github.com/videojs/video.js/blob/master/src/js/control-bar/volume-control.js#L48) - ---- - -### initChildren() -> Add and initialize default child components from options -> -> // when an instance of MyComponent is created, all children in options -> // will be added to the instance by their name strings and options -> MyComponent.prototype.options_.children = { -> myChildComponent: { -> myChildOption: true -> } -> } -> -> // Or when creating the component -> var myComp = new MyComponent(player, { -> children: { -> myChildComponent: { -> myChildOption: true -> } -> } -> }); -> -> The children option can also be an Array of child names or -> child options objects (that also include a 'name' key). -> -> var myComp = new MyComponent(player, { -> children: [ -> 'button', -> { -> name: 'button', -> someOtherOption: true -> } -> ] -> }); - -_inherited from_: [src/js/component.js#L481](https://github.com/videojs/video.js/blob/master/src/js/component.js#L481) - ---- - -### name() -> Get the component's name. The name is often used to reference the component. -> -> var name = myComponent.name(); - -##### RETURNS: -* `String` - -_inherited from_: [src/js/component.js#L277](https://github.com/videojs/video.js/blob/master/src/js/component.js#L277) - ---- - -### off( [first], [second], [third] ) -> Remove an event listener from this component's element -> -> myComponent.off('eventType', myFunc); -> -> If myFunc is excluded, ALL listeners for the event type will be removed. -> If eventType is excluded, ALL listeners will be removed from the component. -> -> Alternatively you can use `off` to remove listeners that were added to other -> elements or components using `myComponent.on(otherComponent...`. -> In this case both the event type and listener function are REQUIRED. -> -> myComponent.off(otherElement, 'eventType', myFunc); -> myComponent.off(otherComponent, 'eventType', myFunc); - -##### PARAMETERS: -* __first__ `String|vjs.Component` _(OPTIONAL)_ The event type or other component -* __second__ `Function|String` _(OPTIONAL)_ The listener function or event type -* __third__ `Function` _(OPTIONAL)_ The listener for other component - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L646](https://github.com/videojs/video.js/blob/master/src/js/component.js#L646) - ---- - -### on( first, second, third ) -> Add an event listener to this component's element -> -> var myFunc = function(){ -> var myComponent = this; -> // Do something when the event is fired -> }; -> -> myComponent.on('eventType', myFunc); -> -> The context of myFunc will be myComponent unless previously bound. -> -> Alternatively, you can add a listener to another element or component. -> -> myComponent.on(otherElement, 'eventName', myFunc); -> myComponent.on(otherComponent, 'eventName', myFunc); -> -> The benefit of using this over `vjs.on(otherElement, 'eventName', myFunc)` -> and `otherComponent.on('eventName', myFunc)` is that this way the listeners -> will be automatically cleaned up when either component is disposed. -> It will also bind myComponent as the context of myFunc. -> -> **NOTE**: When using this on elements in the page other than window -> and document (both permanent), if you remove the element from the DOM -> you need to call `vjs.trigger(el, 'dispose')` on it to clean up -> references to it and allow the browser to garbage collect it. - -##### PARAMETERS: -* __first__ `String|vjs.Component` The event type or other component -* __second__ `Function|String` The event handler or event type -* __third__ `Function` The event handler - -##### RETURNS: -* `vjs.Component` self - -_inherited from_: [src/js/component.js#L577](https://github.com/videojs/video.js/blob/master/src/js/component.js#L577) - ---- - -### onClick( event ) -> Listener for click events on slider, used to prevent clicks -> from bubbling up to parent elements like button menus. - -##### PARAMETERS: -* __event__ `Object` Event object - -_inherited from_: [src/js/slider.js#L202](https://github.com/videojs/video.js/blob/master/src/js/slider.js#L202) - ---- - -### one( first, second, [third] ) -> Add an event listener to be triggered only once and then removed -> -> myComponent.one('eventName', myFunc); -> -> Alternatively you can add a listener to another element or component -> that will be triggered only once. -> -> myComponent.one(otherElement, 'eventName', myFunc); -> myComponent.one(otherComponent, 'eventName', myFunc); - -##### PARAMETERS: -* __first__ `String|vjs.Component` The event type or other component -* __second__ `Function|String` The listener function or event type -* __third__ `Function` _(OPTIONAL)_ The listener function for other component - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L691](https://github.com/videojs/video.js/blob/master/src/js/component.js#L691) - ---- - -### options( obj ) -> Deep merge of options objects -> -> Whenever a property is an object on both options objects -> the two properties will be merged using vjs.obj.deepMerge. -> -> This is used for merging options for child components. We -> want it to be easy to override individual options on a child -> component without having to rewrite all the other default options. -> -> Parent.prototype.options_ = { -> children: { -> 'childOne': { 'foo': 'bar', 'asdf': 'fdsa' }, -> 'childTwo': {}, -> 'childThree': {} -> } -> } -> newOptions = { -> children: { -> 'childOne': { 'foo': 'baz', 'abc': '123' } -> 'childTwo': null, -> 'childFour': {} -> } -> } -> -> this.options(newOptions); -> -> RESULT -> -> { -> children: { -> 'childOne': { 'foo': 'baz', 'asdf': 'fdsa', 'abc': '123' }, -> 'childTwo': null, // Disabled. Won't be initialized. -> 'childThree': {}, -> 'childFour': {} -> } -> } - -##### PARAMETERS: -* __obj__ `Object` Object of new option values - -##### RETURNS: -* `Object` A NEW object of this.options_ and obj merged - -_inherited from_: [src/js/component.js#L179](https://github.com/videojs/video.js/blob/master/src/js/component.js#L179) - ---- - -### player() -> Return the component's player - -##### RETURNS: -* `vjs.Player` - -_inherited from_: [src/js/component.js#L126](https://github.com/videojs/video.js/blob/master/src/js/component.js#L126) - ---- - -### ready( fn ) -> Bind a listener to the component's ready state -> -> Different from event listeners in that if the ready event has already happened -> it will trigger the function immediately. - -##### PARAMETERS: -* __fn__ `Function` Ready listener - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L769](https://github.com/videojs/video.js/blob/master/src/js/component.js#L769) - ---- - -### removeChild( component ) -> Remove a child component from this component's list of children, and the -> child component's element from this component's element - -##### PARAMETERS: -* __component__ `vjs.Component` Component to remove - -_inherited from_: [src/js/component.js#L420](https://github.com/videojs/video.js/blob/master/src/js/component.js#L420) - ---- - -### removeClass( classToRemove ) -> Remove a CSS class name from the component's element - -##### PARAMETERS: -* __classToRemove__ `String` Classname to remove - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L837](https://github.com/videojs/video.js/blob/master/src/js/component.js#L837) - ---- - -### setInterval( fn, interval ) -> Creates an interval and sets up disposal automatically. - -##### PARAMETERS: -* __fn__ `Function` The function to run every N seconds. -* __interval__ `Number` Number of ms to delay before executing specified function. - -##### RETURNS: -* `Number` Returns the interval ID - -_inherited from_: [src/js/component.js#L1202](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1202) - ---- - -### setTimeout( fn, timeout ) -> Creates timeout and sets up disposal automatically. - -##### PARAMETERS: -* __fn__ `Function` The function to run after the timeout. -* __timeout__ `Number` Number of ms to delay before executing specified function. - -##### RETURNS: -* `Number` Returns the timeout ID - -_inherited from_: [src/js/component.js#L1162](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1162) - ---- - -### show() -> Show the component element if hidden - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L847](https://github.com/videojs/video.js/blob/master/src/js/component.js#L847) - ---- - -### trigger( event ) -> Trigger an event on an element -> -> myComponent.trigger('eventName'); -> myComponent.trigger({'type':'eventName'}); - -##### PARAMETERS: -* __event__ `Event|Object|String` A string (the type) or an event object with a type attribute - -##### RETURNS: -* `vjs.Component` self - -_inherited from_: [src/js/component.js#L724](https://github.com/videojs/video.js/blob/master/src/js/component.js#L724) - ---- - -### triggerReady() -> Trigger the ready listeners - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L788](https://github.com/videojs/video.js/blob/master/src/js/component.js#L788) - ---- - -### width( [num], skipListeners ) -> Set or get the width of the component (CSS values) -> -> Setting the video tag dimension values only works with values in pixels. -> Percent values will not work. -> Some percents can be used, but width()/height() will return the number + %, -> not the actual computed width/height. - -##### PARAMETERS: -* __num__ `Number|String` _(OPTIONAL)_ Optional width number -* __skipListeners__ `Boolean` Skip the 'resize' event trigger - -##### RETURNS: -* `vjs.Component` This component, when setting the width -* `Number|String` The width, when getting - -_inherited from_: [src/js/component.js#L910](https://github.com/videojs/video.js/blob/master/src/js/component.js#L910) - ---- - -## EVENTS - -### resize `EVENT` -> Fired when the width and/or height of the component changes - -_inherited from_: [src/js/component.js#L1020](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1020) - ---- - diff --git a/docs/api/vjs.VolumeControl.md b/docs/api/vjs.VolumeControl.md deleted file mode 100644 index 1871944853..0000000000 --- a/docs/api/vjs.VolumeControl.md +++ /dev/null @@ -1,657 +0,0 @@ - - -# vjs.VolumeControl - -__EXTENDS__: [vjs.Component](vjs.Component.md) -__DEFINED IN__: [src/js/control-bar/volume-control.js#L8](https://github.com/videojs/video.js/blob/master/src/js/control-bar/volume-control.js#L8) - -The component for controlling the volume level - ---- - -## INDEX - -- [METHODS](#methods) - - [init](#init-player-options-) - - [addChild](#addchild-child-options-) _`inherited`_ - - [addClass](#addclass-classtoadd-) _`inherited`_ - - [buildCSSClass](#buildcssclass) _`inherited`_ - - [children](#children) _`inherited`_ - - [clearInterval](#clearinterval-intervalid-) _`inherited`_ - - [clearTimeout](#cleartimeout-timeoutid-) _`inherited`_ - - [contentEl](#contentel) _`inherited`_ - - [createEl](#createel-tagname-attributes-) _`inherited`_ - - [dimensions](#dimensions-width-height-) _`inherited`_ - - [dispose](#dispose) _`inherited`_ - - [el](#el) _`inherited`_ - - [enableTouchActivity](#enabletouchactivity) _`inherited`_ - - [getChild](#getchild-name-) _`inherited`_ - - [getChildById](#getchildbyid-id-) _`inherited`_ - - [hasClass](#hasclass-classtocheck-) _`inherited`_ - - [height](#height-num-skiplisteners-) _`inherited`_ - - [hide](#hide) _`inherited`_ - - [id](#id) _`inherited`_ - - [initChildren](#initchildren) _`inherited`_ - - [name](#name) _`inherited`_ - - [off](#off-first-second-third-) _`inherited`_ - - [on](#on-first-second-third-) _`inherited`_ - - [one](#one-first-second-third-) _`inherited`_ - - [options](#options-obj-) _`inherited`_ - - [player](#player) _`inherited`_ - - [ready](#ready-fn-) _`inherited`_ - - [removeChild](#removechild-component-) _`inherited`_ - - [removeClass](#removeclass-classtoremove-) _`inherited`_ - - [setInterval](#setinterval-fn-interval-) _`inherited`_ - - [setTimeout](#settimeout-fn-timeout-) _`inherited`_ - - [show](#show) _`inherited`_ - - [trigger](#trigger-event-) _`inherited`_ - - [triggerReady](#triggerready) _`inherited`_ - - [width](#width-num-skiplisteners-) _`inherited`_ - -- [EVENTS](#events) - - [resize](#resize-event) _`inherited`_ - ---- - -## METHODS - -### addChild( child, [options] ) -> Adds a child component inside this component -> -> myComponent.el(); -> // ->
    -> myComonent.children(); -> // [empty array] -> -> var myButton = myComponent.addChild('MyButton'); -> // ->
    myButton
    -> // -> myButton === myComonent.children()[0]; -> -> Pass in options for child constructors and options for children of the child -> -> var myButton = myComponent.addChild('MyButton', { -> text: 'Press Me', -> children: { -> buttonChildExample: { -> buttonChildOption: true -> } -> } -> }); - -##### PARAMETERS: -* __child__ `String|vjs.Component` The class name or instance of a child to add -* __options__ `Object` _(OPTIONAL)_ Options, including options to be passed to children of the child. - -##### RETURNS: -* `vjs.Component` The child component (created by this process if a string was used) - -_inherited from_: [src/js/component.js#L362](https://github.com/videojs/video.js/blob/master/src/js/component.js#L362) - ---- - -### addClass( classToAdd ) -> Add a CSS class name to the component's element - -##### PARAMETERS: -* __classToAdd__ `String` Classname to add - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L826](https://github.com/videojs/video.js/blob/master/src/js/component.js#L826) - ---- - -### buildCSSClass() -> Allows sub components to stack CSS class names - -##### RETURNS: -* `String` The constructed class name - -_inherited from_: [src/js/component.js#L536](https://github.com/videojs/video.js/blob/master/src/js/component.js#L536) - ---- - -### children() -> Get an array of all child components -> -> var kids = myComponent.children(); - -##### RETURNS: -* `Array` The children - -_inherited from_: [src/js/component.js#L296](https://github.com/videojs/video.js/blob/master/src/js/component.js#L296) - ---- - -### clearInterval( intervalId ) -> Clears an interval and removes the associated dispose listener - -##### PARAMETERS: -* __intervalId__ `Number` The id of the interval to clear - -##### RETURNS: -* `Number` Returns the interval ID - -_inherited from_: [src/js/component.js#L1223](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1223) - ---- - -### clearTimeout( timeoutId ) -> Clears a timeout and removes the associated dispose listener - -##### PARAMETERS: -* __timeoutId__ `Number` The id of the timeout to clear - -##### RETURNS: -* `Number` Returns the timeout ID - -_inherited from_: [src/js/component.js#L1185](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1185) - ---- - -### contentEl() -> Return the component's DOM element for embedding content. -> Will either be el_ or a new element defined in createEl. - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L239](https://github.com/videojs/video.js/blob/master/src/js/component.js#L239) - ---- - -### createEl( [tagName], [attributes] ) -> Create the component's DOM element - -##### PARAMETERS: -* __tagName__ `String` _(OPTIONAL)_ Element's node type. e.g. 'div' -* __attributes__ `Object` _(OPTIONAL)_ An object of element attributes that should be set on the element - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L200](https://github.com/videojs/video.js/blob/master/src/js/component.js#L200) - ---- - -### dimensions( width, height ) -> Set both width and height at the same time - -##### PARAMETERS: -* __width__ `Number|String` -* __height__ `Number|String` - -##### RETURNS: -* `vjs.Component` The component - -_inherited from_: [src/js/component.js#L938](https://github.com/videojs/video.js/blob/master/src/js/component.js#L938) - ---- - -### dispose() -> Dispose of the component and all child components - -_inherited from_: [src/js/component.js#L84](https://github.com/videojs/video.js/blob/master/src/js/component.js#L84) - ---- - -### el() -> Get the component's DOM element -> -> var domEl = myComponent.el(); - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L220](https://github.com/videojs/video.js/blob/master/src/js/component.js#L220) - ---- - -### enableTouchActivity() -> Report user touch activity when touch events occur -> -> User activity is used to determine when controls should show/hide. It's -> relatively simple when it comes to mouse events, because any mouse event -> should show the controls. So we capture mouse events that bubble up to the -> player and report activity when that happens. -> -> With touch events it isn't as easy. We can't rely on touch events at the -> player level, because a tap (touchstart + touchend) on the video itself on -> mobile devices is meant to turn controls off (and on). User activity is -> checked asynchronously, so what could happen is a tap event on the video -> turns the controls off, then the touchend event bubbles up to the player, -> which if it reported user activity, would turn the controls right back on. -> (We also don't want to completely block touch events from bubbling up) -> -> Also a touchmove, touch+hold, and anything other than a tap is not supposed -> to turn the controls back on on a mobile device. -> -> Here we're setting the default component behavior to report user activity -> whenever touch events happen, and this can be turned off by components that -> want touch events to act differently. - -_inherited from_: [src/js/component.js#L1124](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1124) - ---- - -### getChild( name ) -> Returns a child component with the provided name - -##### PARAMETERS: -* __name__ - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L330](https://github.com/videojs/video.js/blob/master/src/js/component.js#L330) - ---- - -### getChildById( id ) -> Returns a child component with the provided ID - -##### PARAMETERS: -* __id__ - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L313](https://github.com/videojs/video.js/blob/master/src/js/component.js#L313) - ---- - -### hasClass( classToCheck ) -> Check if a component's element has a CSS class name - -##### PARAMETERS: -* __classToCheck__ `String` Classname to check - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L816](https://github.com/videojs/video.js/blob/master/src/js/component.js#L816) - ---- - -### height( [num], [skipListeners] ) -> Get or set the height of the component (CSS values) -> -> Setting the video tag dimension values only works with values in pixels. -> Percent values will not work. -> Some percents can be used, but width()/height() will return the number + %, -> not the actual computed width/height. - -##### PARAMETERS: -* __num__ `Number|String` _(OPTIONAL)_ New component height -* __skipListeners__ `Boolean` _(OPTIONAL)_ Skip the resize event trigger - -##### RETURNS: -* `vjs.Component` This component, when setting the height -* `Number|String` The height, when getting - -_inherited from_: [src/js/component.js#L927](https://github.com/videojs/video.js/blob/master/src/js/component.js#L927) - ---- - -### hide() -> Hide the component element if currently showing - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L857](https://github.com/videojs/video.js/blob/master/src/js/component.js#L857) - ---- - -### id() -> Get the component's ID -> -> var id = myComponent.id(); - -##### RETURNS: -* `String` - -_inherited from_: [src/js/component.js#L258](https://github.com/videojs/video.js/blob/master/src/js/component.js#L258) - ---- - -### init( player, options ) - -##### PARAMETERS: -* __player__ -* __options__ - -_defined in_: [src/js/control-bar/volume-control.js#L10](https://github.com/videojs/video.js/blob/master/src/js/control-bar/volume-control.js#L10) - ---- - -### initChildren() -> Add and initialize default child components from options -> -> // when an instance of MyComponent is created, all children in options -> // will be added to the instance by their name strings and options -> MyComponent.prototype.options_.children = { -> myChildComponent: { -> myChildOption: true -> } -> } -> -> // Or when creating the component -> var myComp = new MyComponent(player, { -> children: { -> myChildComponent: { -> myChildOption: true -> } -> } -> }); -> -> The children option can also be an Array of child names or -> child options objects (that also include a 'name' key). -> -> var myComp = new MyComponent(player, { -> children: [ -> 'button', -> { -> name: 'button', -> someOtherOption: true -> } -> ] -> }); - -_inherited from_: [src/js/component.js#L481](https://github.com/videojs/video.js/blob/master/src/js/component.js#L481) - ---- - -### name() -> Get the component's name. The name is often used to reference the component. -> -> var name = myComponent.name(); - -##### RETURNS: -* `String` - -_inherited from_: [src/js/component.js#L277](https://github.com/videojs/video.js/blob/master/src/js/component.js#L277) - ---- - -### off( [first], [second], [third] ) -> Remove an event listener from this component's element -> -> myComponent.off('eventType', myFunc); -> -> If myFunc is excluded, ALL listeners for the event type will be removed. -> If eventType is excluded, ALL listeners will be removed from the component. -> -> Alternatively you can use `off` to remove listeners that were added to other -> elements or components using `myComponent.on(otherComponent...`. -> In this case both the event type and listener function are REQUIRED. -> -> myComponent.off(otherElement, 'eventType', myFunc); -> myComponent.off(otherComponent, 'eventType', myFunc); - -##### PARAMETERS: -* __first__ `String|vjs.Component` _(OPTIONAL)_ The event type or other component -* __second__ `Function|String` _(OPTIONAL)_ The listener function or event type -* __third__ `Function` _(OPTIONAL)_ The listener for other component - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L646](https://github.com/videojs/video.js/blob/master/src/js/component.js#L646) - ---- - -### on( first, second, third ) -> Add an event listener to this component's element -> -> var myFunc = function(){ -> var myComponent = this; -> // Do something when the event is fired -> }; -> -> myComponent.on('eventType', myFunc); -> -> The context of myFunc will be myComponent unless previously bound. -> -> Alternatively, you can add a listener to another element or component. -> -> myComponent.on(otherElement, 'eventName', myFunc); -> myComponent.on(otherComponent, 'eventName', myFunc); -> -> The benefit of using this over `vjs.on(otherElement, 'eventName', myFunc)` -> and `otherComponent.on('eventName', myFunc)` is that this way the listeners -> will be automatically cleaned up when either component is disposed. -> It will also bind myComponent as the context of myFunc. -> -> **NOTE**: When using this on elements in the page other than window -> and document (both permanent), if you remove the element from the DOM -> you need to call `vjs.trigger(el, 'dispose')` on it to clean up -> references to it and allow the browser to garbage collect it. - -##### PARAMETERS: -* __first__ `String|vjs.Component` The event type or other component -* __second__ `Function|String` The event handler or event type -* __third__ `Function` The event handler - -##### RETURNS: -* `vjs.Component` self - -_inherited from_: [src/js/component.js#L577](https://github.com/videojs/video.js/blob/master/src/js/component.js#L577) - ---- - -### one( first, second, [third] ) -> Add an event listener to be triggered only once and then removed -> -> myComponent.one('eventName', myFunc); -> -> Alternatively you can add a listener to another element or component -> that will be triggered only once. -> -> myComponent.one(otherElement, 'eventName', myFunc); -> myComponent.one(otherComponent, 'eventName', myFunc); - -##### PARAMETERS: -* __first__ `String|vjs.Component` The event type or other component -* __second__ `Function|String` The listener function or event type -* __third__ `Function` _(OPTIONAL)_ The listener function for other component - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L691](https://github.com/videojs/video.js/blob/master/src/js/component.js#L691) - ---- - -### options( obj ) -> Deep merge of options objects -> -> Whenever a property is an object on both options objects -> the two properties will be merged using vjs.obj.deepMerge. -> -> This is used for merging options for child components. We -> want it to be easy to override individual options on a child -> component without having to rewrite all the other default options. -> -> Parent.prototype.options_ = { -> children: { -> 'childOne': { 'foo': 'bar', 'asdf': 'fdsa' }, -> 'childTwo': {}, -> 'childThree': {} -> } -> } -> newOptions = { -> children: { -> 'childOne': { 'foo': 'baz', 'abc': '123' } -> 'childTwo': null, -> 'childFour': {} -> } -> } -> -> this.options(newOptions); -> -> RESULT -> -> { -> children: { -> 'childOne': { 'foo': 'baz', 'asdf': 'fdsa', 'abc': '123' }, -> 'childTwo': null, // Disabled. Won't be initialized. -> 'childThree': {}, -> 'childFour': {} -> } -> } - -##### PARAMETERS: -* __obj__ `Object` Object of new option values - -##### RETURNS: -* `Object` A NEW object of this.options_ and obj merged - -_inherited from_: [src/js/component.js#L179](https://github.com/videojs/video.js/blob/master/src/js/component.js#L179) - ---- - -### player() -> Return the component's player - -##### RETURNS: -* `vjs.Player` - -_inherited from_: [src/js/component.js#L126](https://github.com/videojs/video.js/blob/master/src/js/component.js#L126) - ---- - -### ready( fn ) -> Bind a listener to the component's ready state -> -> Different from event listeners in that if the ready event has already happened -> it will trigger the function immediately. - -##### PARAMETERS: -* __fn__ `Function` Ready listener - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L769](https://github.com/videojs/video.js/blob/master/src/js/component.js#L769) - ---- - -### removeChild( component ) -> Remove a child component from this component's list of children, and the -> child component's element from this component's element - -##### PARAMETERS: -* __component__ `vjs.Component` Component to remove - -_inherited from_: [src/js/component.js#L420](https://github.com/videojs/video.js/blob/master/src/js/component.js#L420) - ---- - -### removeClass( classToRemove ) -> Remove a CSS class name from the component's element - -##### PARAMETERS: -* __classToRemove__ `String` Classname to remove - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L837](https://github.com/videojs/video.js/blob/master/src/js/component.js#L837) - ---- - -### setInterval( fn, interval ) -> Creates an interval and sets up disposal automatically. - -##### PARAMETERS: -* __fn__ `Function` The function to run every N seconds. -* __interval__ `Number` Number of ms to delay before executing specified function. - -##### RETURNS: -* `Number` Returns the interval ID - -_inherited from_: [src/js/component.js#L1202](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1202) - ---- - -### setTimeout( fn, timeout ) -> Creates timeout and sets up disposal automatically. - -##### PARAMETERS: -* __fn__ `Function` The function to run after the timeout. -* __timeout__ `Number` Number of ms to delay before executing specified function. - -##### RETURNS: -* `Number` Returns the timeout ID - -_inherited from_: [src/js/component.js#L1162](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1162) - ---- - -### show() -> Show the component element if hidden - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L847](https://github.com/videojs/video.js/blob/master/src/js/component.js#L847) - ---- - -### trigger( event ) -> Trigger an event on an element -> -> myComponent.trigger('eventName'); -> myComponent.trigger({'type':'eventName'}); - -##### PARAMETERS: -* __event__ `Event|Object|String` A string (the type) or an event object with a type attribute - -##### RETURNS: -* `vjs.Component` self - -_inherited from_: [src/js/component.js#L724](https://github.com/videojs/video.js/blob/master/src/js/component.js#L724) - ---- - -### triggerReady() -> Trigger the ready listeners - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L788](https://github.com/videojs/video.js/blob/master/src/js/component.js#L788) - ---- - -### width( [num], skipListeners ) -> Set or get the width of the component (CSS values) -> -> Setting the video tag dimension values only works with values in pixels. -> Percent values will not work. -> Some percents can be used, but width()/height() will return the number + %, -> not the actual computed width/height. - -##### PARAMETERS: -* __num__ `Number|String` _(OPTIONAL)_ Optional width number -* __skipListeners__ `Boolean` Skip the 'resize' event trigger - -##### RETURNS: -* `vjs.Component` This component, when setting the width -* `Number|String` The width, when getting - -_inherited from_: [src/js/component.js#L910](https://github.com/videojs/video.js/blob/master/src/js/component.js#L910) - ---- - -## EVENTS - -### resize `EVENT` -> Fired when the width and/or height of the component changes - -_inherited from_: [src/js/component.js#L1020](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1020) - ---- - diff --git a/docs/api/vjs.VolumeHandle.md b/docs/api/vjs.VolumeHandle.md deleted file mode 100644 index afa04be58b..0000000000 --- a/docs/api/vjs.VolumeHandle.md +++ /dev/null @@ -1,656 +0,0 @@ - - -# vjs.VolumeHandle - -__EXTENDS__: [vjs.SliderHandle](vjs.SliderHandle.md) -__DEFINED IN__: [src/js/control-bar/volume-control.js#L131](https://github.com/videojs/video.js/blob/master/src/js/control-bar/volume-control.js#L131) - -The volume handle can be dragged to adjust the volume level - ---- - -## INDEX - -- [METHODS](#methods) - - [createEl](#createel-tagname-attributes-) - - [addChild](#addchild-child-options-) _`inherited`_ - - [addClass](#addclass-classtoadd-) _`inherited`_ - - [buildCSSClass](#buildcssclass) _`inherited`_ - - [children](#children) _`inherited`_ - - [clearInterval](#clearinterval-intervalid-) _`inherited`_ - - [clearTimeout](#cleartimeout-timeoutid-) _`inherited`_ - - [contentEl](#contentel) _`inherited`_ - - [dimensions](#dimensions-width-height-) _`inherited`_ - - [dispose](#dispose) _`inherited`_ - - [el](#el) _`inherited`_ - - [enableTouchActivity](#enabletouchactivity) _`inherited`_ - - [getChild](#getchild-name-) _`inherited`_ - - [getChildById](#getchildbyid-id-) _`inherited`_ - - [hasClass](#hasclass-classtocheck-) _`inherited`_ - - [height](#height-num-skiplisteners-) _`inherited`_ - - [hide](#hide) _`inherited`_ - - [id](#id) _`inherited`_ - - [init](#init-player-options-ready-) _`inherited`_ - - [initChildren](#initchildren) _`inherited`_ - - [name](#name) _`inherited`_ - - [off](#off-first-second-third-) _`inherited`_ - - [on](#on-first-second-third-) _`inherited`_ - - [one](#one-first-second-third-) _`inherited`_ - - [options](#options-obj-) _`inherited`_ - - [player](#player) _`inherited`_ - - [ready](#ready-fn-) _`inherited`_ - - [removeChild](#removechild-component-) _`inherited`_ - - [removeClass](#removeclass-classtoremove-) _`inherited`_ - - [setInterval](#setinterval-fn-interval-) _`inherited`_ - - [setTimeout](#settimeout-fn-timeout-) _`inherited`_ - - [show](#show) _`inherited`_ - - [trigger](#trigger-event-) _`inherited`_ - - [triggerReady](#triggerready) _`inherited`_ - - [width](#width-num-skiplisteners-) _`inherited`_ - -- [EVENTS](#events) - - [resize](#resize-event) _`inherited`_ - ---- - -## METHODS - -### addChild( child, [options] ) -> Adds a child component inside this component -> -> myComponent.el(); -> // ->
    -> myComonent.children(); -> // [empty array] -> -> var myButton = myComponent.addChild('MyButton'); -> // ->
    myButton
    -> // -> myButton === myComonent.children()[0]; -> -> Pass in options for child constructors and options for children of the child -> -> var myButton = myComponent.addChild('MyButton', { -> text: 'Press Me', -> children: { -> buttonChildExample: { -> buttonChildOption: true -> } -> } -> }); - -##### PARAMETERS: -* __child__ `String|vjs.Component` The class name or instance of a child to add -* __options__ `Object` _(OPTIONAL)_ Options, including options to be passed to children of the child. - -##### RETURNS: -* `vjs.Component` The child component (created by this process if a string was used) - -_inherited from_: [src/js/component.js#L362](https://github.com/videojs/video.js/blob/master/src/js/component.js#L362) - ---- - -### addClass( classToAdd ) -> Add a CSS class name to the component's element - -##### PARAMETERS: -* __classToAdd__ `String` Classname to add - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L826](https://github.com/videojs/video.js/blob/master/src/js/component.js#L826) - ---- - -### buildCSSClass() -> Allows sub components to stack CSS class names - -##### RETURNS: -* `String` The constructed class name - -_inherited from_: [src/js/component.js#L536](https://github.com/videojs/video.js/blob/master/src/js/component.js#L536) - ---- - -### children() -> Get an array of all child components -> -> var kids = myComponent.children(); - -##### RETURNS: -* `Array` The children - -_inherited from_: [src/js/component.js#L296](https://github.com/videojs/video.js/blob/master/src/js/component.js#L296) - ---- - -### clearInterval( intervalId ) -> Clears an interval and removes the associated dispose listener - -##### PARAMETERS: -* __intervalId__ `Number` The id of the interval to clear - -##### RETURNS: -* `Number` Returns the interval ID - -_inherited from_: [src/js/component.js#L1223](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1223) - ---- - -### clearTimeout( timeoutId ) -> Clears a timeout and removes the associated dispose listener - -##### PARAMETERS: -* __timeoutId__ `Number` The id of the timeout to clear - -##### RETURNS: -* `Number` Returns the timeout ID - -_inherited from_: [src/js/component.js#L1185](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1185) - ---- - -### contentEl() -> Return the component's DOM element for embedding content. -> Will either be el_ or a new element defined in createEl. - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L239](https://github.com/videojs/video.js/blob/master/src/js/component.js#L239) - ---- - -### createEl( [tagName], [attributes] ) -> Create the component's DOM element - -##### PARAMETERS: -* __tagName__ `String` _(OPTIONAL)_ Element's node type. e.g. 'div' -* __attributes__ `Object` _(OPTIONAL)_ An object of element attributes that should be set on the element - -_defined in_: [src/js/control-bar/volume-control.js#L136](https://github.com/videojs/video.js/blob/master/src/js/control-bar/volume-control.js#L136) - ---- - -### dimensions( width, height ) -> Set both width and height at the same time - -##### PARAMETERS: -* __width__ `Number|String` -* __height__ `Number|String` - -##### RETURNS: -* `vjs.Component` The component - -_inherited from_: [src/js/component.js#L938](https://github.com/videojs/video.js/blob/master/src/js/component.js#L938) - ---- - -### dispose() -> Dispose of the component and all child components - -_inherited from_: [src/js/component.js#L84](https://github.com/videojs/video.js/blob/master/src/js/component.js#L84) - ---- - -### el() -> Get the component's DOM element -> -> var domEl = myComponent.el(); - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L220](https://github.com/videojs/video.js/blob/master/src/js/component.js#L220) - ---- - -### enableTouchActivity() -> Report user touch activity when touch events occur -> -> User activity is used to determine when controls should show/hide. It's -> relatively simple when it comes to mouse events, because any mouse event -> should show the controls. So we capture mouse events that bubble up to the -> player and report activity when that happens. -> -> With touch events it isn't as easy. We can't rely on touch events at the -> player level, because a tap (touchstart + touchend) on the video itself on -> mobile devices is meant to turn controls off (and on). User activity is -> checked asynchronously, so what could happen is a tap event on the video -> turns the controls off, then the touchend event bubbles up to the player, -> which if it reported user activity, would turn the controls right back on. -> (We also don't want to completely block touch events from bubbling up) -> -> Also a touchmove, touch+hold, and anything other than a tap is not supposed -> to turn the controls back on on a mobile device. -> -> Here we're setting the default component behavior to report user activity -> whenever touch events happen, and this can be turned off by components that -> want touch events to act differently. - -_inherited from_: [src/js/component.js#L1124](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1124) - ---- - -### getChild( name ) -> Returns a child component with the provided name - -##### PARAMETERS: -* __name__ - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L330](https://github.com/videojs/video.js/blob/master/src/js/component.js#L330) - ---- - -### getChildById( id ) -> Returns a child component with the provided ID - -##### PARAMETERS: -* __id__ - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L313](https://github.com/videojs/video.js/blob/master/src/js/component.js#L313) - ---- - -### hasClass( classToCheck ) -> Check if a component's element has a CSS class name - -##### PARAMETERS: -* __classToCheck__ `String` Classname to check - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L816](https://github.com/videojs/video.js/blob/master/src/js/component.js#L816) - ---- - -### height( [num], [skipListeners] ) -> Get or set the height of the component (CSS values) -> -> Setting the video tag dimension values only works with values in pixels. -> Percent values will not work. -> Some percents can be used, but width()/height() will return the number + %, -> not the actual computed width/height. - -##### PARAMETERS: -* __num__ `Number|String` _(OPTIONAL)_ New component height -* __skipListeners__ `Boolean` _(OPTIONAL)_ Skip the resize event trigger - -##### RETURNS: -* `vjs.Component` This component, when setting the height -* `Number|String` The height, when getting - -_inherited from_: [src/js/component.js#L927](https://github.com/videojs/video.js/blob/master/src/js/component.js#L927) - ---- - -### hide() -> Hide the component element if currently showing - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L857](https://github.com/videojs/video.js/blob/master/src/js/component.js#L857) - ---- - -### id() -> Get the component's ID -> -> var id = myComponent.id(); - -##### RETURNS: -* `String` - -_inherited from_: [src/js/component.js#L258](https://github.com/videojs/video.js/blob/master/src/js/component.js#L258) - ---- - -### init( player, options, ready ) -> the constructor function for the class - -##### PARAMETERS: -* __player__ -* __options__ -* __ready__ - -_inherited from_: [src/js/component.js#L41](https://github.com/videojs/video.js/blob/master/src/js/component.js#L41) - ---- - -### initChildren() -> Add and initialize default child components from options -> -> // when an instance of MyComponent is created, all children in options -> // will be added to the instance by their name strings and options -> MyComponent.prototype.options_.children = { -> myChildComponent: { -> myChildOption: true -> } -> } -> -> // Or when creating the component -> var myComp = new MyComponent(player, { -> children: { -> myChildComponent: { -> myChildOption: true -> } -> } -> }); -> -> The children option can also be an Array of child names or -> child options objects (that also include a 'name' key). -> -> var myComp = new MyComponent(player, { -> children: [ -> 'button', -> { -> name: 'button', -> someOtherOption: true -> } -> ] -> }); - -_inherited from_: [src/js/component.js#L481](https://github.com/videojs/video.js/blob/master/src/js/component.js#L481) - ---- - -### name() -> Get the component's name. The name is often used to reference the component. -> -> var name = myComponent.name(); - -##### RETURNS: -* `String` - -_inherited from_: [src/js/component.js#L277](https://github.com/videojs/video.js/blob/master/src/js/component.js#L277) - ---- - -### off( [first], [second], [third] ) -> Remove an event listener from this component's element -> -> myComponent.off('eventType', myFunc); -> -> If myFunc is excluded, ALL listeners for the event type will be removed. -> If eventType is excluded, ALL listeners will be removed from the component. -> -> Alternatively you can use `off` to remove listeners that were added to other -> elements or components using `myComponent.on(otherComponent...`. -> In this case both the event type and listener function are REQUIRED. -> -> myComponent.off(otherElement, 'eventType', myFunc); -> myComponent.off(otherComponent, 'eventType', myFunc); - -##### PARAMETERS: -* __first__ `String|vjs.Component` _(OPTIONAL)_ The event type or other component -* __second__ `Function|String` _(OPTIONAL)_ The listener function or event type -* __third__ `Function` _(OPTIONAL)_ The listener for other component - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L646](https://github.com/videojs/video.js/blob/master/src/js/component.js#L646) - ---- - -### on( first, second, third ) -> Add an event listener to this component's element -> -> var myFunc = function(){ -> var myComponent = this; -> // Do something when the event is fired -> }; -> -> myComponent.on('eventType', myFunc); -> -> The context of myFunc will be myComponent unless previously bound. -> -> Alternatively, you can add a listener to another element or component. -> -> myComponent.on(otherElement, 'eventName', myFunc); -> myComponent.on(otherComponent, 'eventName', myFunc); -> -> The benefit of using this over `vjs.on(otherElement, 'eventName', myFunc)` -> and `otherComponent.on('eventName', myFunc)` is that this way the listeners -> will be automatically cleaned up when either component is disposed. -> It will also bind myComponent as the context of myFunc. -> -> **NOTE**: When using this on elements in the page other than window -> and document (both permanent), if you remove the element from the DOM -> you need to call `vjs.trigger(el, 'dispose')` on it to clean up -> references to it and allow the browser to garbage collect it. - -##### PARAMETERS: -* __first__ `String|vjs.Component` The event type or other component -* __second__ `Function|String` The event handler or event type -* __third__ `Function` The event handler - -##### RETURNS: -* `vjs.Component` self - -_inherited from_: [src/js/component.js#L577](https://github.com/videojs/video.js/blob/master/src/js/component.js#L577) - ---- - -### one( first, second, [third] ) -> Add an event listener to be triggered only once and then removed -> -> myComponent.one('eventName', myFunc); -> -> Alternatively you can add a listener to another element or component -> that will be triggered only once. -> -> myComponent.one(otherElement, 'eventName', myFunc); -> myComponent.one(otherComponent, 'eventName', myFunc); - -##### PARAMETERS: -* __first__ `String|vjs.Component` The event type or other component -* __second__ `Function|String` The listener function or event type -* __third__ `Function` _(OPTIONAL)_ The listener function for other component - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L691](https://github.com/videojs/video.js/blob/master/src/js/component.js#L691) - ---- - -### options( obj ) -> Deep merge of options objects -> -> Whenever a property is an object on both options objects -> the two properties will be merged using vjs.obj.deepMerge. -> -> This is used for merging options for child components. We -> want it to be easy to override individual options on a child -> component without having to rewrite all the other default options. -> -> Parent.prototype.options_ = { -> children: { -> 'childOne': { 'foo': 'bar', 'asdf': 'fdsa' }, -> 'childTwo': {}, -> 'childThree': {} -> } -> } -> newOptions = { -> children: { -> 'childOne': { 'foo': 'baz', 'abc': '123' } -> 'childTwo': null, -> 'childFour': {} -> } -> } -> -> this.options(newOptions); -> -> RESULT -> -> { -> children: { -> 'childOne': { 'foo': 'baz', 'asdf': 'fdsa', 'abc': '123' }, -> 'childTwo': null, // Disabled. Won't be initialized. -> 'childThree': {}, -> 'childFour': {} -> } -> } - -##### PARAMETERS: -* __obj__ `Object` Object of new option values - -##### RETURNS: -* `Object` A NEW object of this.options_ and obj merged - -_inherited from_: [src/js/component.js#L179](https://github.com/videojs/video.js/blob/master/src/js/component.js#L179) - ---- - -### player() -> Return the component's player - -##### RETURNS: -* `vjs.Player` - -_inherited from_: [src/js/component.js#L126](https://github.com/videojs/video.js/blob/master/src/js/component.js#L126) - ---- - -### ready( fn ) -> Bind a listener to the component's ready state -> -> Different from event listeners in that if the ready event has already happened -> it will trigger the function immediately. - -##### PARAMETERS: -* __fn__ `Function` Ready listener - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L769](https://github.com/videojs/video.js/blob/master/src/js/component.js#L769) - ---- - -### removeChild( component ) -> Remove a child component from this component's list of children, and the -> child component's element from this component's element - -##### PARAMETERS: -* __component__ `vjs.Component` Component to remove - -_inherited from_: [src/js/component.js#L420](https://github.com/videojs/video.js/blob/master/src/js/component.js#L420) - ---- - -### removeClass( classToRemove ) -> Remove a CSS class name from the component's element - -##### PARAMETERS: -* __classToRemove__ `String` Classname to remove - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L837](https://github.com/videojs/video.js/blob/master/src/js/component.js#L837) - ---- - -### setInterval( fn, interval ) -> Creates an interval and sets up disposal automatically. - -##### PARAMETERS: -* __fn__ `Function` The function to run every N seconds. -* __interval__ `Number` Number of ms to delay before executing specified function. - -##### RETURNS: -* `Number` Returns the interval ID - -_inherited from_: [src/js/component.js#L1202](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1202) - ---- - -### setTimeout( fn, timeout ) -> Creates timeout and sets up disposal automatically. - -##### PARAMETERS: -* __fn__ `Function` The function to run after the timeout. -* __timeout__ `Number` Number of ms to delay before executing specified function. - -##### RETURNS: -* `Number` Returns the timeout ID - -_inherited from_: [src/js/component.js#L1162](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1162) - ---- - -### show() -> Show the component element if hidden - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L847](https://github.com/videojs/video.js/blob/master/src/js/component.js#L847) - ---- - -### trigger( event ) -> Trigger an event on an element -> -> myComponent.trigger('eventName'); -> myComponent.trigger({'type':'eventName'}); - -##### PARAMETERS: -* __event__ `Event|Object|String` A string (the type) or an event object with a type attribute - -##### RETURNS: -* `vjs.Component` self - -_inherited from_: [src/js/component.js#L724](https://github.com/videojs/video.js/blob/master/src/js/component.js#L724) - ---- - -### triggerReady() -> Trigger the ready listeners - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L788](https://github.com/videojs/video.js/blob/master/src/js/component.js#L788) - ---- - -### width( [num], skipListeners ) -> Set or get the width of the component (CSS values) -> -> Setting the video tag dimension values only works with values in pixels. -> Percent values will not work. -> Some percents can be used, but width()/height() will return the number + %, -> not the actual computed width/height. - -##### PARAMETERS: -* __num__ `Number|String` _(OPTIONAL)_ Optional width number -* __skipListeners__ `Boolean` Skip the 'resize' event trigger - -##### RETURNS: -* `vjs.Component` This component, when setting the width -* `Number|String` The width, when getting - -_inherited from_: [src/js/component.js#L910](https://github.com/videojs/video.js/blob/master/src/js/component.js#L910) - ---- - -## EVENTS - -### resize `EVENT` -> Fired when the width and/or height of the component changes - -_inherited from_: [src/js/component.js#L1020](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1020) - ---- - diff --git a/docs/api/vjs.VolumeLevel.md b/docs/api/vjs.VolumeLevel.md deleted file mode 100644 index f5e898878c..0000000000 --- a/docs/api/vjs.VolumeLevel.md +++ /dev/null @@ -1,657 +0,0 @@ - - -# vjs.VolumeLevel - -__EXTENDS__: [vjs.Component](vjs.Component.md) -__DEFINED IN__: [src/js/control-bar/volume-control.js#L110](https://github.com/videojs/video.js/blob/master/src/js/control-bar/volume-control.js#L110) - -Shows volume level - ---- - -## INDEX - -- [METHODS](#methods) - - [init](#init-player-options-) - - [addChild](#addchild-child-options-) _`inherited`_ - - [addClass](#addclass-classtoadd-) _`inherited`_ - - [buildCSSClass](#buildcssclass) _`inherited`_ - - [children](#children) _`inherited`_ - - [clearInterval](#clearinterval-intervalid-) _`inherited`_ - - [clearTimeout](#cleartimeout-timeoutid-) _`inherited`_ - - [contentEl](#contentel) _`inherited`_ - - [createEl](#createel-tagname-attributes-) _`inherited`_ - - [dimensions](#dimensions-width-height-) _`inherited`_ - - [dispose](#dispose) _`inherited`_ - - [el](#el) _`inherited`_ - - [enableTouchActivity](#enabletouchactivity) _`inherited`_ - - [getChild](#getchild-name-) _`inherited`_ - - [getChildById](#getchildbyid-id-) _`inherited`_ - - [hasClass](#hasclass-classtocheck-) _`inherited`_ - - [height](#height-num-skiplisteners-) _`inherited`_ - - [hide](#hide) _`inherited`_ - - [id](#id) _`inherited`_ - - [initChildren](#initchildren) _`inherited`_ - - [name](#name) _`inherited`_ - - [off](#off-first-second-third-) _`inherited`_ - - [on](#on-first-second-third-) _`inherited`_ - - [one](#one-first-second-third-) _`inherited`_ - - [options](#options-obj-) _`inherited`_ - - [player](#player) _`inherited`_ - - [ready](#ready-fn-) _`inherited`_ - - [removeChild](#removechild-component-) _`inherited`_ - - [removeClass](#removeclass-classtoremove-) _`inherited`_ - - [setInterval](#setinterval-fn-interval-) _`inherited`_ - - [setTimeout](#settimeout-fn-timeout-) _`inherited`_ - - [show](#show) _`inherited`_ - - [trigger](#trigger-event-) _`inherited`_ - - [triggerReady](#triggerready) _`inherited`_ - - [width](#width-num-skiplisteners-) _`inherited`_ - -- [EVENTS](#events) - - [resize](#resize-event) _`inherited`_ - ---- - -## METHODS - -### addChild( child, [options] ) -> Adds a child component inside this component -> -> myComponent.el(); -> // ->
    -> myComonent.children(); -> // [empty array] -> -> var myButton = myComponent.addChild('MyButton'); -> // ->
    myButton
    -> // -> myButton === myComonent.children()[0]; -> -> Pass in options for child constructors and options for children of the child -> -> var myButton = myComponent.addChild('MyButton', { -> text: 'Press Me', -> children: { -> buttonChildExample: { -> buttonChildOption: true -> } -> } -> }); - -##### PARAMETERS: -* __child__ `String|vjs.Component` The class name or instance of a child to add -* __options__ `Object` _(OPTIONAL)_ Options, including options to be passed to children of the child. - -##### RETURNS: -* `vjs.Component` The child component (created by this process if a string was used) - -_inherited from_: [src/js/component.js#L362](https://github.com/videojs/video.js/blob/master/src/js/component.js#L362) - ---- - -### addClass( classToAdd ) -> Add a CSS class name to the component's element - -##### PARAMETERS: -* __classToAdd__ `String` Classname to add - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L826](https://github.com/videojs/video.js/blob/master/src/js/component.js#L826) - ---- - -### buildCSSClass() -> Allows sub components to stack CSS class names - -##### RETURNS: -* `String` The constructed class name - -_inherited from_: [src/js/component.js#L536](https://github.com/videojs/video.js/blob/master/src/js/component.js#L536) - ---- - -### children() -> Get an array of all child components -> -> var kids = myComponent.children(); - -##### RETURNS: -* `Array` The children - -_inherited from_: [src/js/component.js#L296](https://github.com/videojs/video.js/blob/master/src/js/component.js#L296) - ---- - -### clearInterval( intervalId ) -> Clears an interval and removes the associated dispose listener - -##### PARAMETERS: -* __intervalId__ `Number` The id of the interval to clear - -##### RETURNS: -* `Number` Returns the interval ID - -_inherited from_: [src/js/component.js#L1223](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1223) - ---- - -### clearTimeout( timeoutId ) -> Clears a timeout and removes the associated dispose listener - -##### PARAMETERS: -* __timeoutId__ `Number` The id of the timeout to clear - -##### RETURNS: -* `Number` Returns the timeout ID - -_inherited from_: [src/js/component.js#L1185](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1185) - ---- - -### contentEl() -> Return the component's DOM element for embedding content. -> Will either be el_ or a new element defined in createEl. - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L239](https://github.com/videojs/video.js/blob/master/src/js/component.js#L239) - ---- - -### createEl( [tagName], [attributes] ) -> Create the component's DOM element - -##### PARAMETERS: -* __tagName__ `String` _(OPTIONAL)_ Element's node type. e.g. 'div' -* __attributes__ `Object` _(OPTIONAL)_ An object of element attributes that should be set on the element - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L200](https://github.com/videojs/video.js/blob/master/src/js/component.js#L200) - ---- - -### dimensions( width, height ) -> Set both width and height at the same time - -##### PARAMETERS: -* __width__ `Number|String` -* __height__ `Number|String` - -##### RETURNS: -* `vjs.Component` The component - -_inherited from_: [src/js/component.js#L938](https://github.com/videojs/video.js/blob/master/src/js/component.js#L938) - ---- - -### dispose() -> Dispose of the component and all child components - -_inherited from_: [src/js/component.js#L84](https://github.com/videojs/video.js/blob/master/src/js/component.js#L84) - ---- - -### el() -> Get the component's DOM element -> -> var domEl = myComponent.el(); - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L220](https://github.com/videojs/video.js/blob/master/src/js/component.js#L220) - ---- - -### enableTouchActivity() -> Report user touch activity when touch events occur -> -> User activity is used to determine when controls should show/hide. It's -> relatively simple when it comes to mouse events, because any mouse event -> should show the controls. So we capture mouse events that bubble up to the -> player and report activity when that happens. -> -> With touch events it isn't as easy. We can't rely on touch events at the -> player level, because a tap (touchstart + touchend) on the video itself on -> mobile devices is meant to turn controls off (and on). User activity is -> checked asynchronously, so what could happen is a tap event on the video -> turns the controls off, then the touchend event bubbles up to the player, -> which if it reported user activity, would turn the controls right back on. -> (We also don't want to completely block touch events from bubbling up) -> -> Also a touchmove, touch+hold, and anything other than a tap is not supposed -> to turn the controls back on on a mobile device. -> -> Here we're setting the default component behavior to report user activity -> whenever touch events happen, and this can be turned off by components that -> want touch events to act differently. - -_inherited from_: [src/js/component.js#L1124](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1124) - ---- - -### getChild( name ) -> Returns a child component with the provided name - -##### PARAMETERS: -* __name__ - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L330](https://github.com/videojs/video.js/blob/master/src/js/component.js#L330) - ---- - -### getChildById( id ) -> Returns a child component with the provided ID - -##### PARAMETERS: -* __id__ - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L313](https://github.com/videojs/video.js/blob/master/src/js/component.js#L313) - ---- - -### hasClass( classToCheck ) -> Check if a component's element has a CSS class name - -##### PARAMETERS: -* __classToCheck__ `String` Classname to check - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L816](https://github.com/videojs/video.js/blob/master/src/js/component.js#L816) - ---- - -### height( [num], [skipListeners] ) -> Get or set the height of the component (CSS values) -> -> Setting the video tag dimension values only works with values in pixels. -> Percent values will not work. -> Some percents can be used, but width()/height() will return the number + %, -> not the actual computed width/height. - -##### PARAMETERS: -* __num__ `Number|String` _(OPTIONAL)_ New component height -* __skipListeners__ `Boolean` _(OPTIONAL)_ Skip the resize event trigger - -##### RETURNS: -* `vjs.Component` This component, when setting the height -* `Number|String` The height, when getting - -_inherited from_: [src/js/component.js#L927](https://github.com/videojs/video.js/blob/master/src/js/component.js#L927) - ---- - -### hide() -> Hide the component element if currently showing - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L857](https://github.com/videojs/video.js/blob/master/src/js/component.js#L857) - ---- - -### id() -> Get the component's ID -> -> var id = myComponent.id(); - -##### RETURNS: -* `String` - -_inherited from_: [src/js/component.js#L258](https://github.com/videojs/video.js/blob/master/src/js/component.js#L258) - ---- - -### init( player, options ) - -##### PARAMETERS: -* __player__ -* __options__ - -_defined in_: [src/js/control-bar/volume-control.js#L112](https://github.com/videojs/video.js/blob/master/src/js/control-bar/volume-control.js#L112) - ---- - -### initChildren() -> Add and initialize default child components from options -> -> // when an instance of MyComponent is created, all children in options -> // will be added to the instance by their name strings and options -> MyComponent.prototype.options_.children = { -> myChildComponent: { -> myChildOption: true -> } -> } -> -> // Or when creating the component -> var myComp = new MyComponent(player, { -> children: { -> myChildComponent: { -> myChildOption: true -> } -> } -> }); -> -> The children option can also be an Array of child names or -> child options objects (that also include a 'name' key). -> -> var myComp = new MyComponent(player, { -> children: [ -> 'button', -> { -> name: 'button', -> someOtherOption: true -> } -> ] -> }); - -_inherited from_: [src/js/component.js#L481](https://github.com/videojs/video.js/blob/master/src/js/component.js#L481) - ---- - -### name() -> Get the component's name. The name is often used to reference the component. -> -> var name = myComponent.name(); - -##### RETURNS: -* `String` - -_inherited from_: [src/js/component.js#L277](https://github.com/videojs/video.js/blob/master/src/js/component.js#L277) - ---- - -### off( [first], [second], [third] ) -> Remove an event listener from this component's element -> -> myComponent.off('eventType', myFunc); -> -> If myFunc is excluded, ALL listeners for the event type will be removed. -> If eventType is excluded, ALL listeners will be removed from the component. -> -> Alternatively you can use `off` to remove listeners that were added to other -> elements or components using `myComponent.on(otherComponent...`. -> In this case both the event type and listener function are REQUIRED. -> -> myComponent.off(otherElement, 'eventType', myFunc); -> myComponent.off(otherComponent, 'eventType', myFunc); - -##### PARAMETERS: -* __first__ `String|vjs.Component` _(OPTIONAL)_ The event type or other component -* __second__ `Function|String` _(OPTIONAL)_ The listener function or event type -* __third__ `Function` _(OPTIONAL)_ The listener for other component - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L646](https://github.com/videojs/video.js/blob/master/src/js/component.js#L646) - ---- - -### on( first, second, third ) -> Add an event listener to this component's element -> -> var myFunc = function(){ -> var myComponent = this; -> // Do something when the event is fired -> }; -> -> myComponent.on('eventType', myFunc); -> -> The context of myFunc will be myComponent unless previously bound. -> -> Alternatively, you can add a listener to another element or component. -> -> myComponent.on(otherElement, 'eventName', myFunc); -> myComponent.on(otherComponent, 'eventName', myFunc); -> -> The benefit of using this over `vjs.on(otherElement, 'eventName', myFunc)` -> and `otherComponent.on('eventName', myFunc)` is that this way the listeners -> will be automatically cleaned up when either component is disposed. -> It will also bind myComponent as the context of myFunc. -> -> **NOTE**: When using this on elements in the page other than window -> and document (both permanent), if you remove the element from the DOM -> you need to call `vjs.trigger(el, 'dispose')` on it to clean up -> references to it and allow the browser to garbage collect it. - -##### PARAMETERS: -* __first__ `String|vjs.Component` The event type or other component -* __second__ `Function|String` The event handler or event type -* __third__ `Function` The event handler - -##### RETURNS: -* `vjs.Component` self - -_inherited from_: [src/js/component.js#L577](https://github.com/videojs/video.js/blob/master/src/js/component.js#L577) - ---- - -### one( first, second, [third] ) -> Add an event listener to be triggered only once and then removed -> -> myComponent.one('eventName', myFunc); -> -> Alternatively you can add a listener to another element or component -> that will be triggered only once. -> -> myComponent.one(otherElement, 'eventName', myFunc); -> myComponent.one(otherComponent, 'eventName', myFunc); - -##### PARAMETERS: -* __first__ `String|vjs.Component` The event type or other component -* __second__ `Function|String` The listener function or event type -* __third__ `Function` _(OPTIONAL)_ The listener function for other component - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L691](https://github.com/videojs/video.js/blob/master/src/js/component.js#L691) - ---- - -### options( obj ) -> Deep merge of options objects -> -> Whenever a property is an object on both options objects -> the two properties will be merged using vjs.obj.deepMerge. -> -> This is used for merging options for child components. We -> want it to be easy to override individual options on a child -> component without having to rewrite all the other default options. -> -> Parent.prototype.options_ = { -> children: { -> 'childOne': { 'foo': 'bar', 'asdf': 'fdsa' }, -> 'childTwo': {}, -> 'childThree': {} -> } -> } -> newOptions = { -> children: { -> 'childOne': { 'foo': 'baz', 'abc': '123' } -> 'childTwo': null, -> 'childFour': {} -> } -> } -> -> this.options(newOptions); -> -> RESULT -> -> { -> children: { -> 'childOne': { 'foo': 'baz', 'asdf': 'fdsa', 'abc': '123' }, -> 'childTwo': null, // Disabled. Won't be initialized. -> 'childThree': {}, -> 'childFour': {} -> } -> } - -##### PARAMETERS: -* __obj__ `Object` Object of new option values - -##### RETURNS: -* `Object` A NEW object of this.options_ and obj merged - -_inherited from_: [src/js/component.js#L179](https://github.com/videojs/video.js/blob/master/src/js/component.js#L179) - ---- - -### player() -> Return the component's player - -##### RETURNS: -* `vjs.Player` - -_inherited from_: [src/js/component.js#L126](https://github.com/videojs/video.js/blob/master/src/js/component.js#L126) - ---- - -### ready( fn ) -> Bind a listener to the component's ready state -> -> Different from event listeners in that if the ready event has already happened -> it will trigger the function immediately. - -##### PARAMETERS: -* __fn__ `Function` Ready listener - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L769](https://github.com/videojs/video.js/blob/master/src/js/component.js#L769) - ---- - -### removeChild( component ) -> Remove a child component from this component's list of children, and the -> child component's element from this component's element - -##### PARAMETERS: -* __component__ `vjs.Component` Component to remove - -_inherited from_: [src/js/component.js#L420](https://github.com/videojs/video.js/blob/master/src/js/component.js#L420) - ---- - -### removeClass( classToRemove ) -> Remove a CSS class name from the component's element - -##### PARAMETERS: -* __classToRemove__ `String` Classname to remove - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L837](https://github.com/videojs/video.js/blob/master/src/js/component.js#L837) - ---- - -### setInterval( fn, interval ) -> Creates an interval and sets up disposal automatically. - -##### PARAMETERS: -* __fn__ `Function` The function to run every N seconds. -* __interval__ `Number` Number of ms to delay before executing specified function. - -##### RETURNS: -* `Number` Returns the interval ID - -_inherited from_: [src/js/component.js#L1202](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1202) - ---- - -### setTimeout( fn, timeout ) -> Creates timeout and sets up disposal automatically. - -##### PARAMETERS: -* __fn__ `Function` The function to run after the timeout. -* __timeout__ `Number` Number of ms to delay before executing specified function. - -##### RETURNS: -* `Number` Returns the timeout ID - -_inherited from_: [src/js/component.js#L1162](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1162) - ---- - -### show() -> Show the component element if hidden - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L847](https://github.com/videojs/video.js/blob/master/src/js/component.js#L847) - ---- - -### trigger( event ) -> Trigger an event on an element -> -> myComponent.trigger('eventName'); -> myComponent.trigger({'type':'eventName'}); - -##### PARAMETERS: -* __event__ `Event|Object|String` A string (the type) or an event object with a type attribute - -##### RETURNS: -* `vjs.Component` self - -_inherited from_: [src/js/component.js#L724](https://github.com/videojs/video.js/blob/master/src/js/component.js#L724) - ---- - -### triggerReady() -> Trigger the ready listeners - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L788](https://github.com/videojs/video.js/blob/master/src/js/component.js#L788) - ---- - -### width( [num], skipListeners ) -> Set or get the width of the component (CSS values) -> -> Setting the video tag dimension values only works with values in pixels. -> Percent values will not work. -> Some percents can be used, but width()/height() will return the number + %, -> not the actual computed width/height. - -##### PARAMETERS: -* __num__ `Number|String` _(OPTIONAL)_ Optional width number -* __skipListeners__ `Boolean` Skip the 'resize' event trigger - -##### RETURNS: -* `vjs.Component` This component, when setting the width -* `Number|String` The width, when getting - -_inherited from_: [src/js/component.js#L910](https://github.com/videojs/video.js/blob/master/src/js/component.js#L910) - ---- - -## EVENTS - -### resize `EVENT` -> Fired when the width and/or height of the component changes - -_inherited from_: [src/js/component.js#L1020](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1020) - ---- - diff --git a/docs/api/vjs.VolumeMenuButton.md b/docs/api/vjs.VolumeMenuButton.md deleted file mode 100644 index 8eb27e4ae9..0000000000 --- a/docs/api/vjs.VolumeMenuButton.md +++ /dev/null @@ -1,662 +0,0 @@ - - -# vjs.VolumeMenuButton - -__EXTENDS__: [vjs.MenuButton](vjs.MenuButton.md) -__DEFINED IN__: [src/js/control-bar/volume-menu-button.js#L5](https://github.com/videojs/video.js/blob/master/src/js/control-bar/volume-menu-button.js#L5) - -Menu button with a popup for showing the volume slider. - ---- - -## INDEX - -- [METHODS](#methods) - - [init](#init-player-options-) - - [addChild](#addchild-child-options-) _`inherited`_ - - [addClass](#addclass-classtoadd-) _`inherited`_ - - [buildCSSClass](#buildcssclass) _`inherited`_ - - [children](#children) _`inherited`_ - - [clearInterval](#clearinterval-intervalid-) _`inherited`_ - - [clearTimeout](#cleartimeout-timeoutid-) _`inherited`_ - - [contentEl](#contentel) _`inherited`_ - - [createEl](#createel-tagname-attributes-) _`inherited`_ - - [createItems](#createitems) _`inherited`_ - - [dimensions](#dimensions-width-height-) _`inherited`_ - - [dispose](#dispose) _`inherited`_ - - [el](#el) _`inherited`_ - - [enableTouchActivity](#enabletouchactivity) _`inherited`_ - - [getChild](#getchild-name-) _`inherited`_ - - [getChildById](#getchildbyid-id-) _`inherited`_ - - [hasClass](#hasclass-classtocheck-) _`inherited`_ - - [height](#height-num-skiplisteners-) _`inherited`_ - - [hide](#hide) _`inherited`_ - - [id](#id) _`inherited`_ - - [initChildren](#initchildren) _`inherited`_ - - [name](#name) _`inherited`_ - - [off](#off-first-second-third-) _`inherited`_ - - [on](#on-first-second-third-) _`inherited`_ - - [one](#one-first-second-third-) _`inherited`_ - - [options](#options-obj-) _`inherited`_ - - [player](#player) _`inherited`_ - - [ready](#ready-fn-) _`inherited`_ - - [removeChild](#removechild-component-) _`inherited`_ - - [removeClass](#removeclass-classtoremove-) _`inherited`_ - - [setInterval](#setinterval-fn-interval-) _`inherited`_ - - [setTimeout](#settimeout-fn-timeout-) _`inherited`_ - - [show](#show) _`inherited`_ - - [trigger](#trigger-event-) _`inherited`_ - - [triggerReady](#triggerready) _`inherited`_ - - [width](#width-num-skiplisteners-) _`inherited`_ - -- [EVENTS](#events) - - [resize](#resize-event) _`inherited`_ - ---- - -## METHODS - -### addChild( child, [options] ) -> Adds a child component inside this component -> -> myComponent.el(); -> // ->
    -> myComonent.children(); -> // [empty array] -> -> var myButton = myComponent.addChild('MyButton'); -> // ->
    myButton
    -> // -> myButton === myComonent.children()[0]; -> -> Pass in options for child constructors and options for children of the child -> -> var myButton = myComponent.addChild('MyButton', { -> text: 'Press Me', -> children: { -> buttonChildExample: { -> buttonChildOption: true -> } -> } -> }); - -##### PARAMETERS: -* __child__ `String|vjs.Component` The class name or instance of a child to add -* __options__ `Object` _(OPTIONAL)_ Options, including options to be passed to children of the child. - -##### RETURNS: -* `vjs.Component` The child component (created by this process if a string was used) - -_inherited from_: [src/js/component.js#L362](https://github.com/videojs/video.js/blob/master/src/js/component.js#L362) - ---- - -### addClass( classToAdd ) -> Add a CSS class name to the component's element - -##### PARAMETERS: -* __classToAdd__ `String` Classname to add - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L826](https://github.com/videojs/video.js/blob/master/src/js/component.js#L826) - ---- - -### buildCSSClass() -> Allows sub components to stack CSS class names - -_inherited from_: [src/js/menu.js#L166](https://github.com/videojs/video.js/blob/master/src/js/menu.js#L166) - ---- - -### children() -> Get an array of all child components -> -> var kids = myComponent.children(); - -##### RETURNS: -* `Array` The children - -_inherited from_: [src/js/component.js#L296](https://github.com/videojs/video.js/blob/master/src/js/component.js#L296) - ---- - -### clearInterval( intervalId ) -> Clears an interval and removes the associated dispose listener - -##### PARAMETERS: -* __intervalId__ `Number` The id of the interval to clear - -##### RETURNS: -* `Number` Returns the interval ID - -_inherited from_: [src/js/component.js#L1223](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1223) - ---- - -### clearTimeout( timeoutId ) -> Clears a timeout and removes the associated dispose listener - -##### PARAMETERS: -* __timeoutId__ `Number` The id of the timeout to clear - -##### RETURNS: -* `Number` Returns the timeout ID - -_inherited from_: [src/js/component.js#L1185](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1185) - ---- - -### contentEl() -> Return the component's DOM element for embedding content. -> Will either be el_ or a new element defined in createEl. - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L239](https://github.com/videojs/video.js/blob/master/src/js/component.js#L239) - ---- - -### createEl( [tagName], [attributes] ) -> Create the component's DOM element - -##### PARAMETERS: -* __tagName__ `String` _(OPTIONAL)_ Element's node type. e.g. 'div' -* __attributes__ `Object` _(OPTIONAL)_ An object of element attributes that should be set on the element - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L200](https://github.com/videojs/video.js/blob/master/src/js/component.js#L200) - ---- - -### createItems() -> Create the list of menu items. Specific to each subclass. - -_inherited from_: [src/js/menu.js#L163](https://github.com/videojs/video.js/blob/master/src/js/menu.js#L163) - ---- - -### dimensions( width, height ) -> Set both width and height at the same time - -##### PARAMETERS: -* __width__ `Number|String` -* __height__ `Number|String` - -##### RETURNS: -* `vjs.Component` The component - -_inherited from_: [src/js/component.js#L938](https://github.com/videojs/video.js/blob/master/src/js/component.js#L938) - ---- - -### dispose() -> Dispose of the component and all child components - -_inherited from_: [src/js/component.js#L84](https://github.com/videojs/video.js/blob/master/src/js/component.js#L84) - ---- - -### el() -> Get the component's DOM element -> -> var domEl = myComponent.el(); - -##### RETURNS: -* `Element` - -_inherited from_: [src/js/component.js#L220](https://github.com/videojs/video.js/blob/master/src/js/component.js#L220) - ---- - -### enableTouchActivity() -> Report user touch activity when touch events occur -> -> User activity is used to determine when controls should show/hide. It's -> relatively simple when it comes to mouse events, because any mouse event -> should show the controls. So we capture mouse events that bubble up to the -> player and report activity when that happens. -> -> With touch events it isn't as easy. We can't rely on touch events at the -> player level, because a tap (touchstart + touchend) on the video itself on -> mobile devices is meant to turn controls off (and on). User activity is -> checked asynchronously, so what could happen is a tap event on the video -> turns the controls off, then the touchend event bubbles up to the player, -> which if it reported user activity, would turn the controls right back on. -> (We also don't want to completely block touch events from bubbling up) -> -> Also a touchmove, touch+hold, and anything other than a tap is not supposed -> to turn the controls back on on a mobile device. -> -> Here we're setting the default component behavior to report user activity -> whenever touch events happen, and this can be turned off by components that -> want touch events to act differently. - -_inherited from_: [src/js/component.js#L1124](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1124) - ---- - -### getChild( name ) -> Returns a child component with the provided name - -##### PARAMETERS: -* __name__ - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L330](https://github.com/videojs/video.js/blob/master/src/js/component.js#L330) - ---- - -### getChildById( id ) -> Returns a child component with the provided ID - -##### PARAMETERS: -* __id__ - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L313](https://github.com/videojs/video.js/blob/master/src/js/component.js#L313) - ---- - -### hasClass( classToCheck ) -> Check if a component's element has a CSS class name - -##### PARAMETERS: -* __classToCheck__ `String` Classname to check - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L816](https://github.com/videojs/video.js/blob/master/src/js/component.js#L816) - ---- - -### height( [num], [skipListeners] ) -> Get or set the height of the component (CSS values) -> -> Setting the video tag dimension values only works with values in pixels. -> Percent values will not work. -> Some percents can be used, but width()/height() will return the number + %, -> not the actual computed width/height. - -##### PARAMETERS: -* __num__ `Number|String` _(OPTIONAL)_ New component height -* __skipListeners__ `Boolean` _(OPTIONAL)_ Skip the resize event trigger - -##### RETURNS: -* `vjs.Component` This component, when setting the height -* `Number|String` The height, when getting - -_inherited from_: [src/js/component.js#L927](https://github.com/videojs/video.js/blob/master/src/js/component.js#L927) - ---- - -### hide() -> Hide the component element if currently showing - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L857](https://github.com/videojs/video.js/blob/master/src/js/component.js#L857) - ---- - -### id() -> Get the component's ID -> -> var id = myComponent.id(); - -##### RETURNS: -* `String` - -_inherited from_: [src/js/component.js#L258](https://github.com/videojs/video.js/blob/master/src/js/component.js#L258) - ---- - -### init( player, options ) - -##### PARAMETERS: -* __player__ -* __options__ - -_defined in_: [src/js/control-bar/volume-menu-button.js#L7](https://github.com/videojs/video.js/blob/master/src/js/control-bar/volume-menu-button.js#L7) - ---- - -### initChildren() -> Add and initialize default child components from options -> -> // when an instance of MyComponent is created, all children in options -> // will be added to the instance by their name strings and options -> MyComponent.prototype.options_.children = { -> myChildComponent: { -> myChildOption: true -> } -> } -> -> // Or when creating the component -> var myComp = new MyComponent(player, { -> children: { -> myChildComponent: { -> myChildOption: true -> } -> } -> }); -> -> The children option can also be an Array of child names or -> child options objects (that also include a 'name' key). -> -> var myComp = new MyComponent(player, { -> children: [ -> 'button', -> { -> name: 'button', -> someOtherOption: true -> } -> ] -> }); - -_inherited from_: [src/js/component.js#L481](https://github.com/videojs/video.js/blob/master/src/js/component.js#L481) - ---- - -### name() -> Get the component's name. The name is often used to reference the component. -> -> var name = myComponent.name(); - -##### RETURNS: -* `String` - -_inherited from_: [src/js/component.js#L277](https://github.com/videojs/video.js/blob/master/src/js/component.js#L277) - ---- - -### off( [first], [second], [third] ) -> Remove an event listener from this component's element -> -> myComponent.off('eventType', myFunc); -> -> If myFunc is excluded, ALL listeners for the event type will be removed. -> If eventType is excluded, ALL listeners will be removed from the component. -> -> Alternatively you can use `off` to remove listeners that were added to other -> elements or components using `myComponent.on(otherComponent...`. -> In this case both the event type and listener function are REQUIRED. -> -> myComponent.off(otherElement, 'eventType', myFunc); -> myComponent.off(otherComponent, 'eventType', myFunc); - -##### PARAMETERS: -* __first__ `String|vjs.Component` _(OPTIONAL)_ The event type or other component -* __second__ `Function|String` _(OPTIONAL)_ The listener function or event type -* __third__ `Function` _(OPTIONAL)_ The listener for other component - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L646](https://github.com/videojs/video.js/blob/master/src/js/component.js#L646) - ---- - -### on( first, second, third ) -> Add an event listener to this component's element -> -> var myFunc = function(){ -> var myComponent = this; -> // Do something when the event is fired -> }; -> -> myComponent.on('eventType', myFunc); -> -> The context of myFunc will be myComponent unless previously bound. -> -> Alternatively, you can add a listener to another element or component. -> -> myComponent.on(otherElement, 'eventName', myFunc); -> myComponent.on(otherComponent, 'eventName', myFunc); -> -> The benefit of using this over `vjs.on(otherElement, 'eventName', myFunc)` -> and `otherComponent.on('eventName', myFunc)` is that this way the listeners -> will be automatically cleaned up when either component is disposed. -> It will also bind myComponent as the context of myFunc. -> -> **NOTE**: When using this on elements in the page other than window -> and document (both permanent), if you remove the element from the DOM -> you need to call `vjs.trigger(el, 'dispose')` on it to clean up -> references to it and allow the browser to garbage collect it. - -##### PARAMETERS: -* __first__ `String|vjs.Component` The event type or other component -* __second__ `Function|String` The event handler or event type -* __third__ `Function` The event handler - -##### RETURNS: -* `vjs.Component` self - -_inherited from_: [src/js/component.js#L577](https://github.com/videojs/video.js/blob/master/src/js/component.js#L577) - ---- - -### one( first, second, [third] ) -> Add an event listener to be triggered only once and then removed -> -> myComponent.one('eventName', myFunc); -> -> Alternatively you can add a listener to another element or component -> that will be triggered only once. -> -> myComponent.one(otherElement, 'eventName', myFunc); -> myComponent.one(otherComponent, 'eventName', myFunc); - -##### PARAMETERS: -* __first__ `String|vjs.Component` The event type or other component -* __second__ `Function|String` The listener function or event type -* __third__ `Function` _(OPTIONAL)_ The listener function for other component - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L691](https://github.com/videojs/video.js/blob/master/src/js/component.js#L691) - ---- - -### options( obj ) -> Deep merge of options objects -> -> Whenever a property is an object on both options objects -> the two properties will be merged using vjs.obj.deepMerge. -> -> This is used for merging options for child components. We -> want it to be easy to override individual options on a child -> component without having to rewrite all the other default options. -> -> Parent.prototype.options_ = { -> children: { -> 'childOne': { 'foo': 'bar', 'asdf': 'fdsa' }, -> 'childTwo': {}, -> 'childThree': {} -> } -> } -> newOptions = { -> children: { -> 'childOne': { 'foo': 'baz', 'abc': '123' } -> 'childTwo': null, -> 'childFour': {} -> } -> } -> -> this.options(newOptions); -> -> RESULT -> -> { -> children: { -> 'childOne': { 'foo': 'baz', 'asdf': 'fdsa', 'abc': '123' }, -> 'childTwo': null, // Disabled. Won't be initialized. -> 'childThree': {}, -> 'childFour': {} -> } -> } - -##### PARAMETERS: -* __obj__ `Object` Object of new option values - -##### RETURNS: -* `Object` A NEW object of this.options_ and obj merged - -_inherited from_: [src/js/component.js#L179](https://github.com/videojs/video.js/blob/master/src/js/component.js#L179) - ---- - -### player() -> Return the component's player - -##### RETURNS: -* `vjs.Player` - -_inherited from_: [src/js/component.js#L126](https://github.com/videojs/video.js/blob/master/src/js/component.js#L126) - ---- - -### ready( fn ) -> Bind a listener to the component's ready state -> -> Different from event listeners in that if the ready event has already happened -> it will trigger the function immediately. - -##### PARAMETERS: -* __fn__ `Function` Ready listener - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L769](https://github.com/videojs/video.js/blob/master/src/js/component.js#L769) - ---- - -### removeChild( component ) -> Remove a child component from this component's list of children, and the -> child component's element from this component's element - -##### PARAMETERS: -* __component__ `vjs.Component` Component to remove - -_inherited from_: [src/js/component.js#L420](https://github.com/videojs/video.js/blob/master/src/js/component.js#L420) - ---- - -### removeClass( classToRemove ) -> Remove a CSS class name from the component's element - -##### PARAMETERS: -* __classToRemove__ `String` Classname to remove - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L837](https://github.com/videojs/video.js/blob/master/src/js/component.js#L837) - ---- - -### setInterval( fn, interval ) -> Creates an interval and sets up disposal automatically. - -##### PARAMETERS: -* __fn__ `Function` The function to run every N seconds. -* __interval__ `Number` Number of ms to delay before executing specified function. - -##### RETURNS: -* `Number` Returns the interval ID - -_inherited from_: [src/js/component.js#L1202](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1202) - ---- - -### setTimeout( fn, timeout ) -> Creates timeout and sets up disposal automatically. - -##### PARAMETERS: -* __fn__ `Function` The function to run after the timeout. -* __timeout__ `Number` Number of ms to delay before executing specified function. - -##### RETURNS: -* `Number` Returns the timeout ID - -_inherited from_: [src/js/component.js#L1162](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1162) - ---- - -### show() -> Show the component element if hidden - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L847](https://github.com/videojs/video.js/blob/master/src/js/component.js#L847) - ---- - -### trigger( event ) -> Trigger an event on an element -> -> myComponent.trigger('eventName'); -> myComponent.trigger({'type':'eventName'}); - -##### PARAMETERS: -* __event__ `Event|Object|String` A string (the type) or an event object with a type attribute - -##### RETURNS: -* `vjs.Component` self - -_inherited from_: [src/js/component.js#L724](https://github.com/videojs/video.js/blob/master/src/js/component.js#L724) - ---- - -### triggerReady() -> Trigger the ready listeners - -##### RETURNS: -* `vjs.Component` - -_inherited from_: [src/js/component.js#L788](https://github.com/videojs/video.js/blob/master/src/js/component.js#L788) - ---- - -### width( [num], skipListeners ) -> Set or get the width of the component (CSS values) -> -> Setting the video tag dimension values only works with values in pixels. -> Percent values will not work. -> Some percents can be used, but width()/height() will return the number + %, -> not the actual computed width/height. - -##### PARAMETERS: -* __num__ `Number|String` _(OPTIONAL)_ Optional width number -* __skipListeners__ `Boolean` Skip the 'resize' event trigger - -##### RETURNS: -* `vjs.Component` This component, when setting the width -* `Number|String` The width, when getting - -_inherited from_: [src/js/component.js#L910](https://github.com/videojs/video.js/blob/master/src/js/component.js#L910) - ---- - -## EVENTS - -### resize `EVENT` -> Fired when the width and/or height of the component changes - -_inherited from_: [src/js/component.js#L1020](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1020) - ---- - diff --git a/docs/api/vjs.md b/docs/api/vjs.md deleted file mode 100644 index 34d2cd7420..0000000000 --- a/docs/api/vjs.md +++ /dev/null @@ -1,183 +0,0 @@ - - -# vjs - -__DEFINED IN__: [src/js/core.js#L26](https://github.com/videojs/video.js/blob/master/src/js/core.js#L26) - -Doubles as the main function for users to create a player instance and also -the main library object. - -**ALIASES** videojs, _V_ (deprecated) - -The `vjs` function can be used to initialize or retrieve a player. - - var myPlayer = vjs('my_video_id'); - ---- - -## INDEX - -- [PROPERTIES](#properties) - - [options](#options) - - [players](#players) - -- [METHODS](#methods) - - [addLanguage](#addlanguage-code-data-) - - [parseUrl](#parseurl-url-) - - [plugin](#plugin-name-init-) - - [xhr](#xhr-options-callback-) - -- CLASSES - - [BigPlayButton](vjs.BigPlayButton.md) - - [Button](vjs.Button.md) - - [CaptionsButton](undefined.md) - - [ChaptersButton](undefined.md) - - [ChaptersTrackMenuItem](undefined.md) - - [Component](vjs.Component.md) - - [ControlBar](vjs.ControlBar.md) - - [CoreObject](vjs.CoreObject.md) - - [CurrentTimeDisplay](vjs.CurrentTimeDisplay.md) - - [DurationDisplay](vjs.DurationDisplay.md) - - [ErrorDisplay](vjs.ErrorDisplay.md) - - [Flash](vjs.Flash.md) - - [FullscreenToggle](vjs.FullscreenToggle.md) - - [Html5](vjs.Html5.md) - - [LiveDisplay](vjs.LiveDisplay.md) - - [LoadProgressBar](vjs.LoadProgressBar.md) - - [LoadingSpinner](vjs.LoadingSpinner.md) - - [MediaError](vjs.MediaError.md) - - [MediaLoader](vjs.MediaLoader.md) - - [MediaTechController](undefined.md) - - [Menu](vjs.Menu.md) - - [MenuButton](vjs.MenuButton.md) - - [MenuItem](vjs.MenuItem.md) - - [MuteToggle](vjs.MuteToggle.md) - - [OffTextTrackMenuItem](undefined.md) - - [PlayProgressBar](vjs.PlayProgressBar.md) - - [PlayToggle](vjs.PlayToggle.md) - - [PlaybackRateMenuButton](vjs.PlaybackRateMenuButton.md) - - [PlaybackRateMenuItem](vjs.PlaybackRateMenuItem.md) - - [Player](vjs.Player.md) - - [PosterImage](vjs.PosterImage.md) - - [ProgressControl](vjs.ProgressControl.md) - - [RemainingTimeDisplay](vjs.RemainingTimeDisplay.md) - - [SeekBar](vjs.SeekBar.md) - - [SeekHandle](vjs.SeekHandle.md) - - [Slider](vjs.Slider.md) - - [SliderHandle](vjs.SliderHandle.md) - - [SubtitlesButton](undefined.md) - - [TextTrackButton](undefined.md) - - [TextTrackDisplay](undefined.md) - - [TextTrackMenuItem](undefined.md) - - [TimeDivider](vjs.TimeDivider.md) - - [VolumeBar](vjs.VolumeBar.md) - - [VolumeControl](vjs.VolumeControl.md) - - [VolumeHandle](vjs.VolumeHandle.md) - - [VolumeLevel](vjs.VolumeLevel.md) - - [VolumeMenuButton](vjs.VolumeMenuButton.md) - -- NAMESPACES - - [log](vjs.log.md) - - [util](vjs.util.md) - ---- - -## PROPERTIES - -### options -> Global Player instance options, surfaced from vjs.Player.prototype.options_ -> vjs.options = vjs.Player.prototype.options_ -> All options should use string keys so they avoid -> renaming by closure compiler - -_defined in_: [src/js/core.js#L92](https://github.com/videojs/video.js/blob/master/src/js/core.js#L92) - ---- - -### players -> Global player list - -_defined in_: [src/js/core.js#L164](https://github.com/videojs/video.js/blob/master/src/js/core.js#L164) - ---- - -## METHODS - -### addLanguage( code, data ) -> Utility function for adding languages to the default options. Useful for -> amending multiple language support at runtime. -> -> Example: vjs.addLanguage('es', {'Hello':'Hola'}); - -##### PARAMETERS: -* __code__ `String` The language code or dictionary property -* __data__ `Object` The data values to be translated - -##### RETURNS: -* `Object` The resulting global languages dictionary object - -_defined in_: [src/js/core.js#L151](https://github.com/videojs/video.js/blob/master/src/js/core.js#L151) - ---- - -### parseUrl( url ) -> Resolve and parse the elements of a URL - -##### PARAMETERS: -* __url__ `String` The url to parse - -##### RETURNS: -* `Object` An object of url details - -_defined in_: [src/js/lib.js#L688](https://github.com/videojs/video.js/blob/master/src/js/lib.js#L688) - ---- - -### plugin( name, init ) -> the method for registering a video.js plugin - -##### PARAMETERS: -* __name__ `String` The name of the plugin -* __init__ `Function` The function that is run when the player inits - -_defined in_: [src/js/plugins.js#L7](https://github.com/videojs/video.js/blob/master/src/js/plugins.js#L7) - ---- - -### xhr( options, callback ) -> Simple http request for retrieving external files (e.g. text tracks) -> -> ##### Example -> -> // using url string -> videojs.xhr('http://example.com/myfile.vtt', function(error, response, responseBody){}); -> -> // or options block -> videojs.xhr({ -> uri: 'http://example.com/myfile.vtt', -> method: 'GET', -> responseType: 'text' -> }, function(error, response, responseBody){ -> if (error) { -> // log the error -> } else { -> // successful, do something with the response -> } -> }); -> -> -> API is modeled after the Raynos/xhr, which we hope to use after -> getting browserify implemented. -> https://github.com/Raynos/xhr/blob/master/index.js - -##### PARAMETERS: -* __options__ `Object|String` Options block or URL string -* __callback__ `Function` The callback function - -##### RETURNS: -* `Object` The request - -_defined in_: [src/js/xhr.js#L31](https://github.com/videojs/video.js/blob/master/src/js/xhr.js#L31) - ---- - diff --git a/docs/api/vjs.media.md b/docs/api/vjs.media.md deleted file mode 100644 index b7bc636f37..0000000000 --- a/docs/api/vjs.media.md +++ /dev/null @@ -1,23 +0,0 @@ - - -# vjs.media - - ---- - -## INDEX - -- [UNDEFINED](#undefined) - - [ApiMethods](#apimethods) - ---- - -## UNDEFINED - -### ApiMethods -> List of default API methods for any MediaTechController - -_defined in_: [src/js/media/media.js#L169](https://github.com/videojs/video.js/blob/master/src/js/media/media.js#L169) - ---- -