Source: externs/shaka/manifest.js

  1. /*! @license
  2. * Shaka Player
  3. * Copyright 2016 Google LLC
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. /**
  7. * @externs
  8. */
  9. /**
  10. * @typedef {{
  11. * presentationTimeline: !shaka.media.PresentationTimeline,
  12. * variants: !Array.<shaka.extern.Variant>,
  13. * textStreams: !Array.<shaka.extern.Stream>,
  14. * imageStreams: !Array.<shaka.extern.Stream>,
  15. * offlineSessionIds: !Array.<string>,
  16. * minBufferTime: number,
  17. * sequenceMode: boolean,
  18. * ignoreManifestTimestampsInSegmentsMode: boolean,
  19. * type: string,
  20. * serviceDescription: ?shaka.extern.ServiceDescription,
  21. * nextUrl: ?string,
  22. * periodCount: number,
  23. * gapCount: number,
  24. * isLowLatency: boolean
  25. * }}
  26. *
  27. * @description
  28. * <p>
  29. * A Manifest object describes a collection of streams (segmented audio, video,
  30. * or text data) that share a common timeline. We call the collection of
  31. * streams "the presentation" and their timeline "the presentation timeline".
  32. * A Manifest describes one of two types of presentations: live and
  33. * video-on-demand.
  34. * </p>
  35. *
  36. * <p>
  37. * A live presentation begins at some point in time and either continues
  38. * indefinitely or ends when the presentation stops broadcasting. For a live
  39. * presentation, wall-clock time maps onto the presentation timeline, and the
  40. * current wall-clock time maps to the live-edge (AKA "the current presentation
  41. * time"). In contrast, a video-on-demand presentation exists entirely
  42. * independent of wall-clock time.
  43. * </p>
  44. *
  45. * <p>
  46. * A variant is a combination of an audio and a video streams that can be played
  47. * together.
  48. * </p>
  49. *
  50. * <p>
  51. * A stream has the same logical content as another stream if the only
  52. * difference between the two is their quality. For example, an SD video stream
  53. * and an HD video stream that depict the same scene have the same logical
  54. * content; whereas an English audio stream and a French audio stream have
  55. * different logical contents. The player can automatically switch between
  56. * streams which have the same logical content to adapt to network conditions.
  57. * </p>
  58. *
  59. * @property {!shaka.media.PresentationTimeline} presentationTimeline
  60. * <i>Required.</i> <br>
  61. * The presentation timeline.
  62. * @property {!Array.<shaka.extern.Variant>} variants
  63. * <i>Required.</i> <br>
  64. * The presentation's Variants. There must be at least one Variant.
  65. * @property {!Array.<shaka.extern.Stream>} textStreams
  66. * <i>Required.</i> <br>
  67. * The presentation's text streams.
  68. * @property {!Array.<shaka.extern.Stream>} imageStreams
  69. * <i>Required.</i> <br>
  70. * The presentation's image streams
  71. * @property {!Array.<string>} offlineSessionIds
  72. * <i>Defaults to [].</i> <br>
  73. * An array of EME sessions to load for offline playback.
  74. * @property {number} minBufferTime
  75. * <i>Defaults to 0.</i> <br>
  76. * The minimum number of seconds of content that must be buffered before
  77. * playback can begin. Can be overridden by a higher value from the Player
  78. * configuration.
  79. * @property {boolean} sequenceMode
  80. * If true, we will append the media segments using sequence mode; that is to
  81. * say, ignoring any timestamps inside the media files.
  82. * @property {boolean} ignoreManifestTimestampsInSegmentsMode
  83. * If true, don't adjust the timestamp offset to account for manifest
  84. * segment durations being out of sync with segment durations. In other
  85. * words, assume that there are no gaps in the segments when appending
  86. * to the SourceBuffer, even if the manifest and segment times disagree.
  87. * Only applies when sequenceMode is <code>false</code>, and only for HLS
  88. * streams.
  89. * <i>Defaults to <code>false</code>.</i>
  90. * @property {string} type
  91. * Indicates the type of the manifest. It can be <code>'HLS'</code> or
  92. * <code>'DASH'</code>.
  93. * @property {?shaka.extern.ServiceDescription} serviceDescription
  94. * The service description for the manifest. Used to adapt playbackRate to
  95. * decrease latency.
  96. * @property {?string} nextUrl
  97. * The next url to play.
  98. * @property {number} periodCount
  99. * Number of periods found in a manifest. For DASH, it represents number of
  100. * Period elements in a manifest. If streaming protocol does not implement
  101. * period-like structure, it should be set to 1.
  102. * <i>Defaults to <code>1</code>.</i>
  103. * @property {number} gapCount
  104. * The amount of gaps found in a manifest. For DASH, it represents number of
  105. * discontinuities found between periods. For HLS, it is a number of EXT-X-GAP
  106. * and GAP=YES occurrences. For MSS, it is always set to 0.
  107. * If in src= mode or nothing is loaded, NaN.
  108. * @property {bolean} isLowLatency
  109. * If true, the manifest is Low Latency.
  110. *
  111. * @exportDoc
  112. */
  113. shaka.extern.Manifest;
  114. /**
  115. * @typedef {{
  116. * id: string,
  117. * audioStreams: !Array.<shaka.extern.Stream>,
  118. * videoStreams: !Array.<shaka.extern.Stream>,
  119. * textStreams: !Array.<shaka.extern.Stream>,
  120. * imageStreams: !Array.<shaka.extern.Stream>
  121. * }}
  122. *
  123. * @description Contains the streams from one DASH period.
  124. * For use in {@link shaka.util.PeriodCombiner}.
  125. *
  126. * @property {string} id
  127. * The Period ID.
  128. * @property {!Array.<shaka.extern.Stream>} audioStreams
  129. * The audio streams from one Period.
  130. * @property {!Array.<shaka.extern.Stream>} videoStreams
  131. * The video streams from one Period.
  132. * @property {!Array.<shaka.extern.Stream>} textStreams
  133. * The text streams from one Period.
  134. * @property {!Array.<shaka.extern.Stream>} imageStreams
  135. * The image streams from one Period.
  136. *
  137. * @exportDoc
  138. */
  139. shaka.extern.Period;
  140. /**
  141. * @typedef {{
  142. * initData: !Uint8Array,
  143. * initDataType: string,
  144. * keyId: ?string
  145. * }}
  146. *
  147. * @description
  148. * Explicit initialization data, which override any initialization data in the
  149. * content. The initDataType values and the formats that they correspond to
  150. * are specified {@link https://bit.ly/EmeInitTypes here}.
  151. *
  152. * @property {!Uint8Array} initData
  153. * Initialization data in the format indicated by initDataType.
  154. * @property {string} initDataType
  155. * A string to indicate what format initData is in.
  156. * @property {?string} keyId
  157. * The key Id that corresponds to this initData.
  158. *
  159. * @exportDoc
  160. */
  161. shaka.extern.InitDataOverride;
  162. /**
  163. * @typedef {{
  164. * targetLatency:?number,
  165. * maxLatency: ?number,
  166. * maxPlaybackRate: ?number,
  167. * minLatency: ?number,
  168. * minPlaybackRate: ?number
  169. * }}
  170. *
  171. * @description
  172. * Maximum and minimum latency and playback rate for a manifest. When max
  173. * latency is reached playbackrate is updated to maxPlaybackRate to decrease
  174. * latency. When min latency is reached playbackrate is updated to
  175. * minPlaybackRate to increase latency.
  176. * More information {@link https://dashif.org/docs/CR-Low-Latency-Live-r8.pdf here}.
  177. *
  178. * @property {?number} targetLatency
  179. * The target latency to aim for.
  180. * @property {?number} maxLatency
  181. * Maximum latency in seconds.
  182. * @property {?number} maxPlaybackRate
  183. * Maximum playback rate.
  184. * @property {?number} minLatency
  185. * Minimum latency in seconds.
  186. * @property {?number} minPlaybackRate
  187. * Minimum playback rate.
  188. *
  189. * @exportDoc
  190. */
  191. shaka.extern.ServiceDescription;
  192. /**
  193. * @typedef {{
  194. * keySystem: string,
  195. * encryptionScheme: string,
  196. * keySystemUris: (Set.<string>|undefined),
  197. * licenseServerUri: string,
  198. * distinctiveIdentifierRequired: boolean,
  199. * persistentStateRequired: boolean,
  200. * audioRobustness: string,
  201. * videoRobustness: string,
  202. * serverCertificate: Uint8Array,
  203. * serverCertificateUri: string,
  204. * sessionType: string,
  205. * initData: Array.<!shaka.extern.InitDataOverride>,
  206. * keyIds: Set.<string>
  207. * }}
  208. *
  209. * @description
  210. * DRM configuration for a single key system.
  211. *
  212. * @property {string} keySystem
  213. * <i>Required.</i> <br>
  214. * The key system, e.g., "com.widevine.alpha".
  215. * @property {string} encryptionScheme
  216. * <i>Required.</i> <br>
  217. * The encryption scheme, e.g., "cenc", "cbcs", "cbcs-1-9".
  218. * @property {(Set.<string>|undefined)} keySystemUris
  219. * <i>Optional.</i> <br>
  220. * The key system uri, e.g., "skd://" for fairplay.
  221. * @property {string} licenseServerUri
  222. * <i>Filled in by DRM config if missing.</i> <br>
  223. * The license server URI.
  224. * @property {boolean} distinctiveIdentifierRequired
  225. * <i>Defaults to false. Can be filled in by advanced DRM config.</i> <br>
  226. * True if the application requires the key system to support distinctive
  227. * identifiers.
  228. * @property {boolean} persistentStateRequired
  229. * <i>Defaults to false. Can be filled in by advanced DRM config.</i> <br>
  230. * True if the application requires the key system to support persistent
  231. * state, e.g., for persistent license storage.
  232. * @property {string} sessionType
  233. * <i>Defaults to 'temporary' if Shaka wasn't initiated for storage.
  234. * Can be filled in by advanced DRM config sessionType parameter.</i> <br>
  235. * @property {string} audioRobustness
  236. * <i>Defaults to '', e.g., no specific robustness required. Can be filled in
  237. * by advanced DRM config.</i> <br>
  238. * A key-system-specific string that specifies a required security level.
  239. * @property {string} videoRobustness
  240. * <i>Defaults to '', e.g., no specific robustness required. Can be filled in
  241. * by advanced DRM config.</i> <br>
  242. * A key-system-specific string that specifies a required security level.
  243. * @property {Uint8Array} serverCertificate
  244. * <i>Defaults to null, e.g., certificate will be requested from the license
  245. * server if required. Can be filled in by advanced DRM config.</i> <br>
  246. * A key-system-specific server certificate used to encrypt license requests.
  247. * Its use is optional and is meant as an optimization to avoid a round-trip
  248. * to request a certificate.
  249. * @property {string} serverCertificateUri
  250. * <i>Defaults to '', e.g., server certificate will be requested from the
  251. * given URI if serverCertificate is not provided. Can be filled in by
  252. * advanced DRM config.</i>
  253. * @property {Array.<!shaka.extern.InitDataOverride>} initData
  254. * <i>Defaults to [], e.g., no override.</i> <br>
  255. * A list of initialization data which override any initialization data found
  256. * in the content. See also shaka.extern.InitDataOverride.
  257. * @property {Set.<string>} keyIds
  258. * <i>Defaults to the empty Set</i> <br>
  259. * If not empty, contains the default key IDs for this key system, as
  260. * lowercase hex strings.
  261. * @exportDoc
  262. */
  263. shaka.extern.DrmInfo;
  264. /**
  265. * @typedef {{
  266. * id: number,
  267. * language: string,
  268. * disabledUntilTime: number,
  269. * primary: boolean,
  270. * audio: ?shaka.extern.Stream,
  271. * video: ?shaka.extern.Stream,
  272. * bandwidth: number,
  273. * allowedByApplication: boolean,
  274. * allowedByKeySystem: boolean,
  275. * decodingInfos: !Array.<MediaCapabilitiesDecodingInfo>
  276. * }}
  277. *
  278. * @description
  279. * A Variant describes a combination of an audio and video streams which
  280. * could be played together. It's possible to have a video/audio only
  281. * variant.
  282. *
  283. * @property {number} id
  284. * <i>Required.</i> <br>
  285. * A unique ID among all Variant objects within the same Manifest.
  286. * @property {string} language
  287. * <i>Defaults to '' (i.e., unknown).</i> <br>
  288. * The Variant's language, specified as a language code. <br>
  289. * See {@link https://tools.ietf.org/html/rfc5646} <br>
  290. * See {@link http://www.iso.org/iso/home/standards/language_codes.htm}
  291. * @property {number} disabledUntilTime
  292. * <i>Defaults to 0.</i> <br>
  293. * 0 means the variant is enabled. The Player will set this value to
  294. * "(Date.now() / 1000) + config.streaming.maxDisabledTime" and once this
  295. * maxDisabledTime has passed Player will set the value to 0 in order to
  296. * reenable the variant.
  297. * @property {boolean} primary
  298. * <i>Defaults to false.</i> <br>
  299. * True indicates that the player should use this Variant over others if user
  300. * preferences cannot be met. The player may still use another Variant to
  301. * meet user preferences.
  302. * @property {?shaka.extern.Stream} audio
  303. * The audio stream of the variant.
  304. * @property {?shaka.extern.Stream} video
  305. * The video stream of the variant.
  306. * @property {number} bandwidth
  307. * The variant's required bandwidth in bits per second.
  308. * @property {boolean} allowedByApplication
  309. * <i>Defaults to true.</i><br>
  310. * Set by the Player to indicate whether the variant is allowed to be played
  311. * by the application.
  312. * @property {boolean} allowedByKeySystem
  313. * <i>Defaults to true.</i><br>
  314. * Set by the Player to indicate whether the variant is allowed to be played
  315. * by the key system.
  316. * @property {!Array.<MediaCapabilitiesDecodingInfo>} decodingInfos
  317. * <i>Defaults to [].</i><br>
  318. * Set by StreamUtils to indicate the results from MediaCapabilities
  319. * decodingInfo.
  320. *
  321. * @exportDoc
  322. */
  323. shaka.extern.Variant;
  324. /**
  325. * Creates a SegmentIndex; returns a Promise that resolves after the
  326. * SegmentIndex has been created.
  327. *
  328. * @typedef {function(): !Promise}
  329. * @exportDoc
  330. */
  331. shaka.extern.CreateSegmentIndexFunction;
  332. /**
  333. * @typedef {{
  334. * bitsKey: number,
  335. * blockCipherMode: string,
  336. * cryptoKey: (webCrypto.CryptoKey|undefined),
  337. * fetchKey: (shaka.extern.CreateSegmentIndexFunction|undefined),
  338. * iv: (!Uint8Array|undefined),
  339. * firstMediaSequenceNumber: number
  340. * }}
  341. *
  342. * @description
  343. * AES key and iv info from the manifest.
  344. *
  345. * @property {number} bitsKey
  346. * The number of the bit key (eg: 128, 256).
  347. * @property {string} blockCipherMode
  348. * The block cipher mode of operation. Possible values: 'CTR' or 'CBC'.
  349. * @property {webCrypto.CryptoKey|undefined} cryptoKey
  350. * Web crypto key object of the AES key. If unset, the "fetchKey"
  351. * property should be provided.
  352. * @property {shaka.extern.FetchCryptoKeysFunction|undefined} fetchKey
  353. * A function that fetches the key.
  354. * Should be provided if the "cryptoKey" property is unset.
  355. * Should update this object in-place, to set "cryptoKey".
  356. * @property {(!Uint8Array|undefined)} iv
  357. * The IV in the manifest, if defined. For HLS see HLS RFC 8216 Section 5.2
  358. * for handling undefined IV.
  359. * @property {number} firstMediaSequenceNumber
  360. * The starting Media Sequence Number of the playlist, used when IV is
  361. * undefined.
  362. *
  363. * @exportDoc
  364. */
  365. shaka.extern.aesKey;
  366. /**
  367. * A function that fetches the crypto keys for AES-128.
  368. * Returns a promise that resolves when the keys have been fetched.
  369. *
  370. * @typedef {function(): !Promise}
  371. * @exportDoc
  372. */
  373. shaka.extern.FetchCryptoKeysFunction;
  374. /**
  375. * SegmentIndex minimal API.
  376. * @interface
  377. * @exportDoc
  378. */
  379. shaka.extern.SegmentIndex = class {
  380. /**
  381. * Get number of references.
  382. * @return {number}
  383. * @exportDoc
  384. */
  385. getNumReferences() {}
  386. /**
  387. * Finds the position of the segment for the given time, in seconds, relative
  388. * to the start of the presentation. Returns the position of the segment
  389. * with the largest end time if more than one segment is known for the given
  390. * time.
  391. *
  392. * @param {number} time
  393. * @return {?number} The position of the segment, or null if the position of
  394. * the segment could not be determined.
  395. * @exportDoc
  396. */
  397. find(time) {}
  398. /**
  399. * Gets the SegmentReference for the segment at the given position.
  400. *
  401. * @param {number} position The position of the segment as returned by find().
  402. * @return {shaka.media.SegmentReference} The SegmentReference, or null if
  403. * no such SegmentReference exists.
  404. * @exportDoc
  405. */
  406. get(position) {}
  407. /**
  408. * Gets number of already evicted segments.
  409. * @return {number}
  410. * @exportDoc
  411. */
  412. getNumEvicted() {}
  413. };
  414. /**
  415. * @typedef {{
  416. * id: number,
  417. * originalId: ?string,
  418. * groupId: ?string,
  419. * createSegmentIndex: shaka.extern.CreateSegmentIndexFunction,
  420. * closeSegmentIndex: (function()|undefined),
  421. * segmentIndex: shaka.media.SegmentIndex,
  422. * mimeType: string,
  423. * codecs: string,
  424. * frameRate: (number|undefined),
  425. * pixelAspectRatio: (string|undefined),
  426. * hdr: (string|undefined),
  427. * colorGamut: (string|undefined),
  428. * videoLayout: (string|undefined),
  429. * bandwidth: (number|undefined),
  430. * width: (number|undefined),
  431. * height: (number|undefined),
  432. * kind: (string|undefined),
  433. * encrypted: boolean,
  434. * drmInfos: !Array.<shaka.extern.DrmInfo>,
  435. * keyIds: !Set.<string>,
  436. * language: string,
  437. * originalLanguage: ?string,
  438. * label: ?string,
  439. * type: string,
  440. * primary: boolean,
  441. * trickModeVideo: ?shaka.extern.Stream,
  442. * emsgSchemeIdUris: ?Array.<string>,
  443. * roles: !Array.<string>,
  444. * accessibilityPurpose: ?shaka.media.ManifestParser.AccessibilityPurpose,
  445. * forced: boolean,
  446. * channelsCount: ?number,
  447. * audioSamplingRate: ?number,
  448. * spatialAudio: boolean,
  449. * closedCaptions: Map.<string, string>,
  450. * tilesLayout: (string|undefined),
  451. * matchedStreams:
  452. * (!Array.<shaka.extern.Stream>|!Array.<shaka.extern.StreamDB>|
  453. * undefined),
  454. * mssPrivateData: (shaka.extern.MssPrivateData|undefined),
  455. * external: boolean,
  456. * fastSwitching: boolean,
  457. * fullMimeTypes: !Set.<string>
  458. * }}
  459. *
  460. * @description
  461. * A Stream object describes a single stream (segmented media data).
  462. *
  463. * @property {number} id
  464. * <i>Required.</i> <br>
  465. * A unique ID among all Stream objects within the same Manifest.
  466. * @property {?string} originalId
  467. * <i>Optional.</i> <br>
  468. * The original ID, if any, that appeared in the manifest. For example, in
  469. * DASH, this is the "id" attribute of the Representation element. In HLS,
  470. * this is the "NAME" attribute.
  471. * @property {?string} groupId
  472. * <i>Optional.</i> <br>
  473. * The ID of the stream's parent element. In DASH, this will be a unique
  474. * ID that represents the representation's parent adaptation element
  475. * @property {shaka.extern.CreateSegmentIndexFunction} createSegmentIndex
  476. * <i>Required.</i> <br>
  477. * Creates the Stream's segmentIndex (asynchronously).
  478. * @property {(function()|undefined)} closeSegmentIndex
  479. * <i>Optional.</i> <br>
  480. * Closes the Stream's segmentIndex.
  481. * @property {shaka.media.SegmentIndex} segmentIndex
  482. * <i>Required.</i> <br>
  483. * May be null until createSegmentIndex() is complete.
  484. * @property {string} mimeType
  485. * <i>Required.</i> <br>
  486. * The Stream's MIME type, e.g., 'audio/mp4', 'video/webm', or 'text/vtt'.
  487. * In the case of a stream that adapts between different periods with
  488. * different MIME types, this represents only the first period.
  489. * @property {string} codecs
  490. * <i>Defaults to '' (i.e., unknown / not needed).</i> <br>
  491. * The Stream's codecs, e.g., 'avc1.4d4015' or 'vp9', which must be
  492. * compatible with the Stream's MIME type. <br>
  493. * In the case of a stream that adapts between different periods with
  494. * different codecs, this represents only the first period.
  495. * See {@link https://tools.ietf.org/html/rfc6381}
  496. * @property {(number|undefined)} frameRate
  497. * <i>Video streams only.</i> <br>
  498. * The Stream's framerate in frames per second
  499. * @property {(string|undefined)} pixelAspectRatio
  500. * <i>Video streams only.</i> <br>
  501. * The Stream's pixel aspect ratio
  502. * @property {(string|undefined)} hdr
  503. * <i>Video streams only.</i> <br>
  504. * The Stream's HDR info
  505. * @property {(string|undefined)} colorGamut
  506. * <i>Video streams only.</i> <br>
  507. * The Stream's color gamut info
  508. * @property {(string|undefined)} videoLayout
  509. * <i>Video streams only.</i> <br>
  510. * The Stream's video layout info.
  511. * @property {(number|undefined)} bandwidth
  512. * <i>Audio and video streams only.</i> <br>
  513. * The stream's required bandwidth in bits per second.
  514. * @property {(number|undefined)} width
  515. * <i>Video streams only.</i> <br>
  516. * The stream's width in pixels.
  517. * @property {(number|undefined)} height
  518. * <i>Video streams only.</i> <br>
  519. * The stream's height in pixels.
  520. * @property {(string|undefined)} kind
  521. * <i>Text streams only.</i> <br>
  522. * The kind of text stream. For example, 'caption' or 'subtitle'.
  523. * @see https://bit.ly/TextKind
  524. * @property {boolean} encrypted
  525. * <i>Defaults to false.</i><br>
  526. * True if the stream is encrypted.
  527. * @property {!Array.<!shaka.extern.DrmInfo>} drmInfos
  528. * <i>Defaults to [] (i.e., no DRM).</i> <br>
  529. * An array of DrmInfo objects which describe DRM schemes are compatible with
  530. * the content.
  531. * @property {!Set.<string>} keyIds
  532. * <i>Defaults to empty (i.e., unencrypted or key ID unknown).</i> <br>
  533. * The stream's key IDs as lowercase hex strings. These key IDs identify the
  534. * encryption keys that the browser (key system) can use to decrypt the
  535. * stream.
  536. * @property {string} language
  537. * The Stream's language, specified as a language code. <br>
  538. * Audio stream's language must be identical to the language of the containing
  539. * Variant.
  540. * @property {?string} originalLanguage
  541. * <i>Optional.</i> <br>
  542. * The original language, if any, that appeared in the manifest.
  543. * @property {?string} label
  544. * The Stream's label, unique text that should describe the audio/text track.
  545. * @property {string} type
  546. * <i>Required.</i> <br>
  547. * Content type (e.g. 'video', 'audio' or 'text', 'image')
  548. * @property {boolean} primary
  549. * <i>Defaults to false.</i> <br>
  550. * True indicates that the player should use this Stream over others if user
  551. * preferences cannot be met. The player may still use another Variant to
  552. * meet user preferences.
  553. * @property {?shaka.extern.Stream} trickModeVideo
  554. * <i>Video streams only.</i> <br>
  555. * An alternate video stream to use for trick mode playback.
  556. * @property {?Array.<string>} emsgSchemeIdUris
  557. * <i>Defaults to empty.</i><br>
  558. * Array of registered emsg box scheme_id_uri that should result in
  559. * Player events.
  560. * @property {!Array.<string>} roles
  561. * The roles of the stream as they appear on the manifest,
  562. * e.g. 'main', 'caption', or 'commentary'.
  563. * @property {?shaka.media.ManifestParser.AccessibilityPurpose}
  564. * accessibilityPurpose
  565. * The DASH accessibility descriptor, if one was provided for this stream.
  566. * @property {boolean} forced
  567. * <i>Defaults to false.</i> <br>
  568. * Whether the stream set was forced
  569. * @property {?number} channelsCount
  570. * The channel count information for the audio stream.
  571. * @property {?number} audioSamplingRate
  572. * Specifies the maximum sampling rate of the content.
  573. * @property {boolean} spatialAudio
  574. * <i>Defaults to false.</i> <br>
  575. * Whether the stream set has spatial audio
  576. * @property {Map.<string, string>} closedCaptions
  577. * A map containing the description of closed captions, with the caption
  578. * channel number (CC1 | CC2 | CC3 | CC4) as the key and the language code
  579. * as the value. If the channel number is not provided by the description,
  580. * we'll set a 0-based index as the key. If the language code is not
  581. * provided by the description we'll set the same value as channel number.
  582. * Example: {'CC1': 'eng'; 'CC3': 'swe'}, or {'1', 'eng'; '2': 'swe'}, etc.
  583. * @property {(string|undefined)} tilesLayout
  584. * <i>Image streams only.</i> <br>
  585. * The value is a grid-item-dimension consisting of two positive decimal
  586. * integers in the format: column-x-row ('4x3'). It describes the arrangement
  587. * of Images in a Grid. The minimum valid LAYOUT is '1x1'.
  588. * @property {(!Array.<shaka.extern.Stream>|!Array.<shaka.extern.StreamDB>|
  589. * undefined)} matchedStreams
  590. * The streams in all periods which match the stream. Used for Dash.
  591. * @property {(shaka.extern.MssPrivateData|undefined)} mssPrivateData
  592. * <i>Microsoft Smooth Streaming only.</i> <br>
  593. * Private MSS data that is necessary to be able to do transmuxing.
  594. * @property {boolean} external
  595. * Indicate if the stream was added externally.
  596. * Eg: external text tracks.
  597. * @property {boolean} fastSwitching
  598. * Indicate if the stream should be used for fast switching.
  599. * @property {!Set.<string>} fullMimeTypes
  600. * A set of full MIME types (e.g. MIME types plus codecs information), that
  601. * represents the types used in each period of the original manifest.
  602. * Meant for being used by compatibility checking, such as with
  603. * MediaSource.isTypeSupported.
  604. *
  605. * @exportDoc
  606. */
  607. shaka.extern.Stream;
  608. /**
  609. * @typedef {{
  610. * duration: number,
  611. * timescale: number,
  612. * codecPrivateData: ?string
  613. * }}
  614. *
  615. * @description
  616. * Private MSS data that is necessary to be able to do transmuxing.
  617. *
  618. * @property {number} duration
  619. * <i>Required.</i> <br>
  620. * MSS Stream duration.
  621. * @property {number} timescale
  622. * <i>Required.</i> <br>
  623. * MSS timescale.
  624. * @property {?string} codecPrivateData
  625. * MSS codecPrivateData.
  626. *
  627. * @exportDoc
  628. */
  629. shaka.extern.MssPrivateData;