Source: externs/shaka/player.js

  1. /**
  2. * @license
  3. * Copyright 2016 Google Inc.
  4. *
  5. * Licensed under the Apache License, Version 2.0 (the "License");
  6. * you may not use this file except in compliance with the License.
  7. * You may obtain a copy of the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS,
  13. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. * See the License for the specific language governing permissions and
  15. * limitations under the License.
  16. */
  17. /** @externs */
  18. /**
  19. * @typedef {{
  20. * timestamp: number,
  21. * id: number,
  22. * type: string,
  23. * fromAdaptation: boolean,
  24. * bandwidth: ?number
  25. * }}
  26. *
  27. * @property {number} timestamp
  28. * The timestamp the choice was made, in seconds since 1970
  29. * (i.e. Date.now() / 1000).
  30. * @property {number} id
  31. * The id of the track that was chosen.
  32. * @property {string} type
  33. * The type of track chosen ('variant' or 'text').
  34. * @property {boolean} fromAdaptation
  35. * True if the choice was made by AbrManager for adaptation; false if it
  36. * was made by the application through selectTrack.
  37. * @property {?number} bandwidth
  38. * The bandwidth of the chosen track (null for text).
  39. * @exportDoc
  40. */
  41. shakaExtern.TrackChoice;
  42. /**
  43. * @typedef {{
  44. * timestamp: number,
  45. * state: string,
  46. * duration: number
  47. * }}
  48. *
  49. * @property {number} timestamp
  50. * The timestamp the state was entered, in seconds since 1970
  51. * (i.e. Date.now() / 1000).
  52. * @property {string} state
  53. * The state the player entered. This could be 'buffering', 'playing',
  54. * 'paused', or 'ended'.
  55. * @property {number} duration
  56. * The number of seconds the player was in this state. If this is the last
  57. * entry in the list, the player is still in this state, so the duration will
  58. * continue to increase.
  59. * @exportDoc
  60. */
  61. shakaExtern.StateChange;
  62. /**
  63. * @typedef {{
  64. * width: number,
  65. * height: number,
  66. * streamBandwidth: number,
  67. *
  68. * decodedFrames: number,
  69. * droppedFrames: number,
  70. * estimatedBandwidth: number,
  71. *
  72. * loadLatency: number,
  73. * playTime: number,
  74. * bufferingTime: number,
  75. *
  76. * switchHistory: !Array.<shakaExtern.TrackChoice>,
  77. * stateHistory: !Array.<shakaExtern.StateChange>
  78. * }}
  79. *
  80. * @description
  81. * Contains statistics and information about the current state of the player.
  82. * This is meant for applications that want to log quality-of-experience (QoE)
  83. * or other stats. These values will reset when load() is called again.
  84. *
  85. * @property {number} width
  86. * The width of the current video track.
  87. * @property {number} height
  88. * The height of the current video track.
  89. * @property {number} streamBandwidth
  90. * The bandwidth required for the current streams (total, in bit/sec).
  91. *
  92. * @property {number} decodedFrames
  93. * The total number of frames decoded by the Player. This may be NaN if this
  94. * is not supported by the browser.
  95. * @property {number} droppedFrames
  96. * The total number of frames dropped by the Player. This may be NaN if this
  97. * is not supported by the browser.
  98. * @property {number} estimatedBandwidth
  99. * The current estimated network bandwidth (in bit/sec).
  100. *
  101. * @property {number} loadLatency
  102. * This is the number of seconds it took for the video element to have enough
  103. * data to begin playback. This is measured from the time load() is called to
  104. * the time the 'loadeddata' event is fired by the media element.
  105. * @property {number} playTime
  106. * The total time spent in a playing state in seconds.
  107. * @property {number} bufferingTime
  108. * The total time spent in a buffering state in seconds.
  109. *
  110. * @property {!Array.<shakaExtern.TrackChoice>} switchHistory
  111. * A history of the stream changes.
  112. * @property {!Array.<shakaExtern.StateChange>} stateHistory
  113. * A history of the state changes.
  114. * @exportDoc
  115. */
  116. shakaExtern.Stats;
  117. /**
  118. * @typedef {{
  119. * start: number,
  120. * end: number
  121. * }}
  122. *
  123. * @description
  124. * Contains the times of a range of buffered content.
  125. *
  126. * @property {number} start
  127. * The start time of the range, in seconds.
  128. * @property {number} end
  129. * The end time of the range, in seconds.
  130. * @exportDoc
  131. */
  132. shakaExtern.BufferedRange;
  133. /**
  134. * @typedef {{
  135. * total: !Array.<shakaExtern.BufferedRange>,
  136. * audio: !Array.<shakaExtern.BufferedRange>,
  137. * video: !Array.<shakaExtern.BufferedRange>,
  138. * text: !Array.<shakaExtern.BufferedRange>
  139. * }}
  140. *
  141. * @description
  142. * Contains information about the current buffered ranges.
  143. *
  144. * @property {!Array.<shakaExtern.BufferedRange>} total
  145. * The combined audio/video buffered ranges, reported by |video.buffered|.
  146. * @property {!Array.<shakaExtern.BufferedRange>} audio
  147. * The buffered ranges for audio content.
  148. * @property {!Array.<shakaExtern.BufferedRange>} video
  149. * The buffered ranges for video content.
  150. * @property {!Array.<shakaExtern.BufferedRange>} text
  151. * The buffered ranges for text content.
  152. * @exportDoc
  153. */
  154. shakaExtern.BufferedInfo;
  155. /**
  156. * @typedef {{
  157. * id: number,
  158. * active: boolean,
  159. *
  160. * type: string,
  161. * bandwidth: number,
  162. *
  163. * language: string,
  164. * label: ?string,
  165. * kind: ?string,
  166. * width: ?number,
  167. * height: ?number,
  168. * frameRate: ?number,
  169. * mimeType: ?string,
  170. * codecs: ?string,
  171. * audioCodec: ?string,
  172. * videoCodec: ?string,
  173. * primary: boolean,
  174. * roles: !Array.<string>,
  175. * videoId: ?number,
  176. * audioId: ?number,
  177. * channelsCount: ?number,
  178. * audioBandwidth: ?number,
  179. * videoBandwidth: ?number
  180. * }}
  181. *
  182. * @description
  183. * An object describing a media track. This object should be treated as
  184. * read-only as changing any values does not have any effect. This is the
  185. * public view of an audio/video paring (variant type) or text track (text
  186. * type).
  187. *
  188. * @property {number} id
  189. * The unique ID of the track.
  190. * @property {boolean} active
  191. * If true, this is the track being streamed (another track may be
  192. * visible/audible in the buffer).
  193. *
  194. * @property {string} type
  195. * The type of track, either 'variant' or 'text'.
  196. * @property {number} bandwidth
  197. * The bandwidth required to play the track, in bits/sec.
  198. *
  199. * @property {string} language
  200. * The language of the track, or 'und' if not given. This is the exact
  201. * value provided in the manifest; it may need to be normalized.
  202. * @property {?string} label
  203. * The track label, which is unique text that should describe the track.
  204. * @property {?string} kind
  205. * (only for text tracks) The kind of text track, either 'caption' or
  206. * 'subtitle'.
  207. * @property {?number} width
  208. * The video width provided in the manifest, if present.
  209. * @property {?number} height
  210. * The video height provided in the manifest, if present.
  211. * @property {?number} frameRate
  212. * The video framerate provided in the manifest, if present.
  213. * @property {?string} mimeType
  214. * The MIME type of the content provided in the manifest.
  215. * @property {?string} codecs
  216. * The audio/video codecs string provided in the manifest, if present.
  217. * @property {?string} audioCodec
  218. * The audio codecs string provided in the manifest, if present.
  219. * @property {?string} videoCodec
  220. * The video codecs string provided in the manifest, if present.
  221. * @property {boolean} primary
  222. * True indicates that this in the primary language for the content.
  223. * This flag is based on signals from the manifest.
  224. * This can be a useful hint about which language should be the default, and
  225. * indicates which track Shaka will use when the user's language preference
  226. * cannot be satisfied.
  227. * @property {!Array.<string>} roles
  228. * The roles of the track, e.g. 'main', 'caption', or 'commentary'.
  229. * @property {?number} videoId
  230. * (only for variant tracks) The video stream id.
  231. * @property {?number} audioId
  232. * (only for variant tracks) The audio stream id.
  233. * @property {?number} channelsCount
  234. * The count of the audio track channels.
  235. * @property {?number} audioBandwidth
  236. * (only for variant tracks) The audio stream's bandwidth if known.
  237. * @property {?number} videoBandwidth
  238. * (only for variant tracks) The video stream's bandwidth if known.
  239. * @exportDoc
  240. */
  241. shakaExtern.Track;
  242. /**
  243. * @typedef {{
  244. * minWidth: number,
  245. * maxWidth: number,
  246. * minHeight: number,
  247. * maxHeight: number,
  248. * minPixels: number,
  249. * maxPixels: number,
  250. *
  251. * minBandwidth: number,
  252. * maxBandwidth: number
  253. * }}
  254. *
  255. * @description
  256. * An object describing application restrictions on what tracks can play. All
  257. * restrictions must be fulfilled for a track to be playable/selectable.
  258. * The restrictions system behaves somewhat differently at the ABR level and the
  259. * player level, so please refer to the documentation for those specific
  260. * settings.
  261. *
  262. * @see shakaExtern.PlayerConfiguration
  263. * @see shakaExtern.AbrConfiguration
  264. *
  265. * @property {number} minWidth
  266. * The minimum width of a video track, in pixels.
  267. * @property {number} maxWidth
  268. * The maximum width of a video track, in pixels.
  269. * @property {number} minHeight
  270. * The minimum height of a video track, in pixels.
  271. * @property {number} maxHeight
  272. * The maximum height of a video track, in pixels.
  273. * @property {number} minPixels
  274. * The minimum number of total pixels in a video track (i.e. width * height).
  275. * @property {number} maxPixels
  276. * The maximum number of total pixels in a video track (i.e. width * height).
  277. *
  278. * @property {number} minBandwidth
  279. * The minimum bandwidth of a variant track, in bit/sec.
  280. * @property {number} maxBandwidth
  281. * The maximum bandwidth of a variant track, in bit/sec.
  282. * @exportDoc
  283. */
  284. shakaExtern.Restrictions;
  285. /**
  286. * @typedef {{
  287. * persistentState: boolean
  288. * }}
  289. *
  290. * @property {boolean} persistentState
  291. * Whether this key system supports persistent state.
  292. * @exportDoc
  293. */
  294. shakaExtern.DrmSupportType;
  295. /**
  296. * @typedef {{
  297. * manifest: !Object.<string, boolean>,
  298. * media: !Object.<string, boolean>,
  299. * drm: !Object.<string, ?shakaExtern.DrmSupportType>
  300. * }}
  301. *
  302. * @description
  303. * An object detailing browser support for various features.
  304. *
  305. * @property {!Object.<string, boolean>} manifest
  306. * A map of supported manifest types.
  307. * The keys are manifest MIME types and file extensions.
  308. * @property {!Object.<string, boolean>} media
  309. * A map of supported media types.
  310. * The keys are media MIME types.
  311. * @property {!Object.<string, ?shakaExtern.DrmSupportType>} drm
  312. * A map of supported key systems.
  313. * The keys are the key system names. The value is null if it is not
  314. * supported. Key systems not probed will not be in this dictionary.
  315. *
  316. * @exportDoc
  317. */
  318. shakaExtern.SupportType;
  319. /**
  320. * @typedef {{
  321. * schemeIdUri: string,
  322. * value: string,
  323. * startTime: number,
  324. * endTime: number,
  325. * id: string,
  326. * eventElement: Element
  327. * }}
  328. *
  329. * @description
  330. * Contains information about a region of the timeline that will cause an event
  331. * to be raised when the playhead enters or exits it. In DASH this is the
  332. * EventStream element.
  333. *
  334. * @property {string} schemeIdUri
  335. * Identifies the message scheme.
  336. * @property {string} value
  337. * Specifies the value for the region.
  338. * @property {number} startTime
  339. * The presentation time (in seconds) that the region should start.
  340. * @property {number} endTime
  341. * The presentation time (in seconds) that the region should end.
  342. * @property {string} id
  343. * Specifies an identifier for this instance of the region.
  344. * @property {Element} eventElement
  345. * The XML element that defines the Event.
  346. * @exportDoc
  347. */
  348. shakaExtern.TimelineRegionInfo;
  349. /**
  350. * @typedef {{
  351. * schemeIdUri: string,
  352. * value: string,
  353. * startTime: number,
  354. * endTime: number,
  355. * timescale: number,
  356. * presentationTimeDelta: number,
  357. * eventDuration: number,
  358. * id: number,
  359. * messageData: Uint8Array
  360. * }}
  361. *
  362. * @description
  363. * Contains information about an EMSG MP4 box.
  364. *
  365. * @property {string} schemeIdUri
  366. * Identifies the message scheme.
  367. * @property {string} value
  368. * Specifies the value for the event.
  369. * @property {number} startTime
  370. * The time that the event starts (in presentation time).
  371. * @property {number} endTime
  372. * The time that the event ends (in presentation time).
  373. * @property {number} timescale
  374. * Provides the timescale, in ticks per second.
  375. * @property {number} presentationTimeDelta
  376. * The offset that the event starts, relative to the start of the segment
  377. * this is contained in (in units of timescale).
  378. * @property {number} eventDuration
  379. * The duration of the event (in units of timescale).
  380. * @property {number} id
  381. * A field identifying this instance of the message.
  382. * @property {Uint8Array} messageData
  383. * Body of the message.
  384. * @exportDoc
  385. */
  386. shakaExtern.EmsgInfo;
  387. /**
  388. * @typedef {function(!Element):Array.<shakaExtern.DrmInfo>}
  389. * @see shakaExtern.DashManifestConfiguration
  390. * @exportDoc
  391. */
  392. shakaExtern.DashContentProtectionCallback;
  393. /**
  394. * @typedef {{
  395. * distinctiveIdentifierRequired: boolean,
  396. * persistentStateRequired: boolean,
  397. * videoRobustness: string,
  398. * audioRobustness: string,
  399. * serverCertificate: Uint8Array
  400. * }}
  401. *
  402. * @property {boolean} distinctiveIdentifierRequired
  403. * <i>Defaults to false.</i> <br>
  404. * True if the application requires the key system to support distinctive
  405. * identifiers.
  406. * @property {boolean} persistentStateRequired
  407. * <i>Defaults to false.</i> <br>
  408. * True if the application requires the key system to support persistent
  409. * state, e.g., for persistent license storage.
  410. * @property {string} videoRobustness
  411. * A key-system-specific string that specifies a required security level for
  412. * video.
  413. * <i>Defaults to '', i.e., no specific robustness required.</i> <br>
  414. * @property {string} audioRobustness
  415. * A key-system-specific string that specifies a required security level for
  416. * audio.
  417. * <i>Defaults to '', i.e., no specific robustness required.</i> <br>
  418. * @property {Uint8Array} serverCertificate
  419. * <i>Defaults to null.</i> <br>
  420. * <i>An empty certificate (byteLength 0) will be treated as null.</i> <br>
  421. * <i>A certificate will be requested from the license server if
  422. * required.</i> <br>
  423. * A key-system-specific server certificate used to encrypt license requests.
  424. * Its use is optional and is meant as an optimization to avoid a round-trip
  425. * to request a certificate.
  426. *
  427. * @exportDoc
  428. */
  429. shakaExtern.AdvancedDrmConfiguration;
  430. /**
  431. * @typedef {{
  432. * retryParameters: shakaExtern.RetryParameters,
  433. * servers: !Object.<string, string>,
  434. * clearKeys: !Object.<string, string>,
  435. * delayLicenseRequestUntilPlayed: boolean,
  436. * advanced: Object.<string, shakaExtern.AdvancedDrmConfiguration>
  437. * }}
  438. *
  439. * @property {shakaExtern.RetryParameters} retryParameters
  440. * Retry parameters for license requests.
  441. * @property {!Object.<string, string>} servers
  442. * <i>Required for all but the clear key CDM.</i> <br>
  443. * A dictionary which maps key system IDs to their license servers.
  444. * For example, {'com.widevine.alpha': 'http://example.com/drm'}.
  445. * @property {!Object.<string, string>} clearKeys
  446. * <i>Forces the use of the Clear Key CDM.</i>
  447. * A map of key IDs (hex) to keys (hex).
  448. * @property {boolean} delayLicenseRequestUntilPlayed
  449. * <i>Defaults to false.</i> <br>
  450. * True to configure drm to delay sending a license request until a user
  451. * actually starts playing content.
  452. * @property {Object.<string, shakaExtern.AdvancedDrmConfiguration>} advanced
  453. * <i>Optional.</i> <br>
  454. * A dictionary which maps key system IDs to advanced DRM configuration for
  455. * those key systems.
  456. *
  457. * @exportDoc
  458. */
  459. shakaExtern.DrmConfiguration;
  460. /**
  461. * @typedef {{
  462. * customScheme: shakaExtern.DashContentProtectionCallback,
  463. * clockSyncUri: string,
  464. * ignoreDrmInfo: boolean,
  465. * xlinkFailGracefully: boolean,
  466. * defaultPresentationDelay: number
  467. * }}
  468. *
  469. * @property {shakaExtern.DashContentProtectionCallback} customScheme
  470. * If given, invoked by a DASH manifest parser to interpret custom or
  471. * non-standard DRM schemes found in the manifest. The argument is a
  472. * ContentProtection node. Return null if not recognized.
  473. * @property {string} clockSyncUri
  474. * A default clock sync URI to be used with live streams which do not
  475. * contain any clock sync information. The "Date" header from this URI
  476. * will be used to determine the current time.
  477. * @property {boolean} ignoreDrmInfo
  478. * If true will cause DASH parser to ignore DRM information specified
  479. * by the manifest and treat it as if it signaled no particular key
  480. * system and contained no init data. Defaults to false if not provided.
  481. * @property {boolean} xlinkFailGracefully
  482. * If true, xlink-related errors will result in a fallback to the tag's
  483. * existing contents. If false, xlink-related errors will be propagated
  484. * to the application and will result in a playback failure. Defaults to
  485. * false if not provided.
  486. * @property {number} defaultPresentationDelay
  487. * A default presentationDelay if suggestedPresentationDelay is missing
  488. * in the MPEG DASH manifest. This has to be bigger than minBufferTime * 1.5.
  489. *
  490. * @exportDoc
  491. */
  492. shakaExtern.DashManifestConfiguration;
  493. /**
  494. * @typedef {{
  495. * retryParameters: shakaExtern.RetryParameters,
  496. * availabilityWindowOverride: number,
  497. * dash: shakaExtern.DashManifestConfiguration
  498. * }}
  499. *
  500. * @property {shakaExtern.RetryParameters} retryParameters
  501. * Retry parameters for manifest requests.
  502. * @property {number} availabilityWindowOverride
  503. * A number, in seconds, that overrides the availability window in the
  504. * manifest, or NaN if the default value should be used. This is enforced by
  505. * the manifest parser, so custom manifest parsers should take care to honor
  506. * this parameter.
  507. * @property {shakaExtern.DashManifestConfiguration} dash
  508. * Advanced parameters used by the DASH manifest parser.
  509. *
  510. * @exportDoc
  511. */
  512. shakaExtern.ManifestConfiguration;
  513. /**
  514. * @typedef {{
  515. * retryParameters: shakaExtern.RetryParameters,
  516. * failureCallback: function(!shaka.util.Error),
  517. * rebufferingGoal: number,
  518. * bufferingGoal: number,
  519. * bufferBehind: number,
  520. * ignoreTextStreamFailures: boolean,
  521. * alwaysStreamText: boolean,
  522. * startAtSegmentBoundary: boolean,
  523. * smallGapLimit: number,
  524. * jumpLargeGaps: boolean,
  525. * durationBackoff: number,
  526. * forceTransmuxTS: boolean
  527. * }}
  528. *
  529. * @description
  530. * The StreamingEngine's configuration options.
  531. *
  532. * @property {shakaExtern.RetryParameters} retryParameters
  533. * Retry parameters for segment requests.
  534. * @property {function(!shaka.util.Error)} failureCallback
  535. * A callback to decide what to do on a streaming failure. Default behavior
  536. * is to retry on live streams and not on VOD.
  537. * @property {number} rebufferingGoal
  538. * The minimum number of seconds of content that the StreamingEngine must
  539. * buffer before it can begin playback or can continue playback after it has
  540. * entered into a buffering state (i.e., after it has depleted one more
  541. * more of its buffers).
  542. * @property {number} bufferingGoal
  543. * The number of seconds of content that the StreamingEngine will attempt to
  544. * buffer ahead of the playhead. This value must be greater than or equal to
  545. * the rebuffering goal.
  546. * @property {number} bufferBehind
  547. * The maximum number of seconds of content that the StreamingEngine will keep
  548. * in buffer behind the playhead when it appends a new media segment.
  549. * The StreamingEngine will evict content to meet this limit.
  550. * @property {boolean} ignoreTextStreamFailures
  551. * If true, the player will ignore text stream failures and continue playing
  552. * other streams.
  553. * @property {boolean} alwaysStreamText
  554. * If true, always stream text tracks, regardless of whether or not they are
  555. * shown. This is necessary when using the browser's built-in controls, which
  556. * are not capable of signaling display state changes back to Shaka Player.
  557. * Defaults to false.
  558. * @property {boolean} startAtSegmentBoundary
  559. * If true, adjust the start time backwards so it is at the start of a
  560. * segment. This affects both explicit start times and calculated start time
  561. * for live streams. This can put us further from the live edge. Defaults to
  562. * false.
  563. * @property {number} smallGapLimit
  564. * The limit (in seconds) for a gap in the media to be considered "small".
  565. * Small gaps are jumped automatically without events. Large gaps result
  566. * in a Player event and can be jumped.
  567. * @property {boolean} jumpLargeGaps
  568. * If true, jump large gaps in addition to small gaps. The event will be
  569. * raised first. Then, if the app doesn't call preventDefault() on the event,
  570. * the Player will jump the gap. If false, then the event will be raised,
  571. * but the gap will not be jumped.
  572. * @property {number} durationBackoff
  573. * By default, we will not allow seeking to exactly the duration of a
  574. * presentation. This field is the number of seconds before duration we will
  575. * seek to when the user tries to seek to or start playback at the duration.
  576. * To disable this behavior, the config can be set to 0. We recommend using
  577. * the default value unless you have a good reason not to.
  578. * @property {boolean} forceTransmuxTS
  579. * If this is true, we will transmux TS content even if not strictly necessary
  580. * for the assets to be played. Shaka Player currently only supports CEA 708
  581. * captions by transmuxing, so this value is necessary for enabling them on
  582. * platforms with native TS support like Edge or Chromecast.
  583. * This value defaults to false.
  584. * @exportDoc
  585. */
  586. shakaExtern.StreamingConfiguration;
  587. /**
  588. * @typedef {{
  589. * enabled: boolean,
  590. * defaultBandwidthEstimate: number,
  591. * restrictions: shakaExtern.Restrictions,
  592. * switchInterval: number,
  593. * bandwidthUpgradeTarget: number,
  594. * bandwidthDowngradeTarget: number
  595. * }}
  596. *
  597. * @property {boolean} enabled
  598. * If true, enable adaptation by the current AbrManager. Defaults to true.
  599. * @property {number} defaultBandwidthEstimate
  600. * The default bandwidth estimate to use if there is not enough data, in
  601. * bit/sec.
  602. * @property {shakaExtern.Restrictions} restrictions
  603. * The restrictions to apply to ABR decisions. These are "soft" restrictions.
  604. * Any track that fails to meet these restrictions will not be selected
  605. * automatically, but will still appear in the track list and can still be
  606. * selected via selectVariantTrack(). If no tracks meet these restrictions,
  607. * AbrManager should not fail, but choose a low-res or low-bandwidth variant
  608. * instead. It is the responsibiliy of AbrManager implementations to follow
  609. * these rules and implement this behavior.
  610. * @property {number} switchInterval
  611. * The minimum amount of time that must pass between switches, in
  612. * seconds. This keeps us from changing too often and annoying the user.
  613. * @property {number} bandwidthUpgradeTarget
  614. * The fraction of the estimated bandwidth which we should try to use when
  615. * upgrading.
  616. * @property {number} bandwidthDowngradeTarget
  617. * The largest fraction of the estimated bandwidth we should use. We should
  618. * downgrade to avoid this.
  619. * @exportDoc
  620. */
  621. shakaExtern.AbrConfiguration;
  622. /**
  623. * @typedef {{
  624. * drm: shakaExtern.DrmConfiguration,
  625. * manifest: shakaExtern.ManifestConfiguration,
  626. * streaming: shakaExtern.StreamingConfiguration,
  627. * abrFactory: shakaExtern.AbrManager.Factory,
  628. * abr: shakaExtern.AbrConfiguration,
  629. * preferredAudioLanguage: string,
  630. * preferredTextLanguage: string,
  631. * preferredVariantRole: string,
  632. * preferredTextRole: string,
  633. * preferredAudioChannelCount: number,
  634. * restrictions: shakaExtern.Restrictions,
  635. * playRangeStart: number,
  636. * playRangeEnd: number,
  637. * textDisplayFactory: shakaExtern.TextDisplayer.Factory
  638. * }}
  639. *
  640. * @property {shakaExtern.DrmConfiguration} drm
  641. * DRM configuration and settings.
  642. * @property {shakaExtern.ManifestConfiguration} manifest
  643. * Manifest configuration and settings.
  644. * @property {shakaExtern.StreamingConfiguration} streaming
  645. * Streaming configuration and settings.
  646. * @property {shakaExtern.AbrManager.Factory} abrFactory
  647. * A factory to construct an abr manager.
  648. * @property {shakaExtern.AbrConfiguration} abr
  649. * ABR configuration and settings.
  650. * @property {shaka.extern.OfflineConfiguration} offline
  651. * Offline configuration and settings.
  652. * @property {string} preferredAudioLanguage
  653. * The preferred language to use for audio tracks. If not given it will use
  654. * the 'main' track.
  655. * Changing this during playback will not affect the current playback.
  656. * @property {string} preferredTextLanguage
  657. * The preferred language to use for text tracks. If a matching text track
  658. * is found, and the selected audio and text tracks have different languages,
  659. * the text track will be shown.
  660. * Changing this during playback will not affect the current playback.
  661. * @property {string} preferredVariantRole
  662. * The preferred role to use for variants.
  663. * @property {string} preferredTextRole
  664. * The preferred role to use for text tracks.
  665. * @property {number} preferredAudioChannelCount
  666. * The preferred number of audio channels.
  667. * @property {shakaExtern.Restrictions} restrictions
  668. * The application restrictions to apply to the tracks. These are "hard"
  669. * restrictions. Any track that fails to meet these restrictions will not
  670. * appear in the track list. If no tracks meet these restrictions, playback
  671. * will fail.
  672. * @property {number} playRangeStart
  673. * Optional playback and seek start time in seconds. Defaults to 0 if
  674. * not provided.
  675. * @property {number} playRangeEnd
  676. * Optional playback and seek end time in seconds. Defaults to the end of
  677. * the presentation if not provided.
  678. * @property {shakaExtern.TextDisplayer.Factory} textDisplayFactory
  679. * A factory to construct text displayer.
  680. * @exportDoc
  681. */
  682. shakaExtern.PlayerConfiguration;
  683. /**
  684. * @typedef {{
  685. * language: string,
  686. * role: string
  687. * }}
  688. *
  689. * @property {string} language
  690. * The language code for the stream.
  691. * @property {string} role
  692. * The role name for the stream. If the stream has no role, |role| will be
  693. * ''.
  694. * @exportDoc
  695. */
  696. shakaExtern.LanguageRole;