Skip to content

Commit

Permalink
docs: fixup global jsdoc members (#4015)
Browse files Browse the repository at this point in the history
  • Loading branch information
gkatsev authored Feb 2, 2017
1 parent 4949619 commit 6ad1e5c
Show file tree
Hide file tree
Showing 15 changed files with 48 additions and 8 deletions.
1 change: 0 additions & 1 deletion src/js/control-bar/play-toggle.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ class PlayToggle extends Button {
/**
* Add the vjs-ended class to the element so it can change appearance
*
* @method handleEnded
*/
handleEnded(event) {
this.removeClass('vjs-playing');
Expand Down
5 changes: 4 additions & 1 deletion src/js/extend.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/**
* @file extend.js
* @module extend
*/
Expand Down Expand Up @@ -40,6 +40,9 @@ const _inherits = function(subClass, superClass) {
* Function for subclassing using the same inheritance that
* videojs uses internally
*
* @static
* @const
*
* @param {Object} superClass
* The class to inherit from
*
Expand Down
4 changes: 2 additions & 2 deletions src/js/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -3404,7 +3404,7 @@ TECH_EVENTS_RETRIGGER.forEach(function(event) {
* This does not report whether or not the plugin has ever been initialized
* on this player. For that, [usingPlugin]{@link Player#usingPlugin}.
*
* @method hasPlugin
* @method Player#hasPlugin
* @param {string} name
* The name of a plugin.
*
Expand All @@ -3418,7 +3418,7 @@ TECH_EVENTS_RETRIGGER.forEach(function(event) {
* For basic plugins, this only reports whether the plugin has _ever_ been
* initialized on this player.
*
* @method usingPlugin
* @method Player#usingPlugin
* @param {string} name
* The name of a plugin.
*
Expand Down
3 changes: 2 additions & 1 deletion src/js/tech/tech.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ import * as TRACK_TYPES from '../tracks/track-types';
/**
* A function used by {@link Tech} to create a new {@link TextTrack}.
*
* @private
*
* @param {Tech} self
* An instance of the Tech class.
*
Expand Down Expand Up @@ -554,7 +556,6 @@ class Tech extends Component {
/**
* Emulate texttracks
*
* @method emulateTextTracks
*/
emulateTextTracks() {
const tracks = this.textTracks();
Expand Down
2 changes: 2 additions & 0 deletions src/js/tracks/audio-track.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,11 @@ class AudioTrack extends Track {
}
}
/**
* @memberof AudioTrack
* @member {boolean} enabled
* If this `AudioTrack` is enabled or not. When setting this will
* fire {@link AudioTrack#enabledchange} if the state of enabled is changed.
* @instance
*
* @fires VideoTrack#selectedchange
*/
Expand Down
2 changes: 2 additions & 0 deletions src/js/tracks/html-track-element-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ class HtmlTrackElementList {
list.trackElements_ = [];

/**
* @memberof HTMLTrackElementList
* @member {number} length
* The current number of `Track`s in the this Trackist.
* @instance
*/
Object.defineProperty(list, 'length', {
get() {
Expand Down
6 changes: 6 additions & 0 deletions src/js/tracks/html-track-element.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import EventTarget from '../event-target';
import TextTrack from '../tracks/text-track';

/**
* @memberof HTMLTrackElement
* @typedef {HTMLTrackElement~ReadyState}
* @enum {number}
*/
Expand Down Expand Up @@ -83,8 +84,10 @@ class HTMLTrackElement extends EventTarget {
trackElement.default = track.default;

/**
* @memberof HTMLTrackElement
* @member {HTMLTrackElement~ReadyState} readyState
* The current ready state of the track element.
* @instance
*/
Object.defineProperty(trackElement, 'readyState', {
get() {
Expand All @@ -93,8 +96,11 @@ class HTMLTrackElement extends EventTarget {
});

/**
* @memberof HTMLTrackElement
* @member {TextTrack} track
* The underlying TextTrack object.
* @instance
*
*/
Object.defineProperty(trackElement, 'track', {
get() {
Expand Down
6 changes: 4 additions & 2 deletions src/js/tracks/text-track-cue-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import * as browser from '../utils/browser.js';
import document from 'global/document';

/**
* @typedef {Object} TextTrackCue
* @typedef {Object} TextTrackCueList~TextTrackCue
*
* @property {string} id
* The unique id for this text track cue
Expand Down Expand Up @@ -51,8 +51,10 @@ class TextTrackCueList {
TextTrackCueList.prototype.setCues_.call(list, cues);

/**
* @memberof TextTrackCueList
* @member {number} length
* The current number of `TextTrackCue`s in the TextTrackCueList.
* @instance
*/
Object.defineProperty(list, 'length', {
get() {
Expand Down Expand Up @@ -107,7 +109,7 @@ class TextTrackCueList {
* @param {string} id
* The id of the cue that should be searched for.
*
* @return {TextTrackCue|null}
* @return {TextTrackCueList~TextTrackCue|null}
* A single cue or null if none was found.
*/
getCueById(id) {
Expand Down
2 changes: 2 additions & 0 deletions src/js/tracks/text-track-display.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ function constructColor(color, opacity) {
*
* @param {string} rule
* The style rule that should be applied to the property.
*
* @private
*/
function tryUpdateStyle(el, style, rule) {
try {
Expand Down
8 changes: 8 additions & 0 deletions src/js/tracks/text-track.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,11 @@ class TextTrack extends Track {
}

/**
* @memberof TextTrack
* @member {boolean} default
* If this track was set to be on or off by default. Cannot be changed after
* creation.
* @instance
*
* @readonly
*/
Expand All @@ -216,9 +218,11 @@ class TextTrack extends Track {
});

/**
* @memberof TextTrack
* @member {string} mode
* Set the mode of this TextTrack to a valid {@link TextTrack~Mode}. Will
* not be set if setting to an invalid mode.
* @instance
*
* @fires TextTrack#modechange
*/
Expand Down Expand Up @@ -248,8 +252,10 @@ class TextTrack extends Track {
});

/**
* @memberof TextTrack
* @member {TextTrackCueList} cues
* The text track cue list for this TextTrack.
* @instance
*/
Object.defineProperty(tt, 'cues', {
get() {
Expand All @@ -263,8 +269,10 @@ class TextTrack extends Track {
});

/**
* @memberof TextTrack
* @member {TextTrackCueList} activeCues
* The list text track cues that are currently active for this TextTrack.
* @instance
*/
Object.defineProperty(tt, 'activeCues', {
get() {
Expand Down
2 changes: 2 additions & 0 deletions src/js/tracks/track-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ class TrackList extends EventTarget {
list.tracks_ = [];

/**
* @memberof TrackList
* @member {number} length
* The current number of `Track`s in the this Trackist.
* @instance
*/
Object.defineProperty(list, 'length', {
get() {
Expand Down
2 changes: 1 addition & 1 deletion src/js/tracks/track-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import HTMLTrackElement from './html-track-element';

import mergeOptions from '../utils/merge-options';

/**
/*
* This file contains all track properties that are used in
* player.js, tech.js, html5.js and possibly other techs in the future.
*/
Expand Down
8 changes: 8 additions & 0 deletions src/js/tracks/track.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,30 +60,38 @@ class Track extends EventTarget {
};

/**
* @memberof Track
* @member {string} id
* The id of this track. Cannot be changed after creation.
* @instance
*
* @readonly
*/

/**
* @memberof Track
* @member {string} kind
* The kind of track that this is. Cannot be changed after creation.
* @instance
*
* @readonly
*/

/**
* @memberof Track
* @member {string} label
* The label of this track. Cannot be changed after creation.
* @instance
*
* @readonly
*/

/**
* @memberof Track
* @member {string} language
* The two letter language code for this track. Cannot be changed after
* creation.
* @instance
*
* @readonly
*/
Expand Down
2 changes: 2 additions & 0 deletions src/js/tracks/video-track.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,11 @@ class VideoTrack extends Track {
}

/**
* @memberof VideoTrack
* @member {boolean} selected
* If this `VideoTrack` is selected or not. When setting this will
* fire {@link VideoTrack#selectedchange} if the state of selected changed.
* @instance
*
* @fires VideoTrack#selectedchange
*/
Expand Down
3 changes: 3 additions & 0 deletions src/js/utils/computed-style.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ import window from 'global/window';
* The property name you want
*
* @see https://bugzilla.mozilla.org/show_bug.cgi?id=548397
*
* @static
* @const
*/
export default function computedStyle(el, prop) {
if (!el || !prop) {
Expand Down

0 comments on commit 6ad1e5c

Please sign in to comment.