Source: externs/shaka/player.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. * timestamp: number,
  12. * id: number,
  13. * type: string,
  14. * fromAdaptation: boolean,
  15. * bandwidth: ?number
  16. * }}
  17. *
  18. * @property {number} timestamp
  19. * The timestamp the choice was made, in seconds since 1970
  20. * (i.e. <code>Date.now() / 1000</code>).
  21. * @property {number} id
  22. * The id of the track that was chosen.
  23. * @property {string} type
  24. * The type of track chosen (<code>'variant'</code> or <code>'text'</code>).
  25. * @property {boolean} fromAdaptation
  26. * <code>true</code> if the choice was made by AbrManager for adaptation;
  27. * <code>false</code> if it was made by the application through
  28. * <code>selectTrack</code>.
  29. * @property {?number} bandwidth
  30. * The bandwidth of the chosen track (<code>null</code> for text).
  31. * @exportDoc
  32. */
  33. shaka.extern.TrackChoice;
  34. /**
  35. * @typedef {{
  36. * timestamp: number,
  37. * state: string,
  38. * duration: number
  39. * }}
  40. *
  41. * @property {number} timestamp
  42. * The timestamp the state was entered, in seconds since 1970
  43. * (i.e. <code>Date.now() / 1000</code>).
  44. * @property {string} state
  45. * The state the player entered. This could be <code>'buffering'</code>,
  46. * <code>'playing'</code>, <code>'paused'</code>, or <code>'ended'</code>.
  47. * @property {number} duration
  48. * The number of seconds the player was in this state. If this is the last
  49. * entry in the list, the player is still in this state, so the duration will
  50. * continue to increase.
  51. * @exportDoc
  52. */
  53. shaka.extern.StateChange;
  54. /**
  55. * @typedef {{
  56. * width: number,
  57. * height: number,
  58. * streamBandwidth: number,
  59. *
  60. * decodedFrames: number,
  61. * droppedFrames: number,
  62. * corruptedFrames: number,
  63. * estimatedBandwidth: number,
  64. *
  65. * completionPercent: number,
  66. * loadLatency: number,
  67. * manifestTimeSeconds: number,
  68. * drmTimeSeconds: number,
  69. * playTime: number,
  70. * pauseTime: number,
  71. * bufferingTime: number,
  72. * licenseTime: number,
  73. * liveLatency: number,
  74. *
  75. * maxSegmentDuration: number,
  76. *
  77. * gapsJumped: number,
  78. * stallsDetected: number,
  79. *
  80. * manifestSizeBytes: number,
  81. * bytesDownloaded: number,
  82. *
  83. * nonFatalErrorCount: number,
  84. * manifestPeriodCount: number,
  85. * manifestGapCount: number,
  86. *
  87. * switchHistory: !Array.<shaka.extern.TrackChoice>,
  88. * stateHistory: !Array.<shaka.extern.StateChange>
  89. * }}
  90. *
  91. * @description
  92. * Contains statistics and information about the current state of the player.
  93. * This is meant for applications that want to log quality-of-experience (QoE)
  94. * or other stats. These values will reset when <code>load()</code> is called
  95. * again.
  96. *
  97. * @property {number} width
  98. * The width of the current video track. If nothing is loaded or the content
  99. * is audio-only, NaN.
  100. * @property {number} height
  101. * The height of the current video track. If nothing is loaded or the content
  102. * is audio-only, NaN.
  103. * @property {number} streamBandwidth
  104. * The bandwidth required for the current streams (total, in bit/sec).
  105. * It takes into account the playbackrate. If nothing is loaded, NaN.
  106. *
  107. * @property {number} decodedFrames
  108. * The total number of frames decoded by the Player. If not reported by the
  109. * browser, NaN.
  110. * @property {number} droppedFrames
  111. * The total number of frames dropped by the Player. If not reported by the
  112. * browser, NaN.
  113. * @property {number} corruptedFrames
  114. * The total number of corrupted frames dropped by the browser. If not
  115. * reported by the browser, NaN.
  116. * @property {number} estimatedBandwidth
  117. * The current estimated network bandwidth (in bit/sec). If no estimate
  118. * available, NaN.
  119. *
  120. * @property {number} gapsJumped
  121. * The total number of playback gaps jumped by the GapJumpingController.
  122. * If nothing is loaded, NaN.
  123. * @property {number} stallsDetected
  124. * The total number of playback stalls detected by the StallDetector.
  125. * If nothing is loaded, NaN.
  126. *
  127. * @property {number} completionPercent
  128. * This is the greatest completion percent that the user has experienced in
  129. * playback. Also known as the "high water mark". If nothing is loaded, or
  130. * the stream is live (and therefore indefinite), NaN.
  131. * @property {number} loadLatency
  132. * This is the number of seconds it took for the video element to have enough
  133. * data to begin playback. This is measured from the time load() is called to
  134. * the time the <code>'loadeddata'</code> event is fired by the media element.
  135. * If nothing is loaded, NaN.
  136. * @property {number} manifestTimeSeconds
  137. * The amount of time it took to download and parse the manifest.
  138. * If nothing is loaded, NaN.
  139. * @property {number} drmTimeSeconds
  140. * The amount of time it took to download the first drm key, and load that key
  141. * into the drm system. If nothing is loaded or DRM is not in use, NaN.
  142. * @property {number} playTime
  143. * The total time spent in a playing state in seconds. If nothing is loaded,
  144. * NaN.
  145. * @property {number} pauseTime
  146. * The total time spent in a paused state in seconds. If nothing is loaded,
  147. * NaN.
  148. * @property {number} bufferingTime
  149. * The total time spent in a buffering state in seconds. If nothing is
  150. * loaded, NaN.
  151. * @property {number} licenseTime
  152. * The time spent on license requests during this session in seconds. If DRM
  153. * is not in use, NaN.
  154. * @property {number} liveLatency
  155. * The time between the capturing of a frame and the end user having it
  156. * displayed on their screen. If nothing is loaded or the content is VOD,
  157. * NaN.
  158. *
  159. * @property {number} maxSegmentDuration
  160. * The presentation's max segment duration in seconds. If nothing is loaded,
  161. * NaN.
  162. *
  163. * @property {number} manifestSizeBytes
  164. * Size of the manifest payload. For DASH & MSS it will match the latest
  165. * downloaded manifest. For HLS, it will match the lastly downloaded playlist.
  166. * If nothing is loaded or in src= mode, NaN.
  167. * @property {number} bytesDownloaded
  168. * The bytes downloaded during the playback. If nothing is loaded, NaN.
  169. *
  170. * @property {number} nonFatalErrorCount
  171. * The amount of non fatal errors that occurred. If nothing is loaded, NaN.
  172. * @property {number} manifestPeriodCount
  173. * The amount of periods occurred in the manifest. For DASH it represents
  174. * number of Period elements in a manifest. For HLS & MSS it is always 1.
  175. * In src= mode or if nothing is loaded, NaN.
  176. * @property {number} manifestGapCount
  177. * The amount of gaps found in a manifest. For DASH, it represents number of
  178. * discontinuities found between periods. For HLS, it is a number of EXT-X-GAP
  179. * and GAP=YES occurrences. For MSS, it is always set to 0.
  180. * If in src= mode or nothing is loaded, NaN.
  181. *
  182. * @property {!Array.<shaka.extern.TrackChoice>} switchHistory
  183. * A history of the stream changes.
  184. * @property {!Array.<shaka.extern.StateChange>} stateHistory
  185. * A history of the state changes.
  186. * @exportDoc
  187. */
  188. shaka.extern.Stats;
  189. /**
  190. * @typedef {{
  191. * start: number,
  192. * end: number
  193. * }}
  194. *
  195. * @description
  196. * Contains the times of a range of buffered content.
  197. *
  198. * @property {number} start
  199. * The start time of the range, in seconds.
  200. * @property {number} end
  201. * The end time of the range, in seconds.
  202. * @exportDoc
  203. */
  204. shaka.extern.BufferedRange;
  205. /**
  206. * @typedef {{
  207. * total: !Array.<shaka.extern.BufferedRange>,
  208. * audio: !Array.<shaka.extern.BufferedRange>,
  209. * video: !Array.<shaka.extern.BufferedRange>,
  210. * text: !Array.<shaka.extern.BufferedRange>
  211. * }}
  212. *
  213. * @description
  214. * Contains information about the current buffered ranges.
  215. *
  216. * @property {!Array.<shaka.extern.BufferedRange>} total
  217. * The combined audio/video buffered ranges, reported by
  218. * <code>video.buffered</code>.
  219. * @property {!Array.<shaka.extern.BufferedRange>} audio
  220. * The buffered ranges for audio content.
  221. * @property {!Array.<shaka.extern.BufferedRange>} video
  222. * The buffered ranges for video content.
  223. * @property {!Array.<shaka.extern.BufferedRange>} text
  224. * The buffered ranges for text content.
  225. * @exportDoc
  226. */
  227. shaka.extern.BufferedInfo;
  228. /**
  229. * @typedef {{
  230. * id: number,
  231. * active: boolean,
  232. *
  233. * type: string,
  234. * bandwidth: number,
  235. *
  236. * language: string,
  237. * label: ?string,
  238. * kind: ?string,
  239. * width: ?number,
  240. * height: ?number,
  241. * frameRate: ?number,
  242. * pixelAspectRatio: ?string,
  243. * hdr: ?string,
  244. * colorGamut: ?string,
  245. * videoLayout: ?string,
  246. * mimeType: ?string,
  247. * audioMimeType: ?string,
  248. * videoMimeType: ?string,
  249. * codecs: ?string,
  250. * audioCodec: ?string,
  251. * videoCodec: ?string,
  252. * primary: boolean,
  253. * roles: !Array.<string>,
  254. * audioRoles: Array.<string>,
  255. * accessibilityPurpose: ?shaka.media.ManifestParser.AccessibilityPurpose,
  256. * forced: boolean,
  257. * videoId: ?number,
  258. * audioId: ?number,
  259. * channelsCount: ?number,
  260. * audioSamplingRate: ?number,
  261. * tilesLayout: ?string,
  262. * audioBandwidth: ?number,
  263. * videoBandwidth: ?number,
  264. * spatialAudio: boolean,
  265. * originalVideoId: ?string,
  266. * originalAudioId: ?string,
  267. * originalTextId: ?string,
  268. * originalImageId: ?string,
  269. * originalLanguage: ?string
  270. * }}
  271. *
  272. * @description
  273. * An object describing a media track. This object should be treated as
  274. * read-only as changing any values does not have any effect. This is the
  275. * public view of an audio/video paring (variant type) or text track (text
  276. * type) or image track (image type).
  277. *
  278. * @property {number} id
  279. * The unique ID of the track.
  280. * @property {boolean} active
  281. * If true, this is the track being streamed (another track may be
  282. * visible/audible in the buffer).
  283. *
  284. * @property {string} type
  285. * The type of track, either <code>'variant'</code> or <code>'text'</code>
  286. * or <code>'image'</code>.
  287. * @property {number} bandwidth
  288. * The bandwidth required to play the track, in bits/sec.
  289. *
  290. * @property {string} language
  291. * The language of the track, or <code>'und'</code> if not given. This value
  292. * is normalized as follows - language part is always lowercase and translated
  293. * to ISO-639-1 when possible, locale part is always uppercase,
  294. * i.e. <code>'en-US'</code>.
  295. * @property {?string} label
  296. * The track label, which is unique text that should describe the track.
  297. * @property {?string} kind
  298. * (only for text tracks) The kind of text track, either
  299. * <code>'caption'</code> or <code>'subtitle'</code>.
  300. * @property {?number} width
  301. * The video width provided in the manifest, if present.
  302. * @property {?number} height
  303. * The video height provided in the manifest, if present.
  304. * @property {?number} frameRate
  305. * The video framerate provided in the manifest, if present.
  306. * @property {?string} pixelAspectRatio
  307. * The video pixel aspect ratio provided in the manifest, if present.
  308. * @property {?string} hdr
  309. * The video HDR provided in the manifest, if present.
  310. * @property {?string} colorGamut
  311. * The video color gamut provided in the manifest, if present.
  312. * @property {?string} videoLayout
  313. * The video layout provided in the manifest, if present.
  314. * @property {?string} mimeType
  315. * The MIME type of the content provided in the manifest.
  316. * @property {?string} audioMimeType
  317. * The audio MIME type of the content provided in the manifest.
  318. * @property {?string} videoMimeType
  319. * The video MIME type of the content provided in the manifest.
  320. * @property {?string} codecs
  321. * The audio/video codecs string provided in the manifest, if present.
  322. * @property {?string} audioCodec
  323. * The audio codecs string provided in the manifest, if present.
  324. * @property {?string} videoCodec
  325. * The video codecs string provided in the manifest, if present.
  326. * @property {boolean} primary
  327. * True indicates that this in the primary language for the content.
  328. * This flag is based on signals from the manifest.
  329. * This can be a useful hint about which language should be the default, and
  330. * indicates which track Shaka will use when the user's language preference
  331. * cannot be satisfied.
  332. * @property {!Array.<string>} roles
  333. * The roles of the track, e.g. <code>'main'</code>, <code>'caption'</code>,
  334. * or <code>'commentary'</code>.
  335. * @property {Array.<string>} audioRoles
  336. * The roles of the audio in the track, e.g. <code>'main'</code> or
  337. * <code>'commentary'</code>. Will be null for text tracks or variant tracks
  338. * without audio.
  339. * @property {?shaka.media.ManifestParser.AccessibilityPurpose}
  340. * accessibilityPurpose
  341. * The DASH accessibility descriptor, if one was provided for this track.
  342. * For text tracks, this describes the text; otherwise, this is for the audio.
  343. * @property {boolean} forced
  344. * True indicates that this in the forced text language for the content.
  345. * This flag is based on signals from the manifest.
  346. * @property {?number} videoId
  347. * (only for variant tracks) The video stream id.
  348. * @property {?number} audioId
  349. * (only for variant tracks) The audio stream id.
  350. * @property {?number} channelsCount
  351. * The count of the audio track channels.
  352. * @property {?number} audioSamplingRate
  353. * Specifies the maximum sampling rate of the content.
  354. * @property {?string} tilesLayout
  355. * The value is a grid-item-dimension consisting of two positive decimal
  356. * integers in the format: column-x-row ('4x3'). It describes the arrangement
  357. * of Images in a Grid. The minimum valid LAYOUT is '1x1'.
  358. * @property {boolean} spatialAudio
  359. * True indicates that the content has spatial audio.
  360. * This flag is based on signals from the manifest.
  361. * @property {?number} audioBandwidth
  362. * (only for variant tracks) The audio stream's bandwidth if known.
  363. * @property {?number} videoBandwidth
  364. * (only for variant tracks) The video stream's bandwidth if known.
  365. * @property {?string} originalVideoId
  366. * (variant tracks only) The original ID of the video part of the track, if
  367. * any, as it appeared in the original manifest.
  368. * @property {?string} originalAudioId
  369. * (variant tracks only) The original ID of the audio part of the track, if
  370. * any, as it appeared in the original manifest.
  371. * @property {?string} originalTextId
  372. * (text tracks only) The original ID of the text track, if any, as it
  373. * appeared in the original manifest.
  374. * @property {?string} originalImageId
  375. * (image tracks only) The original ID of the image track, if any, as it
  376. * appeared in the original manifest.
  377. * @property {?string} originalLanguage
  378. * The original language of the track, if any, as it appeared in the original
  379. * manifest. This is the exact value provided in the manifest; for normalized
  380. * value use <code>language</code> property.
  381. * @exportDoc
  382. */
  383. shaka.extern.Track;
  384. /**
  385. * @typedef {!Array.<!shaka.extern.Track>}
  386. */
  387. shaka.extern.TrackList;
  388. /**
  389. * @typedef {{
  390. * minWidth: number,
  391. * maxWidth: number,
  392. * minHeight: number,
  393. * maxHeight: number,
  394. * minPixels: number,
  395. * maxPixels: number,
  396. *
  397. * minFrameRate: number,
  398. * maxFrameRate: number,
  399. *
  400. * minBandwidth: number,
  401. * maxBandwidth: number,
  402. *
  403. * minChannelsCount: number,
  404. * maxChannelsCount: number
  405. * }}
  406. *
  407. * @description
  408. * An object describing application restrictions on what tracks can play. All
  409. * restrictions must be fulfilled for a track to be playable/selectable.
  410. * The restrictions system behaves somewhat differently at the ABR level and the
  411. * player level, so please refer to the documentation for those specific
  412. * settings.
  413. *
  414. * @see shaka.extern.PlayerConfiguration
  415. * @see shaka.extern.AbrConfiguration
  416. *
  417. * @property {number} minWidth
  418. * The minimum width of a video track, in pixels.
  419. * <br>
  420. * Defaults to <code>0</code>.
  421. * @property {number} maxWidth
  422. * The maximum width of a video track, in pixels.
  423. * <br>
  424. * Defaults to <code>Infinity</code>.
  425. * @property {number} minHeight
  426. * The minimum height of a video track, in pixels.
  427. * <br>
  428. * Defaults to <code>0</code>.
  429. * @property {number} maxHeight
  430. * The maximum height of a video track, in pixels.
  431. * <br>
  432. * Defaults to <code>Infinity</code>.
  433. * @property {number} minPixels
  434. * The minimum number of total pixels in a video track (i.e.
  435. * <code>width * height</code>).
  436. * <br>
  437. * Defaults to <code>0</code>.
  438. * @property {number} maxPixels
  439. * The maximum number of total pixels in a video track (i.e.
  440. * <code>width * height</code>).
  441. * <br>
  442. * Defaults to <code>Infinity</code>.
  443. *
  444. * @property {number} minFrameRate
  445. * The minimum framerate of a variant track.
  446. * <br>
  447. * Defaults to <code>0</code>.
  448. * @property {number} maxFrameRate
  449. * The maximum framerate of a variant track.
  450. * <br>
  451. * Defaults to <code>Infinity</code>.
  452. *
  453. * @property {number} minBandwidth
  454. * The minimum bandwidth of a variant track, in bit/sec.
  455. * <br>
  456. * Defaults to <code>0</code>.
  457. * @property {number} maxBandwidth
  458. * The maximum bandwidth of a variant track, in bit/sec.
  459. * <br>
  460. * Defaults to <code>Infinity</code>.
  461. *
  462. * @property {number} minChannelsCount
  463. * The minimum channels count of a variant track.
  464. * <br>
  465. * Defaults to <code>0</code>.
  466. * @property {number} maxChannelsCount
  467. * The maximum channels count of a variant track.
  468. * <br>
  469. * Defaults to <code>Infinity</code>.
  470. * @exportDoc
  471. */
  472. shaka.extern.Restrictions;
  473. /**
  474. * @typedef {{
  475. * persistentState: boolean,
  476. * encryptionSchemes: !Array<string|null>,
  477. * videoRobustnessLevels: !Array<string>,
  478. * audioRobustnessLevels: !Array<string>
  479. * }}
  480. *
  481. * @property {boolean} persistentState
  482. * Whether this key system supports persistent state.
  483. * @property {!Array<string|null>} encryptionSchemes
  484. * An array of encryption schemes that are reported to work, through either
  485. * EME or MCap APIs. An empty array indicates that encryptionScheme queries
  486. * are not supported. This should not happen if our polyfills are installed.
  487. * @property {!Array<string>} videoRobustnessLevels
  488. * An array of video robustness levels that are reported to work. An empty
  489. * array indicates that none were tested. Not all key systems have a list of
  490. * known robustness levels built into probeSupport().
  491. * @property {!Array<string>} audioRobustnessLevels
  492. * An array of audio robustness levels that are reported to work. An empty
  493. * array indicates that none were tested. Not all key systems have a list of
  494. * known robustness levels built into probeSupport().
  495. * @exportDoc
  496. */
  497. shaka.extern.DrmSupportType;
  498. /**
  499. * @typedef {{
  500. * manifest: !Object.<string, boolean>,
  501. * media: !Object.<string, boolean>,
  502. * drm: !Object.<string, ?shaka.extern.DrmSupportType>,
  503. * hardwareResolution: shaka.extern.Resolution
  504. * }}
  505. *
  506. * @description
  507. * An object detailing browser support for various features.
  508. *
  509. * @property {!Object.<string, boolean>} manifest
  510. * A map of supported manifest types.
  511. * The keys are manifest MIME types and file extensions.
  512. * @property {!Object.<string, boolean>} media
  513. * A map of supported media types.
  514. * The keys are media MIME types.
  515. * @property {!Object.<string, ?shaka.extern.DrmSupportType>} drm
  516. * A map of supported key systems.
  517. * The keys are the key system names. The value is <code>null</code> if it is
  518. * not supported. Key systems not probed will not be in this dictionary.
  519. * @property {shaka.extern.Resolution} hardwareResolution
  520. * The maximum detected hardware resolution, which may have
  521. * height==width==Infinity for devices without a maximum resolution or
  522. * without a way to detect the maximum.
  523. *
  524. * @exportDoc
  525. */
  526. shaka.extern.SupportType;
  527. /**
  528. * @typedef {{
  529. * cueTime: ?number,
  530. * data: !Uint8Array,
  531. * frames: !Array.<shaka.extern.MetadataFrame>,
  532. * dts: ?number,
  533. * pts: ?number
  534. * }}
  535. *
  536. * @description
  537. * ID3 metadata in format defined by
  538. * https://id3.org/id3v2.3.0#Declared_ID3v2_frames
  539. * The content of the field.
  540. *
  541. * @property {?number} cueTime
  542. * @property {!Uint8Array} data
  543. * @property {!Array.<shaka.extern.MetadataFrame>} frames
  544. * @property {?number} dts
  545. * @property {?number} pts
  546. *
  547. * @exportDoc
  548. */
  549. shaka.extern.ID3Metadata;
  550. /**
  551. * @typedef {{
  552. * type: string,
  553. * size: number,
  554. * data: Uint8Array
  555. * }}
  556. *
  557. * @description metadata raw frame.
  558. * @property {string} type
  559. * @property {number} size
  560. * @property {Uint8Array} data
  561. * @exportDoc
  562. */
  563. shaka.extern.MetadataRawFrame;
  564. /**
  565. * @typedef {{
  566. * key: string,
  567. * data: (ArrayBuffer|string|number),
  568. * description: string,
  569. * mimeType: ?string,
  570. * pictureType: ?number
  571. * }}
  572. *
  573. * @description metadata frame parsed.
  574. * @property {string} key
  575. * @property {ArrayBuffer|string|number} data
  576. * @property {string} description
  577. * @property {?string} mimeType
  578. * @property {?number} pictureType
  579. * @exportDoc
  580. */
  581. shaka.extern.MetadataFrame;
  582. /**
  583. * @typedef {{
  584. * video: ?shaka.extern.PlaybackStreamInfo,
  585. * audio: ?shaka.extern.PlaybackStreamInfo,
  586. * text: ?shaka.extern.PlaybackStreamInfo
  587. * }}
  588. *
  589. * @description Represents the state of the current variant and text.
  590. * @property {?shaka.extern.PlaybackStreamInfo} video
  591. * @property {?shaka.extern.PlaybackStreamInfo} audio
  592. * @property {?shaka.extern.PlaybackStreamInfo} text
  593. * @exportDoc
  594. */
  595. shaka.extern.PlaybackInfo;
  596. /**
  597. * @typedef {{
  598. * codecs: string,
  599. * mimeType: string,
  600. * bandwidth: number,
  601. * width: ?number,
  602. * height: ?number
  603. * }}
  604. *
  605. * @description Represents the state of the given stream.
  606. * @property {string} codecs
  607. * @property {string} mimeType
  608. * @property {number} bandwidth
  609. * @property {?number} width
  610. * @property {?number} height
  611. * @exportDoc
  612. */
  613. shaka.extern.PlaybackStreamInfo;
  614. /**
  615. * @typedef {{
  616. * startTime: number,
  617. * endTime: ?number,
  618. * values: !Array.<shaka.extern.MetadataFrame>
  619. * }}
  620. *
  621. * @property {number} startTime
  622. * @property {?number} endTime
  623. * @property {!Array.<shaka.extern.MetadataFrame>} values
  624. * @exportDoc
  625. */
  626. shaka.extern.HLSInterstitial;
  627. /**
  628. * @typedef {{
  629. * schemeIdUri: string,
  630. * value: string,
  631. * startTime: number,
  632. * endTime: number,
  633. * id: string,
  634. * eventElement: Element,
  635. * eventNode: ?shaka.extern.xml.Node
  636. * }}
  637. *
  638. * @description
  639. * Contains information about a region of the timeline that will cause an event
  640. * to be raised when the playhead enters or exits it. In DASH this is the
  641. * EventStream element.
  642. *
  643. * @property {string} schemeIdUri
  644. * Identifies the message scheme.
  645. * @property {string} value
  646. * Specifies the value for the region.
  647. * @property {number} startTime
  648. * The presentation time (in seconds) that the region should start.
  649. * @property {number} endTime
  650. * The presentation time (in seconds) that the region should end.
  651. * @property {string} id
  652. * Specifies an identifier for this instance of the region.
  653. * @property {Element} eventElement
  654. * <b>DEPRECATED</b>: Use eventNode instead.
  655. * The XML element that defines the Event.
  656. * @property {?shaka.extern.xml.Node} eventNode
  657. * The XML element that defines the Event.
  658. * @exportDoc
  659. */
  660. shaka.extern.TimelineRegionInfo;
  661. /**
  662. * @typedef {{
  663. * audioSamplingRate: ?number,
  664. * bandwidth: number,
  665. * codecs: string,
  666. * contentType: string,
  667. * frameRate: ?number,
  668. * height: ?number,
  669. * mimeType: ?string,
  670. * label: ?string,
  671. * roles: ?Array.<string>,
  672. * language: ?string,
  673. * channelsCount: ?number,
  674. * pixelAspectRatio: ?string,
  675. * width: ?number
  676. * }}
  677. *
  678. * @description
  679. * Contains information about the quality of an audio or video media stream.
  680. *
  681. * @property {?number} audioSamplingRate
  682. * Specifies the maximum sampling rate of the content.
  683. * @property {number} bandwidth
  684. * The bandwidth in bits per second.
  685. * @property {string} codecs
  686. * The Stream's codecs, e.g., 'avc1.4d4015' or 'vp9', which must be
  687. * compatible with the Stream's MIME type.
  688. * @property {string} contentType
  689. * The type of content, which may be "video" or "audio".
  690. * @property {?number} frameRate
  691. * The video frame rate.
  692. * @property {?number} height
  693. * The video height in pixels.
  694. * @property {string} mimeType
  695. * The MIME type.
  696. * @property {?string} label
  697. * The stream's label, when available.
  698. * @property {?Array.<string>} roles
  699. * The stream's role, when available.
  700. * @property {?string} language
  701. * The stream's language, when available.
  702. * @property {?number} channelsCount
  703. * The number of audio channels, or null if unknown.
  704. * @property {?string} pixelAspectRatio
  705. * The pixel aspect ratio value; e.g. "1:1".
  706. * @property {?number} width
  707. * The video width in pixels.
  708. * @exportDoc
  709. */
  710. shaka.extern.MediaQualityInfo;
  711. /**
  712. * @typedef {{
  713. * schemeIdUri: string,
  714. * value: string,
  715. * startTime: number,
  716. * endTime: number,
  717. * timescale: number,
  718. * presentationTimeDelta: number,
  719. * eventDuration: number,
  720. * id: number,
  721. * messageData: Uint8Array
  722. * }}
  723. *
  724. * @description
  725. * Contains information about an EMSG MP4 box.
  726. *
  727. * @property {string} schemeIdUri
  728. * Identifies the message scheme.
  729. * @property {string} value
  730. * Specifies the value for the event.
  731. * @property {number} startTime
  732. * The time that the event starts (in presentation time).
  733. * @property {number} endTime
  734. * The time that the event ends (in presentation time).
  735. * @property {number} timescale
  736. * Provides the timescale, in ticks per second.
  737. * @property {number} presentationTimeDelta
  738. * The offset that the event starts, relative to the start of the segment
  739. * this is contained in (in units of timescale).
  740. * @property {number} eventDuration
  741. * The duration of the event (in units of timescale).
  742. * @property {number} id
  743. * A field identifying this instance of the message.
  744. * @property {Uint8Array} messageData
  745. * Body of the message.
  746. * @exportDoc
  747. */
  748. shaka.extern.EmsgInfo;
  749. /**
  750. * @typedef {{
  751. * wallClockTime: number,
  752. * programStartDate: Date
  753. * }}
  754. *
  755. * @description
  756. * Contains information about an PRFT MP4 box.
  757. *
  758. * @property {number} wallClockTime
  759. * A UTC timestamp corresponding to decoding time in milliseconds.
  760. * @property {Date} programStartDate
  761. * The derived start date of the program.
  762. * @exportDoc
  763. */
  764. shaka.extern.ProducerReferenceTime;
  765. /**
  766. * @typedef {{
  767. * distinctiveIdentifierRequired: boolean,
  768. * persistentStateRequired: boolean,
  769. * videoRobustness: string,
  770. * audioRobustness: string,
  771. * serverCertificate: Uint8Array,
  772. * serverCertificateUri: string,
  773. * individualizationServer: string,
  774. * sessionType: string,
  775. * headers: !Object.<string, string>
  776. * }}
  777. *
  778. * @property {boolean} distinctiveIdentifierRequired
  779. * True if the application requires the key system to support distinctive
  780. * identifiers.
  781. * <br>
  782. * Defaults to <code>false</code>.
  783. * @property {boolean} persistentStateRequired
  784. * True if the application requires the key system to support persistent
  785. * state, e.g., for persistent license storage.
  786. * <br>
  787. * Defaults to <code>false</code>.
  788. * @property {string} videoRobustness
  789. * A key-system-specific string that specifies a required security level for
  790. * video.
  791. * <br>
  792. * Defaults to <code>''</code>, i.e., no specific robustness required.
  793. * @property {string} audioRobustness
  794. * A key-system-specific string that specifies a required security level for
  795. * audio.
  796. * <br>
  797. * Defaults to <code>''</code>, i.e., no specific robustness required.
  798. * @property {Uint8Array} serverCertificate
  799. * <i>An empty certificate (<code>byteLength==0</code>) will be treated as
  800. * <code>null</code>.</i> <br>
  801. * <i>A certificate will be requested from the license server if
  802. * required.</i> <br>
  803. * A key-system-specific server certificate used to encrypt license requests.
  804. * Its use is optional and is meant as an optimization to avoid a round-trip
  805. * to request a certificate.
  806. * <br>
  807. * Defaults to <code>null</code>.
  808. * @property {string} serverCertificateUri
  809. * If given, will make a request to the given URI to get the server
  810. * certificate. This is ignored if <code>serverCertificate</code> is set.
  811. * <br>
  812. * Defaults to <code>''</code>.
  813. * @property {string} individualizationServer
  814. * The server that handles an <code>'individualiation-request'</code>. If the
  815. * server isn't given, it will default to the license server.
  816. * <br>
  817. * Defaults to <code>''</code>.
  818. * @property {string} sessionType
  819. * The MediaKey session type to create streaming licenses with. This doesn't
  820. * affect offline storage.
  821. * <br>
  822. * Defaults to <code>'temporary'</code>.
  823. * @property {!Object.<string, string>} headers
  824. * The headers to use in the license request.
  825. * <br>
  826. * Defaults to <code>{}</code>.
  827. *
  828. * @exportDoc
  829. */
  830. shaka.extern.AdvancedDrmConfiguration;
  831. /**
  832. * @typedef {{
  833. * sessionId: string,
  834. * sessionType: string,
  835. * initData: ?Uint8Array,
  836. * initDataType: ?string
  837. * }}
  838. *
  839. * @description
  840. * DRM Session Metadata for an active session
  841. *
  842. * @property {string} sessionId
  843. * Session id
  844. * @property {string} sessionType
  845. * Session type
  846. * @property {?Uint8Array} initData
  847. * Initialization data in the format indicated by initDataType.
  848. * @property {string} initDataType
  849. * A string to indicate what format initData is in.
  850. * @exportDoc
  851. */
  852. shaka.extern.DrmSessionMetadata;
  853. /**
  854. * @typedef {{
  855. * sessionId: string,
  856. * initData: ?Uint8Array,
  857. * initDataType: ?string
  858. * }}
  859. *
  860. * @description
  861. * DRM Session Metadata for saved persistent session
  862. *
  863. * @property {string} sessionId
  864. * Session id
  865. * @property {?Uint8Array} initData
  866. * Initialization data in the format indicated by initDataType.
  867. * @property {?string} initDataType
  868. * A string to indicate what format initData is in.
  869. * @exportDoc
  870. */
  871. shaka.extern.PersistentSessionMetadata;
  872. /**
  873. * @typedef {{
  874. * retryParameters: shaka.extern.RetryParameters,
  875. * servers: !Object.<string, string>,
  876. * clearKeys: !Object.<string, string>,
  877. * delayLicenseRequestUntilPlayed: boolean,
  878. * persistentSessionOnlinePlayback: boolean,
  879. * persistentSessionsMetadata:
  880. * !Array.<shaka.extern.PersistentSessionMetadata>,
  881. * advanced: Object.<string, shaka.extern.AdvancedDrmConfiguration>,
  882. * initDataTransform:(shaka.extern.InitDataTransform|undefined),
  883. * logLicenseExchange: boolean,
  884. * updateExpirationTime: number,
  885. * preferredKeySystems: !Array.<string>,
  886. * keySystemsMapping: !Object.<string, string>,
  887. * parseInbandPsshEnabled: boolean,
  888. * minHdcpVersion: string,
  889. * ignoreDuplicateInitData: boolean
  890. * }}
  891. *
  892. * @property {shaka.extern.RetryParameters} retryParameters
  893. * Retry parameters for license requests.
  894. * @property {!Object.<string, string>} servers
  895. * <i>Required for all but the clear key CDM.</i> <br>
  896. * A dictionary which maps key system IDs to their license servers.
  897. * For example,
  898. * <code>{'com.widevine.alpha': 'https://example.com/drm'}</code>.
  899. * <br>
  900. * Defaults to <code>{}</code>.
  901. * @property {!Object.<string, string>} clearKeys
  902. * <i>Forces the use of the Clear Key CDM.</i>
  903. * A map of key IDs (hex or base64) to keys (hex or base64).
  904. * <br>
  905. * Defaults to <code>{}</code>.
  906. * @property {boolean} delayLicenseRequestUntilPlayed
  907. * True to configure drm to delay sending a license request until a user
  908. * actually starts playing content.
  909. * <br>
  910. * Defaults to <code>false</code>.
  911. * @property {boolean} persistentSessionOnlinePlayback
  912. * True to configure drm to try playback with given persistent session ids
  913. * before requesting a license. Also prevents the session removal at playback
  914. * stop, as-to be able to re-use it later.
  915. * <br>
  916. * Defaults to <code>false</code>.
  917. * @property {!Array.<PersistentSessionMetadata>} persistentSessionsMetadata
  918. * Persistent sessions metadata to load before starting playback.
  919. * <br>
  920. * Defaults to <code>[]</code>.
  921. * @property {Object.<string, shaka.extern.AdvancedDrmConfiguration>} advanced
  922. * <i>Optional.</i> <br>
  923. * A dictionary which maps key system IDs to advanced DRM configuration for
  924. * those key systems.
  925. * <br>
  926. * Defaults to <code>[]</code>.
  927. * @property {shaka.extern.InitDataTransform|undefined} initDataTransform
  928. * <i>Optional.</i><br>
  929. * If given, this function is called with the init data from the
  930. * manifest/media and should return the (possibly transformed) init data to
  931. * pass to the browser.
  932. * @property {boolean} logLicenseExchange
  933. * <i>Optional.</i><br>
  934. * If set to <code>true</code>, prints logs containing the license exchange.
  935. * This includes the init data, request, and response data, printed as base64
  936. * strings. Don't use in production, for debugging only; has no affect in
  937. * release builds as logging is removed.
  938. * <br>
  939. * Defaults to <code>false</code>.
  940. * @property {number} updateExpirationTime
  941. * The frequency in seconds with which to check the expiration of a session.
  942. * <br>
  943. * Defaults to <code>1</code>.
  944. * @property {!Array.<string>} preferredKeySystems
  945. * Specifies the priorties of available DRM key systems.
  946. * <br>
  947. * Defaults <code>['com.microsoft.playready']</code> on Xbox One and
  948. * PlayStation 4, and <code>[]</code> for all other browsers.
  949. * @property {Object.<string, string>} keySystemsMapping
  950. * A map of key system name to key system name.
  951. * <br>
  952. * Defaults to <code>{}</code>.
  953. * @property {boolean} parseInbandPsshEnabled
  954. * When true parse DRM init data from pssh boxes in media and init segments
  955. * and ignore 'encrypted' events.
  956. * This is required when using in-band key rotation on Xbox One.
  957. * <br>
  958. * Defaults to <code>true</code> on Xbox One, and <code>false</code> for all
  959. * other browsers.
  960. * @property {string} minHdcpVersion
  961. * Indicates the minimum version of HDCP to start the playback of encrypted
  962. * streams. <b>May be ignored if not supported by the device.</b>
  963. * <br>
  964. * Defaults to <code>''</code>, do not check the HDCP version.
  965. * @property {boolean} ignoreDuplicateInitData
  966. * When true indicate that the player doesn't ignore duplicate init data.
  967. * Note: Tizen 2015 and 2016 models will send multiple webkitneedkey events
  968. * with the same init data. If the duplicates are supressed, playback
  969. * will stall without errors.
  970. * <br>
  971. * Defaults to <code>false</code> on Tizen 2, and <code>true</code> for all
  972. * other browsers.
  973. * @exportDoc
  974. */
  975. shaka.extern.DrmConfiguration;
  976. /**
  977. * @typedef {function(!Uint8Array, string, ?shaka.extern.DrmInfo):!Uint8Array}
  978. *
  979. * @description
  980. * A callback function to handle custom content ID signaling for FairPlay
  981. * content.
  982. *
  983. * @exportDoc
  984. */
  985. shaka.extern.InitDataTransform;
  986. /**
  987. * @typedef {{
  988. * tagName: !string,
  989. * attributes: !Object<string, string>,
  990. * children: !Array.<shaka.extern.xml.Node | string>,
  991. * parent: ?shaka.extern.xml.Node
  992. * }}
  993. *
  994. * @description
  995. * Data structure for xml nodes as simple objects
  996. *
  997. * @property {!string} tagName
  998. * The name of the element
  999. * @property {!object} attributes
  1000. * The attributes of the element
  1001. * @property {!Array.<shaka.extern.xml.Node | string>} children
  1002. * The child nodes or string body of the element
  1003. * @property {?shaka.extern.xml.Node} parent
  1004. * The parent of the current element
  1005. *
  1006. * @exportDoc
  1007. */
  1008. shaka.extern.xml.Node;
  1009. /**
  1010. * @typedef {{
  1011. * clockSyncUri: string,
  1012. * ignoreDrmInfo: boolean,
  1013. * disableXlinkProcessing: boolean,
  1014. * xlinkFailGracefully: boolean,
  1015. * ignoreMinBufferTime: boolean,
  1016. * autoCorrectDrift: boolean,
  1017. * initialSegmentLimit: number,
  1018. * ignoreSuggestedPresentationDelay: boolean,
  1019. * ignoreEmptyAdaptationSet: boolean,
  1020. * ignoreMaxSegmentDuration: boolean,
  1021. * keySystemsByURI: !Object.<string, string>,
  1022. * manifestPreprocessor: function(!Element),
  1023. * manifestPreprocessorTXml: function(!shaka.extern.xml.Node),
  1024. * sequenceMode: boolean,
  1025. * enableAudioGroups: boolean,
  1026. * multiTypeVariantsAllowed: boolean,
  1027. * useStreamOnceInPeriodFlattening: boolean,
  1028. * updatePeriod: number,
  1029. * enableFastSwitching: boolean
  1030. * }}
  1031. *
  1032. * @property {string} clockSyncUri
  1033. * A default clock sync URI to be used with live streams which do not
  1034. * contain any clock sync information. The <code>Date</code> header from this
  1035. * URI will be used to determine the current time.
  1036. * <br>
  1037. * Defaults to <code>''</code>.
  1038. * @property {boolean} ignoreDrmInfo
  1039. * If true will cause DASH parser to ignore DRM information specified
  1040. * by the manifest and treat it as if it signaled no particular key
  1041. * system and contained no init data.
  1042. * <br>
  1043. * Defaults to <code>false</code>.
  1044. * @property {boolean} disableXlinkProcessing
  1045. * If true, xlink-related processing will be disabled.
  1046. * <br>
  1047. * Defaults to <code>false</code>.
  1048. * @property {boolean} xlinkFailGracefully
  1049. * If true, xlink-related errors will result in a fallback to the tag's
  1050. * existing contents. If false, xlink-related errors will be propagated
  1051. * to the application and will result in a playback failure.
  1052. * <br>
  1053. * Defaults to <code>false</code>.
  1054. * @property {boolean} ignoreMinBufferTime
  1055. * If true will cause DASH parser to ignore <code>minBufferTime</code> from
  1056. * manifest. It allows player config to take precedence over manifest for
  1057. * <code>rebufferingGoal</code>.
  1058. * <br>
  1059. * Defaults to <code>false</code>.
  1060. * @property {boolean} autoCorrectDrift
  1061. * If <code>true</code>, ignore the <code>availabilityStartTime</code> in the
  1062. * manifest and instead use the segments to determine the live edge. This
  1063. * allows us to play streams that have a lot of drift. If <code>false</code>,
  1064. * we can't play content where the manifest specifies segments in the future.
  1065. * <br>
  1066. * Defaults to <code>true</code>.
  1067. * @property {number} initialSegmentLimit
  1068. * The maximum number of initial segments to generate for
  1069. * <code>SegmentTemplate</code> with fixed-duration segments. This is limited
  1070. * to avoid excessive memory consumption with very large
  1071. * <code>timeShiftBufferDepth</code> values.
  1072. * <br>
  1073. * Defaults to <code>1000</code>.
  1074. * @property {boolean} ignoreSuggestedPresentationDelay
  1075. * If true will cause DASH parser to ignore
  1076. * <code>suggestedPresentationDelay</code> from manifest.
  1077. * <br>
  1078. * Defaults to <code>false</code>.
  1079. * @property {boolean} ignoreEmptyAdaptationSet
  1080. * If true will cause DASH parser to ignore
  1081. * empty <code>AdaptationSet</code> from manifest.
  1082. * <br>
  1083. * Defaults to <code>false</code>.
  1084. * @property {boolean} ignoreMaxSegmentDuration
  1085. * If true will cause DASH parser to ignore
  1086. * <code>maxSegmentDuration</code> from manifest.
  1087. * <br>
  1088. * Defaults to <code>false</code>.
  1089. * @property {Object.<string, string>} keySystemsByURI
  1090. * A map of scheme URI to key system name. Defaults to default key systems
  1091. * mapping handled by Shaka.
  1092. * @property {function(!Element)} manifestPreprocessor
  1093. * <b>DEPRECATED</b>: Use manifestPreprocessorTXml instead.
  1094. * Called immediately after the DASH manifest has been parsed into an
  1095. * XMLDocument. Provides a way for applications to perform efficient
  1096. * preprocessing of the manifest.
  1097. * @property {function(!shaka.extern.xml.Node)} manifestPreprocessorTXml
  1098. * Called immediately after the DASH manifest has been parsed into an
  1099. * XMLDocument. Provides a way for applications to perform efficient
  1100. * preprocessing of the manifest.
  1101. * @property {boolean} sequenceMode
  1102. * If true, the media segments are appended to the SourceBuffer in
  1103. * "sequence mode" (ignoring their internal timestamps).
  1104. * <br>
  1105. * Defaults to <code>false</code>.
  1106. * @property {boolean} enableAudioGroups
  1107. * If set, audio streams will be grouped and filtered by their parent
  1108. * adaptation set ID.
  1109. * <br>
  1110. * Defaults to <code>false</code>.
  1111. * @property {boolean} multiTypeVariantsAllowed
  1112. * If true, the manifest parser will create variants that have multiple
  1113. * mimeTypes or codecs for video or for audio if there is no other choice.
  1114. * Meant for content where some periods are only available in one mimeType or
  1115. * codec, and other periods are only available in a different mimeType or
  1116. * codec. For example, a stream with baked-in ads where the audio codec does
  1117. * not match the main content.
  1118. * Might result in undesirable behavior if mediaSource.codecSwitchingStrategy
  1119. * is not set to SMOOTH.
  1120. * <br>
  1121. * Defaults to true if SMOOTH codec switching is supported, RELOAD overwise.
  1122. * @property {boolean} useStreamOnceInPeriodFlattening
  1123. * If period combiner is used, this option ensures every stream is used
  1124. * only once in period flattening. It speeds up underlying algorithm
  1125. * but may raise issues if manifest does not have stream consistency
  1126. * between periods.
  1127. * <br>
  1128. * Defaults to <code>false</code>.
  1129. * @property {number} updatePeriod
  1130. * Override the minimumUpdatePeriod of the manifest. The value is in second
  1131. * if the value is greater than the minimumUpdatePeriod, it will update the
  1132. * manifest less frequently. if you update the value during for a dynamic
  1133. * manifest, it will directly trigger a new download of the manifest
  1134. * <br>
  1135. * Defaults to <code>-1</code>.
  1136. * @property {boolean} enableFastSwitching
  1137. * If false, disables fast switching track recognition.
  1138. * <br>
  1139. * Defaults to <code>true</code>.
  1140. * @exportDoc
  1141. */
  1142. shaka.extern.DashManifestConfiguration;
  1143. /**
  1144. * @typedef {{
  1145. * ignoreTextStreamFailures: boolean,
  1146. * ignoreImageStreamFailures: boolean,
  1147. * defaultAudioCodec: string,
  1148. * defaultVideoCodec: string,
  1149. * ignoreManifestProgramDateTime: boolean,
  1150. * ignoreManifestProgramDateTimeForTypes: !Array<string>,
  1151. * mediaPlaylistFullMimeType: string,
  1152. * liveSegmentsDelay: number,
  1153. * sequenceMode: boolean,
  1154. * ignoreManifestTimestampsInSegmentsMode: boolean,
  1155. * disableCodecGuessing: boolean,
  1156. * disableClosedCaptionsDetection: boolean,
  1157. * allowLowLatencyByteRangeOptimization: boolean
  1158. * }}
  1159. *
  1160. * @property {boolean} ignoreTextStreamFailures
  1161. * If <code>true</code>, ignore any errors in a text stream and filter out
  1162. * those streams.
  1163. * <br>
  1164. * Defaults to <code>false</code>.
  1165. * @property {boolean} ignoreImageStreamFailures
  1166. * If <code>true</code>, ignore any errors in a image stream and filter out
  1167. * those streams.
  1168. * <br>
  1169. * Defaults to <code>false</code>.
  1170. * @property {string} defaultAudioCodec
  1171. * The default audio codec if it is not specified in the HLS playlist.
  1172. * <br>
  1173. * Defaults to <code>'mp4a.40.2'</code>.
  1174. * @property {string} defaultVideoCodec
  1175. * The default video codec if it is not specified in the HLS playlist.
  1176. * <br>
  1177. * Defaults to <code>'avc1.42E01E'</code>.
  1178. * @property {boolean} ignoreManifestProgramDateTime
  1179. * If <code>true</code>, the HLS parser will ignore the
  1180. * <code>EXT-X-PROGRAM-DATE-TIME</code> tags in the manifest and use media
  1181. * sequence numbers instead. It also causes EXT-X-DATERANGE tags to be
  1182. * ignored. Meant for streams where <code>EXT-X-PROGRAM-DATE-TIME</code> is
  1183. * incorrect or malformed.
  1184. * <br>
  1185. * Defaults to <code>false</code>.
  1186. * @property {!Array.<string>} ignoreManifestProgramDateTimeForTypes
  1187. * An array of strings representing types for which
  1188. * <code>EXT-X-PROGRAM-DATE-TIME</code> should be ignored. Only used if the
  1189. * the main ignoreManifestProgramDateTime is set to false.
  1190. * For example, setting this to ['text', 'video'] will cause the PDT values
  1191. * text and video streams to be ignored, while still using the PDT values for
  1192. * audio.
  1193. * <br>
  1194. * Defaults to <code>[]</code>.
  1195. * @property {string} mediaPlaylistFullMimeType
  1196. * A string containing a full mime type, including both the basic mime type
  1197. * and also the codecs. Used when the HLS parser parses a media playlist
  1198. * directly, required since all of the mime type and codecs information is
  1199. * contained within the master playlist.
  1200. * You can use the <code>shaka.util.MimeUtils.getFullType()</code> utility to
  1201. * format this value.
  1202. * <br>
  1203. * Defaults to <code>'video/mp2t; codecs="avc1.42E01E, mp4a.40.2"'</code>.
  1204. * @property {number} liveSegmentsDelay
  1205. * The default presentation delay will be calculated as a number of segments.
  1206. * This is the number of segments for this calculation.
  1207. * <br>
  1208. * Defaults to <code>3</code>.
  1209. * @property {boolean} sequenceMode
  1210. * If true, the media segments are appended to the SourceBuffer in
  1211. * "sequence mode" (ignoring their internal timestamps).
  1212. * <br>
  1213. * Defaults to <code>true</code> except on WebOS 3, Tizen 2,
  1214. * Tizen 3 and PlayStation 4 whose default value is <code>false</code>.
  1215. * @property {boolean} ignoreManifestTimestampsInSegmentsMode
  1216. * If true, don't adjust the timestamp offset to account for manifest
  1217. * segment durations being out of sync with segment durations. In other
  1218. * words, assume that there are no gaps in the segments when appending
  1219. * to the SourceBuffer, even if the manifest and segment times disagree.
  1220. * Only applies when sequenceMode is <code>false</code>.
  1221. * <br>
  1222. * Defaults to <code>false</code>.
  1223. * @property {boolean} disableCodecGuessing
  1224. * If set to true, the HLS parser won't automatically guess or assume default
  1225. * codec for playlists with no "CODECS" attribute. Instead, it will attempt to
  1226. * extract the missing information from the media segment.
  1227. * As a consequence, lazy-loading media playlists won't be possible for this
  1228. * use case, which may result in longer video startup times.
  1229. * <br>
  1230. * Defaults to <code>false</code>.
  1231. * @property {boolean} disableClosedCaptionsDetection
  1232. * If true, disables the automatic detection of closed captions.
  1233. * Otherwise, in the absence of a EXT-X-MEDIA tag with TYPE="CLOSED-CAPTIONS",
  1234. * Shaka Player will attempt to detect captions based on the media data.
  1235. * <br>
  1236. * Defaults to <code>false</code>.
  1237. * @property {boolean} allowLowLatencyByteRangeOptimization
  1238. * If set to true, the HLS parser will optimize operation with LL and partial
  1239. * byte range segments. More info in
  1240. * https://www.akamai.com/blog/performance/-using-ll-hls-with-byte-range-addressing-to-achieve-interoperabi
  1241. * <br>
  1242. * Defaults to <code>true</code>.
  1243. * @exportDoc
  1244. */
  1245. shaka.extern.HlsManifestConfiguration;
  1246. /**
  1247. * @typedef {{
  1248. * manifestPreprocessor: function(!Element),
  1249. * manifestPreprocessorTXml: function(!shaka.extern.xml.Node),
  1250. * sequenceMode: boolean,
  1251. * keySystemsBySystemId: !Object.<string, string>
  1252. * }}
  1253. *
  1254. * @property {function(!Element)} manifestPreprocessor
  1255. * <b>DEPRECATED</b>: Use manifestPreprocessorTXml instead.
  1256. * Called immediately after the MSS manifest has been parsed into an
  1257. * XMLDocument. Provides a way for applications to perform efficient
  1258. * preprocessing of the manifest.
  1259. * @property {function(!shaka.extern.xml.Node)} manifestPreprocessorTXml
  1260. * Called immediately after the MSS manifest has been parsed into an
  1261. * XMLDocument. Provides a way for applications to perform efficient
  1262. * preprocessing of the manifest.
  1263. * @property {boolean} sequenceMode
  1264. * If true, the media segments are appended to the SourceBuffer in
  1265. * "sequence mode" (ignoring their internal timestamps).
  1266. * <br>
  1267. * Defaults to <code>false</code>.
  1268. * @property {Object.<string, string>} keySystemsBySystemId
  1269. * A map of system id to key system name. Defaults to default key systems
  1270. * mapping handled by Shaka.
  1271. * @exportDoc
  1272. */
  1273. shaka.extern.MssManifestConfiguration;
  1274. /**
  1275. * @typedef {{
  1276. * retryParameters: shaka.extern.RetryParameters,
  1277. * availabilityWindowOverride: number,
  1278. * disableAudio: boolean,
  1279. * disableVideo: boolean,
  1280. * disableText: boolean,
  1281. * disableThumbnails: boolean,
  1282. * defaultPresentationDelay: number,
  1283. * segmentRelativeVttTiming: boolean,
  1284. * dash: shaka.extern.DashManifestConfiguration,
  1285. * hls: shaka.extern.HlsManifestConfiguration,
  1286. * mss: shaka.extern.MssManifestConfiguration,
  1287. * raiseFatalErrorOnManifestUpdateRequestFailure: boolean,
  1288. * continueLoadingWhenPaused: boolean
  1289. * }}
  1290. *
  1291. * @property {shaka.extern.RetryParameters} retryParameters
  1292. * Retry parameters for manifest requests.
  1293. * @property {number} availabilityWindowOverride
  1294. * A number, in seconds, that overrides the availability window in the
  1295. * manifest, or <code>NaN</code> if the default value should be used. This is
  1296. * enforced by the manifest parser, so custom manifest parsers should take
  1297. * care to honor this parameter.
  1298. * <br>
  1299. * Defaults to <code>NaN</code>.
  1300. * @property {boolean} disableAudio
  1301. * If <code>true</code>, the audio tracks are ignored.
  1302. * <br>
  1303. * Defaults to <code>false</code>.
  1304. * @property {boolean} disableVideo
  1305. * If <code>true</code>, the video tracks are ignored.
  1306. * <br>
  1307. * Defaults to <code>false</code>.
  1308. * @property {boolean} disableText
  1309. * If <code>true</code>, the text tracks are ignored.
  1310. * <br>
  1311. * Defaults to <code>false</code>.
  1312. * @property {boolean} disableThumbnails
  1313. * If <code>true</code>, the image tracks are ignored.
  1314. * <br>
  1315. * Defaults to <code>false</code>.
  1316. * @property {number} defaultPresentationDelay
  1317. * For DASH, it's a default <code>presentationDelay</code> value if
  1318. * <code>suggestedPresentationDelay</code> is missing in the MPEG DASH
  1319. * manifest. The default value is <code>1.5 * minBufferTime</code> if not
  1320. * configured or set as 0.
  1321. * For HLS, the default value is 3 segments duration if not configured or
  1322. * set as 0.
  1323. * <br>
  1324. * Defaults to <code>0</code>.
  1325. * @property {boolean} segmentRelativeVttTiming
  1326. * Option to calculate VTT text timings relative to the segment start
  1327. * instead of relative to the period start (which is the default).
  1328. * <br>
  1329. * Defaults to <code>false</code>.
  1330. * @property {shaka.extern.DashManifestConfiguration} dash
  1331. * Advanced parameters used by the DASH manifest parser.
  1332. * @property {shaka.extern.HlsManifestConfiguration} hls
  1333. * Advanced parameters used by the HLS manifest parser.
  1334. * @property {shaka.extern.MssManifestConfiguration} mss
  1335. * Advanced parameters used by the MSS manifest parser.
  1336. * @property {boolean} raiseFatalErrorOnManifestUpdateRequestFailure
  1337. * If true, manifest update request failures will cause a fatal error.
  1338. * <br>
  1339. * Defaults to <code>false</code>.
  1340. * @property {boolean} continueLoadingWhenPaused
  1341. * If true, live manifest will be updated with the regular intervals even if
  1342. * the video is paused.
  1343. * <br>
  1344. * Defaults to <code>true</code>.
  1345. * @exportDoc
  1346. */
  1347. shaka.extern.ManifestConfiguration;
  1348. /**
  1349. * @typedef {{
  1350. * enabled: boolean,
  1351. * stabilityThreshold: number,
  1352. * rebufferIncrement: number,
  1353. * maxAttempts: number,
  1354. * maxLatency: number,
  1355. * minLatency: number
  1356. * }}
  1357. *
  1358. * @description
  1359. * Dynamic Target Latency configuration options.
  1360. *
  1361. * @property {boolean} enabled
  1362. * If <code>true</code>, dynamic latency for live sync is enabled. When
  1363. * enabled, the target latency will be adjusted closer to the min latency
  1364. * when playback is stable (see <code>stabilityThreshold</code>). If
  1365. * there are rebuffering events, then the target latency will move towards
  1366. * the max latency value in increments of <code>rebufferIncrement</code>.
  1367. * <br>
  1368. * Defaults to <code>false</code>
  1369. * @property {number} rebufferIncrement
  1370. * The value, in seconds, to increment the target latency towards
  1371. * <code>maxLatency</code> after a rebuffering event.
  1372. * <br>
  1373. * Defaults to <code>0.5</code>
  1374. * @property {number} stabilityThreshold
  1375. * Number of seconds after a rebuffering before we are considered stable and
  1376. * will move the target latency towards <code>minLatency</code>
  1377. * value.
  1378. * <br>
  1379. * Defaults to <code>60</code>.
  1380. * @property {number} maxAttempts
  1381. * Number of times that dynamic target latency will back off to
  1382. * <code>maxLatency</code> and attempt to adjust it closer to
  1383. * <code>minLatency</code>.
  1384. * <br>
  1385. * Defaults to <code>10</code>.
  1386. * @property {number} maxLatency
  1387. * The latency to use when a rebuffering event causes us to back off from
  1388. * the live edge.
  1389. * <br>
  1390. * Defaults to <code>4</code>.
  1391. * @property {number} minLatency
  1392. * The latency to work towards when the network is stable and we want to get
  1393. * closer to the live edge.
  1394. * <br>
  1395. * Defaults to <code>1</code>.
  1396. * @exportDoc
  1397. */
  1398. shaka.extern.DynamicTargetLatencyConfiguration;
  1399. /**
  1400. * @typedef {{
  1401. * enabled: boolean,
  1402. * targetLatency: number,
  1403. * targetLatencyTolerance: number,
  1404. * maxPlaybackRate: number,
  1405. * minPlaybackRate: number,
  1406. * panicMode: boolean,
  1407. * panicThreshold: number,
  1408. * dynamicTargetLatency: shaka.extern.DynamicTargetLatencyConfiguration
  1409. * }}
  1410. *
  1411. * @description
  1412. * LiveSync configuration options.
  1413. *
  1414. * @property {boolean} enabled
  1415. * Enable the live stream sync against the live edge by changing the playback
  1416. * rate.
  1417. * Note: on some SmartTVs, if this is activated, it may not work or the sound
  1418. * may be lost when activated.
  1419. * <br>
  1420. * Defaults to <code>false</code>.
  1421. * @property {number} targetLatency
  1422. * Preferred latency, in seconds. Effective only if liveSync is true.
  1423. * <br>
  1424. * Defaults to <code>0.5</code>.
  1425. * @property {number} targetLatencyTolerance
  1426. * Latency tolerance for target latency, in seconds. Effective only if
  1427. * liveSync is enabled.
  1428. * <br>
  1429. * Defaults to <code>0.5</code>.
  1430. * @property {number} maxPlaybackRate
  1431. * Max playback rate used for latency chasing. It is recommended to use a
  1432. * value between 1 and 2. Effective only if liveSync is enabled.
  1433. * <br>
  1434. * Defaults to <code>1.1</code>.
  1435. * @property {number} minPlaybackRate
  1436. * Minimum playback rate used for latency chasing. It is recommended to use a
  1437. * value between 0 and 1. Effective only if liveSync is enabled.
  1438. * <br>
  1439. * Defaults to <code>0.95</code>.
  1440. * @property {boolean} panicMode
  1441. * If <code>true</code>, panic mode for live sync is enabled. When enabled,
  1442. * will set the playback rate to the <code>minPlaybackRate</code>
  1443. * until playback has continued past a rebuffering for longer than the
  1444. * <code>panicThreshold</code>.
  1445. * <br>
  1446. * Defaults to <code>false</code>.
  1447. * @property {number} panicThreshold
  1448. * Number of seconds that playback stays in panic mode after a rebuffering.
  1449. * <br>
  1450. * Defaults to <code>60</code>.
  1451. * @property {shaka.extern.DynamicTargetLatencyConfiguration}
  1452. * dynamicTargetLatency
  1453. *
  1454. * The dynamic target latency config for dynamically adjusting the target
  1455. * latency to be closer to edge when network conditions are good and to back
  1456. * off when network conditions are bad.
  1457. * @exportDoc
  1458. */
  1459. shaka.extern.LiveSyncConfiguration;
  1460. /**
  1461. * @typedef {{
  1462. * retryParameters: shaka.extern.RetryParameters,
  1463. * failureCallback: function(!shaka.util.Error),
  1464. * rebufferingGoal: number,
  1465. * bufferingGoal: number,
  1466. * bufferBehind: number,
  1467. * evictionGoal: number,
  1468. * ignoreTextStreamFailures: boolean,
  1469. * alwaysStreamText: boolean,
  1470. * startAtSegmentBoundary: boolean,
  1471. * gapDetectionThreshold: number,
  1472. * gapJumpTimerTime: number,
  1473. * durationBackoff: number,
  1474. * safeSeekOffset: number,
  1475. * stallEnabled: boolean,
  1476. * stallThreshold: number,
  1477. * stallSkip: number,
  1478. * useNativeHlsForFairPlay: boolean,
  1479. * inaccurateManifestTolerance: number,
  1480. * lowLatencyMode: boolean,
  1481. * autoLowLatencyMode: boolean,
  1482. * forceHTTP: boolean,
  1483. * forceHTTPS: boolean,
  1484. * minBytesForProgressEvents: number,
  1485. * preferNativeHls: boolean,
  1486. * updateIntervalSeconds: number,
  1487. * dispatchAllEmsgBoxes: boolean,
  1488. * observeQualityChanges: boolean,
  1489. * maxDisabledTime: number,
  1490. * parsePrftBox: boolean,
  1491. * segmentPrefetchLimit: number,
  1492. * prefetchAudioLanguages: !Array<string>,
  1493. * disableAudioPrefetch: boolean,
  1494. * disableTextPrefetch: boolean,
  1495. * disableVideoPrefetch: boolean,
  1496. * liveSync: shaka.extern.LiveSyncConfiguration,
  1497. * allowMediaSourceRecoveries: boolean,
  1498. * minTimeBetweenRecoveries: number,
  1499. * vodDynamicPlaybackRate: boolean,
  1500. * vodDynamicPlaybackRateLowBufferRate: number,
  1501. * vodDynamicPlaybackRateBufferRatio: number,
  1502. * infiniteLiveStreamDuration: boolean,
  1503. * preloadNextUrlWindow: number,
  1504. * loadTimeout: number,
  1505. * clearDecodingCache: boolean,
  1506. * dontChooseCodecs: boolean,
  1507. * shouldFixTimestampOffset: boolean
  1508. * }}
  1509. *
  1510. * @description
  1511. * The StreamingEngine's configuration options.
  1512. *
  1513. * @property {shaka.extern.RetryParameters} retryParameters
  1514. * Retry parameters for segment requests.
  1515. * @property {function(!shaka.util.Error)} failureCallback
  1516. * A callback to decide what to do on a streaming failure. Default behavior
  1517. * is to retry on live streams and not on VOD.
  1518. * @property {number} rebufferingGoal
  1519. * The minimum number of seconds of content that the StreamingEngine must
  1520. * buffer before it can begin playback or can continue playback after it has
  1521. * entered into a buffering state (i.e., after it has depleted one more
  1522. * more of its buffers).
  1523. * <br>
  1524. * Defaults to <code>2</code>.
  1525. * @property {number} bufferingGoal
  1526. * The number of seconds of content that the StreamingEngine will attempt to
  1527. * buffer ahead of the playhead. This value must be greater than or equal to
  1528. * the rebuffering goal.
  1529. * <br>
  1530. * Defaults to <code>10</code>.
  1531. * @property {number} bufferBehind
  1532. * The maximum number of seconds of content that the StreamingEngine will keep
  1533. * in buffer behind the playhead when it appends a new media segment.
  1534. * The StreamingEngine will evict content to meet this limit.
  1535. * <br>
  1536. * Defaults to <code>30</code>.
  1537. * @property {number} evictionGoal
  1538. * The minimum duration in seconds of buffer overflow the StreamingEngine
  1539. * requires to start removing content from the buffer.
  1540. * Values less than <code>1.0</code> are not recommended.
  1541. * <br>
  1542. * Defaults to <code>1.0</code>.
  1543. * @property {boolean} ignoreTextStreamFailures
  1544. * If <code>true</code>, the player will ignore text stream failures and
  1545. * continue playing other streams.
  1546. * <br>
  1547. * Defaults to <code>false</code>.
  1548. * @property {boolean} alwaysStreamText
  1549. * If <code>true</code>, always stream text tracks, regardless of whether or
  1550. * not they are shown. This is necessary when using the browser's built-in
  1551. * controls, which are not capable of signaling display state changes back to
  1552. * Shaka Player.
  1553. * Defaults to <code>false</code>.
  1554. * @property {boolean} startAtSegmentBoundary
  1555. * If <code>true</code>, adjust the start time backwards so it is at the start
  1556. * of a segment. This affects both explicit start times and calculated start
  1557. * time for live streams. This can put us further from the live edge.
  1558. * <br>
  1559. * Defaults to <code>false</code>.
  1560. * @property {number} gapDetectionThreshold
  1561. * The maximum distance (in seconds) before a gap when we'll automatically
  1562. * jump.
  1563. * <br>
  1564. * Defaults to <code>0.5</code>.
  1565. * @property {number} gapJumpTimerTime
  1566. * The polling time in seconds to check for gaps in the media.
  1567. * <br>
  1568. * Defaults to <code>0.25</code>.
  1569. * @property {number} durationBackoff
  1570. * By default, we will not allow seeking to exactly the duration of a
  1571. * presentation. This field is the number of seconds before duration we will
  1572. * seek to when the user tries to seek to or start playback at the duration.
  1573. * To disable this behavior, the config can be set to 0. We recommend using
  1574. * the default value unless you have a good reason not to.
  1575. * <br>
  1576. * Defaults to <code>1</code>.
  1577. * @property {number} safeSeekOffset
  1578. * The amount of seconds that should be added when repositioning the playhead
  1579. * after falling out of the availability window or seek. This gives the player
  1580. * more time to buffer before falling outside again, but increases the forward
  1581. * jump in the stream skipping more content. This is helpful for lower
  1582. * bandwidth scenarios.
  1583. * <br>
  1584. * Defaults to <code>5</code>.
  1585. * @property {boolean} stallEnabled
  1586. * When set to <code>true</code>, the stall detector logic will run. If the
  1587. * playhead stops moving for <code>stallThreshold</code> seconds, the player
  1588. * will either seek or pause/play to resolve the stall, depending on the value
  1589. * of <code>stallSkip</code>.
  1590. * <br>
  1591. * Defaults to <code>true</code>.
  1592. * @property {number} stallThreshold
  1593. * The maximum number of seconds that may elapse without the playhead moving
  1594. * (when playback is expected) before it will be labeled as a stall.
  1595. * <br>
  1596. * Defaults to <code>1</code>.
  1597. * @property {number} stallSkip
  1598. * The number of seconds that the player will skip forward when a stall has
  1599. * been detected. If 0, the player will pause and immediately play instead of
  1600. * seeking. A value of 0 is recommended and provided as default on TV
  1601. * platforms (WebOS, Tizen, Chromecast, etc).
  1602. * <br>
  1603. * Defaults to <code>0.1</code> except on Tizen, WebOS, Chromecast,
  1604. * Hisense whose default value is <code>0</code>.
  1605. * @property {boolean} useNativeHlsForFairPlay
  1606. * Desktop Safari has both MediaSource and their native HLS implementation.
  1607. * Depending on the application's needs, it may prefer one over the other.
  1608. * Warning when disabled: Where single-key DRM streams work fine, multi-keys
  1609. * streams is showing unexpected behaviours (stall, audio playing with video
  1610. * freezes, ...). Use with care.
  1611. * <br>
  1612. * Defaults to <code>true</code>.
  1613. * @property {number} inaccurateManifestTolerance
  1614. * The maximum difference, in seconds, between the times in the manifest and
  1615. * the times in the segments. Larger values allow us to compensate for more
  1616. * drift (up to one segment duration). Smaller values reduce the incidence of
  1617. * extra segment requests necessary to compensate for drift.
  1618. * <br>
  1619. * Defaults to <code>2</code>.
  1620. * @property {boolean} lowLatencyMode
  1621. * If <code>true</code>, low latency streaming mode is enabled. If
  1622. * lowLatencyMode is set to true, it changes the default config values for
  1623. * other things, see: docs/tutorials/config.md
  1624. * <br>
  1625. * Defaults to <code>false</code>.
  1626. * @property {boolean} autoLowLatencyMode
  1627. * If the stream is low latency and the user has not configured the
  1628. * lowLatencyMode, but if it has been configured to activate the
  1629. * lowLatencyMode if a stream of this type is detected, we automatically
  1630. * activate the lowLatencyMode.
  1631. * <br>
  1632. * Defaults to <code>false</code>.
  1633. * @property {boolean} forceHTTP
  1634. * If true, if the protocol is HTTPs change it to HTTP.
  1635. * If both forceHTTP and forceHTTPS are set, forceHTTPS wins.
  1636. * <br>
  1637. * Defaults to <code>false</code>.
  1638. * @property {boolean} forceHTTPS
  1639. * If true, if the protocol is HTTP change it to HTTPs.
  1640. * If both forceHTTP and forceHTTPS are set, forceHTTPS wins.
  1641. * <br>
  1642. * Defaults to <code>false</code>.
  1643. * @property {number} minBytesForProgressEvents
  1644. * Defines minimum number of bytes that should be used to emit progress event,
  1645. * if possible. To avoid issues around feeding ABR with request history, this
  1646. * value should be greater than or equal to `abr.advanced.minBytes`.
  1647. * By default equals 16e3 (the same value as `abr.advanced.minBytes`).
  1648. * @property {boolean} preferNativeHls
  1649. * If true, prefer native HLS playback when possible, regardless of platform.
  1650. * <br>
  1651. * Defaults to <code>false</code>.
  1652. * @property {number} updateIntervalSeconds
  1653. * The minimum number of seconds to see if the manifest has changes.
  1654. * <br>
  1655. * Defaults to <code>1</code>.
  1656. * @property {boolean} dispatchAllEmsgBoxes
  1657. * If true, all emsg boxes are parsed and dispatched.
  1658. * <br>
  1659. * Defaults to <code>false</code>.
  1660. * @property {boolean} observeQualityChanges
  1661. * If true, monitor media quality changes and emit
  1662. * <code>shaka.Player.MediaQualityChangedEvent</code>.
  1663. * <br>
  1664. * Defaults to <code>false</code>.
  1665. * @property {number} maxDisabledTime
  1666. * The maximum time a variant can be disabled when NETWORK HTTP_ERROR
  1667. * is reached, in seconds.
  1668. * If all variants are disabled this way, NETWORK HTTP_ERROR will be thrown.
  1669. * <br>
  1670. * Defaults to <code>30</code>.
  1671. * @property {boolean} parsePrftBox
  1672. * If <code>true</code>, will raise a shaka.extern.ProducerReferenceTime
  1673. * player event (event name 'prft').
  1674. * The event will be raised only once per playback session as program
  1675. * start date will not change, and would save parsing the segment multiple
  1676. * times needlessly.
  1677. * <br>
  1678. * Defaults to <code>false</code>.
  1679. * @property {number} segmentPrefetchLimit
  1680. * The maximum number of segments for each active stream to be prefetched
  1681. * ahead of playhead in parallel.
  1682. * If <code>0</code>, the segments will be fetched sequentially.
  1683. * <br>
  1684. * Defaults to <code>0</code>.
  1685. * @property {!Array<string>} prefetchAudioLanguages
  1686. * The audio languages to prefetch.
  1687. * <br>
  1688. * Defaults to <code>[]</code>.
  1689. * @property {boolean} disableAudioPrefetch
  1690. * If set and prefetch limit is defined, it will prevent from prefetching data
  1691. * for audio.
  1692. * <br>
  1693. * Defaults to <code>false</code>.
  1694. * @property {boolean} disableTextPrefetch
  1695. * If set and prefetch limit is defined, it will prevent from prefetching data
  1696. * for text.
  1697. * <br>
  1698. * Defaults to <code>false</code>.
  1699. * @property {boolean} disableVideoPrefetch
  1700. * If set and prefetch limit is defined, it will prevent from prefetching data
  1701. * for video.
  1702. * <br>
  1703. * Defaults to <code>false</code>.
  1704. * @property {shaka.extern.LiveSyncConfiguration} liveSync
  1705. * The live sync configuration for keeping near the live edge.
  1706. * @property {boolean} allowMediaSourceRecoveries
  1707. * Indicate if we should recover from VIDEO_ERROR resetting Media Source.
  1708. * <br>
  1709. * Defaults to <code>true</code>.
  1710. * @property {number} minTimeBetweenRecoveries
  1711. * The minimum time between recoveries when VIDEO_ERROR is reached, in
  1712. * seconds.
  1713. * <br>
  1714. * Defaults to <code>5</code>.
  1715. * @property {boolean} vodDynamicPlaybackRate
  1716. * Adapt the playback rate of the player to keep the buffer full.
  1717. * <br>
  1718. * Defaults to <code>false</code>.
  1719. * @property {number} vodDynamicPlaybackRateLowBufferRate
  1720. * Playback rate to use if the buffer is too small.
  1721. * <br>
  1722. * Defaults to <code>0.95</code>.
  1723. * @property {number} vodDynamicPlaybackRateBufferRatio
  1724. * Ratio of the <code>bufferingGoal</code> as the low threshold for
  1725. * setting the playback rate to
  1726. * <code>vodDynamicPlaybackRateLowBufferRate</code>.
  1727. * <br>
  1728. * Defaults to <code>0.5</code>.
  1729. * @property {boolean} infiniteLiveStreamDuration
  1730. * If <code>true</code>, the media source live duration
  1731. * set as a<code>Infinity</code>
  1732. * <br>
  1733. * Defaults to <code>false</code>.
  1734. * @property {number} preloadNextUrlWindow
  1735. * The window of time at the end of the presentation to begin preloading the
  1736. * next URL, such as one specified by a urn:mpeg:dash:chaining:2016 element
  1737. * in DASH. Measured in seconds. If the value is 0, the next URL will not
  1738. * be preloaded at all.
  1739. * <br>
  1740. * Defaults to <code>30</code>.
  1741. * @property {number} loadTimeout
  1742. * The maximum timeout to reject the load when using src= in case the content
  1743. * does not work correctly. Measured in seconds.
  1744. * <br>
  1745. * Defaults to <code>30</code>.
  1746. * @property {boolean} clearDecodingCache
  1747. * Clears decodingInfo and MediaKeySystemAccess cache during player unload
  1748. * as these objects may become corrupt and cause issues during subsequent
  1749. * playbacks on some platforms.
  1750. * <br>
  1751. * Defaults to <code>true</code> on PlayStation devices and to
  1752. * <code>false</code> on other devices.
  1753. * @property {boolean} dontChooseCodecs
  1754. * If true, we don't choose codecs in the player, and keep all the variants.
  1755. * <br>
  1756. * Defaults to <code>false</code>.
  1757. * @property {boolean} shouldFixTimestampOffset
  1758. * If true, we will try to fix problems when the timestampOffset is less than
  1759. * the baseMediaDecodeTime. This only works when the manifest is DASH with
  1760. * MP4 segments.
  1761. * <br>
  1762. * Defaults to <code>false</code> except on Tizen, WebOS whose default value
  1763. * is <code>true</code>.
  1764. * @exportDoc
  1765. */
  1766. shaka.extern.StreamingConfiguration;
  1767. /**
  1768. * @typedef {{
  1769. * codecSwitchingStrategy: shaka.config.CodecSwitchingStrategy,
  1770. * addExtraFeaturesToSourceBuffer: function(string): string,
  1771. * forceTransmux: boolean,
  1772. * insertFakeEncryptionInInit: boolean,
  1773. * modifyCueCallback: shaka.extern.TextParser.ModifyCueCallback
  1774. * }}
  1775. *
  1776. * @description
  1777. * Media source configuration.
  1778. *
  1779. * @property {shaka.config.CodecSwitchingStrategy} codecSwitchingStrategy
  1780. * Allow codec switching strategy. SMOOTH loading uses
  1781. * SourceBuffer.changeType. RELOAD uses cycling of MediaSource.
  1782. * <br>
  1783. * Defaults to SMOOTH if SMOOTH codec switching is supported, RELOAD
  1784. * overwise.
  1785. * @property {function(string): string} addExtraFeaturesToSourceBuffer
  1786. * Callback to generate extra features string based on used MIME type.
  1787. * Some platforms may need to pass features when initializing the
  1788. * sourceBuffer.
  1789. * This string is ultimately appended to a MIME type in addSourceBuffer() &
  1790. * changeType().
  1791. * @property {boolean} forceTransmux
  1792. * If this is <code>true</code>, we will transmux AAC and TS content even if
  1793. * not strictly necessary for the assets to be played.
  1794. * <br>
  1795. * Defaults to <code>false</code>.
  1796. * @property {boolean} insertFakeEncryptionInInit
  1797. * If true, will apply a work-around for non-encrypted init segments on
  1798. * encrypted content for some platforms.
  1799. * <br><br>
  1800. * See https://github.com/shaka-project/shaka-player/issues/2759.
  1801. * <br><br>
  1802. * If you know you don't need this, you canset this value to
  1803. * <code>false</code> to gain a few milliseconds on loading time and seek
  1804. * time.
  1805. * <br><br>
  1806. * <br>
  1807. * Defaults to <code>true</code>.
  1808. * @property {shaka.extern.TextParser.ModifyCueCallback} modifyCueCallback
  1809. * A callback called for each cue after it is parsed, but right before it
  1810. * is appended to the presentation.
  1811. * Gives a chance for client-side editing of cue text, cue timing, etc.
  1812. * @exportDoc
  1813. */
  1814. shaka.extern.MediaSourceConfiguration;
  1815. /**
  1816. * @typedef {{
  1817. * customPlayheadTracker: boolean,
  1818. * skipPlayDetection: boolean,
  1819. * supportsMultipleMediaElements: boolean
  1820. * }}
  1821. *
  1822. * @description
  1823. * Ads configuration.
  1824. *
  1825. * @property {boolean} customPlayheadTracker
  1826. * If this is <code>true</code>, we create a custom playhead tracker for
  1827. * Client Side. This is useful because it allows you to implement the use of
  1828. * IMA on platforms that do not support multiple video elements.
  1829. * <br>
  1830. * Defaults to <code>false</code> except on Tizen, WebOS, Chromecast,
  1831. * Hisense, PlayStation 4, PlayStation5, Xbox whose default value is
  1832. * <code>true</code>.
  1833. * @property {boolean} skipPlayDetection
  1834. * If this is true, we will load Client Side ads without waiting for a play
  1835. * event.
  1836. * <br>
  1837. * Defaults to <code>false</code> except on Tizen, WebOS, Chromecast,
  1838. * Hisense, PlayStation 4, PlayStation5, Xbox whose default value is
  1839. * <code>true</code>.
  1840. * @property {boolean} supportsMultipleMediaElements
  1841. * If this is true, the browser supports multiple media elements.
  1842. * <br>
  1843. * Defaults to <code>true</code> except on Tizen, WebOS, Chromecast,
  1844. * Hisense, PlayStation 4, PlayStation5, Xbox whose default value is
  1845. * <code>false</code>.
  1846. *
  1847. * @exportDoc
  1848. */
  1849. shaka.extern.AdsConfiguration;
  1850. /**
  1851. * @typedef {{
  1852. * enabled: boolean,
  1853. * useNetworkInformation: boolean,
  1854. * defaultBandwidthEstimate: number,
  1855. * restrictions: shaka.extern.Restrictions,
  1856. * switchInterval: number,
  1857. * bandwidthUpgradeTarget: number,
  1858. * bandwidthDowngradeTarget: number,
  1859. * advanced: shaka.extern.AdvancedAbrConfiguration,
  1860. * restrictToElementSize: boolean,
  1861. * restrictToScreenSize: boolean,
  1862. * ignoreDevicePixelRatio: boolean,
  1863. * clearBufferSwitch: boolean,
  1864. * safeMarginSwitch: number,
  1865. * cacheLoadThreshold: number,
  1866. * minTimeToSwitch: number,
  1867. * preferNetworkInformationBandwidth: boolean
  1868. * }}
  1869. *
  1870. * @property {boolean} enabled
  1871. * If true, enable adaptation by the current AbrManager.
  1872. * <br>
  1873. * Defaults to <code>true</code>.
  1874. * @property {boolean} useNetworkInformation
  1875. * If true, use the Network Information API in the current AbrManager, if it
  1876. * is available in the browser environment. If the Network Information API is
  1877. * used, Shaka Player will ignore the defaultBandwidthEstimate config.
  1878. * <br>
  1879. * Defaults to <code>true</code>.
  1880. * @property {number} defaultBandwidthEstimate
  1881. * The default bandwidth estimate to use if there is not enough data, in
  1882. * bit/sec. Only used if useNetworkInformation is false, or if the Network
  1883. * Information API is not available.
  1884. * <br>
  1885. * Defaults to <code>1e6</code>.
  1886. * @property {shaka.extern.Restrictions} restrictions
  1887. * The restrictions to apply to ABR decisions. These are "soft" restrictions.
  1888. * Any track that fails to meet these restrictions will not be selected
  1889. * automatically, but will still appear in the track list and can still be
  1890. * selected via <code>selectVariantTrack()</code>. If no tracks meet these
  1891. * restrictions, AbrManager should not fail, but choose a low-res or
  1892. * low-bandwidth variant instead. It is the responsibility of AbrManager
  1893. * implementations to follow these rules and implement this behavior.
  1894. * @property {number} switchInterval
  1895. * The minimum amount of time that must pass between switches, in
  1896. * seconds. This keeps us from changing too often and annoying the user.
  1897. * <br>
  1898. * Defaults to <code>8</code>.
  1899. * @property {number} bandwidthUpgradeTarget
  1900. * The fraction of the estimated bandwidth which we should try to use when
  1901. * upgrading.
  1902. * <br>
  1903. * Defaults to <code>0.85</code>.
  1904. * @property {number} bandwidthDowngradeTarget
  1905. * The largest fraction of the estimated bandwidth we should use. We should
  1906. * downgrade to avoid this.
  1907. * <br>
  1908. * Defaults to <code>0.95</code>.
  1909. * @property {shaka.extern.AdvancedAbrConfiguration} advanced
  1910. * Advanced ABR configuration
  1911. * @property {boolean} restrictToElementSize
  1912. * If true, restrict the quality to media element size.
  1913. * Note: The use of ResizeObserver is required for it to work properly. If
  1914. * true without ResizeObserver, it behaves as false.
  1915. * <br>
  1916. * Defaults to <code>false</code>.
  1917. * @property {boolean} restrictToScreenSize
  1918. * If true, restrict the quality to screen size.
  1919. * <br>
  1920. * Defaults to <code>false</code>.
  1921. * @property {boolean} ignoreDevicePixelRatio
  1922. * If true,device pixel ratio is ignored when restricting the quality to
  1923. * media element size or screen size.
  1924. * <br>
  1925. * Defaults to <code>false</code>.
  1926. * @property {boolean} clearBufferSwitch
  1927. * If true, the buffer will be cleared during the switch.
  1928. * The default automatic behavior is false to have a smoother transition.
  1929. * On some device it's better to clear buffer.
  1930. * <br>
  1931. * Defaults to <code>false</code>.
  1932. * @property {number} safeMarginSwitch
  1933. * Optional amount of buffer (in seconds) to
  1934. * retain when clearing the buffer during the automatic switch.
  1935. * Useful for switching variant quickly without causing a buffering event.
  1936. * Ignored if clearBuffer is false.
  1937. * Can cause hiccups on some browsers if chosen too small, e.g.
  1938. * The amount of two segments is a fair minimum to consider as safeMargin
  1939. * value.
  1940. * <br>
  1941. * Defaults to <code>o</code>.
  1942. * @property {number} cacheLoadThreshold
  1943. * Indicates the value in milliseconds from which a request is not
  1944. * considered cached.
  1945. * <br>
  1946. * Defaults to <code>20</code>.
  1947. * @property {number} minTimeToSwitch
  1948. * Indicates the minimum time to change quality once the real bandwidth is
  1949. * available, in seconds. This time is only used on the first load.
  1950. * <br>
  1951. * Defaults to <code>0</code> seconds except in Apple browsers whose default
  1952. * value is <code>0.5</code> seconds.
  1953. * @property {boolean} preferNetworkInformationBandwidth
  1954. * If true, use the Network Information API bandwidth estimation in the
  1955. * current AbrManager, if it is available in the browser environment. This
  1956. * way Shaka Player will never estimate the bandwidth and we will always
  1957. * trust the information provided by the browser.
  1958. * <br>
  1959. * Defaults to <code>false</code>.
  1960. * @exportDoc
  1961. */
  1962. shaka.extern.AbrConfiguration;
  1963. /**
  1964. * @typedef {{
  1965. * minTotalBytes: number,
  1966. * minBytes: number,
  1967. * fastHalfLife: number,
  1968. * slowHalfLife: number
  1969. * }}
  1970. *
  1971. * @property {number} minTotalBytes
  1972. * Minimum number of bytes sampled before we trust the estimate. If we have
  1973. * not sampled much data, our estimate may not be accurate enough to trust.
  1974. * <br>
  1975. * Defaults to <code>128e3</code>.
  1976. * @property {number} minBytes
  1977. * Minimum number of bytes, under which samples are discarded. Our models
  1978. * do not include latency information, so connection startup time (time to
  1979. * first byte) is considered part of the download time. Because of this, we
  1980. * should ignore very small downloads which would cause our estimate to be
  1981. * too low.
  1982. * <br>
  1983. * Defaults to <code>16e3</code>.
  1984. * @property {number} fastHalfLife
  1985. * The quantity of prior samples (by weight) used when creating a new
  1986. * estimate, in seconds. Those prior samples make up half of the
  1987. * new estimate.
  1988. * <br>
  1989. * Defaults to <code>2</code>.
  1990. * @property {number} slowHalfLife
  1991. * The quantity of prior samples (by weight) used when creating a new
  1992. * estimate, in seconds. Those prior samples make up half of the
  1993. * new estimate.
  1994. * <br>
  1995. * Defaults to <code>5</code>.
  1996. * @exportDoc
  1997. */
  1998. shaka.extern.AdvancedAbrConfiguration;
  1999. /**
  2000. * @typedef {{
  2001. * enabled: boolean,
  2002. * useHeaders: boolean,
  2003. * sessionId: string,
  2004. * contentId: string,
  2005. * rtpSafetyFactor: number,
  2006. * includeKeys: !Array<string>
  2007. * }}
  2008. *
  2009. * @description
  2010. * Common Media Client Data (CMCD) configuration.
  2011. *
  2012. * @property {boolean} enabled
  2013. * If <code>true</code>, enable CMCD data to be sent with media requests.
  2014. * <br>
  2015. * Defaults to <code>false</code>.
  2016. * @property {boolean} useHeaders
  2017. * If <code>true</code>, send CMCD data using the header transmission mode
  2018. * instead of query args.
  2019. * <br>
  2020. * Defaults to <code>false</code>.
  2021. * @property {string} sessionId
  2022. * A GUID identifying the current playback session. A playback session
  2023. * typically ties together segments belonging to a single media asset.
  2024. * Maximum length is 64 characters. It is RECOMMENDED to conform to the UUID
  2025. * specification.
  2026. * <br>
  2027. * By default the sessionId is automatically generated on each
  2028. * <code>load()</code> call.
  2029. * @property {string} contentId
  2030. * A unique string identifying the current content. Maximum length is 64
  2031. * characters. This value is consistent across multiple different sessions and
  2032. * devices and is defined and updated at the discretion of the service
  2033. * provider.
  2034. * <br>
  2035. * Defaults to <code>'false'</code>.
  2036. * @property {number} rtpSafetyFactor
  2037. * RTP safety factor.
  2038. * <br>
  2039. * Defaults to <code>5</code>.
  2040. * @property {!Array<string>} includeKeys
  2041. * An array of keys to include in the CMCD data. If not provided, all keys
  2042. * will be included.
  2043. * <br>
  2044. * Defaults to <code>[]</code>.
  2045. * @exportDoc
  2046. */
  2047. shaka.extern.CmcdConfiguration;
  2048. /**
  2049. * @typedef {{
  2050. * enabled: boolean,
  2051. * applyMaximumSuggestedBitrate: boolean,
  2052. * estimatedThroughputWeightRatio: number
  2053. * }}
  2054. *
  2055. * @description
  2056. * Common Media Server Data (CMSD) configuration.
  2057. *
  2058. * @property {boolean} enabled
  2059. * If <code>true</code>, enables reading CMSD data in media requests.
  2060. * <br>
  2061. * Defaults to <code>true</code>.
  2062. * @property {boolean} applyMaximumSuggestedBitrate
  2063. * If true, we must apply the maximum suggested bitrate. If false, we ignore
  2064. * this.
  2065. * <br>
  2066. * Defaults to <code>true</code>.
  2067. * @property {number} estimatedThroughputWeightRatio
  2068. * How much the estimatedThroughput of the CMSD data should be weighted
  2069. * against the default estimate, between 0 and 1.
  2070. * <br>
  2071. * Defaults to <code>0.5</code>.
  2072. * @exportDoc
  2073. */
  2074. shaka.extern.CmsdConfiguration;
  2075. /**
  2076. * @typedef {{
  2077. * enabled: boolean,
  2078. * dynamicPerformanceScaling: boolean,
  2079. * logLevel: number,
  2080. * drawLogo: boolean
  2081. * }}
  2082. *
  2083. * @description
  2084. * Decoding for MPEG-5 Part2 LCEVC.
  2085. *
  2086. * @property {boolean} enabled
  2087. * If <code>true</code>, enable LCEVC.
  2088. * Defaults to <code>false</code>.
  2089. * @property {boolean} dynamicPerformanceScaling
  2090. * If <code>true</code>, LCEVC Dynamic Performance Scaling or dps is enabled
  2091. * to be triggered, when the system is not able to decode frames within a
  2092. * specific tolerance of the fps of the video and disables LCEVC decoding
  2093. * for some time. The base video will be shown upscaled to target resolution.
  2094. * If it is triggered again within a short period of time, the disabled
  2095. * time will be higher and if it is triggered three times in a row the LCEVC
  2096. * decoding will be disabled for that playback session.
  2097. * If dynamicPerformanceScaling is false, LCEVC decode will be forced
  2098. * and will drop frames appropriately if performance is sub optimal.
  2099. * <br>
  2100. * Defaults to <code>true</code>.
  2101. * @property {number} logLevel
  2102. * Loglevel 0-5 for logging.
  2103. * NONE = 0
  2104. * ERROR = 1
  2105. * WARNING = 2
  2106. * INFO = 3
  2107. * DEBUG = 4
  2108. * VERBOSE = 5
  2109. * <br>
  2110. * Defaults to <code>0</code>.
  2111. * @property {boolean} drawLogo
  2112. * If <code>true</code>, LCEVC Logo is placed on the top left hand corner
  2113. * which only appears when the LCEVC enhanced frames are being rendered.
  2114. * Defaults to true for the lib but is forced to false in this integration
  2115. * unless explicitly set to true through config.
  2116. * <br>
  2117. * Defaults to <code>false</code>.
  2118. * @exportDoc
  2119. */
  2120. shaka.extern.LcevcConfiguration;
  2121. /**
  2122. * @typedef {{
  2123. * trackSelectionCallback:
  2124. * function(shaka.extern.TrackList):!Promise<shaka.extern.TrackList>,
  2125. * downloadSizeCallback: function(number):!Promise<boolean>,
  2126. * progressCallback: function(shaka.extern.StoredContent,number),
  2127. * usePersistentLicense: boolean,
  2128. * numberOfParallelDownloads: number
  2129. * }}
  2130. *
  2131. * @property {function(shaka.extern.TrackList):!Promise<shaka.extern.TrackList>}
  2132. * trackSelectionCallback
  2133. * Called inside <code>store()</code> to determine which tracks to save from a
  2134. * manifest. It is passed an array of Tracks from the manifest and it should
  2135. * return an array of the tracks to store.
  2136. * @property {function(number):!Promise<boolean>} downloadSizeCallback
  2137. * Called inside <code>store()</code> to determine if the content can be
  2138. * downloaded due to its estimated size. The estimated size of the download is
  2139. * passed and it must return if the download is allowed or not.
  2140. * @property {function(shaka.extern.StoredContent,number)} progressCallback
  2141. * Called inside <code>store()</code> to give progress info back to the app.
  2142. * It is given the current manifest being stored and the progress of it being
  2143. * stored.
  2144. * @property {boolean} usePersistentLicense
  2145. * If <code>true</code>, store protected content with a persistent license so
  2146. * that no network is required to view.
  2147. * If <code>false</code>, store protected content without a persistent
  2148. * license. A network will be required to retrieve a temporary license to
  2149. * view.
  2150. * <br>
  2151. * Defaults to <code>true</code>.
  2152. * @property {number} numberOfParallelDownloads
  2153. * Number of parallel downloads.
  2154. * Note: normally browsers limit to 5 request in parallel, so putting a
  2155. * number higher than this will not help it download faster.
  2156. * <br>
  2157. * Defaults to <code>5</code>.
  2158. * @exportDoc
  2159. */
  2160. shaka.extern.OfflineConfiguration;
  2161. /**
  2162. * @typedef {{
  2163. * captionsUpdatePeriod: number
  2164. * }}
  2165. *
  2166. * @description
  2167. * Text displayer configuration.
  2168. *
  2169. * @property {number} captionsUpdatePeriod
  2170. * The number of seconds to see if the captions should be updated.
  2171. * <br>
  2172. * Defaults to <code>0.25</code>.
  2173. *
  2174. * @exportDoc
  2175. */
  2176. shaka.extern.TextDisplayerConfiguration;
  2177. /**
  2178. * @typedef {{
  2179. * ads: shaka.extern.AdsConfiguration,
  2180. * autoShowText: shaka.config.AutoShowText,
  2181. * drm: shaka.extern.DrmConfiguration,
  2182. * manifest: shaka.extern.ManifestConfiguration,
  2183. * streaming: shaka.extern.StreamingConfiguration,
  2184. * mediaSource: shaka.extern.MediaSourceConfiguration,
  2185. * abrFactory: shaka.extern.AbrManager.Factory,
  2186. * abr: shaka.extern.AbrConfiguration,
  2187. * cmcd: shaka.extern.CmcdConfiguration,
  2188. * cmsd: shaka.extern.CmsdConfiguration,
  2189. * lcevc: shaka.extern.LcevcConfiguration,
  2190. * offline: shaka.extern.OfflineConfiguration,
  2191. * preferredAudioLanguage: string,
  2192. * preferredAudioLabel: string,
  2193. * preferredTextLanguage: string,
  2194. * preferredVariantRole: string,
  2195. * preferredTextRole: string,
  2196. * preferredVideoCodecs: !Array.<string>,
  2197. * preferredAudioCodecs: !Array.<string>,
  2198. * preferredAudioChannelCount: number,
  2199. * preferredVideoHdrLevel: string,
  2200. * preferredVideoLayout: string,
  2201. * preferredVideoLabel: string,
  2202. * preferredDecodingAttributes: !Array.<string>,
  2203. * preferForcedSubs: boolean,
  2204. * preferSpatialAudio: boolean,
  2205. * restrictions: shaka.extern.Restrictions,
  2206. * playRangeStart: number,
  2207. * playRangeEnd: number,
  2208. * textDisplayer: shaka.extern.TextDisplayerConfiguration,
  2209. * textDisplayFactory: shaka.extern.TextDisplayer.Factory
  2210. * }}
  2211. *
  2212. * @property {shaka.extern.AdsConfiguration} ads
  2213. * Ads configuration and settings.
  2214. * @property {shaka.config.AutoShowText} autoShowText
  2215. * Controls behavior of auto-showing text tracks on load().
  2216. * <br>
  2217. * Defaults to
  2218. * {@link shaka.config.AutoShowText#IF_SUBTITLES_MAY_BE_NEEDED}.
  2219. * @property {shaka.extern.DrmConfiguration} drm
  2220. * DRM configuration and settings.
  2221. * @property {shaka.extern.ManifestConfiguration} manifest
  2222. * Manifest configuration and settings.
  2223. * @property {shaka.extern.StreamingConfiguration} streaming
  2224. * Streaming configuration and settings.
  2225. * @property {shaka.extern.MediaSourceConfiguration} mediaSource
  2226. * Media source configuration and settings.
  2227. * @property {shaka.extern.AbrManager.Factory} abrFactory
  2228. * A factory to construct an abr manager.
  2229. * @property {shaka.extern.AbrConfiguration} abr
  2230. * ABR configuration and settings.
  2231. * @property {shaka.extern.CmcdConfiguration} cmcd
  2232. * CMCD configuration and settings. (Common Media Client Data)
  2233. * @property {shaka.extern.CmsdConfiguration} cmsd
  2234. * CMSD configuration and settings. (Common Media Server Data)
  2235. * @property {shaka.extern.LcevcConfiguration} lcevc
  2236. * MPEG-5 LCEVC configuration and settings.
  2237. * (Low Complexity Enhancement Video Codec)
  2238. * @property {shaka.extern.OfflineConfiguration} offline
  2239. * Offline configuration and settings.
  2240. * @property {string} preferredAudioLanguage
  2241. * The preferred language to use for audio tracks. If not given it will use
  2242. * the <code>'main'</code> track.
  2243. * Changing this during playback will not affect the current playback.
  2244. * <br>
  2245. * Defaults to <code>''</code>.
  2246. * @property {string} preferredAudioLabel
  2247. * The preferred label to use for audio tracks.
  2248. * <br>
  2249. * Defaults to <code>''</code>.
  2250. * @property {string} preferredVideoLabel
  2251. * The preferred label to use for video tracks.
  2252. * <br>
  2253. * Defaults to <code>''</code>.
  2254. * @property {string} preferredTextLanguage
  2255. * The preferred language to use for text tracks. If a matching text track
  2256. * is found, and the selected audio and text tracks have different languages,
  2257. * the text track will be shown.
  2258. * Changing this during playback will not affect the current playback.
  2259. * <br>
  2260. * Defaults to <code>''</code>.
  2261. * @property {string} preferredVariantRole
  2262. * The preferred role to use for variants.
  2263. * <br>
  2264. * Defaults to <code>''</code>.
  2265. * @property {string} preferredTextRole
  2266. * The preferred role to use for text tracks.
  2267. * <br>
  2268. * Defaults to <code>''</code>.
  2269. * @property {!Array.<string>} preferredVideoCodecs
  2270. * The list of preferred video codecs, in order of highest to lowest priority.
  2271. * <br>
  2272. * Defaults to <code>[]</code>.
  2273. * @property {!Array.<string>} preferredAudioCodecs
  2274. * The list of preferred audio codecs, in order of highest to lowest priority.
  2275. * <br>
  2276. * Defaults to <code>[]</code>.
  2277. * @property {number} preferredAudioChannelCount
  2278. * The preferred number of audio channels.
  2279. * <br>
  2280. * Defaults to <code>2</code>.
  2281. * @property {string} preferredVideoHdrLevel
  2282. * The preferred HDR level of the video. If possible, this will cause the
  2283. * player to filter to assets that either have that HDR level, or no HDR level
  2284. * at all.
  2285. * Can be 'SDR', 'PQ', 'HLG', 'AUTO' for auto-detect, or '' for no preference.
  2286. * Note that one some platforms, such as Chrome, attempting to play PQ content
  2287. * may cause problems.
  2288. * <br>
  2289. * Defaults to <code>'AUTO'</code>.
  2290. * @property {string} preferredVideoLayout
  2291. * The preferred video layout of the video.
  2292. * Can be 'CH-STEREO', 'CH-MONO', or '' for no preference.
  2293. * If the content is predominantly stereoscopic you should use 'CH-STEREO'.
  2294. * If the content is predominantly monoscopic you should use 'CH-MONO'.
  2295. * <br>
  2296. * Defaults to <code>''</code>.
  2297. * @property {!Array.<string>} preferredDecodingAttributes
  2298. * The list of preferred attributes of decodingInfo, in the order of their
  2299. * priorities.
  2300. * <br>
  2301. * Defaults to <code>[]</code>.
  2302. * @property {boolean} preferForcedSubs
  2303. * If true, a forced text track is preferred.
  2304. * If the content has no forced captions and the value is true,
  2305. * no text track is chosen.
  2306. * Changing this during playback will not affect the current playback.
  2307. * <br>
  2308. * Defaults to <code>false</code>.
  2309. * @property {boolean} preferSpatialAudio
  2310. * If true, a spatial audio track is preferred.
  2311. * <br>
  2312. * Defaults to <code>false</code>.
  2313. * @property {shaka.extern.Restrictions} restrictions
  2314. * The application restrictions to apply to the tracks. These are "hard"
  2315. * restrictions. Any track that fails to meet these restrictions will not
  2316. * appear in the track list. If no tracks meet these restrictions, playback
  2317. * will fail.
  2318. * @property {number} playRangeStart
  2319. * Optional playback and seek start time in seconds. Defaults to 0 if
  2320. * not provided.
  2321. * <br>
  2322. * Defaults to <code>0</code>.
  2323. * @property {number} playRangeEnd
  2324. * Optional playback and seek end time in seconds. Defaults to the end of
  2325. * the presentation if not provided.
  2326. * <br>
  2327. * Defaults to <code>Infinity</code>.
  2328. * @property {shaka.extern.TextDisplayerConfiguration} textDisplayer
  2329. * Text displayer configuration and settings.
  2330. * @property {shaka.extern.TextDisplayer.Factory} textDisplayFactory
  2331. * A factory to construct a text displayer. Note that, if this is changed
  2332. * during playback, it will cause the text tracks to be reloaded.
  2333. * @exportDoc
  2334. */
  2335. shaka.extern.PlayerConfiguration;
  2336. /**
  2337. * @typedef {{
  2338. * language: string,
  2339. * role: string,
  2340. * label: ?string
  2341. * }}
  2342. *
  2343. * @property {string} language
  2344. * The language code for the stream.
  2345. * @property {string} role
  2346. * The role name for the stream. If the stream has no role, <code>role</code>
  2347. * will be <code>''</code>.
  2348. * @property {?string} label
  2349. * The label of the audio stream, if it has one.
  2350. * @exportDoc
  2351. */
  2352. shaka.extern.LanguageRole;
  2353. /**
  2354. * @typedef {{
  2355. * segment: shaka.media.SegmentReference,
  2356. * imageHeight: number,
  2357. * imageWidth: number,
  2358. * height: number,
  2359. * positionX: number,
  2360. * positionY: number,
  2361. * startTime: number,
  2362. * duration: number,
  2363. * uris: !Array.<string>,
  2364. * width: number,
  2365. * sprite: boolean
  2366. * }}
  2367. *
  2368. * @property {shaka.media.SegmentReference} segment
  2369. * The segment of this thumbnail.
  2370. * @property {number} imageHeight
  2371. * The image height in px. The image height could be different to height if
  2372. * the layout is different to 1x1.
  2373. * @property {number} imageWidth
  2374. * The image width in px. The image width could be different to width if
  2375. * the layout is different to 1x1.
  2376. * @property {number} height
  2377. * The thumbnail height in px.
  2378. * @property {number} positionX
  2379. * The thumbnail left position in px.
  2380. * @property {number} positionY
  2381. * The thumbnail top position in px.
  2382. * @property {number} startTime
  2383. * The start time of the thumbnail in the presentation timeline, in seconds.
  2384. * @property {number} duration
  2385. * The duration of the thumbnail, in seconds.
  2386. * @property {!Array.<string>} uris
  2387. * An array of URIs to attempt. They will be tried in the order they are
  2388. * given.
  2389. * @property {number} width
  2390. * The thumbnail width in px.
  2391. * @property {boolean} sprite
  2392. * Indicate if the thumbnail is a sprite.
  2393. * @exportDoc
  2394. */
  2395. shaka.extern.Thumbnail;
  2396. /**
  2397. * @typedef {{
  2398. * id: string,
  2399. * title: string,
  2400. * startTime: number,
  2401. * endTime: number
  2402. * }}
  2403. *
  2404. * @property {string} id
  2405. * The id of the chapter.
  2406. * @property {string} title
  2407. * The title of the chapter.
  2408. * @property {number} startTime
  2409. * The time that describes the beginning of the range of the chapter.
  2410. * @property {number} endTime
  2411. * The time that describes the end of the range of chapter.
  2412. * @exportDoc
  2413. */
  2414. shaka.extern.Chapter;