Create a MetadataType object from a metadata object
(Object
= {}
)
={} - object with metadata to create MetadataType object of
Object
:
MetadataType
Parses MetadataType according to specified options. The attributes can be targeted for each sub-type.
(Object
= {}
)
The MetadataType response from the API.
(Object
= {}
)
Options which change how the metadataType is parsed.
Name | Description |
---|---|
options.joinValue string
|
String to join the values, eg ','. |
options.includeAttributes boolean
|
Include attributes on all objects. |
options.includeMetadataAttributes boolean
|
Include attributes on root. |
options.includeTimespanAttributes boolean
|
Include attributes on timespans. |
options.includeGroupAttributes boolean
|
Include attributes on groups. |
options.includeFieldAttributes boolean
|
Include attributes on fields. |
options.includeValueAttributes boolean
|
Include attributes on values. |
options.flat boolean
|
Flatten to key/value (Note: keys may be overwritten). |
options.flatTimespan boolean
|
Flatten timespan. |
options.flatGroup boolean
|
Flatten group. |
options.sortTimespan boolean
|
Sort timespan by start time. |
options.timespanAsList boolean
|
Return timespans as list. |
options.groupAsList boolean
|
Return groups as list. |
options.fieldAsList boolean
|
Return fields as list. |
options.arrayOnSingle boolean
|
=true - Return fields as array even if single field. |
options.arrayOnSingleValue boolean
|
=true - Return fields as array even if single field value. |
Object
:
Metadata object parsed according to options.
Parses timespanList according to specified options. The attributes can be targeted for each sub-type.
(Object
= {}
)
Options which change how the metadataType is parsed.
Name | Description |
---|---|
options.joinValue string
|
String to join the values, eg ','. |
options.includeAttributes boolean
|
Include attributes on all objects. |
options.includeMetadataAttributes boolean
|
Include attributes on root. |
options.includeTimespanAttributes boolean
|
Include attributes on timespans. |
options.includeGroupAttributes boolean
|
Include attributes on groups. |
options.includeFieldAttributes boolean
|
Include attributes on fields. |
options.includeValueAttributes boolean
|
Include attributes on values. |
options.flat boolean
|
Flatten to key/value (Note: keys may be overwritten). |
options.flatTimespan boolean
|
Flatten timespan. |
options.flatGroup boolean
|
Flatten group. |
options.sortTimespan boolean
|
Sort timespan by start time. |
options.timespanAsList boolean
|
Return timespans as list. |
options.groupAsList boolean
|
Return groups as list. |
options.fieldAsList boolean
|
Return fields as list. |
options.arrayOnSingle boolean
|
=true - Return fields as array even if single field. |
options.arrayOnSingleValue boolean
|
=true - Return fields as array even if single field value. |
Object
:
Metadata object parsed according to options.
Parses timespan according to specified options. The attributes can be targeted for each sub-type.
(Object
= {}
)
={} - The timespan response from the API.
(Object
= {}
)
={} - Options which change how the metadataType is parsed.
Name | Description |
---|---|
options.joinValue string
|
=undefined - String to join the values, eg ','. |
options.includeAttributes boolean
|
=false - Include attributes on all objects. |
options.includeTimespanAttributes boolean
|
=false - Include attributes on timespans. |
options.includeGroupAttributes boolean
|
=false - Include attributes on groups. |
options.includeFieldAttributes boolean
|
=false - Include attributes on fields. |
options.includeValueAttributes boolean
|
=false - Include attributes on values. |
options.flat boolean
|
=false - Flatten to key/value (Note: keys may be overwritten). |
options.flatTimespan boolean
|
=false - Flatten timespan. |
options.flatGroup boolean
|
=false - Flatten group. |
options.groupAsList boolean
|
=false - Return groups as list. |
options.fieldAsList boolean
|
=false - Return fields as list. |
options.arrayOnSingle boolean
|
=true - Return fields as array even if single field. |
options.arrayOnSingleValue boolean
|
=true - Return fields as array even if single field value. |
Object
:
Metadata object parsed according to options.
Parses highlight timespans responses from the api into key/value object. The attributes can be targeted for each sub-type.
(Object
= []
)
A list of timespans from the api response.
(any
= {}
)
(Object)
Options which change how the timespans are parsed.
Name | Description |
---|---|
options.arrayOnSingle boolean
|
=true - Return an array if there is a single value. |
options.joinValue string
|
String to join the values, eg ','. |
options.timespanAsList boolean
|
=false - Return timespans as list. |
options.flat boolean
|
=false - Flatten to field-name/field-value (Note: field-values may be overwritten). |
options.flatTimespan boolean
|
=false - Flatten timespan to object with start/end as key. |
options.joinTimespan string
|
=_ - Character to join the start/end timecodes. |
Parses highlight timespan responses from the api into key/value object. The attributes can be targeted for each sub-type.
Name | Description |
---|---|
highlightTimespan.field any
(default [] )
|
|
highlightTimespan.start any
|
|
highlightTimespan.end any
|
(any
= {}
)
Convert subtitle groups to WebVtt subtitle format
(Object)
={}
Name | Description |
---|---|
input.metadataType Object
|
MetadataType response from API. |
input.subtitleGroup string
(default 'stl_subtitle' )
|
=stl_subtitle - Name of group containing subtitle field/text. |
input.subtitleField string
(default 'stl_text' )
|
=stl_text - Name of field (text) to use for the subtitles. |
string
:
WebVtt subtitles