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