@microsoft/live-share-media 2.0.0-internal.4 → 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,475 @@
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, TimeInterval, 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 { LiveMediaSessionCoordinatorSuspension } from "./LiveMediaSessionCoordinatorSuspension.js";
20
+ import { TypedEventEmitter } from "@fluid-internal/client-utils";
21
+ /**
22
+ * The `LiveMediaSessionCoordinator` tracks the playback & position state of all other
23
+ * clients being synchronized with. It is responsible for keeping the local media player
24
+ * in sync with the group.
25
+ */
26
+ export class LiveMediaSessionCoordinator extends TypedEventEmitter {
27
+ /**
28
+ * @hidden
29
+ * Applications shouldn't directly create new coordinator instances.
30
+ */
31
+ constructor(id, runtime, liveRuntime, getPlayerState) {
32
+ super();
33
+ this._positionUpdateInterval = new TimeInterval(2000);
34
+ this._maxPlaybackDrift = new TimeInterval(1000);
35
+ this.initializeState = LiveDataObjectInitializeState.needed;
36
+ /**
37
+ * Controls whether or not the local client is allowed to instruct the group to play or pause.
38
+ *
39
+ * @remarks
40
+ * This flag largely meant to influence decisions made by the coordinator and can be used by
41
+ * the UI to determine what controls should be shown to the user. It does not provide any
42
+ * security in itself.
43
+ *
44
+ * If your app is running in a semi-trusted environment where only some clients are allowed
45
+ * to play/pause media, you should use "role based verification" to enforce those policies.
46
+ */
47
+ this.canPlayPause = true;
48
+ /**
49
+ * Controls whether or not the local client is allowed to seek the group to a new playback
50
+ * position.
51
+ *
52
+ * @remarks
53
+ * This flag largely meant to influence decisions made by the coordinator and can be used by
54
+ * the UI to determine what controls should be shown to the user. It does not provide any
55
+ * security in itself.
56
+ *
57
+ * If your app is running in a semi-trusted environment where only some clients are allowed
58
+ * to change the playback position, you should use "role based verification" to enforce those policies.
59
+ */
60
+ this.canSeek = true;
61
+ /**
62
+ * Controls whether or not the local client is allowed to change tracks.
63
+ *
64
+ * @remarks
65
+ * This flag largely meant to influence decisions made by the coordinator and can be used by
66
+ * the UI to determine what controls should be shown to the user. It does not provide any
67
+ * security in itself.
68
+ *
69
+ * If your app is running in a semi-trusted environment where only some clients are allowed
70
+ * to change tracks, you should use "role based verification" to enforce those policies.
71
+ */
72
+ this.canSetTrack = true;
73
+ /**
74
+ * Controls whether or not the local client is allowed to change the tracks custom data object.
75
+ *
76
+ * @remarks
77
+ * This flag largely meant to influence decisions made by the coordinator and can be used by
78
+ * the UI to determine what controls should be shown to the user. It does not provide any
79
+ * security in itself.
80
+ *
81
+ * If your app is running in a semi-trusted environment where only some clients are allowed
82
+ * to change the tracks data object, you should use "role based verification" to enforce those
83
+ * policies.
84
+ */
85
+ this.canSetTrackData = true;
86
+ /**
87
+ * Controls whether or not the local client is allowed to change the playback rate.
88
+ *
89
+ * @remarks
90
+ * This flag largely meant to influence decisions made by the coordinator and can be used by
91
+ * the UI to determine what controls should be shown to the user. It does not provide any
92
+ * security in itself.
93
+ *
94
+ * If your app is running in a semi-trusted environment where only some clients are allowed
95
+ * to change the tracks data object, you should use "role based verification" to enforce those
96
+ * policies.
97
+ */
98
+ this.canSetPlaybackRate = true;
99
+ /**
100
+ * Controls whether or not the local client is allowed to send position updates to the group.
101
+ *
102
+ * @remarks
103
+ * This flag largely meant to limit the number of signals sent to the group for performance reasons.
104
+ * It does not provide any security in itself.
105
+ */
106
+ this.canSendPositionUpdates = true;
107
+ this._id = id;
108
+ this._runtime = runtime;
109
+ this._liveRuntime = liveRuntime;
110
+ this._logger = new LiveTelemetryLogger(runtime, liveRuntime);
111
+ this._getPlayerState = getPlayerState;
112
+ }
113
+ /**
114
+ * Returns true if the local client is in a suspended state.
115
+ */
116
+ get isSuspended() {
117
+ return this._groupState ? this._groupState.isSuspended : false;
118
+ }
119
+ /**
120
+ * Max amount of playback drift allowed in seconds.
121
+ *
122
+ * @remarks
123
+ * Should the local clients playback position lag by more than the specified value, the
124
+ * coordinator will trigger a `catchup` action.
125
+ *
126
+ * Defaults to a value of `1` second.
127
+ */
128
+ get maxPlaybackDrift() {
129
+ return this._maxPlaybackDrift.seconds;
130
+ }
131
+ set maxPlaybackDrift(value) {
132
+ this._maxPlaybackDrift.seconds = value;
133
+ }
134
+ /**
135
+ * Frequency with which position updates are broadcast to the rest of the group in
136
+ * seconds.
137
+ *
138
+ * @remarks
139
+ * Defaults to a value of `2` seconds.
140
+ */
141
+ get positionUpdateInterval() {
142
+ return this._positionUpdateInterval.seconds;
143
+ }
144
+ set positionUpdateInterval(value) {
145
+ this._positionUpdateInterval.seconds = value;
146
+ }
147
+ /**
148
+ * Instructs the group to play the current track.
149
+ *
150
+ * @remarks
151
+ * Throws an exception if the session/coordinator hasn't been initialized, no track has been
152
+ * loaded, or `canPlayPause` is false.
153
+ *
154
+ * @returns a void promise that resolves once complete, throws if user does not have proper roles
155
+ */
156
+ play() {
157
+ return __awaiter(this, void 0, void 0, function* () {
158
+ var _a;
159
+ LiveDataObjectNotInitializedError.assert("LiveMediaSessionCoordinator:play", "play", this.initializeState);
160
+ TrackMetadataNotSetError.assert(!!((_a = this._groupState) === null || _a === void 0 ? void 0 : _a.playbackTrack.current.metadata), "LiveMediaSessionCoordinator:play", "play");
161
+ ActionBlockedError.assert(this.canPlayPause, "LiveMediaSessionCoordinator:play", "play", "canPlayPause");
162
+ // Get projected position
163
+ const position = this.getPlayerPosition();
164
+ // Send transport command
165
+ this._logger.sendTelemetryEvent(TelemetryEvents.SessionCoordinator.PlayCalled, null, { position: position });
166
+ yield this._playEvent.sendEvent({
167
+ track: this._groupState.playbackTrack.current,
168
+ position: position,
169
+ });
170
+ });
171
+ }
172
+ /**
173
+ * Instructs the group to pause the current track.
174
+ *
175
+ * @remarks
176
+ * Throws an exception if the session/coordinator hasn't been initialized, no track has been
177
+ * loaded, or `canPlayPause` is false.
178
+ *
179
+ * @returns a void promise that resolves once complete, throws if user does not have proper roles
180
+ */
181
+ pause() {
182
+ return __awaiter(this, void 0, void 0, function* () {
183
+ var _a;
184
+ LiveDataObjectNotInitializedError.assert("LiveMediaSessionCoordinator:pause", "pause", this.initializeState);
185
+ TrackMetadataNotSetError.assert(!!((_a = this._groupState) === null || _a === void 0 ? void 0 : _a.playbackTrack.current.metadata), "LiveMediaSessionCoordinator:pause", "pause");
186
+ ActionBlockedError.assert(this.canPlayPause, "LiveMediaSessionCoordinator:pause", "pause", "canPlayPause");
187
+ // Get projected position
188
+ const position = this.getPlayerPosition();
189
+ // Send transport command
190
+ this._logger.sendTelemetryEvent(TelemetryEvents.SessionCoordinator.PauseCalled, null, { position: position });
191
+ yield this._pauseEvent.sendEvent({
192
+ track: this._groupState.playbackTrack.current,
193
+ position: position,
194
+ });
195
+ });
196
+ }
197
+ /**
198
+ * Instructs the group to seek to a new position within the current track.
199
+ *
200
+ * @remarks
201
+ * Throws an exception if the session/coordinator hasn't been initialized, no track has been
202
+ * loaded, or `canSeek` is false.
203
+ * @param time Playback position in seconds to seek to.
204
+ * @returns a void promise that resolves once complete, throws if user does not have proper roles
205
+ */
206
+ seekTo(time) {
207
+ return __awaiter(this, void 0, void 0, function* () {
208
+ var _a;
209
+ LiveDataObjectNotInitializedError.assert("LiveMediaSessionCoordinator:seekTo", "seekTo", this.initializeState);
210
+ TrackMetadataNotSetError.assert(!!((_a = this._groupState) === null || _a === void 0 ? void 0 : _a.playbackTrack.current.metadata), "LiveMediaSessionCoordinator:seekTo", "seekTo");
211
+ ActionBlockedError.assert(this.canSeek, "LiveMediaSessionCoordinator:seekTo", "seekTo", "canSeek");
212
+ // Send transport command
213
+ this._logger.sendTelemetryEvent(TelemetryEvents.SessionCoordinator.SeekToCalled, null, { position: time });
214
+ try {
215
+ yield this._seekToEvent.sendEvent({
216
+ track: this._groupState.playbackTrack.current,
217
+ position: time,
218
+ });
219
+ }
220
+ catch (err) {
221
+ yield this._groupState.syncLocalMediaSession();
222
+ throw err;
223
+ }
224
+ });
225
+ }
226
+ setPlaybackRate(playbackRate) {
227
+ return __awaiter(this, void 0, void 0, function* () {
228
+ LiveDataObjectNotInitializedError.assert("LiveMediaSessionCoordinator:setPlaybackRate", "setPlaybackRate", this.initializeState);
229
+ ActionBlockedError.assert(this.canSetPlaybackRate, "LiveMediaSessionCoordinator:setPlaybackRate", "setPlaybackRate", "canSetPlaybackRate");
230
+ this._logger.sendTelemetryEvent(TelemetryEvents.SessionCoordinator.SetPlaybackRateCalled, null, { playbackRate });
231
+ yield this._rateChangeEvent.sendEvent({ playbackRate });
232
+ });
233
+ }
234
+ /**
235
+ * Instructs the group to load a new track.
236
+ *
237
+ * @remarks
238
+ * Throws an exception if the session/coordinator hasn't been initialized or `canSetTrack` is
239
+ * false.
240
+ * @param metadata The track to load or `null` to indicate that the end of the track is reached.
241
+ * @param waitPoints Optional. List of static wait points to configure for the track. Dynamic wait points can be added via the `beginSuspension()` call.
242
+ * @returns a void promise that resolves once complete, throws if user does not have proper roles
243
+ */
244
+ setTrack(metadata, waitPoints) {
245
+ return __awaiter(this, void 0, void 0, function* () {
246
+ LiveDataObjectNotInitializedError.assert("LiveMediaSessionCoordinator:setTrack", "setTrack", this.initializeState);
247
+ ActionBlockedError.assert(this.canSetTrack, "LiveMediaSessionCoordinator:setTrack", "setTrack", "canSetTrack");
248
+ // Send transport command
249
+ this._logger.sendTelemetryEvent(TelemetryEvents.SessionCoordinator.SetTrackCalled);
250
+ yield this._setTrackEvent.sendEvent({
251
+ metadata: metadata,
252
+ waitPoints: waitPoints || [],
253
+ });
254
+ });
255
+ }
256
+ /**
257
+ * Updates the track data object for the current track.
258
+ *
259
+ * @remarks
260
+ * The track data object can be used by applications to synchronize things like pitch, roll,
261
+ * and yaw of a 360 video. This data object will be reset to null anytime the track changes.
262
+ *
263
+ * Throws an exception if the session/coordinator hasn't been initialized or `canSetTrackData` is
264
+ * false.
265
+ * @param data New data object to sync with the group. This value will be synchronized using a last writer wins strategy.
266
+ * @returns a void promise that resolves once complete, throws if user does not have proper roles
267
+ */
268
+ setTrackData(data) {
269
+ return __awaiter(this, void 0, void 0, function* () {
270
+ LiveDataObjectNotInitializedError.assert("LiveMediaSessionCoordinator:setTrackData", "setTrackData", this.initializeState);
271
+ ActionBlockedError.assert(this.canSetTrackData, "LiveMediaSessionCoordinator:setTrackData", "setTrackData", "canSetTrackData");
272
+ // Send transport command
273
+ this._logger.sendTelemetryEvent(TelemetryEvents.SessionCoordinator.SetTrackDataCalled);
274
+ yield this._setTrackDataEvent.sendEvent({
275
+ data: data,
276
+ });
277
+ });
278
+ }
279
+ /**
280
+ * Begins a new local suspension.
281
+ *
282
+ * @remarks
283
+ * Suspension temporarily suspend the clients local synchronization with the group. This can
284
+ * be useful for displaying ads to users or temporarily disconnecting from the session while
285
+ * the user seeks the video using a timeline scrubber.
286
+ *
287
+ * Multiple simultaneous suspensions are allowed and when the last suspension ends the local
288
+ * client will be immediately re-synchronized with the group.
289
+ *
290
+ * A "Dynamic Wait Point" can be specified when `beginSuspension()` is called and the wait
291
+ * point will be broadcast to all other clients in the group. Those clients will then
292
+ * automatically enter a suspension state once they reach the positions specified by the
293
+ * wait point. Clients that are passed the wait point will immediately suspend.
294
+ *
295
+ * Any wait point based suspension (dynamic or static) will result in all clients remaining
296
+ * in a suspension state until the list client ends their suspension. This behavior can be
297
+ * conditionally bypassed by settings the wait points `maxClients` value.
298
+ *
299
+ * Throws an exception if the session/coordinator hasn't been initialized.
300
+ * @param waitPoint Optional. Dynamic wait point to broadcast to all of the clients.
301
+ * @returns The suspension object. Call `end()` on the returned suspension to end the suspension.
302
+ */
303
+ beginSuspension(waitPoint) {
304
+ var _a;
305
+ LiveDataObjectNotInitializedError.assert("LiveMediaSessionCoordinator:beginSuspension", "beginSuspension", this.initializeState);
306
+ TrackMetadataNotSetError.assert(!!((_a = this._groupState) === null || _a === void 0 ? void 0 : _a.playbackTrack.current.metadata), "LiveMediaSessionCoordinator:beginSuspension", "beginSuspension");
307
+ // Tell group state that suspension is started
308
+ if (waitPoint) {
309
+ this._logger.sendTelemetryEvent(TelemetryEvents.SessionCoordinator.BeginSuspensionAndWait, null, {
310
+ position: waitPoint.position,
311
+ maxClients: waitPoint.maxClients,
312
+ });
313
+ this._lastWaitPoint = waitPoint;
314
+ this._groupState.beginSuspension(waitPoint);
315
+ }
316
+ else {
317
+ this._logger.sendTelemetryEvent(TelemetryEvents.SessionCoordinator.BeginSuspension);
318
+ this._groupState.beginSuspension();
319
+ }
320
+ // Return new suspension object
321
+ return new LiveMediaSessionCoordinatorSuspension(waitPoint, (time) => {
322
+ var _a, _b;
323
+ if (waitPoint) {
324
+ this._logger.sendTelemetryEvent(TelemetryEvents.SessionCoordinator.EndSuspensionAndWait, null, {
325
+ position: waitPoint.position,
326
+ maxClients: waitPoint.maxClients,
327
+ });
328
+ }
329
+ else {
330
+ this._logger.sendTelemetryEvent(TelemetryEvents.SessionCoordinator.EndSuspension);
331
+ }
332
+ this._groupState.endSuspension(time == undefined);
333
+ if (time != undefined &&
334
+ !((_a = this._groupState) === null || _a === void 0 ? void 0 : _a.isSuspended) &&
335
+ !((_b = this._groupState) === null || _b === void 0 ? void 0 : _b.isWaiting)) {
336
+ // Seek to new position
337
+ this.seekTo(Math.max(time, 0.0));
338
+ }
339
+ });
340
+ }
341
+ /**
342
+ * @hidden
343
+ * Called by MediaSession to verify the coordinator has been initialized.
344
+ */
345
+ get isInitialized() {
346
+ return this.initializeState === LiveDataObjectInitializeState.succeeded;
347
+ }
348
+ /**
349
+ * @hidden
350
+ * Called by MediaSession to start coordinator.
351
+ */
352
+ initialize(acceptTransportChangesFrom) {
353
+ return __awaiter(this, void 0, void 0, function* () {
354
+ var _a;
355
+ LiveDataObjectInitializeNotNeededError.assert("LiveMediaSessionCoordinator:initialize", this.initializeState);
356
+ this.initializeState = LiveDataObjectInitializeState.pending;
357
+ try {
358
+ // Create children
359
+ yield this.createChildren(acceptTransportChangesFrom);
360
+ }
361
+ catch (error) {
362
+ this.initializeState = LiveDataObjectInitializeState.needed;
363
+ throw error;
364
+ }
365
+ this.initializeState = LiveDataObjectInitializeState.succeeded;
366
+ try {
367
+ // start needs to happen after setting initializedState to "succeeded"
368
+ yield ((_a = this._synchronizer) === null || _a === void 0 ? void 0 : _a.start({
369
+ initialState: undefined,
370
+ updateState: (evt, sender, local) => __awaiter(this, void 0, void 0, function* () { return false; }),
371
+ getLocalUserCanSend: (connecting) => __awaiter(this, void 0, void 0, function* () { return true; }),
372
+ enableBackgroundUpdates: false,
373
+ }));
374
+ }
375
+ catch (error) {
376
+ // not a fatal error for LiveMediaSession, only used for "connect" event to send new clients position updates.
377
+ this._logger.sendErrorEvent(TelemetryEvents.SessionCoordinator
378
+ .LiveObjectSynchronizerStartError, error);
379
+ }
380
+ });
381
+ }
382
+ /**
383
+ * @hidden
384
+ * Called by the MediaSession to detect if a wait point has been hit.
385
+ */
386
+ findNextWaitPoint() {
387
+ var _a;
388
+ return (((_a = this._groupState) === null || _a === void 0 ? void 0 : _a.playbackTrack.findNextWaitPoint(this._lastWaitPoint)) || null);
389
+ }
390
+ /**
391
+ * @hidden
392
+ * Called by MediaSession to trigger the sending of a position update.
393
+ */
394
+ sendPositionUpdate(state, targetClientId) {
395
+ var _a, _b;
396
+ LiveDataObjectNotInitializedError.assert("LiveMediaSessionCoordinator:sendPositionUpdate", "sendPositionUpdate", this.initializeState);
397
+ if (this.canSendPositionUpdates) {
398
+ // Send position update event
399
+ const evt = this._groupState.createPositionUpdateEvent(state);
400
+ (_a = this._positionUpdateEvent) === null || _a === void 0 ? void 0 : _a.sendEvent(evt, targetClientId).catch((err) => {
401
+ this._logger.sendErrorEvent(TelemetryEvents.SessionCoordinator
402
+ .PositionUpdateEventError, err);
403
+ });
404
+ }
405
+ else if (this.isSuspended) {
406
+ // send a local only position update event that was not sent as a signal, and use to handle local
407
+ // position update for clients that have canSendPositionUpdates==false, but are suspending
408
+ const evt = this._groupState.createPositionUpdateEvent(state);
409
+ (_b = this._positionUpdateEvent) === null || _b === void 0 ? void 0 : _b.sendLocalEvent(evt).catch((err) => {
410
+ this._logger.sendErrorEvent(TelemetryEvents.SessionCoordinator.PositionUpdateEventError, err);
411
+ });
412
+ }
413
+ else {
414
+ // make sure position is synced to position of clients who can send position updates
415
+ this._groupState.syncLocalMediaSession();
416
+ }
417
+ }
418
+ createChildren(acceptTransportChangesFrom) {
419
+ return __awaiter(this, void 0, void 0, function* () {
420
+ // Create event scopes
421
+ const scope = new LiveEventScope(this._runtime, this._liveRuntime, acceptTransportChangesFrom);
422
+ const unrestrictedScope = new LiveEventScope(this._runtime, this._liveRuntime);
423
+ // Initialize internal coordinator state
424
+ this._groupState = new GroupCoordinatorState(this._runtime, this._liveRuntime, this._maxPlaybackDrift, this._positionUpdateInterval, this._getPlayerState);
425
+ this._groupState.on(GroupCoordinatorStateEvents.triggeraction, (evt) => this.emit(evt.name, evt));
426
+ this._groupState.on(GroupCoordinatorStateEvents.triggeractionignored, (evt) => this.emit(evt.name, evt));
427
+ // Listen for track changes
428
+ this._setTrackEvent = new LiveEventTarget(scope, "setTrack", (event, local) => this._groupState.handleSetTrack(event, local));
429
+ this._setTrackDataEvent = new LiveEventTarget(scope, "setTrackData", (event, local) => this._groupState.handleSetTrackData(event, local));
430
+ // Listen for transport commands
431
+ this._playEvent = new LiveEventTarget(scope, "play", (event, local) => this._groupState.handleTransportCommand(event, local));
432
+ this._pauseEvent = new LiveEventTarget(scope, "pause", (event, local) => this._groupState.handleTransportCommand(event, local));
433
+ this._seekToEvent = new LiveEventTarget(scope, "seekTo", (event, local) => this._groupState.handleTransportCommand(event, local));
434
+ this._rateChangeEvent = new LiveEventTarget(scope, "rateChange", (event, local) => {
435
+ this._groupState.handleRateChangeCommand(event, local);
436
+ });
437
+ // Listen for position updates
438
+ this._positionUpdateEvent = new LiveEventTarget(unrestrictedScope, "positionUpdate", (event, local) => this._groupState.handlePositionUpdate(event, local));
439
+ this._synchronizer = new LiveObjectSynchronizer(this._id, this._runtime, this._liveRuntime);
440
+ this._synchronizer.onJoinedListener = (clientId, timestamp) => {
441
+ this._logger.sendTelemetryEvent(TelemetryEvents.SessionCoordinator.RemoteConnectReceived, null, {
442
+ correlationId: LiveTelemetryLogger.formatCorrelationId(clientId, timestamp),
443
+ });
444
+ // Immediately send a position update
445
+ try {
446
+ const state = this._getPlayerState();
447
+ // Send only to the user that joined the session using the targetClientId prop.
448
+ // This ensures that only the user that connected receives this one-time position update, minimizing costs.
449
+ this.sendPositionUpdate(state, clientId);
450
+ }
451
+ catch (err) {
452
+ // if player is not setup yet, local client might have also just joined and can't send its position.
453
+ const playerNotSetup = isErrorLike(err) &&
454
+ err.message.includes("LiveMediaSession:getCurrentPlayerState");
455
+ if (!playerNotSetup) {
456
+ throw err;
457
+ }
458
+ }
459
+ };
460
+ });
461
+ }
462
+ getPlayerPosition() {
463
+ const { positionState, playbackState } = this._getPlayerState();
464
+ switch (playbackState) {
465
+ case "none":
466
+ case "ended":
467
+ return 0.0;
468
+ default:
469
+ return positionState && positionState.position != undefined
470
+ ? positionState.position
471
+ : 0.0;
472
+ }
473
+ }
474
+ }
475
+ //# sourceMappingURL=LiveMediaSessionCoordinator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LiveMediaSessionCoordinator.js","sourceRoot":"","sources":["../../src/LiveMediaSessionCoordinator.ts"],"names":[],"mappings":"AAAA;;;GAGG;;;;;;;;;;AAEH,OAAO,EACH,mBAAmB,EACnB,YAAY,EAEZ,6BAA6B,EAC7B,sCAAsC,EACtC,iCAAiC,GAEpC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAEH,cAAc,EACd,eAAe,EACf,sBAAsB,EAEtB,WAAW,GACd,MAAM,gCAAgC,CAAC;AAOxC,OAAO,EAIH,qBAAqB,EACrB,2BAA2B,GAG9B,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EACH,wBAAwB,EACxB,kBAAkB,GACrB,MAAM,uBAAuB,CAAC;AA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CAAC;oBACN,IAAI,CAAC,cAAc,EAAE,CAAC;wBAClB,MAAM,GAAG,CAAC;oBACd,CAAC;gBACL,CAAC;YACL,CAAC,CAAC;QACN,CAAC;KAAA;IAEO,iBAAiB;QACrB,MAAM,EAAE,aAAa,EAAE,aAAa,EAAE,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,qCACT,YAAW,iCAAiC;IAE5C,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;IAM9C,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"}