@microsoft/live-share-media 2.0.0-internal.5 → 2.0.0-internal.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (329) hide show
  1. package/.mocharc.cjs +12 -0
  2. package/.nycrc.json +1 -1
  3. package/README.md +30 -31
  4. package/bin/cjs/IMediaPlayer.d.ts.map +1 -0
  5. package/bin/cjs/IMediaPlayer.js.map +1 -0
  6. package/bin/{LiveMediaSession.d.ts → cjs/LiveMediaSession.d.ts} +16 -9
  7. package/bin/cjs/LiveMediaSession.d.ts.map +1 -0
  8. package/bin/{LiveMediaSession.js → cjs/LiveMediaSession.js} +31 -25
  9. package/bin/cjs/LiveMediaSession.js.map +1 -0
  10. package/bin/{LiveMediaSessionCoordinator.d.ts → cjs/LiveMediaSessionCoordinator.d.ts} +5 -4
  11. package/bin/cjs/LiveMediaSessionCoordinator.d.ts.map +1 -0
  12. package/bin/{LiveMediaSessionCoordinator.js → cjs/LiveMediaSessionCoordinator.js} +60 -50
  13. package/bin/cjs/LiveMediaSessionCoordinator.js.map +1 -0
  14. package/bin/{LiveMediaSessionCoordinatorSuspension.d.ts → cjs/LiveMediaSessionCoordinatorSuspension.d.ts} +1 -1
  15. package/bin/cjs/LiveMediaSessionCoordinatorSuspension.d.ts.map +1 -0
  16. package/bin/cjs/LiveMediaSessionCoordinatorSuspension.js.map +1 -0
  17. package/bin/{MediaPlayerSynchronizer.d.ts → cjs/MediaPlayerSynchronizer.d.ts} +7 -6
  18. package/bin/cjs/MediaPlayerSynchronizer.d.ts.map +1 -0
  19. package/bin/{MediaPlayerSynchronizer.js → cjs/MediaPlayerSynchronizer.js} +36 -36
  20. package/bin/cjs/MediaPlayerSynchronizer.js.map +1 -0
  21. package/bin/{MediaSessionActionThrottler.d.ts → cjs/MediaSessionActionThrottler.d.ts} +1 -1
  22. package/bin/cjs/MediaSessionActionThrottler.d.ts.map +1 -0
  23. package/bin/cjs/MediaSessionActionThrottler.js.map +1 -0
  24. package/bin/cjs/MediaSessionExtensions.d.ts.map +1 -0
  25. package/bin/cjs/MediaSessionExtensions.js.map +1 -0
  26. package/bin/{RepeatedActionThrottler.d.ts → cjs/RepeatedActionThrottler.d.ts} +2 -2
  27. package/bin/cjs/RepeatedActionThrottler.d.ts.map +1 -0
  28. package/bin/{RepeatedActionThrottler.js → cjs/RepeatedActionThrottler.js} +2 -2
  29. package/bin/cjs/RepeatedActionThrottler.js.map +1 -0
  30. package/bin/{VolumeManager.d.ts → cjs/VolumeManager.d.ts} +6 -6
  31. package/bin/cjs/VolumeManager.d.ts.map +1 -0
  32. package/bin/{VolumeManager.js → cjs/VolumeManager.js} +5 -5
  33. package/bin/cjs/VolumeManager.js.map +1 -0
  34. package/bin/cjs/index.d.ts +14 -0
  35. package/bin/cjs/index.d.ts.map +1 -0
  36. package/bin/{internals → cjs}/index.js +9 -8
  37. package/bin/cjs/index.js.map +1 -0
  38. package/bin/{internals → cjs/internals}/GroupCoordinatorState.d.ts +10 -9
  39. package/bin/cjs/internals/GroupCoordinatorState.d.ts.map +1 -0
  40. package/bin/{internals → cjs/internals}/GroupCoordinatorState.js +44 -44
  41. package/bin/cjs/internals/GroupCoordinatorState.js.map +1 -0
  42. package/bin/{internals → cjs/internals}/GroupPlaybackPosition.d.ts +5 -4
  43. package/bin/cjs/internals/GroupPlaybackPosition.d.ts.map +1 -0
  44. package/bin/{internals → cjs/internals}/GroupPlaybackPosition.js +2 -2
  45. package/bin/cjs/internals/GroupPlaybackPosition.js.map +1 -0
  46. package/bin/{internals → cjs/internals}/GroupPlaybackRate.d.ts +2 -2
  47. package/bin/cjs/internals/GroupPlaybackRate.d.ts.map +1 -0
  48. package/bin/cjs/internals/GroupPlaybackRate.js.map +1 -0
  49. package/bin/{internals → cjs/internals}/GroupPlaybackTrack.d.ts +3 -3
  50. package/bin/cjs/internals/GroupPlaybackTrack.d.ts.map +1 -0
  51. package/bin/cjs/internals/GroupPlaybackTrack.js.map +1 -0
  52. package/bin/{internals → cjs/internals}/GroupPlaybackTrackData.d.ts +3 -3
  53. package/bin/cjs/internals/GroupPlaybackTrackData.d.ts.map +1 -0
  54. package/bin/{internals → cjs/internals}/GroupPlaybackTrackData.js +2 -2
  55. package/bin/cjs/internals/GroupPlaybackTrackData.js.map +1 -0
  56. package/bin/{internals → cjs/internals}/GroupTransportState.d.ts +6 -6
  57. package/bin/cjs/internals/GroupTransportState.d.ts.map +1 -0
  58. package/bin/{internals → cjs/internals}/GroupTransportState.js +2 -2
  59. package/bin/cjs/internals/GroupTransportState.js.map +1 -0
  60. package/bin/cjs/internals/consts.d.ts.map +1 -0
  61. package/bin/cjs/internals/consts.js.map +1 -0
  62. package/bin/cjs/internals/errors.d.ts.map +1 -0
  63. package/bin/cjs/internals/errors.js.map +1 -0
  64. package/bin/{internals → cjs/internals}/interfaces.d.ts +2 -2
  65. package/bin/cjs/internals/interfaces.d.ts.map +1 -0
  66. package/bin/{internals → cjs/internals}/interfaces.js.map +1 -1
  67. package/bin/cjs/package.json +1 -0
  68. package/bin/esm/IMediaPlayer.d.ts +21 -0
  69. package/bin/esm/IMediaPlayer.d.ts.map +1 -0
  70. package/bin/esm/IMediaPlayer.js +6 -0
  71. package/bin/esm/IMediaPlayer.js.map +1 -0
  72. package/bin/esm/LiveMediaSession.d.ts +97 -0
  73. package/bin/esm/LiveMediaSession.d.ts.map +1 -0
  74. package/bin/esm/LiveMediaSession.js +257 -0
  75. package/bin/esm/LiveMediaSession.js.map +1 -0
  76. package/bin/esm/LiveMediaSessionCoordinator.d.ts +273 -0
  77. package/bin/esm/LiveMediaSessionCoordinator.d.ts.map +1 -0
  78. package/bin/esm/LiveMediaSessionCoordinator.js +475 -0
  79. package/bin/esm/LiveMediaSessionCoordinator.js.map +1 -0
  80. package/bin/esm/LiveMediaSessionCoordinatorSuspension.d.ts +20 -0
  81. package/bin/esm/LiveMediaSessionCoordinatorSuspension.d.ts.map +1 -0
  82. package/bin/esm/LiveMediaSessionCoordinatorSuspension.js +24 -0
  83. package/bin/esm/LiveMediaSessionCoordinatorSuspension.js.map +1 -0
  84. package/bin/esm/MediaPlayerSynchronizer.d.ts +204 -0
  85. package/bin/esm/MediaPlayerSynchronizer.d.ts.map +1 -0
  86. package/bin/esm/MediaPlayerSynchronizer.js +570 -0
  87. package/bin/esm/MediaPlayerSynchronizer.js.map +1 -0
  88. package/bin/esm/MediaSessionActionThrottler.d.ts +12 -0
  89. package/bin/esm/MediaSessionActionThrottler.d.ts.map +1 -0
  90. package/bin/esm/MediaSessionActionThrottler.js +10 -0
  91. package/bin/esm/MediaSessionActionThrottler.js.map +1 -0
  92. package/bin/esm/MediaSessionExtensions.d.ts +177 -0
  93. package/bin/esm/MediaSessionExtensions.d.ts.map +1 -0
  94. package/bin/esm/MediaSessionExtensions.js +23 -0
  95. package/bin/esm/MediaSessionExtensions.js.map +1 -0
  96. package/bin/esm/RepeatedActionThrottler.d.ts +20 -0
  97. package/bin/esm/RepeatedActionThrottler.d.ts.map +1 -0
  98. package/bin/esm/RepeatedActionThrottler.js +59 -0
  99. package/bin/esm/RepeatedActionThrottler.js.map +1 -0
  100. package/bin/esm/VolumeManager.d.ts +84 -0
  101. package/bin/esm/VolumeManager.d.ts.map +1 -0
  102. package/bin/esm/VolumeManager.js +171 -0
  103. package/bin/esm/VolumeManager.js.map +1 -0
  104. package/bin/esm/index.d.ts +14 -0
  105. package/bin/esm/index.d.ts.map +1 -0
  106. package/bin/esm/index.js +14 -0
  107. package/bin/esm/index.js.map +1 -0
  108. package/bin/esm/internals/GroupCoordinatorState.d.ts +109 -0
  109. package/bin/esm/internals/GroupCoordinatorState.d.ts.map +1 -0
  110. package/bin/esm/internals/GroupCoordinatorState.js +512 -0
  111. package/bin/esm/internals/GroupCoordinatorState.js.map +1 -0
  112. package/bin/esm/internals/GroupPlaybackPosition.d.ts +71 -0
  113. package/bin/esm/internals/GroupPlaybackPosition.d.ts.map +1 -0
  114. package/bin/esm/internals/GroupPlaybackPosition.js +166 -0
  115. package/bin/esm/internals/GroupPlaybackPosition.js.map +1 -0
  116. package/bin/esm/internals/GroupPlaybackRate.d.ts +38 -0
  117. package/bin/esm/internals/GroupPlaybackRate.d.ts.map +1 -0
  118. package/bin/esm/internals/GroupPlaybackRate.js +55 -0
  119. package/bin/esm/internals/GroupPlaybackRate.js.map +1 -0
  120. package/bin/esm/internals/GroupPlaybackTrack.d.ts +45 -0
  121. package/bin/esm/internals/GroupPlaybackTrack.d.ts.map +1 -0
  122. package/bin/esm/internals/GroupPlaybackTrack.js +118 -0
  123. package/bin/esm/internals/GroupPlaybackTrack.js.map +1 -0
  124. package/bin/esm/internals/GroupPlaybackTrackData.d.ts +40 -0
  125. package/bin/esm/internals/GroupPlaybackTrackData.d.ts.map +1 -0
  126. package/bin/esm/internals/GroupPlaybackTrackData.js +66 -0
  127. package/bin/esm/internals/GroupPlaybackTrackData.js.map +1 -0
  128. package/bin/esm/internals/GroupTransportState.d.ts +52 -0
  129. package/bin/esm/internals/GroupTransportState.d.ts.map +1 -0
  130. package/bin/esm/internals/GroupTransportState.js +116 -0
  131. package/bin/esm/internals/GroupTransportState.js.map +1 -0
  132. package/bin/esm/internals/consts.d.ts +83 -0
  133. package/bin/esm/internals/consts.d.ts.map +1 -0
  134. package/bin/esm/internals/consts.js +89 -0
  135. package/bin/esm/internals/consts.js.map +1 -0
  136. package/bin/esm/internals/errors.d.ts +17 -0
  137. package/bin/esm/internals/errors.d.ts.map +1 -0
  138. package/bin/esm/internals/errors.js +29 -0
  139. package/bin/esm/internals/errors.js.map +1 -0
  140. package/bin/esm/internals/interfaces.d.ts +23 -0
  141. package/bin/esm/internals/interfaces.d.ts.map +1 -0
  142. package/bin/esm/internals/interfaces.js +2 -0
  143. package/bin/esm/internals/interfaces.js.map +1 -0
  144. package/bin/test/IMediaPlayer.d.ts +21 -0
  145. package/bin/test/IMediaPlayer.d.ts.map +1 -0
  146. package/bin/test/IMediaPlayer.js +7 -0
  147. package/bin/test/IMediaPlayer.js.map +1 -0
  148. package/bin/test/LiveMediaSession.d.ts +97 -0
  149. package/bin/test/LiveMediaSession.d.ts.map +1 -0
  150. package/bin/test/LiveMediaSession.js +261 -0
  151. package/bin/test/LiveMediaSession.js.map +1 -0
  152. package/bin/test/LiveMediaSessionCoordinator.d.ts +273 -0
  153. package/bin/test/LiveMediaSessionCoordinator.d.ts.map +1 -0
  154. package/bin/test/LiveMediaSessionCoordinator.js +479 -0
  155. package/bin/test/LiveMediaSessionCoordinator.js.map +1 -0
  156. package/bin/test/LiveMediaSessionCoordinatorSuspension.d.ts +20 -0
  157. package/bin/test/LiveMediaSessionCoordinatorSuspension.d.ts.map +1 -0
  158. package/bin/test/LiveMediaSessionCoordinatorSuspension.js +28 -0
  159. package/bin/test/LiveMediaSessionCoordinatorSuspension.js.map +1 -0
  160. package/bin/test/MediaPlayerSynchronizer.d.ts +204 -0
  161. package/bin/test/MediaPlayerSynchronizer.d.ts.map +1 -0
  162. package/bin/test/MediaPlayerSynchronizer.js +574 -0
  163. package/bin/test/MediaPlayerSynchronizer.js.map +1 -0
  164. package/bin/test/MediaSessionActionThrottler.d.ts +12 -0
  165. package/bin/test/MediaSessionActionThrottler.d.ts.map +1 -0
  166. package/bin/test/MediaSessionActionThrottler.js +14 -0
  167. package/bin/test/MediaSessionActionThrottler.js.map +1 -0
  168. package/bin/test/MediaSessionExtensions.d.ts +177 -0
  169. package/bin/test/MediaSessionExtensions.d.ts.map +1 -0
  170. package/bin/test/MediaSessionExtensions.js +26 -0
  171. package/bin/test/MediaSessionExtensions.js.map +1 -0
  172. package/bin/test/RepeatedActionThrottler.d.ts +20 -0
  173. package/bin/test/RepeatedActionThrottler.d.ts.map +1 -0
  174. package/bin/test/RepeatedActionThrottler.js +63 -0
  175. package/bin/test/RepeatedActionThrottler.js.map +1 -0
  176. package/bin/test/VolumeManager.d.ts +84 -0
  177. package/bin/test/VolumeManager.d.ts.map +1 -0
  178. package/bin/test/VolumeManager.js +175 -0
  179. package/bin/test/VolumeManager.js.map +1 -0
  180. package/bin/test/index.d.ts +14 -0
  181. package/bin/test/index.d.ts.map +1 -0
  182. package/bin/{index.js → test/index.js} +9 -9
  183. package/bin/test/index.js.map +1 -0
  184. package/bin/test/internals/GroupCoordinatorState.d.ts +109 -0
  185. package/bin/test/internals/GroupCoordinatorState.d.ts.map +1 -0
  186. package/bin/test/internals/GroupCoordinatorState.js +516 -0
  187. package/bin/test/internals/GroupCoordinatorState.js.map +1 -0
  188. package/bin/test/internals/GroupPlaybackPosition.d.ts +71 -0
  189. package/bin/test/internals/GroupPlaybackPosition.d.ts.map +1 -0
  190. package/bin/test/internals/GroupPlaybackPosition.js +170 -0
  191. package/bin/test/internals/GroupPlaybackPosition.js.map +1 -0
  192. package/bin/test/internals/GroupPlaybackRate.d.ts +38 -0
  193. package/bin/test/internals/GroupPlaybackRate.d.ts.map +1 -0
  194. package/bin/test/internals/GroupPlaybackRate.js +59 -0
  195. package/bin/test/internals/GroupPlaybackRate.js.map +1 -0
  196. package/bin/test/internals/GroupPlaybackTrack.d.ts +45 -0
  197. package/bin/test/internals/GroupPlaybackTrack.d.ts.map +1 -0
  198. package/bin/test/internals/GroupPlaybackTrack.js +122 -0
  199. package/bin/test/internals/GroupPlaybackTrack.js.map +1 -0
  200. package/bin/test/internals/GroupPlaybackTrackData.d.ts +40 -0
  201. package/bin/test/internals/GroupPlaybackTrackData.d.ts.map +1 -0
  202. package/bin/test/internals/GroupPlaybackTrackData.js +70 -0
  203. package/bin/test/internals/GroupPlaybackTrackData.js.map +1 -0
  204. package/bin/test/internals/GroupTransportState.d.ts +52 -0
  205. package/bin/test/internals/GroupTransportState.d.ts.map +1 -0
  206. package/bin/test/internals/GroupTransportState.js +120 -0
  207. package/bin/test/internals/GroupTransportState.js.map +1 -0
  208. package/bin/test/internals/consts.d.ts +83 -0
  209. package/bin/test/internals/consts.d.ts.map +1 -0
  210. package/bin/test/internals/consts.js +92 -0
  211. package/bin/test/internals/consts.js.map +1 -0
  212. package/bin/test/internals/errors.d.ts +17 -0
  213. package/bin/test/internals/errors.d.ts.map +1 -0
  214. package/bin/test/internals/errors.js +34 -0
  215. package/bin/test/internals/errors.js.map +1 -0
  216. package/bin/test/internals/interfaces.d.ts +23 -0
  217. package/bin/test/internals/interfaces.d.ts.map +1 -0
  218. package/bin/test/internals/interfaces.js +3 -0
  219. package/bin/test/internals/interfaces.js.map +1 -0
  220. package/bin/test/package.json +1 -0
  221. package/bin/test/test/GroupPlaybackPosition.spec.d.ts +6 -0
  222. package/bin/test/test/GroupPlaybackPosition.spec.d.ts.map +1 -0
  223. package/bin/test/test/GroupPlaybackPosition.spec.js +314 -0
  224. package/bin/test/test/GroupPlaybackPosition.spec.js.map +1 -0
  225. package/bin/test/test/GroupPlaybackRate.spec.d.ts +6 -0
  226. package/bin/test/test/GroupPlaybackRate.spec.d.ts.map +1 -0
  227. package/bin/test/test/GroupPlaybackRate.spec.js +47 -0
  228. package/bin/test/test/GroupPlaybackRate.spec.js.map +1 -0
  229. package/bin/test/test/GroupPlaybackTrack.spec.d.ts +6 -0
  230. package/bin/test/test/GroupPlaybackTrack.spec.d.ts.map +1 -0
  231. package/bin/test/test/GroupPlaybackTrack.spec.js +171 -0
  232. package/bin/test/test/GroupPlaybackTrack.spec.js.map +1 -0
  233. package/bin/test/test/GroupPlaybackTrackData.spec.d.ts +6 -0
  234. package/bin/test/test/GroupPlaybackTrackData.spec.d.ts.map +1 -0
  235. package/bin/test/test/GroupPlaybackTrackData.spec.js +63 -0
  236. package/bin/test/test/GroupPlaybackTrackData.spec.js.map +1 -0
  237. package/bin/test/test/LiveMediaSession_ManualActionHandler.spec.d.ts +6 -0
  238. package/bin/test/test/LiveMediaSession_ManualActionHandler.spec.d.ts.map +1 -0
  239. package/bin/test/test/LiveMediaSession_ManualActionHandler.spec.js +324 -0
  240. package/bin/test/test/LiveMediaSession_ManualActionHandler.spec.js.map +1 -0
  241. package/bin/test/test/LiveMediaSession_Synchronizer.spec.d.ts +6 -0
  242. package/bin/test/test/LiveMediaSession_Synchronizer.spec.d.ts.map +1 -0
  243. package/bin/test/test/LiveMediaSession_Synchronizer.spec.js +669 -0
  244. package/bin/test/test/LiveMediaSession_Synchronizer.spec.js.map +1 -0
  245. package/bin/test/test/TestUtils.d.ts +44 -0
  246. package/bin/test/test/TestUtils.d.ts.map +1 -0
  247. package/bin/test/test/TestUtils.js +116 -0
  248. package/bin/test/test/TestUtils.js.map +1 -0
  249. package/bin/test/test/VolumeManager.spec.d.ts +2 -0
  250. package/bin/test/test/VolumeManager.spec.d.ts.map +1 -0
  251. package/bin/test/test/VolumeManager.spec.js +163 -0
  252. package/bin/test/test/VolumeManager.spec.js.map +1 -0
  253. package/nyc/junit-report.json +167 -167
  254. package/nyc/junit-report.xml +53 -53
  255. package/package.json +31 -15
  256. package/src/LiveMediaSession.ts +32 -14
  257. package/src/LiveMediaSessionCoordinator.ts +39 -27
  258. package/src/LiveMediaSessionCoordinatorSuspension.ts +1 -1
  259. package/src/MediaPlayerSynchronizer.ts +10 -10
  260. package/src/MediaSessionActionThrottler.ts +1 -1
  261. package/src/RepeatedActionThrottler.ts +2 -2
  262. package/src/VolumeManager.ts +6 -6
  263. package/src/index.ts +9 -9
  264. package/src/internals/GroupCoordinatorState.ts +15 -14
  265. package/src/internals/GroupPlaybackPosition.ts +6 -6
  266. package/src/internals/GroupPlaybackRate.ts +2 -2
  267. package/src/internals/GroupPlaybackTrack.ts +3 -3
  268. package/src/internals/GroupPlaybackTrackData.ts +3 -3
  269. package/src/internals/GroupTransportState.ts +6 -6
  270. package/src/internals/interfaces.ts +2 -2
  271. package/tsconfig.cjs.json +14 -0
  272. package/tsconfig.json +65 -74
  273. package/tsconfig.test.json +9 -0
  274. package/bin/IMediaPlayer.d.ts.map +0 -1
  275. package/bin/IMediaPlayer.js.map +0 -1
  276. package/bin/LiveMediaSession.d.ts.map +0 -1
  277. package/bin/LiveMediaSession.js.map +0 -1
  278. package/bin/LiveMediaSessionCoordinator.d.ts.map +0 -1
  279. package/bin/LiveMediaSessionCoordinator.js.map +0 -1
  280. package/bin/LiveMediaSessionCoordinatorSuspension.d.ts.map +0 -1
  281. package/bin/LiveMediaSessionCoordinatorSuspension.js.map +0 -1
  282. package/bin/MediaPlayerSynchronizer.d.ts.map +0 -1
  283. package/bin/MediaPlayerSynchronizer.js.map +0 -1
  284. package/bin/MediaSessionActionThrottler.d.ts.map +0 -1
  285. package/bin/MediaSessionActionThrottler.js.map +0 -1
  286. package/bin/MediaSessionExtensions.d.ts.map +0 -1
  287. package/bin/MediaSessionExtensions.js.map +0 -1
  288. package/bin/RepeatedActionThrottler.d.ts.map +0 -1
  289. package/bin/RepeatedActionThrottler.js.map +0 -1
  290. package/bin/VolumeManager.d.ts.map +0 -1
  291. package/bin/VolumeManager.js.map +0 -1
  292. package/bin/index.d.ts +0 -14
  293. package/bin/index.d.ts.map +0 -1
  294. package/bin/index.js.map +0 -1
  295. package/bin/internals/GroupCoordinatorState.d.ts.map +0 -1
  296. package/bin/internals/GroupCoordinatorState.js.map +0 -1
  297. package/bin/internals/GroupPlaybackPosition.d.ts.map +0 -1
  298. package/bin/internals/GroupPlaybackPosition.js.map +0 -1
  299. package/bin/internals/GroupPlaybackRate.d.ts.map +0 -1
  300. package/bin/internals/GroupPlaybackRate.js.map +0 -1
  301. package/bin/internals/GroupPlaybackTrack.d.ts.map +0 -1
  302. package/bin/internals/GroupPlaybackTrack.js.map +0 -1
  303. package/bin/internals/GroupPlaybackTrackData.d.ts.map +0 -1
  304. package/bin/internals/GroupPlaybackTrackData.js.map +0 -1
  305. package/bin/internals/GroupTransportState.d.ts.map +0 -1
  306. package/bin/internals/GroupTransportState.js.map +0 -1
  307. package/bin/internals/consts.d.ts.map +0 -1
  308. package/bin/internals/consts.js.map +0 -1
  309. package/bin/internals/errors.d.ts.map +0 -1
  310. package/bin/internals/errors.js.map +0 -1
  311. package/bin/internals/index.d.ts +0 -13
  312. package/bin/internals/index.d.ts.map +0 -1
  313. package/bin/internals/index.js.map +0 -1
  314. package/bin/internals/interfaces.d.ts.map +0 -1
  315. package/src/internals/index.ts +0 -13
  316. package/tsconfig.build.json +0 -9
  317. /package/bin/{IMediaPlayer.d.ts → cjs/IMediaPlayer.d.ts} +0 -0
  318. /package/bin/{IMediaPlayer.js → cjs/IMediaPlayer.js} +0 -0
  319. /package/bin/{LiveMediaSessionCoordinatorSuspension.js → cjs/LiveMediaSessionCoordinatorSuspension.js} +0 -0
  320. /package/bin/{MediaSessionActionThrottler.js → cjs/MediaSessionActionThrottler.js} +0 -0
  321. /package/bin/{MediaSessionExtensions.d.ts → cjs/MediaSessionExtensions.d.ts} +0 -0
  322. /package/bin/{MediaSessionExtensions.js → cjs/MediaSessionExtensions.js} +0 -0
  323. /package/bin/{internals → cjs/internals}/GroupPlaybackRate.js +0 -0
  324. /package/bin/{internals → cjs/internals}/GroupPlaybackTrack.js +0 -0
  325. /package/bin/{internals → cjs/internals}/consts.d.ts +0 -0
  326. /package/bin/{internals → cjs/internals}/consts.js +0 -0
  327. /package/bin/{internals → cjs/internals}/errors.d.ts +0 -0
  328. /package/bin/{internals → cjs/internals}/errors.js +0 -0
  329. /package/bin/{internals → cjs/internals}/interfaces.js +0 -0
@@ -0,0 +1,273 @@
1
+ /**
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the Microsoft Live Share SDK License.
4
+ */
5
+ import { UserMeetingRole } from "@microsoft/live-share";
6
+ import { IRuntimeSignaler, LiveShareRuntime } from "@microsoft/live-share/internal";
7
+ import { CoordinationWaitPoint, ExtendedMediaMetadata, ExtendedMediaSessionPlaybackState, MediaSessionCoordinatorSuspension } from "./MediaSessionExtensions.js";
8
+ import { TypedEventEmitter } from "@fluid-internal/client-utils";
9
+ import { IEvent } from "@fluidframework/core-interfaces";
10
+ /**
11
+ * Most recent state of the media session.
12
+ */
13
+ export interface IMediaPlayerState {
14
+ /**
15
+ * Metadata for the sessions current track.
16
+ */
17
+ metadata: ExtendedMediaMetadata | null;
18
+ /**
19
+ * Optional track data object being synchronized.
20
+ *
21
+ * @remarks
22
+ * This can be used to sync things like pitch, roll, and yaw when watching 360 videos together.
23
+ */
24
+ trackData: object | null;
25
+ /**
26
+ * Sessions current playback state.
27
+ */
28
+ playbackState: ExtendedMediaSessionPlaybackState;
29
+ /**
30
+ * Sessions current position state if known.
31
+ */
32
+ positionState?: MediaPositionState;
33
+ }
34
+ /**
35
+ * @hidden
36
+ */
37
+ export interface ILiveMediaSessionCoordinatorEvents extends IEvent {
38
+ /**
39
+ * Event listener for events emitted
40
+ * @param event update
41
+ * @param listener listener function
42
+ * @param listener.event the event instance
43
+ */
44
+ (event: string, listener: (event: any) => void): void;
45
+ }
46
+ /**
47
+ * The `LiveMediaSessionCoordinator` tracks the playback & position state of all other
48
+ * clients being synchronized with. It is responsible for keeping the local media player
49
+ * in sync with the group.
50
+ */
51
+ export declare class LiveMediaSessionCoordinator extends TypedEventEmitter<ILiveMediaSessionCoordinatorEvents> {
52
+ private readonly _id;
53
+ private readonly _runtime;
54
+ private readonly _liveRuntime;
55
+ private readonly _logger;
56
+ private readonly _getPlayerState;
57
+ private _positionUpdateInterval;
58
+ private _maxPlaybackDrift;
59
+ private _lastWaitPoint?;
60
+ private initializeState;
61
+ private _playEvent?;
62
+ private _pauseEvent?;
63
+ private _seekToEvent?;
64
+ private _rateChangeEvent?;
65
+ private _setTrackEvent?;
66
+ private _setTrackDataEvent?;
67
+ private _positionUpdateEvent?;
68
+ private _synchronizer?;
69
+ private _groupState?;
70
+ /**
71
+ * @hidden
72
+ * Applications shouldn't directly create new coordinator instances.
73
+ */
74
+ constructor(id: string, runtime: IRuntimeSignaler, liveRuntime: LiveShareRuntime, getPlayerState: () => IMediaPlayerState);
75
+ /**
76
+ * Controls whether or not the local client is allowed to instruct the group to play or pause.
77
+ *
78
+ * @remarks
79
+ * This flag largely meant to influence decisions made by the coordinator and can be used by
80
+ * the UI to determine what controls should be shown to the user. It does not provide any
81
+ * security in itself.
82
+ *
83
+ * If your app is running in a semi-trusted environment where only some clients are allowed
84
+ * to play/pause media, you should use "role based verification" to enforce those policies.
85
+ */
86
+ canPlayPause: boolean;
87
+ /**
88
+ * Controls whether or not the local client is allowed to seek the group to a new playback
89
+ * position.
90
+ *
91
+ * @remarks
92
+ * This flag largely meant to influence decisions made by the coordinator and can be used by
93
+ * the UI to determine what controls should be shown to the user. It does not provide any
94
+ * security in itself.
95
+ *
96
+ * If your app is running in a semi-trusted environment where only some clients are allowed
97
+ * to change the playback position, you should use "role based verification" to enforce those policies.
98
+ */
99
+ canSeek: boolean;
100
+ /**
101
+ * Controls whether or not the local client is allowed to change tracks.
102
+ *
103
+ * @remarks
104
+ * This flag largely meant to influence decisions made by the coordinator and can be used by
105
+ * the UI to determine what controls should be shown to the user. It does not provide any
106
+ * security in itself.
107
+ *
108
+ * If your app is running in a semi-trusted environment where only some clients are allowed
109
+ * to change tracks, you should use "role based verification" to enforce those policies.
110
+ */
111
+ canSetTrack: boolean;
112
+ /**
113
+ * Controls whether or not the local client is allowed to change the tracks custom data object.
114
+ *
115
+ * @remarks
116
+ * This flag largely meant to influence decisions made by the coordinator and can be used by
117
+ * the UI to determine what controls should be shown to the user. It does not provide any
118
+ * security in itself.
119
+ *
120
+ * If your app is running in a semi-trusted environment where only some clients are allowed
121
+ * to change the tracks data object, you should use "role based verification" to enforce those
122
+ * policies.
123
+ */
124
+ canSetTrackData: boolean;
125
+ /**
126
+ * Controls whether or not the local client is allowed to change the playback rate.
127
+ *
128
+ * @remarks
129
+ * This flag largely meant to influence decisions made by the coordinator and can be used by
130
+ * the UI to determine what controls should be shown to the user. It does not provide any
131
+ * security in itself.
132
+ *
133
+ * If your app is running in a semi-trusted environment where only some clients are allowed
134
+ * to change the tracks data object, you should use "role based verification" to enforce those
135
+ * policies.
136
+ */
137
+ canSetPlaybackRate: boolean;
138
+ /**
139
+ * Controls whether or not the local client is allowed to send position updates to the group.
140
+ *
141
+ * @remarks
142
+ * This flag largely meant to limit the number of signals sent to the group for performance reasons.
143
+ * It does not provide any security in itself.
144
+ */
145
+ canSendPositionUpdates: boolean;
146
+ /**
147
+ * Returns true if the local client is in a suspended state.
148
+ */
149
+ get isSuspended(): boolean;
150
+ /**
151
+ * Max amount of playback drift allowed in seconds.
152
+ *
153
+ * @remarks
154
+ * Should the local clients playback position lag by more than the specified value, the
155
+ * coordinator will trigger a `catchup` action.
156
+ *
157
+ * Defaults to a value of `1` second.
158
+ */
159
+ get maxPlaybackDrift(): number;
160
+ set maxPlaybackDrift(value: number);
161
+ /**
162
+ * Frequency with which position updates are broadcast to the rest of the group in
163
+ * seconds.
164
+ *
165
+ * @remarks
166
+ * Defaults to a value of `2` seconds.
167
+ */
168
+ get positionUpdateInterval(): number;
169
+ set positionUpdateInterval(value: number);
170
+ /**
171
+ * Instructs the group to play the current track.
172
+ *
173
+ * @remarks
174
+ * Throws an exception if the session/coordinator hasn't been initialized, no track has been
175
+ * loaded, or `canPlayPause` is false.
176
+ *
177
+ * @returns a void promise that resolves once complete, throws if user does not have proper roles
178
+ */
179
+ play(): Promise<void>;
180
+ /**
181
+ * Instructs the group to pause the current track.
182
+ *
183
+ * @remarks
184
+ * Throws an exception if the session/coordinator hasn't been initialized, no track has been
185
+ * loaded, or `canPlayPause` is false.
186
+ *
187
+ * @returns a void promise that resolves once complete, throws if user does not have proper roles
188
+ */
189
+ pause(): Promise<void>;
190
+ /**
191
+ * Instructs the group to seek to a new position within the current track.
192
+ *
193
+ * @remarks
194
+ * Throws an exception if the session/coordinator hasn't been initialized, no track has been
195
+ * loaded, or `canSeek` is false.
196
+ * @param time Playback position in seconds to seek to.
197
+ * @returns a void promise that resolves once complete, throws if user does not have proper roles
198
+ */
199
+ seekTo(time: number): Promise<void>;
200
+ setPlaybackRate(playbackRate: number): Promise<void>;
201
+ /**
202
+ * Instructs the group to load a new track.
203
+ *
204
+ * @remarks
205
+ * Throws an exception if the session/coordinator hasn't been initialized or `canSetTrack` is
206
+ * false.
207
+ * @param metadata The track to load or `null` to indicate that the end of the track is reached.
208
+ * @param waitPoints Optional. List of static wait points to configure for the track. Dynamic wait points can be added via the `beginSuspension()` call.
209
+ * @returns a void promise that resolves once complete, throws if user does not have proper roles
210
+ */
211
+ setTrack(metadata: ExtendedMediaMetadata | null, waitPoints?: CoordinationWaitPoint[]): Promise<void>;
212
+ /**
213
+ * Updates the track data object for the current track.
214
+ *
215
+ * @remarks
216
+ * The track data object can be used by applications to synchronize things like pitch, roll,
217
+ * and yaw of a 360 video. This data object will be reset to null anytime the track changes.
218
+ *
219
+ * Throws an exception if the session/coordinator hasn't been initialized or `canSetTrackData` is
220
+ * false.
221
+ * @param data New data object to sync with the group. This value will be synchronized using a last writer wins strategy.
222
+ * @returns a void promise that resolves once complete, throws if user does not have proper roles
223
+ */
224
+ setTrackData(data: object | null): Promise<void>;
225
+ /**
226
+ * Begins a new local suspension.
227
+ *
228
+ * @remarks
229
+ * Suspension temporarily suspend the clients local synchronization with the group. This can
230
+ * be useful for displaying ads to users or temporarily disconnecting from the session while
231
+ * the user seeks the video using a timeline scrubber.
232
+ *
233
+ * Multiple simultaneous suspensions are allowed and when the last suspension ends the local
234
+ * client will be immediately re-synchronized with the group.
235
+ *
236
+ * A "Dynamic Wait Point" can be specified when `beginSuspension()` is called and the wait
237
+ * point will be broadcast to all other clients in the group. Those clients will then
238
+ * automatically enter a suspension state once they reach the positions specified by the
239
+ * wait point. Clients that are passed the wait point will immediately suspend.
240
+ *
241
+ * Any wait point based suspension (dynamic or static) will result in all clients remaining
242
+ * in a suspension state until the list client ends their suspension. This behavior can be
243
+ * conditionally bypassed by settings the wait points `maxClients` value.
244
+ *
245
+ * Throws an exception if the session/coordinator hasn't been initialized.
246
+ * @param waitPoint Optional. Dynamic wait point to broadcast to all of the clients.
247
+ * @returns The suspension object. Call `end()` on the returned suspension to end the suspension.
248
+ */
249
+ beginSuspension(waitPoint?: CoordinationWaitPoint): MediaSessionCoordinatorSuspension;
250
+ /**
251
+ * @hidden
252
+ * Called by MediaSession to verify the coordinator has been initialized.
253
+ */
254
+ get isInitialized(): boolean;
255
+ /**
256
+ * @hidden
257
+ * Called by MediaSession to start coordinator.
258
+ */
259
+ initialize(acceptTransportChangesFrom?: UserMeetingRole[]): Promise<void>;
260
+ /**
261
+ * @hidden
262
+ * Called by the MediaSession to detect if a wait point has been hit.
263
+ */
264
+ findNextWaitPoint(): CoordinationWaitPoint | null;
265
+ /**
266
+ * @hidden
267
+ * Called by MediaSession to trigger the sending of a position update.
268
+ */
269
+ sendPositionUpdate(state: IMediaPlayerState, targetClientId?: string): void;
270
+ protected createChildren(acceptTransportChangesFrom?: UserMeetingRole[]): Promise<void>;
271
+ private getPlayerPosition;
272
+ }
273
+ //# sourceMappingURL=LiveMediaSessionCoordinator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LiveMediaSessionCoordinator.d.ts","sourceRoot":"","sources":["../../src/LiveMediaSessionCoordinator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAGH,eAAe,EAKlB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACH,gBAAgB,EAIhB,gBAAgB,EAEnB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACH,qBAAqB,EACrB,qBAAqB,EACrB,iCAAiC,EACjC,iCAAiC,EACpC,MAAM,6BAA6B,CAAC;AAiBrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAC;AAEzD;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAC9B;;OAEG;IACH,QAAQ,EAAE,qBAAqB,GAAG,IAAI,CAAC;IAEvC;;;;;OAKG;IACH,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAEzB;;OAEG;IACH,aAAa,EAAE,iCAAiC,CAAC;IAEjD;;OAEG;IACH,aAAa,CAAC,EAAE,kBAAkB,CAAC;CACtC;AAED;;GAEG;AACH,MAAM,WAAW,kCAAmC,SAAQ,MAAM;IAC9D;;;;;OAKG;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