AVSubtitleComponent class

The AVSubtitleComponent class implements the [AVComponent](/references/shared-utility-classes-and-features/avcomponent-class) interface.

Properties

This section details the additional properties of a AVSubtitleComponent Object.

readonly String language
An ISO 639-2 language code representing the language of the stream, as defined in [ISO 639-2].
readonly Boolean hearingImpaired
Has value true if the stream is intended for the hearing-impaired (e.g. contains a written description of the sound effects), false otherwise.
readonly String label
The label identifies a component by a human readable short description.

Additional Notes

Support for TTML subtitles

For in-band and out-of-band delivered TTML subtitles, the following mappings for the properties of the AVSubtitleComponent class shall apply:

PropertyValue
encodingHas the value “application/ttml+xml“.
languageThe value defined by the ‘srclang‘ key used in the <param> element.
hearingImpairedIs true if the value of the ‘name‘ attribute is ‘captions‘, false otherwise.
labelThe value defined by the ‘label‘ key used in the <param> element.

Example:

<object type='video/mp4' data='http://mycdn.de/video.mp4'>
<param name='subtitles ' value='srclang:de src: http%3A%2F%2Fmycdn.de%2Fsubtitles_de.ttml' />
<param name='captions ' value='srclang:en src:
    http%3A%2F%2Fmycdn.de%2Fsubtitles_hearing_impaired.ttml' />