Skip to content

Commit

Permalink
fix: Fix some properties on the shaka.text.Cue that are mangled (#5673)
Browse files Browse the repository at this point in the history
Fixes #5669

Backported to v4.4.x
  • Loading branch information
avelad authored and joeyparrish committed Oct 4, 2023
1 parent fdc1e9f commit c69e50f
Showing 1 changed file with 47 additions and 47 deletions.
94 changes: 47 additions & 47 deletions lib/text/cue.js
Expand Up @@ -26,90 +26,90 @@ shaka.text.Cue = class {
* The start time of the cue in seconds, relative to the start of the
* presentation.
* @type {number}
* @exportDoc
* @export
*/
this.startTime = startTime;

/**
* The end time of the cue in seconds, relative to the start of the
* presentation.
* @type {number}
* @exportDoc
* @export
*/
this.endTime = endTime;

/**
* The text payload of the cue. If nestedCues is non-empty, this should be
* empty. Top-level block containers should have no payload of their own.
* @type {string}
* @exportDoc
* @export
*/
this.payload = payload;

/**
* The region to render the cue into. Only supported on top-level cues,
* because nested cues are inline elements.
* @type {shaka.text.CueRegion}
* @exportDoc
* @export
*/
this.region = new shaka.text.CueRegion();

/**
* The indent (in percent) of the cue box in the direction defined by the
* writing direction.
* @type {?number}
* @exportDoc
* @export
*/
this.position = null;

/**
* Position alignment of the cue.
* @type {shaka.text.Cue.positionAlign}
* @exportDoc
* @export
*/
this.positionAlign = Cue.positionAlign.AUTO;

/**
* Size of the cue box (in percents), where 0 means "auto".
* @type {number}
* @exportDoc
* @export
*/
this.size = 0;

/**
* Alignment of the text inside the cue box.
* @type {shaka.text.Cue.textAlign}
* @exportDoc
* @export
*/
this.textAlign = Cue.textAlign.CENTER;

/**
* Text direction of the cue.
* @type {shaka.text.Cue.direction}
* @exportDoc
* @export
*/
this.direction = Cue.direction.HORIZONTAL_LEFT_TO_RIGHT;

/**
* Text writing mode of the cue.
* @type {shaka.text.Cue.writingMode}
* @exportDoc
* @export
*/
this.writingMode = Cue.writingMode.HORIZONTAL_TOP_TO_BOTTOM;

/**
* The way to interpret line field. (Either as an integer line number or
* percentage from the display box).
* @type {shaka.text.Cue.lineInterpretation}
* @exportDoc
* @export
*/
this.lineInterpretation = Cue.lineInterpretation.LINE_NUMBER;

/**
* The offset from the display box in either number of lines or
* percentage depending on the value of lineInterpretation.
* @type {?number}
* @exportDoc
* @export
*/
this.line = null;

Expand All @@ -118,7 +118,7 @@ shaka.text.Cue = class {
* (e.g. '100px'/'100em'). If not specified, this should be no less than
* the largest font size applied to the text in the cue.
* @type {string}.
* @exportDoc
* @export
*/
this.lineHeight = '';

Expand All @@ -132,7 +132,7 @@ shaka.text.Cue = class {
* (for vertical growing right), or left side (for vertical growing left) is
* aligned at the line.
* @type {shaka.text.Cue.lineAlign}
* @exportDoc
* @export
*/
this.lineAlign = Cue.lineAlign.START;

Expand All @@ -141,127 +141,127 @@ shaka.text.Cue = class {
* 'BEFORE' means displaying the captions at the top of the text display
* container box, 'CENTER' means in the middle, 'AFTER' means at the bottom.
* @type {shaka.text.Cue.displayAlign}
* @exportDoc
* @export
*/
this.displayAlign = Cue.displayAlign.AFTER;

/**
* Text color as a CSS color, e.g. "#FFFFFF" or "white".
* @type {string}
* @exportDoc
* @export
*/
this.color = '';

/**
* Text background color as a CSS color, e.g. "#FFFFFF" or "white".
* @type {string}
* @exportDoc
* @export
*/
this.backgroundColor = '';

/**
* The URL of the background image, e.g. "data:[mime type];base64,[data]".
* @type {string}
* @exportDoc
* @export
*/
this.backgroundImage = '';

/**
* The border around this cue as a CSS border.
* @type {string}
* @exportDoc
* @export
*/
this.border = '';

/**
* Text font size in px or em (e.g. '100px'/'100em').
* @type {string}
* @exportDoc
* @export
*/
this.fontSize = '';

/**
* Text font weight. Either normal or bold.
* @type {shaka.text.Cue.fontWeight}
* @exportDoc
* @export
*/
this.fontWeight = Cue.fontWeight.NORMAL;

/**
* Text font style. Normal, italic or oblique.
* @type {shaka.text.Cue.fontStyle}
* @exportDoc
* @export
*/
this.fontStyle = Cue.fontStyle.NORMAL;

/**
* Text font family.
* @type {string}
* @exportDoc
* @export
*/
this.fontFamily = '';

/**
* Text letter spacing as a CSS letter-spacing value.
* @type {string}
* @exportDoc
* @export
*/
this.letterSpacing = '';

/**
* Text line padding as a CSS line-padding value.
* @type {string}
* @exportDoc
* @export
*/
this.linePadding = '';

/**
* Opacity of the cue element, from 0-1.
* @type {number}
* @exportDoc
* @export
*/
this.opacity = 1;

/**
* Text decoration. A combination of underline, overline
* and line through. Empty array means no decoration.
* @type {!Array.<!shaka.text.Cue.textDecoration>}
* @exportDoc
* @export
*/
this.textDecoration = [];

/**
* Text shadow color as a CSS text-shadow value.
* @type {string}
* @exportDoc
* @export
*/
this.textShadow = '';

/**
* Text stroke color as a CSS color, e.g. "#FFFFFF" or "white".
* @type {string}
* @exportDoc
* @export
*/
this.textStrokeColor = '';

/**
* Text stroke width as a CSS stroke-width value.
* @type {string}
* @exportDoc
* @export
*/
this.textStrokeWidth = '';

/**
* Whether or not line wrapping should be applied to the cue.
* @type {boolean}
* @exportDoc
* @export
*/
this.wrapLine = true;

/**
* Id of the cue.
* @type {string}
* @exportDoc
* @export
*/
this.id = '';

Expand All @@ -270,7 +270,7 @@ shaka.text.Cue = class {
* Top-level cues are blocks, and nested cues are inline elements.
* Cues can be nested arbitrarily deeply.
* @type {!Array.<!shaka.text.Cue>}
* @exportDoc
* @export
*/
this.nestedCues = [];

Expand All @@ -280,15 +280,15 @@ shaka.text.Cue = class {
* in a TTML file. This controls the flow of the final cues; any nested cues
* within an "isContainer" cue will be laid out as separate lines.
* @type {boolean}
* @exportDoc
* @export
*/
this.isContainer = false;

/**
* Whether or not the cue only acts as a line break between two nested cues.
* Should only appear in nested cues.
* @type {boolean}
* @exportDoc
* @export
*/
this.lineBreak = false;

Expand All @@ -297,7 +297,7 @@ shaka.text.Cue = class {
* Region area is divided.
*
* @type {{ columns: number, rows: number }}
* @exportDoc
* @export
*/
this.cellResolution = {
columns: 32,
Expand Down Expand Up @@ -551,74 +551,74 @@ shaka.text.CueRegion = class {
/**
* Region identifier.
* @type {string}
* @exportDoc
* @export
*/
this.id = '';

/**
* The X offset to start the rendering area in viewportAnchorUnits of the
* video width.
* @type {number}
* @exportDoc
* @export
*/
this.viewportAnchorX = 0;

/**
* The X offset to start the rendering area in viewportAnchorUnits of the
* video height.
* @type {number}
* @exportDoc
* @export
*/
this.viewportAnchorY = 0;

/**
* The X offset to start the rendering area in percentage (0-100) of this
* region width.
* @type {number}
* @exportDoc
* @export
*/
this.regionAnchorX = 0;

/**
* The Y offset to start the rendering area in percentage (0-100) of the
* region height.
* @type {number}
* @exportDoc
* @export
*/
this.regionAnchorY = 0;

/**
* The width of the rendering area in widthUnits.
* @type {number}
* @exportDoc
* @export
*/
this.width = 100;

/**
* The width of the rendering area in heightUnits.
* @type {number}
* @exportDoc
* @export
*/
this.height = 100;

/**
* The units (percentage, pixels or lines) the region height is in.
* @type {shaka.text.CueRegion.units}
* @exportDoc
* @export
*/
this.heightUnits = CueRegion.units.PERCENTAGE;

/**
* The units (percentage or pixels) the region width is in.
* @type {shaka.text.CueRegion.units}
* @exportDoc
* @export
*/
this.widthUnits = CueRegion.units.PERCENTAGE;

/**
* The units (percentage or pixels) the region viewportAnchors are in.
* @type {shaka.text.CueRegion.units}
* @exportDoc
* @export
*/
this.viewportAnchorUnits = CueRegion.units.PERCENTAGE;

Expand All @@ -628,7 +628,7 @@ shaka.text.CueRegion = class {
* region up. Otherwise (scroll=NONE) cues will stay fixed at the location
* they were first painted in.
* @type {shaka.text.CueRegion.scrollMode}
* @exportDoc
* @export
*/
this.scroll = CueRegion.scrollMode.NONE;
}
Expand Down

0 comments on commit c69e50f

Please sign in to comment.