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