Subtitle
public struct Subtitle : Codable
Model representing a subtitle/track for a media
A subtitle can be assigned as a track to Metadata
Conforms to Codable
and therefore can be encoded to JSON
-
URL string of the WebVTT file
Declaration
Swift
public let src: String
-
Type of the subtitle, always
SubtitleKind.subtitles
Declaration
Swift
public let kind: SubtitleKind
-
Language code of the subtitle
Declaration
Swift
public let srclang: String
-
Text which is shown on the UI
Declaration
Swift
public let label: String
-
Initializes using all properties
Declaration
Swift
public init?(src: URL, kind: SubtitleKind, srclang: String, label: String)
Parameters
src
URL of the WebVTT file
kind
Type of the subtitle, currently always
SubtitleKind.subtitles
srclang
Language code of the subtitle, has to be exactly 2 characters
label
Text which is shown on the UI