@microsoft/live-share-media 1.4.0 → 1.4.2

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 (293) hide show
  1. package/bin/LiveMediaSessionCoordinator.d.ts +0 -1
  2. package/bin/LiveMediaSessionCoordinator.d.ts.map +1 -1
  3. package/bin/MediaPlayerSynchronizer.d.ts +0 -1
  4. package/bin/MediaPlayerSynchronizer.d.ts.map +1 -1
  5. package/bin/cjs/IMediaPlayer.d.ts +21 -0
  6. package/bin/cjs/IMediaPlayer.d.ts.map +1 -0
  7. package/bin/cjs/IMediaPlayer.js +7 -0
  8. package/bin/cjs/IMediaPlayer.js.map +1 -0
  9. package/bin/cjs/LiveMediaSession.d.ts +97 -0
  10. package/bin/cjs/LiveMediaSession.d.ts.map +1 -0
  11. package/bin/cjs/LiveMediaSession.js +261 -0
  12. package/bin/cjs/LiveMediaSession.js.map +1 -0
  13. package/bin/cjs/LiveMediaSessionCoordinator.d.ts +304 -0
  14. package/bin/cjs/LiveMediaSessionCoordinator.d.ts.map +1 -0
  15. package/bin/cjs/LiveMediaSessionCoordinator.js +560 -0
  16. package/bin/cjs/LiveMediaSessionCoordinator.js.map +1 -0
  17. package/bin/cjs/LiveMediaSessionCoordinatorSuspension.d.ts +20 -0
  18. package/bin/cjs/LiveMediaSessionCoordinatorSuspension.d.ts.map +1 -0
  19. package/bin/cjs/LiveMediaSessionCoordinatorSuspension.js +28 -0
  20. package/bin/cjs/LiveMediaSessionCoordinatorSuspension.js.map +1 -0
  21. package/bin/cjs/MediaPlayerSynchronizer.d.ts +204 -0
  22. package/bin/cjs/MediaPlayerSynchronizer.d.ts.map +1 -0
  23. package/bin/cjs/MediaPlayerSynchronizer.js +574 -0
  24. package/bin/cjs/MediaPlayerSynchronizer.js.map +1 -0
  25. package/bin/cjs/MediaSessionActionThrottler.d.ts +12 -0
  26. package/bin/cjs/MediaSessionActionThrottler.d.ts.map +1 -0
  27. package/bin/cjs/MediaSessionActionThrottler.js +14 -0
  28. package/bin/cjs/MediaSessionActionThrottler.js.map +1 -0
  29. package/bin/cjs/MediaSessionExtensions.d.ts +177 -0
  30. package/bin/cjs/MediaSessionExtensions.d.ts.map +1 -0
  31. package/bin/cjs/MediaSessionExtensions.js +26 -0
  32. package/bin/cjs/MediaSessionExtensions.js.map +1 -0
  33. package/bin/cjs/RepeatedActionThrottler.d.ts +20 -0
  34. package/bin/cjs/RepeatedActionThrottler.d.ts.map +1 -0
  35. package/bin/cjs/RepeatedActionThrottler.js +63 -0
  36. package/bin/cjs/RepeatedActionThrottler.js.map +1 -0
  37. package/bin/cjs/VolumeManager.d.ts +84 -0
  38. package/bin/cjs/VolumeManager.d.ts.map +1 -0
  39. package/bin/cjs/VolumeManager.js +175 -0
  40. package/bin/cjs/VolumeManager.js.map +1 -0
  41. package/bin/cjs/index.d.ts +14 -0
  42. package/bin/cjs/index.d.ts.map +1 -0
  43. package/bin/cjs/index.js +30 -0
  44. package/bin/cjs/index.js.map +1 -0
  45. package/bin/cjs/internals/GroupCoordinatorState.d.ts +110 -0
  46. package/bin/cjs/internals/GroupCoordinatorState.d.ts.map +1 -0
  47. package/bin/cjs/internals/GroupCoordinatorState.js +516 -0
  48. package/bin/cjs/internals/GroupCoordinatorState.js.map +1 -0
  49. package/bin/cjs/internals/GroupPlaybackPosition.d.ts +71 -0
  50. package/bin/cjs/internals/GroupPlaybackPosition.d.ts.map +1 -0
  51. package/bin/cjs/internals/GroupPlaybackPosition.js +170 -0
  52. package/bin/cjs/internals/GroupPlaybackPosition.js.map +1 -0
  53. package/bin/cjs/internals/GroupPlaybackRate.d.ts +38 -0
  54. package/bin/cjs/internals/GroupPlaybackRate.d.ts.map +1 -0
  55. package/bin/cjs/internals/GroupPlaybackRate.js +59 -0
  56. package/bin/cjs/internals/GroupPlaybackRate.js.map +1 -0
  57. package/bin/cjs/internals/GroupPlaybackTrack.d.ts +45 -0
  58. package/bin/cjs/internals/GroupPlaybackTrack.d.ts.map +1 -0
  59. package/bin/cjs/internals/GroupPlaybackTrack.js +122 -0
  60. package/bin/cjs/internals/GroupPlaybackTrack.js.map +1 -0
  61. package/bin/cjs/internals/GroupPlaybackTrackData.d.ts +40 -0
  62. package/bin/cjs/internals/GroupPlaybackTrackData.d.ts.map +1 -0
  63. package/bin/cjs/internals/GroupPlaybackTrackData.js +70 -0
  64. package/bin/cjs/internals/GroupPlaybackTrackData.js.map +1 -0
  65. package/bin/cjs/internals/GroupTransportState.d.ts +52 -0
  66. package/bin/cjs/internals/GroupTransportState.d.ts.map +1 -0
  67. package/bin/cjs/internals/GroupTransportState.js +120 -0
  68. package/bin/cjs/internals/GroupTransportState.js.map +1 -0
  69. package/bin/cjs/internals/PriorityTimeInterval.d.ts +33 -0
  70. package/bin/cjs/internals/PriorityTimeInterval.d.ts.map +1 -0
  71. package/bin/cjs/internals/PriorityTimeInterval.js +45 -0
  72. package/bin/cjs/internals/PriorityTimeInterval.js.map +1 -0
  73. package/bin/cjs/internals/consts.d.ts +83 -0
  74. package/bin/cjs/internals/consts.d.ts.map +1 -0
  75. package/bin/cjs/internals/consts.js +92 -0
  76. package/bin/cjs/internals/consts.js.map +1 -0
  77. package/bin/cjs/internals/errors.d.ts +17 -0
  78. package/bin/cjs/internals/errors.d.ts.map +1 -0
  79. package/bin/cjs/internals/errors.js +34 -0
  80. package/bin/cjs/internals/errors.js.map +1 -0
  81. package/bin/cjs/internals/interfaces.d.ts +23 -0
  82. package/bin/cjs/internals/interfaces.d.ts.map +1 -0
  83. package/bin/cjs/internals/interfaces.js +3 -0
  84. package/bin/cjs/internals/interfaces.js.map +1 -0
  85. package/bin/cjs/package.json +1 -0
  86. package/bin/esm/IMediaPlayer.d.ts +21 -0
  87. package/bin/esm/IMediaPlayer.d.ts.map +1 -0
  88. package/bin/esm/IMediaPlayer.js +6 -0
  89. package/bin/esm/IMediaPlayer.js.map +1 -0
  90. package/bin/esm/LiveMediaSession.d.ts +97 -0
  91. package/bin/esm/LiveMediaSession.d.ts.map +1 -0
  92. package/bin/esm/LiveMediaSession.js +257 -0
  93. package/bin/esm/LiveMediaSession.js.map +1 -0
  94. package/bin/esm/LiveMediaSessionCoordinator.d.ts +304 -0
  95. package/bin/esm/LiveMediaSessionCoordinator.d.ts.map +1 -0
  96. package/bin/esm/LiveMediaSessionCoordinator.js +556 -0
  97. package/bin/esm/LiveMediaSessionCoordinator.js.map +1 -0
  98. package/bin/esm/LiveMediaSessionCoordinatorSuspension.d.ts +20 -0
  99. package/bin/esm/LiveMediaSessionCoordinatorSuspension.d.ts.map +1 -0
  100. package/bin/esm/LiveMediaSessionCoordinatorSuspension.js +24 -0
  101. package/bin/esm/LiveMediaSessionCoordinatorSuspension.js.map +1 -0
  102. package/bin/esm/MediaPlayerSynchronizer.d.ts +204 -0
  103. package/bin/esm/MediaPlayerSynchronizer.d.ts.map +1 -0
  104. package/bin/esm/MediaPlayerSynchronizer.js +570 -0
  105. package/bin/esm/MediaPlayerSynchronizer.js.map +1 -0
  106. package/bin/esm/MediaSessionActionThrottler.d.ts +12 -0
  107. package/bin/esm/MediaSessionActionThrottler.d.ts.map +1 -0
  108. package/bin/esm/MediaSessionActionThrottler.js +10 -0
  109. package/bin/esm/MediaSessionActionThrottler.js.map +1 -0
  110. package/bin/esm/MediaSessionExtensions.d.ts +177 -0
  111. package/bin/esm/MediaSessionExtensions.d.ts.map +1 -0
  112. package/bin/esm/MediaSessionExtensions.js +23 -0
  113. package/bin/esm/MediaSessionExtensions.js.map +1 -0
  114. package/bin/esm/RepeatedActionThrottler.d.ts +20 -0
  115. package/bin/esm/RepeatedActionThrottler.d.ts.map +1 -0
  116. package/bin/esm/RepeatedActionThrottler.js +59 -0
  117. package/bin/esm/RepeatedActionThrottler.js.map +1 -0
  118. package/bin/esm/VolumeManager.d.ts +84 -0
  119. package/bin/esm/VolumeManager.d.ts.map +1 -0
  120. package/bin/esm/VolumeManager.js +171 -0
  121. package/bin/esm/VolumeManager.js.map +1 -0
  122. package/bin/esm/index.d.ts +14 -0
  123. package/bin/esm/index.d.ts.map +1 -0
  124. package/bin/esm/index.js +14 -0
  125. package/bin/esm/index.js.map +1 -0
  126. package/bin/esm/internals/GroupCoordinatorState.d.ts +110 -0
  127. package/bin/esm/internals/GroupCoordinatorState.d.ts.map +1 -0
  128. package/bin/esm/internals/GroupCoordinatorState.js +512 -0
  129. package/bin/esm/internals/GroupCoordinatorState.js.map +1 -0
  130. package/bin/esm/internals/GroupPlaybackPosition.d.ts +71 -0
  131. package/bin/esm/internals/GroupPlaybackPosition.d.ts.map +1 -0
  132. package/bin/esm/internals/GroupPlaybackPosition.js +166 -0
  133. package/bin/esm/internals/GroupPlaybackPosition.js.map +1 -0
  134. package/bin/esm/internals/GroupPlaybackRate.d.ts +38 -0
  135. package/bin/esm/internals/GroupPlaybackRate.d.ts.map +1 -0
  136. package/bin/esm/internals/GroupPlaybackRate.js +55 -0
  137. package/bin/esm/internals/GroupPlaybackRate.js.map +1 -0
  138. package/bin/esm/internals/GroupPlaybackTrack.d.ts +45 -0
  139. package/bin/esm/internals/GroupPlaybackTrack.d.ts.map +1 -0
  140. package/bin/esm/internals/GroupPlaybackTrack.js +118 -0
  141. package/bin/esm/internals/GroupPlaybackTrack.js.map +1 -0
  142. package/bin/esm/internals/GroupPlaybackTrackData.d.ts +40 -0
  143. package/bin/esm/internals/GroupPlaybackTrackData.d.ts.map +1 -0
  144. package/bin/esm/internals/GroupPlaybackTrackData.js +66 -0
  145. package/bin/esm/internals/GroupPlaybackTrackData.js.map +1 -0
  146. package/bin/esm/internals/GroupTransportState.d.ts +52 -0
  147. package/bin/esm/internals/GroupTransportState.d.ts.map +1 -0
  148. package/bin/esm/internals/GroupTransportState.js +116 -0
  149. package/bin/esm/internals/GroupTransportState.js.map +1 -0
  150. package/bin/esm/internals/PriorityTimeInterval.d.ts +33 -0
  151. package/bin/esm/internals/PriorityTimeInterval.d.ts.map +1 -0
  152. package/bin/esm/internals/PriorityTimeInterval.js +41 -0
  153. package/bin/esm/internals/PriorityTimeInterval.js.map +1 -0
  154. package/bin/esm/internals/consts.d.ts +83 -0
  155. package/bin/esm/internals/consts.d.ts.map +1 -0
  156. package/bin/esm/internals/consts.js +89 -0
  157. package/bin/esm/internals/consts.js.map +1 -0
  158. package/bin/esm/internals/errors.d.ts +17 -0
  159. package/bin/esm/internals/errors.d.ts.map +1 -0
  160. package/bin/esm/internals/errors.js +29 -0
  161. package/bin/esm/internals/errors.js.map +1 -0
  162. package/bin/esm/internals/interfaces.d.ts +23 -0
  163. package/bin/esm/internals/interfaces.d.ts.map +1 -0
  164. package/bin/esm/internals/interfaces.js +2 -0
  165. package/bin/esm/internals/interfaces.js.map +1 -0
  166. package/bin/internals/GroupCoordinatorState.d.ts +0 -1
  167. package/bin/internals/GroupCoordinatorState.d.ts.map +1 -1
  168. package/bin/internals/GroupPlaybackRate.d.ts +0 -1
  169. package/bin/internals/GroupPlaybackRate.d.ts.map +1 -1
  170. package/bin/internals/GroupPlaybackTrack.d.ts +0 -1
  171. package/bin/internals/GroupPlaybackTrack.d.ts.map +1 -1
  172. package/bin/internals/GroupPlaybackTrackData.d.ts +0 -1
  173. package/bin/internals/GroupPlaybackTrackData.d.ts.map +1 -1
  174. package/bin/internals/GroupTransportState.d.ts +0 -1
  175. package/bin/internals/GroupTransportState.d.ts.map +1 -1
  176. package/bin/test/IMediaPlayer.d.ts +21 -0
  177. package/bin/test/IMediaPlayer.d.ts.map +1 -0
  178. package/bin/test/IMediaPlayer.js +7 -0
  179. package/bin/test/IMediaPlayer.js.map +1 -0
  180. package/bin/test/LiveMediaSession.d.ts +97 -0
  181. package/bin/test/LiveMediaSession.d.ts.map +1 -0
  182. package/bin/test/LiveMediaSession.js +261 -0
  183. package/bin/test/LiveMediaSession.js.map +1 -0
  184. package/bin/test/LiveMediaSessionCoordinator.d.ts +304 -0
  185. package/bin/test/LiveMediaSessionCoordinator.d.ts.map +1 -0
  186. package/bin/test/LiveMediaSessionCoordinator.js +560 -0
  187. package/bin/test/LiveMediaSessionCoordinator.js.map +1 -0
  188. package/bin/test/LiveMediaSessionCoordinatorSuspension.d.ts +20 -0
  189. package/bin/test/LiveMediaSessionCoordinatorSuspension.d.ts.map +1 -0
  190. package/bin/test/LiveMediaSessionCoordinatorSuspension.js +28 -0
  191. package/bin/test/LiveMediaSessionCoordinatorSuspension.js.map +1 -0
  192. package/bin/test/MediaPlayerSynchronizer.d.ts +204 -0
  193. package/bin/test/MediaPlayerSynchronizer.d.ts.map +1 -0
  194. package/bin/test/MediaPlayerSynchronizer.js +574 -0
  195. package/bin/test/MediaPlayerSynchronizer.js.map +1 -0
  196. package/bin/test/MediaSessionActionThrottler.d.ts +12 -0
  197. package/bin/test/MediaSessionActionThrottler.d.ts.map +1 -0
  198. package/bin/test/MediaSessionActionThrottler.js +14 -0
  199. package/bin/test/MediaSessionActionThrottler.js.map +1 -0
  200. package/bin/test/MediaSessionExtensions.d.ts +177 -0
  201. package/bin/test/MediaSessionExtensions.d.ts.map +1 -0
  202. package/bin/test/MediaSessionExtensions.js +26 -0
  203. package/bin/test/MediaSessionExtensions.js.map +1 -0
  204. package/bin/test/RepeatedActionThrottler.d.ts +20 -0
  205. package/bin/test/RepeatedActionThrottler.d.ts.map +1 -0
  206. package/bin/test/RepeatedActionThrottler.js +63 -0
  207. package/bin/test/RepeatedActionThrottler.js.map +1 -0
  208. package/bin/test/VolumeManager.d.ts +84 -0
  209. package/bin/test/VolumeManager.d.ts.map +1 -0
  210. package/bin/test/VolumeManager.js +175 -0
  211. package/bin/test/VolumeManager.js.map +1 -0
  212. package/bin/test/index.d.ts +14 -0
  213. package/bin/test/index.d.ts.map +1 -0
  214. package/bin/test/index.js +30 -0
  215. package/bin/test/index.js.map +1 -0
  216. package/bin/test/internals/GroupCoordinatorState.d.ts +110 -0
  217. package/bin/test/internals/GroupCoordinatorState.d.ts.map +1 -0
  218. package/bin/test/internals/GroupCoordinatorState.js +516 -0
  219. package/bin/test/internals/GroupCoordinatorState.js.map +1 -0
  220. package/bin/test/internals/GroupPlaybackPosition.d.ts +71 -0
  221. package/bin/test/internals/GroupPlaybackPosition.d.ts.map +1 -0
  222. package/bin/test/internals/GroupPlaybackPosition.js +170 -0
  223. package/bin/test/internals/GroupPlaybackPosition.js.map +1 -0
  224. package/bin/test/internals/GroupPlaybackRate.d.ts +38 -0
  225. package/bin/test/internals/GroupPlaybackRate.d.ts.map +1 -0
  226. package/bin/test/internals/GroupPlaybackRate.js +59 -0
  227. package/bin/test/internals/GroupPlaybackRate.js.map +1 -0
  228. package/bin/test/internals/GroupPlaybackTrack.d.ts +45 -0
  229. package/bin/test/internals/GroupPlaybackTrack.d.ts.map +1 -0
  230. package/bin/test/internals/GroupPlaybackTrack.js +122 -0
  231. package/bin/test/internals/GroupPlaybackTrack.js.map +1 -0
  232. package/bin/test/internals/GroupPlaybackTrackData.d.ts +40 -0
  233. package/bin/test/internals/GroupPlaybackTrackData.d.ts.map +1 -0
  234. package/bin/test/internals/GroupPlaybackTrackData.js +70 -0
  235. package/bin/test/internals/GroupPlaybackTrackData.js.map +1 -0
  236. package/bin/test/internals/GroupTransportState.d.ts +52 -0
  237. package/bin/test/internals/GroupTransportState.d.ts.map +1 -0
  238. package/bin/test/internals/GroupTransportState.js +120 -0
  239. package/bin/test/internals/GroupTransportState.js.map +1 -0
  240. package/bin/test/internals/PriorityTimeInterval.d.ts +33 -0
  241. package/bin/test/internals/PriorityTimeInterval.d.ts.map +1 -0
  242. package/bin/test/internals/PriorityTimeInterval.js +45 -0
  243. package/bin/test/internals/PriorityTimeInterval.js.map +1 -0
  244. package/bin/test/internals/consts.d.ts +83 -0
  245. package/bin/test/internals/consts.d.ts.map +1 -0
  246. package/bin/test/internals/consts.js +92 -0
  247. package/bin/test/internals/consts.js.map +1 -0
  248. package/bin/test/internals/errors.d.ts +17 -0
  249. package/bin/test/internals/errors.d.ts.map +1 -0
  250. package/bin/test/internals/errors.js +34 -0
  251. package/bin/test/internals/errors.js.map +1 -0
  252. package/bin/test/internals/interfaces.d.ts +23 -0
  253. package/bin/test/internals/interfaces.d.ts.map +1 -0
  254. package/bin/test/internals/interfaces.js +3 -0
  255. package/bin/test/internals/interfaces.js.map +1 -0
  256. package/bin/test/package.json +1 -0
  257. package/bin/test/test/GroupPlaybackPosition.spec.d.ts +6 -0
  258. package/bin/test/test/GroupPlaybackPosition.spec.d.ts.map +1 -0
  259. package/bin/test/test/GroupPlaybackPosition.spec.js +315 -0
  260. package/bin/test/test/GroupPlaybackPosition.spec.js.map +1 -0
  261. package/bin/test/test/GroupPlaybackRate.spec.d.ts +6 -0
  262. package/bin/test/test/GroupPlaybackRate.spec.d.ts.map +1 -0
  263. package/bin/test/test/GroupPlaybackRate.spec.js +47 -0
  264. package/bin/test/test/GroupPlaybackRate.spec.js.map +1 -0
  265. package/bin/test/test/GroupPlaybackTrack.spec.d.ts +6 -0
  266. package/bin/test/test/GroupPlaybackTrack.spec.d.ts.map +1 -0
  267. package/bin/test/test/GroupPlaybackTrack.spec.js +171 -0
  268. package/bin/test/test/GroupPlaybackTrack.spec.js.map +1 -0
  269. package/bin/test/test/GroupPlaybackTrackData.spec.d.ts +6 -0
  270. package/bin/test/test/GroupPlaybackTrackData.spec.d.ts.map +1 -0
  271. package/bin/test/test/GroupPlaybackTrackData.spec.js +63 -0
  272. package/bin/test/test/GroupPlaybackTrackData.spec.js.map +1 -0
  273. package/bin/test/test/LiveMediaSession_ManualActionHandler.spec.d.ts +6 -0
  274. package/bin/test/test/LiveMediaSession_ManualActionHandler.spec.d.ts.map +1 -0
  275. package/bin/test/test/LiveMediaSession_ManualActionHandler.spec.js +323 -0
  276. package/bin/test/test/LiveMediaSession_ManualActionHandler.spec.js.map +1 -0
  277. package/bin/test/test/LiveMediaSession_Synchronizer.spec.d.ts +6 -0
  278. package/bin/test/test/LiveMediaSession_Synchronizer.spec.d.ts.map +1 -0
  279. package/bin/test/test/LiveMediaSession_Synchronizer.spec.js +669 -0
  280. package/bin/test/test/LiveMediaSession_Synchronizer.spec.js.map +1 -0
  281. package/bin/test/test/PriorityTimeInterval.spec.d.ts +6 -0
  282. package/bin/test/test/PriorityTimeInterval.spec.d.ts.map +1 -0
  283. package/bin/test/test/PriorityTimeInterval.spec.js +67 -0
  284. package/bin/test/test/PriorityTimeInterval.spec.js.map +1 -0
  285. package/bin/test/test/TestUtils.d.ts +44 -0
  286. package/bin/test/test/TestUtils.d.ts.map +1 -0
  287. package/bin/test/test/TestUtils.js +116 -0
  288. package/bin/test/test/TestUtils.js.map +1 -0
  289. package/bin/test/test/VolumeManager.spec.d.ts +2 -0
  290. package/bin/test/test/VolumeManager.spec.d.ts.map +1 -0
  291. package/bin/test/test/VolumeManager.spec.js +163 -0
  292. package/bin/test/test/VolumeManager.spec.js.map +1 -0
  293. package/package.json +3 -3
@@ -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,M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E,qBAAqB,GAClC,iCAAiC;IA2DpC;;;OAGG;IACH,IAAW,aAAa,IAAI,OAAO,CAElC;IAED;;;OAGG;IACU,UAAU,CACnB,0BAA0B,CAAC,EAAE,eAAe,EAAE,GAC/C,OAAO,CAAC,IAAI,CAAC;IAkChB;;;OAGG;IACI,iBAAiB,IAAI,qBAAqB,GAAG,IAAI;IAQxD;;;OAGG;IACI,kBAAkB,CACrB,KAAK,EAAE,iBAAiB,EACxB,cAAc,CAAC,EAAE,MAAM,GACxB,IAAI;cAmCS,cAAc,CAC1B,0BAA0B,CAAC,EAAE,eAAe,EAAE,GAC/C,OAAO,CAAC,IAAI,CAAC;IA8GhB,OAAO,CAAC,iBAAiB;CAY5B"}
@@ -0,0 +1,556 @@
1
+ /**
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the Microsoft Live Share SDK License.
4
+ */
5
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
6
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
7
+ return new (P || (P = Promise))(function (resolve, reject) {
8
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
9
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
10
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
11
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
12
+ });
13
+ };
14
+ import { LiveTelemetryLogger, LiveDataObjectInitializeState, LiveDataObjectInitializeNotNeededError, LiveDataObjectNotInitializedError, } from "@microsoft/live-share";
15
+ import { LiveEventScope, LiveEventTarget, LiveObjectSynchronizer, isErrorLike, } from "@microsoft/live-share/internal";
16
+ import { GroupCoordinatorState, GroupCoordinatorStateEvents, } from "./internals/GroupCoordinatorState.js";
17
+ import { TelemetryEvents } from "./internals/consts.js";
18
+ import { TrackMetadataNotSetError, ActionBlockedError, } from "./internals/errors.js";
19
+ import { PriorityTimeInterval } from "./internals/PriorityTimeInterval.js";
20
+ import { LiveMediaSessionCoordinatorSuspension } from "./LiveMediaSessionCoordinatorSuspension.js";
21
+ import { TypedEventEmitter } from "@fluid-internal/client-utils";
22
+ /**
23
+ * The `LiveMediaSessionCoordinator` tracks the playback & position state of all other
24
+ * clients being synchronized with. It is responsible for keeping the local media player
25
+ * in sync with the group.
26
+ */
27
+ export class LiveMediaSessionCoordinator extends TypedEventEmitter {
28
+ /**
29
+ * @hidden
30
+ * Applications shouldn't directly create new coordinator instances.
31
+ */
32
+ constructor(id, runtime, liveRuntime, getPlayerState) {
33
+ super();
34
+ this._positionUpdateInterval = new PriorityTimeInterval(2000,
35
+ // Scale by function
36
+ () => {
37
+ const audience = this._liveRuntime.audience;
38
+ if (!audience)
39
+ return 1;
40
+ // As the audience size gets bigger, we relax the update interval, since more variance is expected
41
+ const count = audience.getMembers().size;
42
+ return 1 + count / 5;
43
+ });
44
+ this._maxPlaybackDrift = new PriorityTimeInterval(1500, // Scale by function
45
+ () => {
46
+ const audience = this._liveRuntime.audience;
47
+ if (!audience)
48
+ return 1;
49
+ // As the audience size gets bigger, we relax the playback drift, since more variance is expected
50
+ const count = audience.getMembers().size;
51
+ return 1 + count / 25;
52
+ });
53
+ this.initializeState = LiveDataObjectInitializeState.needed;
54
+ /**
55
+ * Controls whether or not the local client is allowed to instruct the group to play or pause.
56
+ *
57
+ * @remarks
58
+ * This flag largely meant to influence decisions made by the coordinator and can be used by
59
+ * the UI to determine what controls should be shown to the user. It does not provide any
60
+ * security in itself.
61
+ *
62
+ * If your app is running in a semi-trusted environment where only some clients are allowed
63
+ * to play/pause media, you should use "role based verification" to enforce those policies.
64
+ */
65
+ this.canPlayPause = true;
66
+ /**
67
+ * Controls whether or not the local client is allowed to seek the group to a new playback
68
+ * position.
69
+ *
70
+ * @remarks
71
+ * This flag largely meant to influence decisions made by the coordinator and can be used by
72
+ * the UI to determine what controls should be shown to the user. It does not provide any
73
+ * security in itself.
74
+ *
75
+ * If your app is running in a semi-trusted environment where only some clients are allowed
76
+ * to change the playback position, you should use "role based verification" to enforce those policies.
77
+ */
78
+ this.canSeek = true;
79
+ /**
80
+ * Controls whether or not the local client is allowed to change tracks.
81
+ *
82
+ * @remarks
83
+ * This flag largely meant to influence decisions made by the coordinator and can be used by
84
+ * the UI to determine what controls should be shown to the user. It does not provide any
85
+ * security in itself.
86
+ *
87
+ * If your app is running in a semi-trusted environment where only some clients are allowed
88
+ * to change tracks, you should use "role based verification" to enforce those policies.
89
+ */
90
+ this.canSetTrack = true;
91
+ /**
92
+ * Controls whether or not the local client is allowed to change the tracks custom data object.
93
+ *
94
+ * @remarks
95
+ * This flag largely meant to influence decisions made by the coordinator and can be used by
96
+ * the UI to determine what controls should be shown to the user. It does not provide any
97
+ * security in itself.
98
+ *
99
+ * If your app is running in a semi-trusted environment where only some clients are allowed
100
+ * to change the tracks data object, you should use "role based verification" to enforce those
101
+ * policies.
102
+ */
103
+ this.canSetTrackData = true;
104
+ /**
105
+ * Controls whether or not the local client is allowed to change the playback rate.
106
+ *
107
+ * @remarks
108
+ * This flag largely meant to influence decisions made by the coordinator and can be used by
109
+ * the UI to determine what controls should be shown to the user. It does not provide any
110
+ * security in itself.
111
+ *
112
+ * If your app is running in a semi-trusted environment where only some clients are allowed
113
+ * to change the tracks data object, you should use "role based verification" to enforce those
114
+ * policies.
115
+ */
116
+ this.canSetPlaybackRate = true;
117
+ /**
118
+ * Controls whether or not the local client is allowed to send position updates to the group.
119
+ *
120
+ * @remarks
121
+ * This flag largely meant to limit the number of signals sent to the group for performance reasons.
122
+ * It does not provide any security in itself.
123
+ */
124
+ this.canSendPositionUpdates = true;
125
+ this._id = id;
126
+ this._runtime = runtime;
127
+ this._liveRuntime = liveRuntime;
128
+ this._logger = new LiveTelemetryLogger(runtime, liveRuntime);
129
+ this._getPlayerState = getPlayerState;
130
+ }
131
+ /**
132
+ * Returns true if the local client is in a suspended state.
133
+ */
134
+ get isSuspended() {
135
+ return this._groupState ? this._groupState.isSuspended : false;
136
+ }
137
+ /**
138
+ * Controls whether or not to scale {@link maxPlaybackDrift} by the number of users in the session.
139
+ *
140
+ * @remarks
141
+ * As more clients join a session, it is more likely that some users will fall behind the presenter.
142
+ * It is also less likely that users will notice drift as more clients are added.
143
+ * It is usually helpful to be more lenient as more clients are added so everyone can watch all the content.
144
+ * Default value is true.
145
+ */
146
+ get shouldScaleMaxPlaybackDrift() {
147
+ return this._maxPlaybackDrift.shouldPrioritize;
148
+ }
149
+ set shouldScaleMaxPlaybackDrift(value) {
150
+ this._maxPlaybackDrift.shouldPrioritize = value;
151
+ }
152
+ /**
153
+ * Max amount of playback drift allowed in seconds.
154
+ * This will scale automatically according to the number of participants in the session when {@link shouldScaleMaxPlaybackDrift} is true.
155
+ *
156
+ * @remarks
157
+ * Should the local clients playback position lag by more than the specified value, the coordinator will trigger a `catchup` action.
158
+ * Default value is `1.5` seconds.
159
+ */
160
+ get maxPlaybackDrift() {
161
+ return this._maxPlaybackDrift.seconds;
162
+ }
163
+ set maxPlaybackDrift(value) {
164
+ this._maxPlaybackDrift.seconds = value;
165
+ }
166
+ /**
167
+ * Controls whether or not to compute {@link positionUpdateInterval} based on whether user has initiated a playback command.
168
+ * Default value is true.
169
+ *
170
+ * @remarks
171
+ * When true, users that are simply watching but not controlling playback will report their positions less frequently.
172
+ * When a user has sent a transport command, they will begin sending position updates more frequently.
173
+ * Most Live Share apps have a concept of a primary presenter, and don't allow anyone to pause/play for the group.
174
+ * By ensuring only one/few users broadcast updates frequently, the server load is reduced considerably.
175
+ */
176
+ get shouldScalePositionUpdateInterval() {
177
+ return this._positionUpdateInterval.shouldPrioritize;
178
+ }
179
+ set shouldScalePositionUpdateInterval(value) {
180
+ this._positionUpdateInterval.shouldPrioritize = value;
181
+ }
182
+ /**
183
+ * Frequency with which position updates are broadcast to the rest of the group in seconds.
184
+ * When {@link shouldScalePositionUpdateInterval} is set to `true`, the value set is the minimum value.
185
+ * The value returned is the actual value used to send updates by the local user, which may be larger than the value set.
186
+ *
187
+ * @remarks
188
+ * Defaults to a minimum value of `2` seconds.
189
+ */
190
+ get positionUpdateInterval() {
191
+ return this._positionUpdateInterval.seconds;
192
+ }
193
+ set positionUpdateInterval(value) {
194
+ this._positionUpdateInterval.seconds = value;
195
+ }
196
+ /**
197
+ * Instructs the group to play the current track.
198
+ *
199
+ * @remarks
200
+ * Throws an exception if the session/coordinator hasn't been initialized, no track has been
201
+ * loaded, or `canPlayPause` is false.
202
+ *
203
+ * @returns a void promise that resolves once complete, throws if user does not have proper roles
204
+ */
205
+ play() {
206
+ return __awaiter(this, void 0, void 0, function* () {
207
+ var _a;
208
+ LiveDataObjectNotInitializedError.assert("LiveMediaSessionCoordinator:play", "play", this.initializeState);
209
+ TrackMetadataNotSetError.assert(!!((_a = this._groupState) === null || _a === void 0 ? void 0 : _a.playbackTrack.current.metadata), "LiveMediaSessionCoordinator:play", "play");
210
+ ActionBlockedError.assert(this.canPlayPause, "LiveMediaSessionCoordinator:play", "play", "canPlayPause");
211
+ // Get projected position
212
+ const position = this.getPlayerPosition();
213
+ // Send transport command
214
+ this._logger.sendTelemetryEvent(TelemetryEvents.SessionCoordinator.PlayCalled, null, { position: position });
215
+ yield this._playEvent.sendEvent({
216
+ track: this._groupState.playbackTrack.current,
217
+ position: position,
218
+ });
219
+ if (this.canSendPositionUpdates) {
220
+ // User has taken initiative to send event, give priority for sending position updates
221
+ this._positionUpdateInterval.hasPriority = true;
222
+ }
223
+ });
224
+ }
225
+ /**
226
+ * Instructs the group to pause the current track.
227
+ *
228
+ * @remarks
229
+ * Throws an exception if the session/coordinator hasn't been initialized, no track has been
230
+ * loaded, or `canPlayPause` is false.
231
+ *
232
+ * @returns a void promise that resolves once complete, throws if user does not have proper roles
233
+ */
234
+ pause() {
235
+ return __awaiter(this, void 0, void 0, function* () {
236
+ var _a;
237
+ LiveDataObjectNotInitializedError.assert("LiveMediaSessionCoordinator:pause", "pause", this.initializeState);
238
+ TrackMetadataNotSetError.assert(!!((_a = this._groupState) === null || _a === void 0 ? void 0 : _a.playbackTrack.current.metadata), "LiveMediaSessionCoordinator:pause", "pause");
239
+ ActionBlockedError.assert(this.canPlayPause, "LiveMediaSessionCoordinator:pause", "pause", "canPlayPause");
240
+ // Get projected position
241
+ const position = this.getPlayerPosition();
242
+ // Send transport command
243
+ this._logger.sendTelemetryEvent(TelemetryEvents.SessionCoordinator.PauseCalled, null, { position: position });
244
+ yield this._pauseEvent.sendEvent({
245
+ track: this._groupState.playbackTrack.current,
246
+ position: position,
247
+ });
248
+ if (this.canSendPositionUpdates) {
249
+ // User has taken initiative to send event, give priority for sending position updates
250
+ this._positionUpdateInterval.hasPriority = true;
251
+ }
252
+ });
253
+ }
254
+ /**
255
+ * Instructs the group to seek to a new position within the current track.
256
+ *
257
+ * @remarks
258
+ * Throws an exception if the session/coordinator hasn't been initialized, no track has been
259
+ * loaded, or `canSeek` is false.
260
+ * @param time Playback position in seconds to seek to.
261
+ * @returns a void promise that resolves once complete, throws if user does not have proper roles
262
+ */
263
+ seekTo(time) {
264
+ return __awaiter(this, void 0, void 0, function* () {
265
+ var _a;
266
+ LiveDataObjectNotInitializedError.assert("LiveMediaSessionCoordinator:seekTo", "seekTo", this.initializeState);
267
+ TrackMetadataNotSetError.assert(!!((_a = this._groupState) === null || _a === void 0 ? void 0 : _a.playbackTrack.current.metadata), "LiveMediaSessionCoordinator:seekTo", "seekTo");
268
+ ActionBlockedError.assert(this.canSeek, "LiveMediaSessionCoordinator:seekTo", "seekTo", "canSeek");
269
+ // Send transport command
270
+ this._logger.sendTelemetryEvent(TelemetryEvents.SessionCoordinator.SeekToCalled, null, { position: time });
271
+ try {
272
+ yield this._seekToEvent.sendEvent({
273
+ track: this._groupState.playbackTrack.current,
274
+ position: time,
275
+ });
276
+ if (this.canSendPositionUpdates) {
277
+ // User has taken initiative to send event, give priority for sending position updates
278
+ this._positionUpdateInterval.hasPriority = true;
279
+ }
280
+ }
281
+ catch (err) {
282
+ yield this._groupState.syncLocalMediaSession();
283
+ throw err;
284
+ }
285
+ });
286
+ }
287
+ /**
288
+ * Sets the playback rate for everyone in the session.
289
+ *
290
+ * @param playbackRate the playback rate to set.
291
+ *
292
+ * @throws
293
+ * Throws an exception if the session/coordinator hasn't been initialized or {@link canSetPlaybackRate} is false.
294
+ */
295
+ setPlaybackRate(playbackRate) {
296
+ return __awaiter(this, void 0, void 0, function* () {
297
+ LiveDataObjectNotInitializedError.assert("LiveMediaSessionCoordinator:setPlaybackRate", "setPlaybackRate", this.initializeState);
298
+ ActionBlockedError.assert(this.canSetPlaybackRate, "LiveMediaSessionCoordinator:setPlaybackRate", "setPlaybackRate", "canSetPlaybackRate");
299
+ this._logger.sendTelemetryEvent(TelemetryEvents.SessionCoordinator.SetPlaybackRateCalled, null, { playbackRate });
300
+ yield this._rateChangeEvent.sendEvent({ playbackRate });
301
+ if (this.canSendPositionUpdates) {
302
+ // User has taken initiative to send event, give priority for sending position updates
303
+ this._positionUpdateInterval.hasPriority = true;
304
+ }
305
+ });
306
+ }
307
+ /**
308
+ * Instructs the group to load a new track.
309
+ *
310
+ * @remarks
311
+ * Throws an exception if the session/coordinator hasn't been initialized or `canSetTrack` is
312
+ * false.
313
+ * @param metadata The track to load or `null` to indicate that the end of the track is reached.
314
+ * @param waitPoints Optional. List of static wait points to configure for the track. Dynamic wait points can be added via the `beginSuspension()` call.
315
+ * @returns a void promise that resolves once complete, throws if user does not have proper roles
316
+ */
317
+ setTrack(metadata, waitPoints) {
318
+ return __awaiter(this, void 0, void 0, function* () {
319
+ LiveDataObjectNotInitializedError.assert("LiveMediaSessionCoordinator:setTrack", "setTrack", this.initializeState);
320
+ ActionBlockedError.assert(this.canSetTrack, "LiveMediaSessionCoordinator:setTrack", "setTrack", "canSetTrack");
321
+ // Send transport command
322
+ this._logger.sendTelemetryEvent(TelemetryEvents.SessionCoordinator.SetTrackCalled);
323
+ yield this._setTrackEvent.sendEvent({
324
+ metadata: metadata,
325
+ waitPoints: waitPoints || [],
326
+ });
327
+ if (this.canSendPositionUpdates) {
328
+ // User has taken initiative to send event, give priority for sending position updates
329
+ this._positionUpdateInterval.hasPriority = true;
330
+ }
331
+ });
332
+ }
333
+ /**
334
+ * Updates the track data object for the current track.
335
+ *
336
+ * @remarks
337
+ * The track data object can be used by applications to synchronize things like pitch, roll,
338
+ * and yaw of a 360 video. This data object will be reset to null anytime the track changes.
339
+ *
340
+ * Throws an exception if the session/coordinator hasn't been initialized or `canSetTrackData` is
341
+ * false.
342
+ * @param data New data object to sync with the group. This value will be synchronized using a last writer wins strategy.
343
+ * @returns a void promise that resolves once complete, throws if user does not have proper roles
344
+ */
345
+ setTrackData(data) {
346
+ return __awaiter(this, void 0, void 0, function* () {
347
+ LiveDataObjectNotInitializedError.assert("LiveMediaSessionCoordinator:setTrackData", "setTrackData", this.initializeState);
348
+ ActionBlockedError.assert(this.canSetTrackData, "LiveMediaSessionCoordinator:setTrackData", "setTrackData", "canSetTrackData");
349
+ // Send transport command
350
+ this._logger.sendTelemetryEvent(TelemetryEvents.SessionCoordinator.SetTrackDataCalled);
351
+ yield this._setTrackDataEvent.sendEvent({
352
+ data: data,
353
+ });
354
+ if (this.canSendPositionUpdates) {
355
+ // User has taken initiative to send event, give priority for sending position updates
356
+ this._positionUpdateInterval.hasPriority = true;
357
+ }
358
+ });
359
+ }
360
+ /**
361
+ * Begins a new local suspension.
362
+ *
363
+ * @remarks
364
+ * Suspension temporarily suspend the clients local synchronization with the group. This can
365
+ * be useful for displaying ads to users or temporarily disconnecting from the session while
366
+ * the user seeks the video using a timeline scrubber.
367
+ *
368
+ * Multiple simultaneous suspensions are allowed and when the last suspension ends the local
369
+ * client will be immediately re-synchronized with the group.
370
+ *
371
+ * A "Dynamic Wait Point" can be specified when `beginSuspension()` is called and the wait
372
+ * point will be broadcast to all other clients in the group. Those clients will then
373
+ * automatically enter a suspension state once they reach the positions specified by the
374
+ * wait point. Clients that are passed the wait point will immediately suspend.
375
+ *
376
+ * Any wait point based suspension (dynamic or static) will result in all clients remaining
377
+ * in a suspension state until the list client ends their suspension. This behavior can be
378
+ * conditionally bypassed by settings the wait points `maxClients` value.
379
+ *
380
+ * Throws an exception if the session/coordinator hasn't been initialized.
381
+ * @param waitPoint Optional. Dynamic wait point to broadcast to all of the clients.
382
+ * @returns The suspension object. Call `end()` on the returned suspension to end the suspension.
383
+ */
384
+ beginSuspension(waitPoint) {
385
+ var _a;
386
+ LiveDataObjectNotInitializedError.assert("LiveMediaSessionCoordinator:beginSuspension", "beginSuspension", this.initializeState);
387
+ TrackMetadataNotSetError.assert(!!((_a = this._groupState) === null || _a === void 0 ? void 0 : _a.playbackTrack.current.metadata), "LiveMediaSessionCoordinator:beginSuspension", "beginSuspension");
388
+ // Tell group state that suspension is started
389
+ if (waitPoint) {
390
+ this._logger.sendTelemetryEvent(TelemetryEvents.SessionCoordinator.BeginSuspensionAndWait, null, {
391
+ position: waitPoint.position,
392
+ maxClients: waitPoint.maxClients,
393
+ });
394
+ this._lastWaitPoint = waitPoint;
395
+ this._groupState.beginSuspension(waitPoint);
396
+ }
397
+ else {
398
+ this._logger.sendTelemetryEvent(TelemetryEvents.SessionCoordinator.BeginSuspension);
399
+ this._groupState.beginSuspension();
400
+ }
401
+ // Return new suspension object
402
+ return new LiveMediaSessionCoordinatorSuspension(waitPoint, (time) => {
403
+ var _a, _b;
404
+ if (waitPoint) {
405
+ this._logger.sendTelemetryEvent(TelemetryEvents.SessionCoordinator.EndSuspensionAndWait, null, {
406
+ position: waitPoint.position,
407
+ maxClients: waitPoint.maxClients,
408
+ });
409
+ }
410
+ else {
411
+ this._logger.sendTelemetryEvent(TelemetryEvents.SessionCoordinator.EndSuspension);
412
+ }
413
+ this._groupState.endSuspension(time == undefined);
414
+ if (time != undefined &&
415
+ !((_a = this._groupState) === null || _a === void 0 ? void 0 : _a.isSuspended) &&
416
+ !((_b = this._groupState) === null || _b === void 0 ? void 0 : _b.isWaiting)) {
417
+ // Seek to new position
418
+ this.seekTo(Math.max(time, 0.0));
419
+ }
420
+ });
421
+ }
422
+ /**
423
+ * @hidden
424
+ * Called by MediaSession to verify the coordinator has been initialized.
425
+ */
426
+ get isInitialized() {
427
+ return this.initializeState === LiveDataObjectInitializeState.succeeded;
428
+ }
429
+ /**
430
+ * @hidden
431
+ * Called by MediaSession to start coordinator.
432
+ */
433
+ initialize(acceptTransportChangesFrom) {
434
+ return __awaiter(this, void 0, void 0, function* () {
435
+ var _a;
436
+ LiveDataObjectInitializeNotNeededError.assert("LiveMediaSessionCoordinator:initialize", this.initializeState);
437
+ this.initializeState = LiveDataObjectInitializeState.pending;
438
+ try {
439
+ // Create children
440
+ yield this.createChildren(acceptTransportChangesFrom);
441
+ }
442
+ catch (error) {
443
+ this.initializeState = LiveDataObjectInitializeState.needed;
444
+ throw error;
445
+ }
446
+ this.initializeState = LiveDataObjectInitializeState.succeeded;
447
+ try {
448
+ // start needs to happen after setting initializedState to "succeeded"
449
+ yield ((_a = this._synchronizer) === null || _a === void 0 ? void 0 : _a.start({
450
+ initialState: undefined,
451
+ updateState: (evt, sender, local) => __awaiter(this, void 0, void 0, function* () { return false; }),
452
+ getLocalUserCanSend: (connecting) => __awaiter(this, void 0, void 0, function* () { return true; }),
453
+ enableBackgroundUpdates: false,
454
+ }));
455
+ }
456
+ catch (error) {
457
+ // not a fatal error for LiveMediaSession, only used for "connect" event to send new clients position updates.
458
+ this._logger.sendErrorEvent(TelemetryEvents.SessionCoordinator
459
+ .LiveObjectSynchronizerStartError, error);
460
+ }
461
+ });
462
+ }
463
+ /**
464
+ * @hidden
465
+ * Called by the MediaSession to detect if a wait point has been hit.
466
+ */
467
+ findNextWaitPoint() {
468
+ var _a;
469
+ return (((_a = this._groupState) === null || _a === void 0 ? void 0 : _a.playbackTrack.findNextWaitPoint(this._lastWaitPoint)) || null);
470
+ }
471
+ /**
472
+ * @hidden
473
+ * Called by MediaSession to trigger the sending of a position update.
474
+ */
475
+ sendPositionUpdate(state, targetClientId) {
476
+ var _a, _b;
477
+ LiveDataObjectNotInitializedError.assert("LiveMediaSessionCoordinator:sendPositionUpdate", "sendPositionUpdate", this.initializeState);
478
+ if (this.canSendPositionUpdates) {
479
+ // Send position update event
480
+ const evt = this._groupState.createPositionUpdateEvent(state);
481
+ (_a = this._positionUpdateEvent) === null || _a === void 0 ? void 0 : _a.sendEvent(evt, targetClientId).catch((err) => {
482
+ this._logger.sendErrorEvent(TelemetryEvents.SessionCoordinator
483
+ .PositionUpdateEventError, err);
484
+ });
485
+ }
486
+ else if (this.isSuspended) {
487
+ // send a local only position update event that was not sent as a signal, and use to handle local
488
+ // position update for clients that have canSendPositionUpdates==false, but are suspending
489
+ const evt = this._groupState.createPositionUpdateEvent(state);
490
+ (_b = this._positionUpdateEvent) === null || _b === void 0 ? void 0 : _b.sendLocalEvent(evt).catch((err) => {
491
+ this._logger.sendErrorEvent(TelemetryEvents.SessionCoordinator.PositionUpdateEventError, err);
492
+ });
493
+ }
494
+ else {
495
+ // make sure position is synced to position of clients who can send position updates
496
+ this._groupState.syncLocalMediaSession();
497
+ }
498
+ }
499
+ createChildren(acceptTransportChangesFrom) {
500
+ return __awaiter(this, void 0, void 0, function* () {
501
+ // Create event scopes
502
+ const scope = new LiveEventScope(this._runtime, this._liveRuntime, acceptTransportChangesFrom);
503
+ const unrestrictedScope = new LiveEventScope(this._runtime, this._liveRuntime);
504
+ // Initialize internal coordinator state
505
+ this._groupState = new GroupCoordinatorState(this._runtime, this._liveRuntime, this._maxPlaybackDrift, this._positionUpdateInterval, this._getPlayerState);
506
+ this._groupState.on(GroupCoordinatorStateEvents.triggeraction, (evt) => this.emit(evt.name, evt));
507
+ this._groupState.on(GroupCoordinatorStateEvents.triggeractionignored, (evt) => this.emit(evt.name, evt));
508
+ // Listen for track changes
509
+ this._setTrackEvent = new LiveEventTarget(scope, "setTrack", (event, local) => this._groupState.handleSetTrack(event, local));
510
+ this._setTrackDataEvent = new LiveEventTarget(scope, "setTrackData", (event, local) => this._groupState.handleSetTrackData(event, local));
511
+ // Listen for transport commands
512
+ this._playEvent = new LiveEventTarget(scope, "play", (event, local) => this._groupState.handleTransportCommand(event, local));
513
+ this._pauseEvent = new LiveEventTarget(scope, "pause", (event, local) => this._groupState.handleTransportCommand(event, local));
514
+ this._seekToEvent = new LiveEventTarget(scope, "seekTo", (event, local) => this._groupState.handleTransportCommand(event, local));
515
+ this._rateChangeEvent = new LiveEventTarget(scope, "rateChange", (event, local) => {
516
+ this._groupState.handleRateChangeCommand(event, local);
517
+ });
518
+ // Listen for position updates
519
+ this._positionUpdateEvent = new LiveEventTarget(unrestrictedScope, "positionUpdate", (event, local) => this._groupState.handlePositionUpdate(event, local));
520
+ this._synchronizer = new LiveObjectSynchronizer(this._id, this._runtime, this._liveRuntime);
521
+ this._synchronizer.onJoinedListener = (clientId, timestamp) => {
522
+ this._logger.sendTelemetryEvent(TelemetryEvents.SessionCoordinator.RemoteConnectReceived, null, {
523
+ correlationId: LiveTelemetryLogger.formatCorrelationId(clientId, timestamp),
524
+ });
525
+ // Immediately send a position update
526
+ try {
527
+ const state = this._getPlayerState();
528
+ // Send only to the user that joined the session using the targetClientId prop.
529
+ // This ensures that only the user that connected receives this one-time position update, minimizing costs.
530
+ this.sendPositionUpdate(state, clientId);
531
+ }
532
+ catch (err) {
533
+ // if player is not setup yet, local client might have also just joined and can't send its position.
534
+ const playerNotSetup = isErrorLike(err) &&
535
+ err.message.includes("LiveMediaSession:getCurrentPlayerState");
536
+ if (!playerNotSetup) {
537
+ throw err;
538
+ }
539
+ }
540
+ };
541
+ });
542
+ }
543
+ getPlayerPosition() {
544
+ const { positionState, playbackState } = this._getPlayerState();
545
+ switch (playbackState) {
546
+ case "none":
547
+ case "ended":
548
+ return 0.0;
549
+ default:
550
+ return positionState && positionState.position != undefined
551
+ ? positionState.position
552
+ : 0.0;
553
+ }
554
+ }
555
+ }
556
+ //# sourceMappingURL=LiveMediaSessionCoordinator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LiveMediaSessionCoordinator.js","sourceRoot":"","sources":["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AAE,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC;QAChE,QAAQ,aAAa,EAAE,CAAC;YACpB,KAAK,MAAM,CAAC;YACZ,KAAK,OAAO;gBACR,OAAO,GAAG,CAAC;YACf;gBACI,OAAO,aAAa,IAAI,aAAa,CAAC,QAAQ,IAAI,SAAS;oBACvD,CAAC,CAAC,aAAa,CAAC,QAAQ;oBACxB,CAAC,CAAC,GAAG,CAAC;QAClB,CAAC;IACL,CAAC;CACJ"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the Microsoft Live Share SDK License.
4
+ */
5
+ import { MediaSessionCoordinatorSuspension, CoordinationWaitPoint } from "./MediaSessionExtensions.js";
6
+ export declare class LiveMediaSessionCoordinatorSuspension implements MediaSessionCoordinatorSuspension {
7
+ private _waitPoint?;
8
+ private _onEnd;
9
+ constructor(waitPoint: CoordinationWaitPoint | undefined, onEnd: (seekTo?: number) => void);
10
+ /**
11
+ * Returns an optional wait point associated with the suspension.
12
+ */
13
+ get waitPoint(): CoordinationWaitPoint | undefined;
14
+ /**
15
+ * Ends the suspension and optionally proposes a time to seek to.
16
+ * @param seekTo Optional. Proposed time to seek to. Ignored for suspensions at wait points.
17
+ */
18
+ end(seekTo?: number): void;
19
+ }
20
+ //# sourceMappingURL=LiveMediaSessionCoordinatorSuspension.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LiveMediaSessionCoordinatorSuspension.d.ts","sourceRoot":"","sources":["../../src/LiveMediaSessionCoordinatorSuspension.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACH,iCAAiC,EACjC,qBAAqB,EACxB,MAAM,6BAA6B,CAAC;AAErC,qBAAa,qCAAsC,YAAW,iCAAiC;IAC3F,OAAO,CAAC,UAAU,CAAC,CAAwB;IAC3C,OAAO,CAAC,MAAM,CAA4B;gBAGtC,SAAS,EAAE,qBAAqB,GAAG,SAAS,EAC5C,KAAK,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,KAAK,IAAI;IAMpC;;OAEG;IACH,IAAW,SAAS,IAAI,qBAAqB,GAAG,SAAS,CAExD;IAED;;;OAGG;IACI,GAAG,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI;CAGpC"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the Microsoft Live Share SDK License.
4
+ */
5
+ export class LiveMediaSessionCoordinatorSuspension {
6
+ constructor(waitPoint, onEnd) {
7
+ this._waitPoint = waitPoint;
8
+ this._onEnd = onEnd;
9
+ }
10
+ /**
11
+ * Returns an optional wait point associated with the suspension.
12
+ */
13
+ get waitPoint() {
14
+ return this._waitPoint;
15
+ }
16
+ /**
17
+ * Ends the suspension and optionally proposes a time to seek to.
18
+ * @param seekTo Optional. Proposed time to seek to. Ignored for suspensions at wait points.
19
+ */
20
+ end(seekTo) {
21
+ this._onEnd(seekTo);
22
+ }
23
+ }
24
+ //# sourceMappingURL=LiveMediaSessionCoordinatorSuspension.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LiveMediaSessionCoordinatorSuspension.js","sourceRoot":"","sources":["../../src/LiveMediaSessionCoordinatorSuspension.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,MAAM,OAAO,qCAAqC;IAI9C,YACI,SAA4C,EAC5C,KAAgC;QAEhC,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC5B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACxB,CAAC;IAED;;OAEG;IACH,IAAW,SAAS;QAChB,OAAO,IAAI,CAAC,UAAU,CAAC;IAC3B,CAAC;IAED;;;OAGG;IACI,GAAG,CAAC,MAAe;QACtB,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACxB,CAAC;CACJ"}