Source: externs/shaka/player.js

  1. /*! @license
  2. * Shaka Player
  3. * Copyright 2016 Google LLC
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. /**
  7. * @externs
  8. */
  9. /**
  10. * @typedef {{
  11. * timestamp: number,
  12. * id: number,
  13. * type: string,
  14. * fromAdaptation: boolean,
  15. * bandwidth: ?number
  16. * }}
  17. *
  18. * @property {number} timestamp
  19. * The timestamp the choice was made, in seconds since 1970
  20. * (i.e. <code>Date.now() / 1000</code>).
  21. * @property {number} id
  22. * The id of the track that was chosen.
  23. * @property {string} type
  24. * The type of track chosen (<code>'variant'</code> or <code>'text'</code>).
  25. * @property {boolean} fromAdaptation
  26. * <code>true</code> if the choice was made by AbrManager for adaptation;
  27. * <code>false</code> if it was made by the application through
  28. * <code>selectTrack</code>.
  29. * @property {?number} bandwidth
  30. * The bandwidth of the chosen track (<code>null</code> for text).
  31. * @exportDoc
  32. */
  33. shaka.extern.TrackChoice;
  34. /**
  35. * @typedef {{
  36. * timestamp: number,
  37. * state: string,
  38. * duration: number
  39. * }}
  40. *
  41. * @property {number} timestamp
  42. * The timestamp the state was entered, in seconds since 1970
  43. * (i.e. <code>Date.now() / 1000</code>).
  44. * @property {string} state
  45. * The state the player entered. This could be <code>'buffering'</code>,
  46. * <code>'playing'</code>, <code>'paused'</code>, or <code>'ended'</code>.
  47. * @property {number} duration
  48. * The number of seconds the player was in this state. If this is the last
  49. * entry in the list, the player is still in this state, so the duration will
  50. * continue to increase.
  51. * @exportDoc
  52. */
  53. shaka.extern.StateChange;
  54. /**
  55. * @typedef {{
  56. * width: number,
  57. * height: number,
  58. * streamBandwidth: number,
  59. *
  60. * decodedFrames: number,
  61. * droppedFrames: number,
  62. * corruptedFrames: number,
  63. * estimatedBandwidth: number,
  64. *
  65. * completionPercent: number,
  66. * loadLatency: number,
  67. * manifestTimeSeconds: number,
  68. * drmTimeSeconds: number,
  69. * playTime: number,
  70. * pauseTime: number,
  71. * bufferingTime: number,
  72. * licenseTime: number,
  73. * liveLatency: number,
  74. *
  75. * maxSegmentDuration: number,
  76. *
  77. * switchHistory: !Array.<shaka.extern.TrackChoice>,
  78. * stateHistory: !Array.<shaka.extern.StateChange>
  79. * }}
  80. *
  81. * @description
  82. * Contains statistics and information about the current state of the player.
  83. * This is meant for applications that want to log quality-of-experience (QoE)
  84. * or other stats. These values will reset when <code>load()</code> is called
  85. * again.
  86. *
  87. * @property {number} width
  88. * The width of the current video track.
  89. * @property {number} height
  90. * The height of the current video track.
  91. * @property {number} streamBandwidth
  92. * The bandwidth required for the current streams (total, in bit/sec).
  93. * It takes into account the playbackrate.
  94. *
  95. * @property {number} decodedFrames
  96. * The total number of frames decoded by the Player. This may be
  97. * <code>NaN</code> if this is not supported by the browser.
  98. * @property {number} droppedFrames
  99. * The total number of frames dropped by the Player. This may be
  100. * <code>NaN</code> if this is not supported by the browser.
  101. * @property {number} corruptedFrames
  102. * The total number of corrupted frames dropped by the browser. This may be
  103. * <code>NaN</code> if this is not supported by the browser.
  104. * @property {number} estimatedBandwidth
  105. * The current estimated network bandwidth (in bit/sec).
  106. *
  107. * @property {number} completionPercent
  108. * This is the greatest completion percent that the user has experienced in
  109. * playback. Also known as the "high water mark". Is NaN when there is no
  110. * known duration, such as for livestreams.
  111. * @property {number} loadLatency
  112. * This is the number of seconds it took for the video element to have enough
  113. * data to begin playback. This is measured from the time load() is called to
  114. * the time the <code>'loadeddata'</code> event is fired by the media element.
  115. * @property {number} manifestTimeSeconds
  116. * The amount of time it took to download and parse the manifest.
  117. * @property {number} drmTimeSeconds
  118. * The amount of time it took to download the first drm key, and load that key
  119. * into the drm system.
  120. * @property {number} playTime
  121. * The total time spent in a playing state in seconds.
  122. * @property {number} pauseTime
  123. * The total time spent in a paused state in seconds.
  124. * @property {number} bufferingTime
  125. * The total time spent in a buffering state in seconds.
  126. * @property {number} licenseTime
  127. * The time spent on license requests during this session in seconds, or NaN.
  128. * @property {number} liveLatency
  129. * The time between the capturing of a frame and the end user having it
  130. * displayed on their screen.
  131. *
  132. * @property {number} maxSegmentDuration
  133. * The presentation's max segment duration in seconds, or NaN.
  134. *
  135. * @property {!Array.<shaka.extern.TrackChoice>} switchHistory
  136. * A history of the stream changes.
  137. * @property {!Array.<shaka.extern.StateChange>} stateHistory
  138. * A history of the state changes.
  139. * @exportDoc
  140. */
  141. shaka.extern.Stats;
  142. /**
  143. * @typedef {{
  144. * start: number,
  145. * end: number
  146. * }}
  147. *
  148. * @description
  149. * Contains the times of a range of buffered content.
  150. *
  151. * @property {number} start
  152. * The start time of the range, in seconds.
  153. * @property {number} end
  154. * The end time of the range, in seconds.
  155. * @exportDoc
  156. */
  157. shaka.extern.BufferedRange;
  158. /**
  159. * @typedef {{
  160. * total: !Array.<shaka.extern.BufferedRange>,
  161. * audio: !Array.<shaka.extern.BufferedRange>,
  162. * video: !Array.<shaka.extern.BufferedRange>,
  163. * text: !Array.<shaka.extern.BufferedRange>
  164. * }}
  165. *
  166. * @description
  167. * Contains information about the current buffered ranges.
  168. *
  169. * @property {!Array.<shaka.extern.BufferedRange>} total
  170. * The combined audio/video buffered ranges, reported by
  171. * <code>video.buffered</code>.
  172. * @property {!Array.<shaka.extern.BufferedRange>} audio
  173. * The buffered ranges for audio content.
  174. * @property {!Array.<shaka.extern.BufferedRange>} video
  175. * The buffered ranges for video content.
  176. * @property {!Array.<shaka.extern.BufferedRange>} text
  177. * The buffered ranges for text content.
  178. * @exportDoc
  179. */
  180. shaka.extern.BufferedInfo;
  181. /**
  182. * @typedef {{
  183. * id: number,
  184. * active: boolean,
  185. *
  186. * type: string,
  187. * bandwidth: number,
  188. *
  189. * language: string,
  190. * label: ?string,
  191. * kind: ?string,
  192. * width: ?number,
  193. * height: ?number,
  194. * frameRate: ?number,
  195. * pixelAspectRatio: ?string,
  196. * hdr: ?string,
  197. * mimeType: ?string,
  198. * codecs: ?string,
  199. * audioCodec: ?string,
  200. * videoCodec: ?string,
  201. * primary: boolean,
  202. * roles: !Array.<string>,
  203. * audioRoles: Array.<string>,
  204. * forced: boolean,
  205. * videoId: ?number,
  206. * audioId: ?number,
  207. * channelsCount: ?number,
  208. * audioSamplingRate: ?number,
  209. * tilesLayout: ?string,
  210. * audioBandwidth: ?number,
  211. * videoBandwidth: ?number,
  212. * spatialAudio: boolean,
  213. * originalVideoId: ?string,
  214. * originalAudioId: ?string,
  215. * originalTextId: ?string,
  216. * originalImageId: ?string
  217. * }}
  218. *
  219. * @description
  220. * An object describing a media track. This object should be treated as
  221. * read-only as changing any values does not have any effect. This is the
  222. * public view of an audio/video paring (variant type) or text track (text
  223. * type) or image track (image type).
  224. *
  225. * @property {number} id
  226. * The unique ID of the track.
  227. * @property {boolean} active
  228. * If true, this is the track being streamed (another track may be
  229. * visible/audible in the buffer).
  230. *
  231. * @property {string} type
  232. * The type of track, either <code>'variant'</code> or <code>'text'</code>
  233. * or <code>'image'</code>.
  234. * @property {number} bandwidth
  235. * The bandwidth required to play the track, in bits/sec.
  236. *
  237. * @property {string} language
  238. * The language of the track, or <code>'und'</code> if not given. This is the
  239. * exact value provided in the manifest; it may need to be normalized.
  240. * @property {?string} label
  241. * The track label, which is unique text that should describe the track.
  242. * @property {?string} kind
  243. * (only for text tracks) The kind of text track, either
  244. * <code>'caption'</code> or <code>'subtitle'</code>.
  245. * @property {?number} width
  246. * The video width provided in the manifest, if present.
  247. * @property {?number} height
  248. * The video height provided in the manifest, if present.
  249. * @property {?number} frameRate
  250. * The video framerate provided in the manifest, if present.
  251. * @property {?string} pixelAspectRatio
  252. * The video pixel aspect ratio provided in the manifest, if present.
  253. * @property {?string} hdr
  254. * The video HDR provided in the manifest, if present.
  255. * @property {?string} mimeType
  256. * The MIME type of the content provided in the manifest.
  257. * @property {?string} codecs
  258. * The audio/video codecs string provided in the manifest, if present.
  259. * @property {?string} audioCodec
  260. * The audio codecs string provided in the manifest, if present.
  261. * @property {?string} videoCodec
  262. * The video codecs string provided in the manifest, if present.
  263. * @property {boolean} primary
  264. * True indicates that this in the primary language for the content.
  265. * This flag is based on signals from the manifest.
  266. * This can be a useful hint about which language should be the default, and
  267. * indicates which track Shaka will use when the user's language preference
  268. * cannot be satisfied.
  269. * @property {!Array.<string>} roles
  270. * The roles of the track, e.g. <code>'main'</code>, <code>'caption'</code>,
  271. * or <code>'commentary'</code>.
  272. * @property {Array.<string>} audioRoles
  273. * The roles of the audio in the track, e.g. <code>'main'</code> or
  274. * <code>'commentary'</code>. Will be null for text tracks or variant tracks
  275. * without audio.
  276. * @property {boolean} forced
  277. * True indicates that this in the forced text language for the content.
  278. * This flag is based on signals from the manifest.
  279. * @property {?number} videoId
  280. * (only for variant tracks) The video stream id.
  281. * @property {?number} audioId
  282. * (only for variant tracks) The audio stream id.
  283. * @property {?number} channelsCount
  284. * The count of the audio track channels.
  285. * @property {?number} audioSamplingRate
  286. * Specifies the maximum sampling rate of the content.
  287. * @property {?string} tilesLayout
  288. * The value is a grid-item-dimension consisting of two positive decimal
  289. * integers in the format: column-x-row ('4x3'). It describes the arrangement
  290. * of Images in a Grid. The minimum valid LAYOUT is '1x1'.
  291. * @property {boolean} spatialAudio
  292. * True indicates that the content has spatial audio.
  293. * This flag is based on signals from the manifest.
  294. * @property {?number} audioBandwidth
  295. * (only for variant tracks) The audio stream's bandwidth if known.
  296. * @property {?number} videoBandwidth
  297. * (only for variant tracks) The video stream's bandwidth if known.
  298. * @property {?string} originalVideoId
  299. * (variant tracks only) The original ID of the video part of the track, if
  300. * any, as it appeared in the original manifest.
  301. * @property {?string} originalAudioId
  302. * (variant tracks only) The original ID of the audio part of the track, if
  303. * any, as it appeared in the original manifest.
  304. * @property {?string} originalTextId
  305. * (text tracks only) The original ID of the text track, if any, as it
  306. * appeared in the original manifest.
  307. * @property {?string} originalImageId
  308. * (image tracks only) The original ID of the image track, if any, as it
  309. * appeared in the original manifest.
  310. * @exportDoc
  311. */
  312. shaka.extern.Track;
  313. /**
  314. * @typedef {!Array.<!shaka.extern.Track>}
  315. */
  316. shaka.extern.TrackList;
  317. /**
  318. * @typedef {{
  319. * minWidth: number,
  320. * maxWidth: number,
  321. * minHeight: number,
  322. * maxHeight: number,
  323. * minPixels: number,
  324. * maxPixels: number,
  325. *
  326. * minFrameRate: number,
  327. * maxFrameRate: number,
  328. *
  329. * minBandwidth: number,
  330. * maxBandwidth: number
  331. * }}
  332. *
  333. * @description
  334. * An object describing application restrictions on what tracks can play. All
  335. * restrictions must be fulfilled for a track to be playable/selectable.
  336. * The restrictions system behaves somewhat differently at the ABR level and the
  337. * player level, so please refer to the documentation for those specific
  338. * settings.
  339. *
  340. * @see shaka.extern.PlayerConfiguration
  341. * @see shaka.extern.AbrConfiguration
  342. *
  343. * @property {number} minWidth
  344. * The minimum width of a video track, in pixels.
  345. * @property {number} maxWidth
  346. * The maximum width of a video track, in pixels.
  347. * @property {number} minHeight
  348. * The minimum height of a video track, in pixels.
  349. * @property {number} maxHeight
  350. * The maximum height of a video track, in pixels.
  351. * @property {number} minPixels
  352. * The minimum number of total pixels in a video track (i.e.
  353. * <code>width * height</code>).
  354. * @property {number} maxPixels
  355. * The maximum number of total pixels in a video track (i.e.
  356. * <code>width * height</code>).
  357. *
  358. * @property {number} minFrameRate
  359. * The minimum framerate of a variant track.
  360. * @property {number} maxFrameRate
  361. * The maximum framerate of a variant track.
  362. *
  363. * @property {number} minBandwidth
  364. * The minimum bandwidth of a variant track, in bit/sec.
  365. * @property {number} maxBandwidth
  366. * The maximum bandwidth of a variant track, in bit/sec.
  367. * @exportDoc
  368. */
  369. shaka.extern.Restrictions;
  370. /**
  371. * @typedef {{
  372. * persistentState: boolean
  373. * }}
  374. *
  375. * @property {boolean} persistentState
  376. * Whether this key system supports persistent state.
  377. * @exportDoc
  378. */
  379. shaka.extern.DrmSupportType;
  380. /**
  381. * @typedef {{
  382. * manifest: !Object.<string, boolean>,
  383. * media: !Object.<string, boolean>,
  384. * drm: !Object.<string, ?shaka.extern.DrmSupportType>
  385. * }}
  386. *
  387. * @description
  388. * An object detailing browser support for various features.
  389. *
  390. * @property {!Object.<string, boolean>} manifest
  391. * A map of supported manifest types.
  392. * The keys are manifest MIME types and file extensions.
  393. * @property {!Object.<string, boolean>} media
  394. * A map of supported media types.
  395. * The keys are media MIME types.
  396. * @property {!Object.<string, ?shaka.extern.DrmSupportType>} drm
  397. * A map of supported key systems.
  398. * The keys are the key system names. The value is <code>null</code> if it is
  399. * not supported. Key systems not probed will not be in this dictionary.
  400. *
  401. * @exportDoc
  402. */
  403. shaka.extern.SupportType;
  404. /**
  405. * @typedef {!Object.<string, ?>}
  406. *
  407. * @description
  408. * ID3 metadata in format defined by
  409. * https://id3.org/id3v2.3.0#Declared_ID3v2_frames
  410. * The content of the field.
  411. *
  412. * @exportDoc
  413. */
  414. shaka.extern.ID3Metadata;
  415. /**
  416. * @typedef {{
  417. * schemeIdUri: string,
  418. * value: string,
  419. * startTime: number,
  420. * endTime: number,
  421. * id: string,
  422. * eventElement: Element
  423. * }}
  424. *
  425. * @description
  426. * Contains information about a region of the timeline that will cause an event
  427. * to be raised when the playhead enters or exits it. In DASH this is the
  428. * EventStream element.
  429. *
  430. * @property {string} schemeIdUri
  431. * Identifies the message scheme.
  432. * @property {string} value
  433. * Specifies the value for the region.
  434. * @property {number} startTime
  435. * The presentation time (in seconds) that the region should start.
  436. * @property {number} endTime
  437. * The presentation time (in seconds) that the region should end.
  438. * @property {string} id
  439. * Specifies an identifier for this instance of the region.
  440. * @property {Element} eventElement
  441. * The XML element that defines the Event.
  442. * @exportDoc
  443. */
  444. shaka.extern.TimelineRegionInfo;
  445. /**
  446. * @typedef {{
  447. * audioSamplingRate: ?number,
  448. * bandwidth: number,
  449. * codecs: string,
  450. * contentType: string,
  451. * frameRate: ?number,
  452. * height: ?number,
  453. * mimeType: ?string,
  454. * channelsCount: ?number,
  455. * pixelAspectRatio: ?string,
  456. * width: ?number
  457. * }}
  458. *
  459. * @description
  460. * Contains information about the quality of an audio or video media stream.
  461. *
  462. * @property {?number} audioSamplingRate
  463. * Specifies the maximum sampling rate of the content.
  464. * @property {number} bandwidth
  465. * The bandwidth in bits per second.
  466. * @property {string} codecs
  467. * The Stream's codecs, e.g., 'avc1.4d4015' or 'vp9', which must be
  468. * compatible with the Stream's MIME type.
  469. * @property {string} contentType
  470. * The type of content, which may be "video" or "audio".
  471. * @property {?number} frameRate
  472. * The video frame rate.
  473. * @property {?number} height
  474. * The video height in pixels.
  475. * @property {string} mimeType
  476. * The MIME type.
  477. * @property {?number} channelsCount
  478. * The number of audio channels, or null if unknown.
  479. * @property {?string} pixelAspectRatio
  480. * The pixel aspect ratio value; e.g "1:1".
  481. * @property {?number} width
  482. * The video width in pixels.
  483. * @exportDoc
  484. */
  485. shaka.extern.MediaQualityInfo;
  486. /**
  487. * @typedef {{
  488. * schemeIdUri: string,
  489. * value: string,
  490. * startTime: number,
  491. * endTime: number,
  492. * timescale: number,
  493. * presentationTimeDelta: number,
  494. * eventDuration: number,
  495. * id: number,
  496. * messageData: Uint8Array
  497. * }}
  498. *
  499. * @description
  500. * Contains information about an EMSG MP4 box.
  501. *
  502. * @property {string} schemeIdUri
  503. * Identifies the message scheme.
  504. * @property {string} value
  505. * Specifies the value for the event.
  506. * @property {number} startTime
  507. * The time that the event starts (in presentation time).
  508. * @property {number} endTime
  509. * The time that the event ends (in presentation time).
  510. * @property {number} timescale
  511. * Provides the timescale, in ticks per second.
  512. * @property {number} presentationTimeDelta
  513. * The offset that the event starts, relative to the start of the segment
  514. * this is contained in (in units of timescale).
  515. * @property {number} eventDuration
  516. * The duration of the event (in units of timescale).
  517. * @property {number} id
  518. * A field identifying this instance of the message.
  519. * @property {Uint8Array} messageData
  520. * Body of the message.
  521. * @exportDoc
  522. */
  523. shaka.extern.EmsgInfo;
  524. /**
  525. * @typedef {{
  526. * distinctiveIdentifierRequired: boolean,
  527. * persistentStateRequired: boolean,
  528. * videoRobustness: string,
  529. * audioRobustness: string,
  530. * serverCertificate: Uint8Array,
  531. * serverCertificateUri: string,
  532. * individualizationServer: string,
  533. * sessionType: string
  534. * }}
  535. *
  536. * @property {boolean} distinctiveIdentifierRequired
  537. * <i>Defaults to false.</i> <br>
  538. * True if the application requires the key system to support distinctive
  539. * identifiers.
  540. * @property {boolean} persistentStateRequired
  541. * <i>Defaults to false.</i> <br>
  542. * True if the application requires the key system to support persistent
  543. * state, e.g., for persistent license storage.
  544. * @property {string} videoRobustness
  545. * A key-system-specific string that specifies a required security level for
  546. * video.
  547. * <i>Defaults to <code>''</code>, i.e., no specific robustness required.</i>
  548. * @property {string} audioRobustness
  549. * A key-system-specific string that specifies a required security level for
  550. * audio.
  551. * <i>Defaults to <code>''</code>, i.e., no specific robustness required.</i>
  552. * @property {Uint8Array} serverCertificate
  553. * <i>Defaults to null.</i> <br>
  554. * <i>An empty certificate (<code>byteLength==0</code>) will be treated as
  555. * <code>null</code>.</i> <br>
  556. * <i>A certificate will be requested from the license server if
  557. * required.</i> <br>
  558. * A key-system-specific server certificate used to encrypt license requests.
  559. * Its use is optional and is meant as an optimization to avoid a round-trip
  560. * to request a certificate.
  561. * @property {string} serverCertificateUri
  562. * <i>Defaults to <code>''</code>.</i><br>
  563. * If given, will make a request to the given URI to get the server
  564. * certificate. This is ignored if <code>serverCertificate</code> is set.
  565. * @property {string} individualizationServer
  566. * The server that handles an <code>'individualiation-request'</code>. If the
  567. * server isn't given, it will default to the license server.
  568. * @property {string} sessionType
  569. * <i>Defaults to <code>'temporary'</code> for streaming.</i> <br>
  570. * The MediaKey session type to create streaming licenses with. This doesn't
  571. * affect offline storage.
  572. *
  573. * @exportDoc
  574. */
  575. shaka.extern.AdvancedDrmConfiguration;
  576. /**
  577. * @typedef {{
  578. * retryParameters: shaka.extern.RetryParameters,
  579. * servers: !Object.<string, string>,
  580. * clearKeys: !Object.<string, string>,
  581. * delayLicenseRequestUntilPlayed: boolean,
  582. * advanced: Object.<string, shaka.extern.AdvancedDrmConfiguration>,
  583. * initDataTransform:(shaka.extern.InitDataTransform|undefined),
  584. * logLicenseExchange: boolean,
  585. * updateExpirationTime: number,
  586. * preferredKeySystems: !Array.<string>
  587. * }}
  588. *
  589. * @property {shaka.extern.RetryParameters} retryParameters
  590. * Retry parameters for license requests.
  591. * @property {!Object.<string, string>} servers
  592. * <i>Required for all but the clear key CDM.</i> <br>
  593. * A dictionary which maps key system IDs to their license servers.
  594. * For example,
  595. * <code>{'com.widevine.alpha': 'https://example.com/drm'}</code>.
  596. * @property {!Object.<string, string>} clearKeys
  597. * <i>Forces the use of the Clear Key CDM.</i>
  598. * A map of key IDs (hex) to keys (hex).
  599. * @property {boolean} delayLicenseRequestUntilPlayed
  600. * <i>Defaults to false.</i> <br>
  601. * True to configure drm to delay sending a license request until a user
  602. * actually starts playing content.
  603. * @property {Object.<string, shaka.extern.AdvancedDrmConfiguration>} advanced
  604. * <i>Optional.</i> <br>
  605. * A dictionary which maps key system IDs to advanced DRM configuration for
  606. * those key systems.
  607. * @property {shaka.extern.InitDataTransform|undefined} initDataTransform
  608. * <i>Optional.</i><br>
  609. * If given, this function is called with the init data from the
  610. * manifest/media and should return the (possibly transformed) init data to
  611. * pass to the browser.
  612. * @property {boolean} logLicenseExchange
  613. * <i>Optional.</i><br>
  614. * If set to <code>true</code>, prints logs containing the license exchange.
  615. * This includes the init data, request, and response data, printed as base64
  616. * strings. Don't use in production, for debugging only; has no affect in
  617. * release builds as logging is removed.
  618. * @property {number} updateExpirationTime
  619. * <i>Defaults to 1.</i> <br>
  620. * The frequency in seconds with which to check the expiration of a session.
  621. * @property {!Array.<string>} preferredKeySystems
  622. * <i>Defaults to an empty array. </i> <br>
  623. * Specifies the priorties of available DRM key systems.
  624. *
  625. * @exportDoc
  626. */
  627. shaka.extern.DrmConfiguration;
  628. /**
  629. * @typedef {function(!Uint8Array, string, ?shaka.extern.DrmInfo):!Uint8Array}
  630. *
  631. * @description
  632. * A callback function to handle custom content ID signaling for FairPlay
  633. * content.
  634. *
  635. * @exportDoc
  636. */
  637. shaka.extern.InitDataTransform;
  638. /**
  639. * @typedef {{
  640. * clockSyncUri: string,
  641. * ignoreDrmInfo: boolean,
  642. * disableXlinkProcessing: boolean,
  643. * xlinkFailGracefully: boolean,
  644. * ignoreMinBufferTime: boolean,
  645. * autoCorrectDrift: boolean,
  646. * initialSegmentLimit: number,
  647. * ignoreSuggestedPresentationDelay: boolean,
  648. * ignoreEmptyAdaptationSet: boolean,
  649. * ignoreMaxSegmentDuration: boolean,
  650. * keySystemsByURI: !Object.<string, string>,
  651. * manifestPreprocessor: function(!Element)
  652. * }}
  653. *
  654. * @property {string} clockSyncUri
  655. * A default clock sync URI to be used with live streams which do not
  656. * contain any clock sync information. The <code>Date</code> header from this
  657. * URI will be used to determine the current time.
  658. * @property {boolean} ignoreDrmInfo
  659. * If true will cause DASH parser to ignore DRM information specified
  660. * by the manifest and treat it as if it signaled no particular key
  661. * system and contained no init data. Defaults to false if not provided.
  662. * @property {boolean} disableXlinkProcessing
  663. * If true, xlink-related processing will be disabled. Defaults to
  664. * <code>false</code> if not provided.
  665. * @property {boolean} xlinkFailGracefully
  666. * If true, xlink-related errors will result in a fallback to the tag's
  667. * existing contents. If false, xlink-related errors will be propagated
  668. * to the application and will result in a playback failure. Defaults to
  669. * false if not provided.
  670. * @property {boolean} ignoreMinBufferTime
  671. * If true will cause DASH parser to ignore <code>minBufferTime</code> from
  672. * manifest. It allows player config to take precedence over manifest for
  673. * <code>rebufferingGoal</code>. Defaults to <code>false</code> if not
  674. * provided.
  675. * @property {boolean} autoCorrectDrift
  676. * If <code>true</code>, ignore the <code>availabilityStartTime</code> in the
  677. * manifest and instead use the segments to determine the live edge. This
  678. * allows us to play streams that have a lot of drift. If <code>false</code>,
  679. * we can't play content where the manifest specifies segments in the future.
  680. * Defaults to <code>true</code>.
  681. * @property {number} initialSegmentLimit
  682. * The maximum number of initial segments to generate for
  683. * <code>SegmentTemplate</code> with fixed-duration segments. This is limited
  684. * to avoid excessive memory consumption with very large
  685. * <code>timeShiftBufferDepth</code> values.
  686. * @property {boolean} ignoreSuggestedPresentationDelay
  687. * If true will cause DASH parser to ignore
  688. * <code>suggestedPresentationDelay</code> from manifest. Defaults to
  689. * <code>false</code> if not provided.
  690. * @property {boolean} ignoreEmptyAdaptationSet
  691. * If true will cause DASH parser to ignore
  692. * empty <code>AdaptationSet</code> from manifest. Defaults to
  693. * <code>false</code> if not provided.
  694. * @property {boolean} ignoreMaxSegmentDuration
  695. * If true will cause DASH parser to ignore
  696. * <code>maxSegmentDuration</code> from manifest. Defaults to
  697. * <code>false</code> if not provided.
  698. * @property {Object.<string, string>} keySystemsByURI
  699. * A map of scheme URI to key system name. Defaults to default key systems
  700. * mapping handled by Shaka.
  701. * @property {function(!Element)} manifestPreprocessor
  702. * Called immediately after the DASH manifest has been parsed into an
  703. * XMLDocument. Provides a way for applications to perform efficient
  704. * preprocessing of the manifest.
  705. * @exportDoc
  706. */
  707. shaka.extern.DashManifestConfiguration;
  708. /**
  709. * @typedef {{
  710. * ignoreTextStreamFailures: boolean,
  711. * ignoreImageStreamFailures: boolean,
  712. * useFullSegmentsForStartTime: boolean,
  713. * defaultAudioCodec: string,
  714. * defaultVideoCodec: string
  715. * }}
  716. *
  717. * @property {boolean} ignoreTextStreamFailures
  718. * If <code>true</code>, ignore any errors in a text stream and filter out
  719. * those streams.
  720. * @property {boolean} ignoreImageStreamFailures
  721. * If <code>true</code>, ignore any errors in a image stream and filter out
  722. * those streams.
  723. * @property {boolean} useFullSegmentsForStartTime
  724. * If <code>true</code>, force HlsParser to use a full segment request for
  725. * determining start time in case the server does not support partial requests
  726. * @property {string} defaultAudioCodec
  727. * The default audio codec if it is not specified in the HLS playlist.
  728. * <i>Defaults to <code>'mp4a.40.2'</code>.</i>
  729. * @property {string} defaultVideoCodec
  730. * The default video codec if it is not specified in the HLS playlist.
  731. * <i>Defaults to <code>'avc1.42E01E'</code>.</i>
  732. * @exportDoc
  733. */
  734. shaka.extern.HlsManifestConfiguration;
  735. /**
  736. * @typedef {{
  737. * retryParameters: shaka.extern.RetryParameters,
  738. * availabilityWindowOverride: number,
  739. * disableAudio: boolean,
  740. * disableVideo: boolean,
  741. * disableText: boolean,
  742. * disableThumbnails: boolean,
  743. * defaultPresentationDelay: number,
  744. * dash: shaka.extern.DashManifestConfiguration,
  745. * hls: shaka.extern.HlsManifestConfiguration
  746. * }}
  747. *
  748. * @property {shaka.extern.RetryParameters} retryParameters
  749. * Retry parameters for manifest requests.
  750. * @property {number} availabilityWindowOverride
  751. * A number, in seconds, that overrides the availability window in the
  752. * manifest, or <code>NaN</code> if the default value should be used. This is
  753. * enforced by the manifest parser, so custom manifest parsers should take
  754. * care to honor this parameter.
  755. * @property {boolean} disableAudio
  756. * If <code>true</code>, the audio tracks are ignored.
  757. * Defaults to <code>false</code>.
  758. * @property {boolean} disableVideo
  759. * If <code>true</code>, the video tracks are ignored.
  760. * Defaults to <code>false</code>.
  761. * @property {boolean} disableText
  762. * If <code>true</code>, the text tracks are ignored.
  763. * Defaults to <code>false</code>.
  764. * @property {boolean} disableThumbnails
  765. * If <code>true</code>, the image tracks are ignored.
  766. * Defaults to <code>false</code>.
  767. * @property {number} defaultPresentationDelay
  768. * A default <code>presentationDelay</code> value.
  769. * For DASH, it's a default <code>presentationDelay</code> value if
  770. * <code>suggestedPresentationDelay</code> is missing in the MPEG DASH
  771. * manifest. The default value is <code>1.5 * minBufferTime</code> if not
  772. * configured or set as 0.
  773. * For HLS, the default value is 3 segments duration if not configured or
  774. * set as 0.
  775. * @property {shaka.extern.DashManifestConfiguration} dash
  776. * Advanced parameters used by the DASH manifest parser.
  777. * @property {shaka.extern.HlsManifestConfiguration} hls
  778. * Advanced parameters used by the HLS manifest parser.
  779. *
  780. * @exportDoc
  781. */
  782. shaka.extern.ManifestConfiguration;
  783. /**
  784. * @typedef {{
  785. * retryParameters: shaka.extern.RetryParameters,
  786. * failureCallback: function(!shaka.util.Error),
  787. * rebufferingGoal: number,
  788. * bufferingGoal: number,
  789. * bufferBehind: number,
  790. * ignoreTextStreamFailures: boolean,
  791. * alwaysStreamText: boolean,
  792. * startAtSegmentBoundary: boolean,
  793. * gapDetectionThreshold: number,
  794. * smallGapLimit: number,
  795. * jumpLargeGaps: boolean,
  796. * durationBackoff: number,
  797. * forceTransmuxTS: boolean,
  798. * safeSeekOffset: number,
  799. * stallEnabled: boolean,
  800. * stallThreshold: number,
  801. * stallSkip: number,
  802. * useNativeHlsOnSafari: boolean,
  803. * inaccurateManifestTolerance: number,
  804. * lowLatencyMode: boolean,
  805. * autoLowLatencyMode: boolean,
  806. * forceHTTPS: boolean,
  807. * preferNativeHls: boolean,
  808. * updateIntervalSeconds: number,
  809. * dispatchAllEmsgBoxes: boolean,
  810. * observeQualityChanges: boolean
  811. * }}
  812. *
  813. * @description
  814. * The StreamingEngine's configuration options.
  815. *
  816. * @property {shaka.extern.RetryParameters} retryParameters
  817. * Retry parameters for segment requests.
  818. * @property {function(!shaka.util.Error)} failureCallback
  819. * A callback to decide what to do on a streaming failure. Default behavior
  820. * is to retry on live streams and not on VOD.
  821. * @property {number} rebufferingGoal
  822. * The minimum number of seconds of content that the StreamingEngine must
  823. * buffer before it can begin playback or can continue playback after it has
  824. * entered into a buffering state (i.e., after it has depleted one more
  825. * more of its buffers).
  826. * @property {number} bufferingGoal
  827. * The number of seconds of content that the StreamingEngine will attempt to
  828. * buffer ahead of the playhead. This value must be greater than or equal to
  829. * the rebuffering goal.
  830. * @property {number} bufferBehind
  831. * The maximum number of seconds of content that the StreamingEngine will keep
  832. * in buffer behind the playhead when it appends a new media segment.
  833. * The StreamingEngine will evict content to meet this limit.
  834. * @property {boolean} ignoreTextStreamFailures
  835. * If <code>true</code>, the player will ignore text stream failures and
  836. * continue playing other streams.
  837. * @property {boolean} alwaysStreamText
  838. * If <code>true</code>, always stream text tracks, regardless of whether or
  839. * not they are shown. This is necessary when using the browser's built-in
  840. * controls, which are not capable of signaling display state changes back to
  841. * Shaka Player.
  842. * Defaults to <code>false</code>.
  843. * @property {boolean} startAtSegmentBoundary
  844. * If <code>true</code>, adjust the start time backwards so it is at the start
  845. * of a segment. This affects both explicit start times and calculated start
  846. * time for live streams. This can put us further from the live edge. Defaults
  847. * to <code>false</code>.
  848. * @property {number} gapDetectionThreshold
  849. * TThe maximum distance (in seconds) before a gap when we'll automatically
  850. * jump. This value defaults to <code>0.1</code>, except in Edge Legacy, IE,
  851. * Tizen, Chromecast that value defaults value is <code>0.5</code>
  852. * @property {number} smallGapLimit
  853. * The limit (in seconds) for a gap in the media to be considered "small".
  854. * Small gaps are jumped automatically without events. Large gaps result
  855. * in a Player event and can be jumped.
  856. * @property {boolean} jumpLargeGaps
  857. * If <code>true</code>, jump large gaps in addition to small gaps. A
  858. * <code>largegap</code> event will be raised first. Then, if the app doesn't
  859. * call <code>preventDefault()</code> on the event, the Player will jump the
  860. * gap. If <code>false</code>, then the event will be raised, but the gap
  861. * will not be jumped.
  862. * @property {number} durationBackoff
  863. * By default, we will not allow seeking to exactly the duration of a
  864. * presentation. This field is the number of seconds before duration we will
  865. * seek to when the user tries to seek to or start playback at the duration.
  866. * To disable this behavior, the config can be set to 0. We recommend using
  867. * the default value unless you have a good reason not to.
  868. * @property {boolean} forceTransmuxTS
  869. * If this is <code>true</code>, we will transmux TS content even if not
  870. * strictly necessary for the assets to be played. Shaka Player currently
  871. * only supports CEA 708 captions by transmuxing, so this value is necessary
  872. * for enabling them on platforms with native TS support like Edge or
  873. * Chromecast. This value defaults to <code>false</code>.
  874. * @property {number} safeSeekOffset
  875. * The amount of seconds that should be added when repositioning the playhead
  876. * after falling out of the availability window or seek. This gives the player
  877. * more time to buffer before falling outside again, but increases the forward
  878. * jump in the stream skipping more content. This is helpful for lower
  879. * bandwidth scenarios. Defaults to 5 if not provided.
  880. * @property {boolean} stallEnabled
  881. * When set to <code>true</code>, the stall detector logic will run. If the
  882. * playhead stops moving for <code>stallThreshold</code> seconds, the player
  883. * will either seek or pause/play to resolve the stall, depending on the value
  884. * of <code>stallSkip</code>.
  885. * @property {number} stallThreshold
  886. * The maximum number of seconds that may elapse without the playhead moving
  887. * (when playback is expected) before it will be labeled as a stall.
  888. * @property {number} stallSkip
  889. * The number of seconds that the player will skip forward when a stall has
  890. * been detected. If 0, the player will pause and immediately play instead of
  891. * seeking. A value of 0 is recommended and provided as default on TV
  892. * platforms (WebOS, Tizen, Chromecast, etc).
  893. * @property {boolean} useNativeHlsOnSafari
  894. * Desktop Safari has both MediaSource and their native HLS implementation.
  895. * Depending on the application's needs, it may prefer one over the other.
  896. * Examples: FairPlay is only supported via Safari's native HLS, but it
  897. * doesn't have an API for selecting specific tracks.
  898. * @property {number} inaccurateManifestTolerance
  899. * The maximum difference, in seconds, between the times in the manifest and
  900. * the times in the segments. Larger values allow us to compensate for more
  901. * drift (up to one segment duration). Smaller values reduce the incidence of
  902. * extra segment requests necessary to compensate for drift.
  903. * @property {boolean} lowLatencyMode
  904. * If <code>true</code>, low latency streaming mode is enabled. If
  905. * lowLatencyMode is set to true, inaccurateManifestTolerance is set to 0
  906. * unless specified, and rebufferingGoal to 0.01 unless specified at the same
  907. * time.
  908. * @property {boolean} autoLowLatencyMode
  909. * If the stream is low latency and the user has not configured the
  910. * lowLatencyMode, but if it has been configured to activate the
  911. * lowLatencyMode if a stream of this type is detected, we automatically
  912. * activate the lowLatencyMode. Defaults to false.
  913. * @property {boolean} forceHTTPS
  914. * If true, if the protocol is HTTP change it to HTTPs.
  915. * @property {boolean} preferNativeHls
  916. * If true, prefer native HLS playback when possible, regardless of platform.
  917. * @property {number} updateIntervalSeconds
  918. * The minimum number of seconds to see if the manifest has changes.
  919. * @property {boolean} dispatchAllEmsgBoxes
  920. * If true, all emsg boxes are parsed and dispatched.
  921. * @property {boolean} observeQualityChanges
  922. * If true, monitor media quality changes and emit
  923. * <code.shaka.Player.MediaQualityChangedEvent</code>.
  924. * @exportDoc
  925. */
  926. shaka.extern.StreamingConfiguration;
  927. /**
  928. * @typedef {{
  929. * enabled: boolean,
  930. * useNetworkInformation: boolean,
  931. * defaultBandwidthEstimate: number,
  932. * restrictions: shaka.extern.Restrictions,
  933. * switchInterval: number,
  934. * bandwidthUpgradeTarget: number,
  935. * bandwidthDowngradeTarget: number,
  936. * advanced: shaka.extern.AdvancedAbrConfiguration
  937. * }}
  938. *
  939. * @property {boolean} enabled
  940. * If true, enable adaptation by the current AbrManager. Defaults to true.
  941. * @property {boolean} useNetworkInformation
  942. * If true, use Network Information API in the current AbrManager.
  943. * Defaults to true.
  944. * @property {number} defaultBandwidthEstimate
  945. * The default bandwidth estimate to use if there is not enough data, in
  946. * bit/sec.
  947. * @property {shaka.extern.Restrictions} restrictions
  948. * The restrictions to apply to ABR decisions. These are "soft" restrictions.
  949. * Any track that fails to meet these restrictions will not be selected
  950. * automatically, but will still appear in the track list and can still be
  951. * selected via <code>selectVariantTrack()</code>. If no tracks meet these
  952. * restrictions, AbrManager should not fail, but choose a low-res or
  953. * low-bandwidth variant instead. It is the responsibility of AbrManager
  954. * implementations to follow these rules and implement this behavior.
  955. * @property {number} switchInterval
  956. * The minimum amount of time that must pass between switches, in
  957. * seconds. This keeps us from changing too often and annoying the user.
  958. * @property {number} bandwidthUpgradeTarget
  959. * The fraction of the estimated bandwidth which we should try to use when
  960. * upgrading.
  961. * @property {number} bandwidthDowngradeTarget
  962. * The largest fraction of the estimated bandwidth we should use. We should
  963. * downgrade to avoid this.
  964. * @property {shaka.extern.AdvancedAbrConfiguration} advanced
  965. * Advanced ABR configuration.
  966. * @exportDoc
  967. */
  968. shaka.extern.AbrConfiguration;
  969. /**
  970. * @typedef {{
  971. * minTotalBytes: number,
  972. * minBytes: number,
  973. * fastHalfLife: number,
  974. * slowHalfLife: number
  975. * }}
  976. *
  977. * @property {number} minTotalBytes
  978. * Minimum number of bytes sampled before we trust the estimate. If we have
  979. * not sampled much data, our estimate may not be accurate enough to trust.
  980. * @property {number} minBytes
  981. * Minimum number of bytes, under which samples are discarded. Our models
  982. * do not include latency information, so connection startup time (time to
  983. * first byte) is considered part of the download time. Because of this, we
  984. * should ignore very small downloads which would cause our estimate to be
  985. * too low.
  986. * @property {number} fastHalfLife
  987. * The quantity of prior samples (by weight) used when creating a new
  988. * estimate, in seconds. Those prior samples make up half of the
  989. * new estimate.
  990. * @property {number} slowHalfLife
  991. * The quantity of prior samples (by weight) used when creating a new
  992. * estimate, in seconds. Those prior samples make up half of the
  993. * new estimate.
  994. * @exportDoc
  995. */
  996. shaka.extern.AdvancedAbrConfiguration;
  997. /**
  998. * @typedef {{
  999. * enabled: boolean,
  1000. * useHeaders: boolean,
  1001. * sessionId: string,
  1002. * contentId: string
  1003. * }}
  1004. *
  1005. * @description
  1006. * Common Media Client Data (CMCD) configuration.
  1007. *
  1008. * @property {boolean} enabled
  1009. * If <code>true</code>, enable CMCD data to be sent with media requests.
  1010. * Defaults to <code>false</code>.
  1011. * @property {boolean} useHeaders
  1012. * If <code>true</code>, send CMCD data using the header transmission mode
  1013. * instead of query args. Defaults to <code>false</code>.
  1014. * @property {string} sessionId
  1015. * A GUID identifying the current playback session. A playback session
  1016. * typically ties together segments belonging to a single media asset.
  1017. * Maximum length is 64 characters. It is RECOMMENDED to conform to the UUID
  1018. * specification. By default the sessionId is automatically generated on each
  1019. * <code>load()</code> call.
  1020. * @property {string} contentId
  1021. * A unique string identifying the current content. Maximum length is 64
  1022. * characters. This value is consistent across multiple different sessions and
  1023. * devices and is defined and updated at the discretion of the service
  1024. * provider.
  1025. * @exportDoc
  1026. */
  1027. shaka.extern.CmcdConfiguration;
  1028. /**
  1029. * @typedef {{
  1030. * trackSelectionCallback:
  1031. * function(shaka.extern.TrackList):!Promise<shaka.extern.TrackList>,
  1032. * downloadSizeCallback: function(number):!Promise<boolean>,
  1033. * progressCallback: function(shaka.extern.StoredContent,number),
  1034. * usePersistentLicense: boolean
  1035. * }}
  1036. *
  1037. * @property {function(shaka.extern.TrackList):!Promise<shaka.extern.TrackList>}
  1038. * trackSelectionCallback
  1039. * Called inside <code>store()</code> to determine which tracks to save from a
  1040. * manifest. It is passed an array of Tracks from the manifest and it should
  1041. * return an array of the tracks to store.
  1042. * @property {function(number):!Promise<boolean>} downloadSizeCallback
  1043. * Called inside <code>store()</code> to determine if the content can be
  1044. * downloaded due to its estimated size. The estimated size of the download is
  1045. * passed and it must return if the download is allowed or not.
  1046. * @property {function(shaka.extern.StoredContent,number)} progressCallback
  1047. * Called inside <code>store()</code> to give progress info back to the app.
  1048. * It is given the current manifest being stored and the progress of it being
  1049. * stored.
  1050. * @property {boolean} usePersistentLicense
  1051. * If <code>true</code>, store protected content with a persistent license so
  1052. * that no network is required to view.
  1053. * If <code>false</code>, store protected content without a persistent
  1054. * license. A network will be required to retrieve a temporary license to
  1055. * view.
  1056. * Defaults to <code>true</code>.
  1057. * @exportDoc
  1058. */
  1059. shaka.extern.OfflineConfiguration;
  1060. /**
  1061. * @typedef {{
  1062. * drm: shaka.extern.DrmConfiguration,
  1063. * manifest: shaka.extern.ManifestConfiguration,
  1064. * streaming: shaka.extern.StreamingConfiguration,
  1065. * abrFactory: shaka.extern.AbrManager.Factory,
  1066. * abr: shaka.extern.AbrConfiguration,
  1067. * cmcd: shaka.extern.CmcdConfiguration,
  1068. * offline: shaka.extern.OfflineConfiguration,
  1069. * preferredAudioLanguage: string,
  1070. * preferredTextLanguage: string,
  1071. * preferredVariantRole: string,
  1072. * preferredTextRole: string,
  1073. * preferredVideoCodecs: !Array.<string>,
  1074. * preferredAudioCodecs: !Array.<string>,
  1075. * preferredAudioChannelCount: number,
  1076. * preferredDecodingAttributes: !Array.<string>,
  1077. * preferForcedSubs: boolean,
  1078. * restrictions: shaka.extern.Restrictions,
  1079. * playRangeStart: number,
  1080. * playRangeEnd: number,
  1081. * textDisplayFactory: shaka.extern.TextDisplayer.Factory
  1082. * }}
  1083. *
  1084. * @property {shaka.extern.DrmConfiguration} drm
  1085. * DRM configuration and settings.
  1086. * @property {shaka.extern.ManifestConfiguration} manifest
  1087. * Manifest configuration and settings.
  1088. * @property {shaka.extern.StreamingConfiguration} streaming
  1089. * Streaming configuration and settings.
  1090. * @property {shaka.extern.AbrManager.Factory} abrFactory
  1091. * A factory to construct an abr manager.
  1092. * @property {shaka.extern.AbrConfiguration} abr
  1093. * ABR configuration and settings.
  1094. * @property {shaka.extern.CmcdConfiguration} cmcd
  1095. * CMCD configuration and settings. (Common Media Client Data)
  1096. * @property {shaka.extern.OfflineConfiguration} offline
  1097. * Offline configuration and settings.
  1098. * @property {string} preferredAudioLanguage
  1099. * The preferred language to use for audio tracks. If not given it will use
  1100. * the <code>'main'</code> track.
  1101. * Changing this during playback will not affect the current playback.
  1102. * @property {string} preferredTextLanguage
  1103. * The preferred language to use for text tracks. If a matching text track
  1104. * is found, and the selected audio and text tracks have different languages,
  1105. * the text track will be shown.
  1106. * Changing this during playback will not affect the current playback.
  1107. * @property {string} preferredVariantRole
  1108. * The preferred role to use for variants.
  1109. * @property {string} preferredTextRole
  1110. * The preferred role to use for text tracks.
  1111. * @property {!Array.<string>} preferredVideoCodecs
  1112. * The list of preferred video codecs, in order of highest to lowest priority.
  1113. * @property {!Array.<string>} preferredAudioCodecs
  1114. * The list of preferred audio codecs, in order of highest to lowest priority.
  1115. * @property {number} preferredAudioChannelCount
  1116. * The preferred number of audio channels.
  1117. * @property {!Array.<string>} preferredDecodingAttributes
  1118. * The list of preferred attributes of decodingInfo, in the order of their
  1119. * priorities.
  1120. * @property {boolean} preferForcedSubs
  1121. * If true, a forced text track is preferred. Defaults to false.
  1122. * If the content has no forced captions and the value is true,
  1123. * no text track is chosen.
  1124. * Changing this during playback will not affect the current playback.
  1125. * @property {shaka.extern.Restrictions} restrictions
  1126. * The application restrictions to apply to the tracks. These are "hard"
  1127. * restrictions. Any track that fails to meet these restrictions will not
  1128. * appear in the track list. If no tracks meet these restrictions, playback
  1129. * will fail.
  1130. * @property {number} playRangeStart
  1131. * Optional playback and seek start time in seconds. Defaults to 0 if
  1132. * not provided.
  1133. * @property {number} playRangeEnd
  1134. * Optional playback and seek end time in seconds. Defaults to the end of
  1135. * the presentation if not provided.
  1136. * @property {shaka.extern.TextDisplayer.Factory} textDisplayFactory
  1137. * A factory to construct a text displayer. Note that, if this is changed
  1138. * during playback, it will cause the text tracks to be reloaded.
  1139. * @exportDoc
  1140. */
  1141. shaka.extern.PlayerConfiguration;
  1142. /**
  1143. * @typedef {{
  1144. * language: string,
  1145. * role: string,
  1146. * label: ?string
  1147. * }}
  1148. *
  1149. * @property {string} language
  1150. * The language code for the stream.
  1151. * @property {string} role
  1152. * The role name for the stream. If the stream has no role, <code>role</code>
  1153. * will be <code>''</code>.
  1154. * @property {?string} label
  1155. * The label of the audio stream, if it has one.
  1156. * @exportDoc
  1157. */
  1158. shaka.extern.LanguageRole;
  1159. /**
  1160. * @typedef {{
  1161. * imageHeight: number,
  1162. * imageWidth: number,
  1163. * height: number,
  1164. * positionX: number,
  1165. * positionY: number,
  1166. * startTime: number,
  1167. * duration: number,
  1168. * uris: !Array.<string>,
  1169. * width: number
  1170. * }}
  1171. *
  1172. * @property {number} imageHeight
  1173. * The image height in px. The image height could be different to height if
  1174. * the layout is different to 1x1.
  1175. * @property {number} imageWidth
  1176. * The image width in px. The image width could be different to width if
  1177. * the layout is different to 1x1.
  1178. * @property {number} height
  1179. * The thumbnail height in px.
  1180. * @property {number} positionX
  1181. * The thumbnail left position in px.
  1182. * @property {number} positionY
  1183. * The thumbnail top position in px.
  1184. * @property {number} startTime
  1185. * The start time of the thumbnail in the presentation timeline, in seconds.
  1186. * @property {number} duration
  1187. * The duration of the thumbnail, in seconds.
  1188. * @property {!Array.<string>} uris
  1189. * An array of URIs to attempt. They will be tried in the order they are
  1190. * given.
  1191. * @property {number} width
  1192. * The thumbnail width in px.
  1193. * @exportDoc
  1194. */
  1195. shaka.extern.Thumbnail;
  1196. /**
  1197. * @typedef {{
  1198. * title: string,
  1199. * startTime: number,
  1200. * endTime: number
  1201. * }}
  1202. *
  1203. * @property {string} title
  1204. * The title of the chapter.
  1205. * @property {number} startTime
  1206. * The time that describes the beginning of the range of the chapter.
  1207. * @property {number} endTime
  1208. * The time that describes the end of the range of chapter.
  1209. * @exportDoc
  1210. */
  1211. shaka.extern.Chapter;