Source: externs/shaka/offline_compat_v2.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. * originalManifestUri: string,
  12. * duration: number,
  13. * size: number,
  14. * expiration: number,
  15. * periods: !Array<shaka.extern.PeriodDBV2>,
  16. * sessionIds: !Array<string>,
  17. * drmInfo: ?shaka.extern.DrmInfo,
  18. * appMetadata: Object
  19. * }}
  20. *
  21. * @property {string} originalManifestUri
  22. * The URI that the manifest was originally loaded from.
  23. * @property {number} duration
  24. * The total duration of the media, in seconds.
  25. * @property {number} size
  26. * The total size of all stored segments, in bytes.
  27. * @property {number} expiration
  28. * The license expiration, in milliseconds; or Infinity if not applicable.
  29. * Note that upon JSON serialization, Infinity becomes null, and must be
  30. * converted back upon loading from storage.
  31. * @property {!Array<shaka.extern.PeriodDBV2>} periods
  32. * The Periods that are stored.
  33. * @property {!Array<string>} sessionIds
  34. * The DRM offline session IDs for the media.
  35. * @property {?shaka.extern.DrmInfo} drmInfo
  36. * The DRM info used to initialize EME.
  37. * @property {Object} appMetadata
  38. * A metadata object passed from the application.
  39. */
  40. shaka.extern.ManifestDBV2;
  41. /**
  42. * @typedef {{
  43. * startTime: number,
  44. * streams: !Array<shaka.extern.StreamDBV2>
  45. * }}
  46. *
  47. * @property {number} startTime
  48. * The start time of the period, in seconds.
  49. * @property {!Array<shaka.extern.StreamDBV2>} streams
  50. * The streams that define the Period.
  51. */
  52. shaka.extern.PeriodDBV2;
  53. /**
  54. * @typedef {{
  55. * id: number,
  56. * originalId: ?string,
  57. * primary: boolean,
  58. * presentationTimeOffset: number,
  59. * contentType: string,
  60. * mimeType: string,
  61. * codecs: string,
  62. * frameRate: (number|undefined),
  63. * pixelAspectRatio: (string|undefined),
  64. * kind: (string|undefined),
  65. * language: string,
  66. * label: ?string,
  67. * width: ?number,
  68. * height: ?number,
  69. * initSegmentKey: ?number,
  70. * encrypted: boolean,
  71. * keyId: ?string,
  72. * segments: !Array<shaka.extern.SegmentDBV2>,
  73. * variantIds: !Array<number>
  74. * }}
  75. *
  76. * @property {number} id
  77. * The unique id of the stream.
  78. * @property {?string} originalId
  79. * The original ID, if any, that appeared in the manifest. For example, in
  80. * DASH, this is the "id" attribute of the Representation element.
  81. * @property {boolean} primary
  82. * Whether the stream set was primary.
  83. * @property {number} presentationTimeOffset
  84. * The presentation time offset of the stream, in seconds. Note that this is
  85. * the inverse of the timestampOffset as defined in the manifest types.
  86. * @property {string} contentType
  87. * The type of the stream, 'audio', 'text', or 'video'.
  88. * @property {string} mimeType
  89. * The MIME type of the stream.
  90. * @property {string} codecs
  91. * The codecs of the stream.
  92. * @property {(number|undefined)} frameRate
  93. * The Stream's framerate in frames per second.
  94. * @property {(string|undefined)} pixelAspectRatio
  95. * The Stream's pixel aspect ratio
  96. * @property {(string|undefined)} kind
  97. * The kind of text stream; undefined for audio/video.
  98. * @property {string} language
  99. * The language of the stream; '' for video.
  100. * @property {?string} label
  101. * The label of the stream; '' for video.
  102. * @property {?number} width
  103. * The width of the stream; null for audio/text.
  104. * @property {?number} height
  105. * The height of the stream; null for audio/text.
  106. * @property {?number} initSegmentKey
  107. * The storage key where the init segment is found; null if no init segment.
  108. * @property {boolean} encrypted
  109. * Whether this stream is encrypted.
  110. * @property {?string} keyId
  111. * The key ID this stream is encrypted with.
  112. * @property {!Array<shaka.extern.SegmentDBV2>} segments
  113. * An array of segments that make up the stream.
  114. * @property {!Array<number>} variantIds
  115. * An array of ids of variants the stream is a part of.
  116. */
  117. shaka.extern.StreamDBV2;
  118. /**
  119. * @typedef {{
  120. * startTime: number,
  121. * endTime: number,
  122. * dataKey: number
  123. * }}
  124. *
  125. * @property {number} startTime
  126. * The start time of the segment, in seconds from the start of the Period.
  127. * @property {number} endTime
  128. * The end time of the segment, in seconds from the start of the Period.
  129. * @property {number} dataKey
  130. * The key to the data in storage.
  131. */
  132. shaka.extern.SegmentDBV2;
  133. /**
  134. * @typedef {{
  135. * data: !ArrayBuffer
  136. * }}
  137. *
  138. * @property {!ArrayBuffer} data
  139. * The data contents of the segment.
  140. */
  141. shaka.extern.SegmentDataDBV2;