mediasfu-angular 1.0.0

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 (471) hide show
  1. package/README.md +2068 -0
  2. package/dist/README.md +2068 -0
  3. package/dist/esm2022/lib/@types/types.mjs +2 -0
  4. package/dist/esm2022/lib/components/background-components/background-modal/background-modal.component.mjs +763 -0
  5. package/dist/esm2022/lib/components/breakout-components/breakout-rooms-modal.component.mjs +316 -0
  6. package/dist/esm2022/lib/components/breakout-components/edit-room-modal/edit-room-modal.component.mjs +95 -0
  7. package/dist/esm2022/lib/components/breakout-components/room-list/room-list.component.mjs +40 -0
  8. package/dist/esm2022/lib/components/co-host-components/co-host-modal/co-host-modal.component.mjs +246 -0
  9. package/dist/esm2022/lib/components/display-components/alert-component/alert.component.component.mjs +73 -0
  10. package/dist/esm2022/lib/components/display-components/audio-card/audio-card.component.mjs +297 -0
  11. package/dist/esm2022/lib/components/display-components/audio-grid/audio-grid.component.mjs +60 -0
  12. package/dist/esm2022/lib/components/display-components/card-video-display/card-video-display.component.mjs +94 -0
  13. package/dist/esm2022/lib/components/display-components/control-buttons-alt-component/control-buttons-alt-component.component.mjs +100 -0
  14. package/dist/esm2022/lib/components/display-components/control-buttons-component/control-buttons-component.component.mjs +231 -0
  15. package/dist/esm2022/lib/components/display-components/control-buttons-component-touch/control-buttons-component-touch.component.mjs +298 -0
  16. package/dist/esm2022/lib/components/display-components/control-widgets/menu-participants-widget.component.mjs +61 -0
  17. package/dist/esm2022/lib/components/display-components/control-widgets/menu-record-widget.component.mjs +43 -0
  18. package/dist/esm2022/lib/components/display-components/control-widgets/menu-widget.component.mjs +114 -0
  19. package/dist/esm2022/lib/components/display-components/control-widgets/message-widget.component.mjs +114 -0
  20. package/dist/esm2022/lib/components/display-components/control-widgets/record-timer-widget.component.mjs +36 -0
  21. package/dist/esm2022/lib/components/display-components/control-widgets/screenshare-widget.component.mjs +74 -0
  22. package/dist/esm2022/lib/components/display-components/flexible-grid/flexible-grid.component.mjs +142 -0
  23. package/dist/esm2022/lib/components/display-components/flexible-video/flexible-video.component.mjs +265 -0
  24. package/dist/esm2022/lib/components/display-components/loading-modal/loading-modal.component.mjs +100 -0
  25. package/dist/esm2022/lib/components/display-components/main-aspect-component/main-aspect-component.component.mjs +132 -0
  26. package/dist/esm2022/lib/components/display-components/main-container-component/main-container-component.component.mjs +119 -0
  27. package/dist/esm2022/lib/components/display-components/main-grid-component/main-grid-component.component.mjs +106 -0
  28. package/dist/esm2022/lib/components/display-components/main-screen-component/main-screen-component.component.mjs +180 -0
  29. package/dist/esm2022/lib/components/display-components/meeting-progress-timer/meeting-progress-timer.component.mjs +120 -0
  30. package/dist/esm2022/lib/components/display-components/mini-audio/mini-audio.component.mjs +326 -0
  31. package/dist/esm2022/lib/components/display-components/mini-card/mini-card.component.mjs +165 -0
  32. package/dist/esm2022/lib/components/display-components/mini-card-audio/mini-card-audio.component.mjs +230 -0
  33. package/dist/esm2022/lib/components/display-components/other-grid-component/other-grid-component.component.mjs +111 -0
  34. package/dist/esm2022/lib/components/display-components/pagination/pagination.component.mjs +328 -0
  35. package/dist/esm2022/lib/components/display-components/sub-aspect-component/sub-aspect-component.component.mjs +118 -0
  36. package/dist/esm2022/lib/components/display-components/video-card/video-card.component.mjs +330 -0
  37. package/dist/esm2022/lib/components/display-settings-components/display-settings-modal.component.mjs +95 -0
  38. package/dist/esm2022/lib/components/event-settings-components/event-settings-modal/event-settings-modal.component.mjs +190 -0
  39. package/dist/esm2022/lib/components/exit-components/confirm-exit-modal/confirm-exit-modal.component.mjs +119 -0
  40. package/dist/esm2022/lib/components/media-settings-components/media-settings-modal/media-settings-modal.component.mjs +209 -0
  41. package/dist/esm2022/lib/components/mediasfu-components/mediasfu-broadcast.component.mjs +4187 -0
  42. package/dist/esm2022/lib/components/mediasfu-components/mediasfu-chat.component.mjs +3703 -0
  43. package/dist/esm2022/lib/components/mediasfu-components/mediasfu-conference.component.mjs +5022 -0
  44. package/dist/esm2022/lib/components/mediasfu-components/mediasfu-generic.component.mjs +5331 -0
  45. package/dist/esm2022/lib/components/mediasfu-components/mediasfu-webinar.component.mjs +5021 -0
  46. package/dist/esm2022/lib/components/menu-components/custom-buttons/custom-buttons.component.mjs +85 -0
  47. package/dist/esm2022/lib/components/menu-components/meeting-id-component/meeting-id-component.component.mjs +22 -0
  48. package/dist/esm2022/lib/components/menu-components/meeting-passcode-component/meeting-passcode-component.component.mjs +22 -0
  49. package/dist/esm2022/lib/components/menu-components/menu-modal/menu-modal.component.mjs +132 -0
  50. package/dist/esm2022/lib/components/menu-components/share-buttons-component/share-buttons-component.component.mjs +104 -0
  51. package/dist/esm2022/lib/components/message-components/message-panel/message-panel.component.mjs +204 -0
  52. package/dist/esm2022/lib/components/message-components/messages-modal/messages-modal.component.mjs +243 -0
  53. package/dist/esm2022/lib/components/misc-components/confirm-here-modal/confirm-here-modal.component.mjs +147 -0
  54. package/dist/esm2022/lib/components/misc-components/pre-join-page/pre-join-page.component.mjs +335 -0
  55. package/dist/esm2022/lib/components/misc-components/share-event-modal/share-event-modal.component.mjs +113 -0
  56. package/dist/esm2022/lib/components/misc-components/welcome-page/welcome-page.component.mjs +226 -0
  57. package/dist/esm2022/lib/components/participants-components/participant-list/participant-list.component.mjs +63 -0
  58. package/dist/esm2022/lib/components/participants-components/participant-list-item/participant-list-item.component.mjs +120 -0
  59. package/dist/esm2022/lib/components/participants-components/participant-list-others/participant-list-others.component.mjs +23 -0
  60. package/dist/esm2022/lib/components/participants-components/participant-list-others-item/participant-list-others-item.component.mjs +43 -0
  61. package/dist/esm2022/lib/components/participants-components/participants-modal/participants-modal.component.mjs +100 -0
  62. package/dist/esm2022/lib/components/polls-components/poll-modal/poll-modal.component.mjs +174 -0
  63. package/dist/esm2022/lib/components/recording-components/advanced-panel-component/advanced-panel-components.component.mjs +77 -0
  64. package/dist/esm2022/lib/components/recording-components/recording-modal/recording-modal.component.mjs +121 -0
  65. package/dist/esm2022/lib/components/recording-components/standard-panel-component/standard-panel-component.component.mjs +85 -0
  66. package/dist/esm2022/lib/components/requests-components/render-request-component/render-request-component.component.mjs +59 -0
  67. package/dist/esm2022/lib/components/requests-components/requests-modal/requests-modal.component.mjs +130 -0
  68. package/dist/esm2022/lib/components/screenboard-components/screenboard/screenboard.component.mjs +617 -0
  69. package/dist/esm2022/lib/components/screenboard-components/screenboard-modal/screenboard-modal.component.mjs +380 -0
  70. package/dist/esm2022/lib/components/waiting-components/waiting-room-modal.component.mjs +142 -0
  71. package/dist/esm2022/lib/components/whiteboard-components/configure-whiteboard-modal/configure-whiteboard-modal.component.mjs +265 -0
  72. package/dist/esm2022/lib/components/whiteboard-components/whiteboard/whiteboard.component.mjs +1784 -0
  73. package/dist/esm2022/lib/consumers/add-videos-grid.service.mjs +296 -0
  74. package/dist/esm2022/lib/consumers/auto-adjust.service.mjs +83 -0
  75. package/dist/esm2022/lib/consumers/calculate-rows-and-columns.service.mjs +42 -0
  76. package/dist/esm2022/lib/consumers/change-vids.service.mjs +486 -0
  77. package/dist/esm2022/lib/consumers/check-grid.service.mjs +79 -0
  78. package/dist/esm2022/lib/consumers/check-permission.service.mjs +80 -0
  79. package/dist/esm2022/lib/consumers/check-screen-share.service.mjs +71 -0
  80. package/dist/esm2022/lib/consumers/close-and-resize.service.mjs +229 -0
  81. package/dist/esm2022/lib/consumers/compare-active-names.service.mjs +75 -0
  82. package/dist/esm2022/lib/consumers/compare-screen-states.service.mjs +63 -0
  83. package/dist/esm2022/lib/consumers/connect-ips.service.mjs +112 -0
  84. package/dist/esm2022/lib/consumers/connect-recv-transport.service.mjs +113 -0
  85. package/dist/esm2022/lib/consumers/connect-send-transport-audio.service.mjs +46 -0
  86. package/dist/esm2022/lib/consumers/connect-send-transport-screen.service.mjs +62 -0
  87. package/dist/esm2022/lib/consumers/connect-send-transport-video.service.mjs +55 -0
  88. package/dist/esm2022/lib/consumers/connect-send-transport.service.mjs +86 -0
  89. package/dist/esm2022/lib/consumers/consumer-resume.service.mjs +332 -0
  90. package/dist/esm2022/lib/consumers/control-media.service.mjs +68 -0
  91. package/dist/esm2022/lib/consumers/create-send-transport.service.mjs +126 -0
  92. package/dist/esm2022/lib/consumers/disconnect-send-transport-audio.service.mjs +58 -0
  93. package/dist/esm2022/lib/consumers/disconnect-send-transport-screen.service.mjs +45 -0
  94. package/dist/esm2022/lib/consumers/disconnect-send-transport-video.service.mjs +56 -0
  95. package/dist/esm2022/lib/consumers/disp-streams.service.mjs +421 -0
  96. package/dist/esm2022/lib/consumers/generate-page-content.service.mjs +59 -0
  97. package/dist/esm2022/lib/consumers/get-estimate.service.mjs +70 -0
  98. package/dist/esm2022/lib/consumers/get-piped-producers-alt.service.mjs +49 -0
  99. package/dist/esm2022/lib/consumers/get-producers-piped.service.mjs +46 -0
  100. package/dist/esm2022/lib/consumers/get-videos.service.mjs +58 -0
  101. package/dist/esm2022/lib/consumers/mix-streams.service.mjs +73 -0
  102. package/dist/esm2022/lib/consumers/on-screen-changes.service.mjs +63 -0
  103. package/dist/esm2022/lib/consumers/prepopulate-user-media.service.mjs +442 -0
  104. package/dist/esm2022/lib/consumers/process-consumer-transports-audio.service.mjs +72 -0
  105. package/dist/esm2022/lib/consumers/process-consumer-transports.service.mjs +91 -0
  106. package/dist/esm2022/lib/consumers/re-port.service.mjs +66 -0
  107. package/dist/esm2022/lib/consumers/re-update-inter.service.mjs +157 -0
  108. package/dist/esm2022/lib/consumers/readjust.service.mjs +123 -0
  109. package/dist/esm2022/lib/consumers/receive-all-piped-transports.service.mjs +56 -0
  110. package/dist/esm2022/lib/consumers/receive-room-messages.service.mjs +42 -0
  111. package/dist/esm2022/lib/consumers/reorder-streams.service.mjs +181 -0
  112. package/dist/esm2022/lib/consumers/request-screen-share.service.mjs +67 -0
  113. package/dist/esm2022/lib/consumers/resume-pause-audio-streams.service.mjs +99 -0
  114. package/dist/esm2022/lib/consumers/resume-pause-streams.service.mjs +70 -0
  115. package/dist/esm2022/lib/consumers/resume-send-transport-audio.service.mjs +55 -0
  116. package/dist/esm2022/lib/consumers/signal-new-consumer-transport.service.mjs +136 -0
  117. package/dist/esm2022/lib/consumers/socket-receive-methods/join-consume-room.service.mjs +63 -0
  118. package/dist/esm2022/lib/consumers/socket-receive-methods/new-pipe-producer.service.mjs +61 -0
  119. package/dist/esm2022/lib/consumers/socket-receive-methods/producer-closed.service.mjs +51 -0
  120. package/dist/esm2022/lib/consumers/start-share-screen.service.mjs +80 -0
  121. package/dist/esm2022/lib/consumers/stop-share-screen.service.mjs +120 -0
  122. package/dist/esm2022/lib/consumers/stream-success-audio-switch.service.mjs +132 -0
  123. package/dist/esm2022/lib/consumers/stream-success-audio.service.mjs +149 -0
  124. package/dist/esm2022/lib/consumers/stream-success-screen.service.mjs +143 -0
  125. package/dist/esm2022/lib/consumers/stream-success-video.service.mjs +202 -0
  126. package/dist/esm2022/lib/consumers/switch-user-audio.service.mjs +87 -0
  127. package/dist/esm2022/lib/consumers/switch-user-video-alt.service.mjs +228 -0
  128. package/dist/esm2022/lib/consumers/switch-user-video.service.mjs +125 -0
  129. package/dist/esm2022/lib/consumers/trigger.service.mjs +172 -0
  130. package/dist/esm2022/lib/consumers/update-mini-cards-grid.service.mjs +81 -0
  131. package/dist/esm2022/lib/consumers/update-participant-audio-decibels.service.mjs +39 -0
  132. package/dist/esm2022/lib/methods/background-methods/launch-background.service.mjs +23 -0
  133. package/dist/esm2022/lib/methods/breakout-room-methods/breakout-room-updated.service.mjs +112 -0
  134. package/dist/esm2022/lib/methods/breakout-room-methods/launch-breakout-rooms.service.mjs +22 -0
  135. package/dist/esm2022/lib/methods/co-host-methods/launch-co-host.service.mjs +22 -0
  136. package/dist/esm2022/lib/methods/co-host-methods/modify-co-host-settings.service.mjs +60 -0
  137. package/dist/esm2022/lib/methods/display-settings-methods/launch-display-settings.service.mjs +24 -0
  138. package/dist/esm2022/lib/methods/display-settings-methods/modify-display-settings.service.mjs +119 -0
  139. package/dist/esm2022/lib/methods/exit-methods/confirm-exit.service.mjs +28 -0
  140. package/dist/esm2022/lib/methods/exit-methods/launch-confirm-exit.service.mjs +22 -0
  141. package/dist/esm2022/lib/methods/media-settings-methods/launch-media-settings.service.mjs +50 -0
  142. package/dist/esm2022/lib/methods/menu-methods/launch-menu-modal.service.mjs +22 -0
  143. package/dist/esm2022/lib/methods/message-methods/launch-messages.service.mjs +23 -0
  144. package/dist/esm2022/lib/methods/message-methods/send-message.service.mjs +94 -0
  145. package/dist/esm2022/lib/methods/participants-methods/launch-participants.service.mjs +23 -0
  146. package/dist/esm2022/lib/methods/participants-methods/message-participants.service.mjs +52 -0
  147. package/dist/esm2022/lib/methods/participants-methods/mute-participants.service.mjs +57 -0
  148. package/dist/esm2022/lib/methods/participants-methods/remove-participants.service.mjs +62 -0
  149. package/dist/esm2022/lib/methods/polls-methods/handle-create-poll.service.mjs +37 -0
  150. package/dist/esm2022/lib/methods/polls-methods/handle-end-poll.service.mjs +40 -0
  151. package/dist/esm2022/lib/methods/polls-methods/handle-vote-poll.service.mjs +49 -0
  152. package/dist/esm2022/lib/methods/polls-methods/launch-poll.service.mjs +23 -0
  153. package/dist/esm2022/lib/methods/polls-methods/poll-updated.service.mjs +64 -0
  154. package/dist/esm2022/lib/methods/recording-methods/check-pause-state.service.mjs +45 -0
  155. package/dist/esm2022/lib/methods/recording-methods/check-resume-state.service.mjs +34 -0
  156. package/dist/esm2022/lib/methods/recording-methods/confirm-recording.service.mjs +215 -0
  157. package/dist/esm2022/lib/methods/recording-methods/launch-recording.service.mjs +82 -0
  158. package/dist/esm2022/lib/methods/recording-methods/record-pause-timer.service.mjs +40 -0
  159. package/dist/esm2022/lib/methods/recording-methods/record-resume-timer.service.mjs +86 -0
  160. package/dist/esm2022/lib/methods/recording-methods/record-start-timer.service.mjs +89 -0
  161. package/dist/esm2022/lib/methods/recording-methods/record-update-timer.service.mjs +48 -0
  162. package/dist/esm2022/lib/methods/recording-methods/start-recording.service.mjs +147 -0
  163. package/dist/esm2022/lib/methods/recording-methods/stop-recording.service.mjs +74 -0
  164. package/dist/esm2022/lib/methods/recording-methods/update-recording.service.mjs +224 -0
  165. package/dist/esm2022/lib/methods/requests-methods/launch-requests.service.mjs +26 -0
  166. package/dist/esm2022/lib/methods/requests-methods/respond-to-requests.service.mjs +45 -0
  167. package/dist/esm2022/lib/methods/settings-methods/launch-settings.service.mjs +26 -0
  168. package/dist/esm2022/lib/methods/settings-methods/modify-settings.service.mjs +67 -0
  169. package/dist/esm2022/lib/methods/stream-methods/click-audio.service.mjs +178 -0
  170. package/dist/esm2022/lib/methods/stream-methods/click-chat.service.mjs +44 -0
  171. package/dist/esm2022/lib/methods/stream-methods/click-screen-share.service.mjs +110 -0
  172. package/dist/esm2022/lib/methods/stream-methods/click-video.service.mjs +183 -0
  173. package/dist/esm2022/lib/methods/stream-methods/switch-audio.service.mjs +33 -0
  174. package/dist/esm2022/lib/methods/stream-methods/switch-video-alt.service.mjs +66 -0
  175. package/dist/esm2022/lib/methods/stream-methods/switch-video.service.mjs +76 -0
  176. package/dist/esm2022/lib/methods/utils/format-number.service.mjs +45 -0
  177. package/dist/esm2022/lib/methods/utils/generate-random-messages.service.mjs +87 -0
  178. package/dist/esm2022/lib/methods/utils/generate-random-participants.service.mjs +99 -0
  179. package/dist/esm2022/lib/methods/utils/generate-random-polls.service.mjs +52 -0
  180. package/dist/esm2022/lib/methods/utils/generate-random-request-list.service.mjs +54 -0
  181. package/dist/esm2022/lib/methods/utils/generate-random-waiting-room-list.service.mjs +38 -0
  182. package/dist/esm2022/lib/methods/utils/get-modal-position.util.mjs +22 -0
  183. package/dist/esm2022/lib/methods/utils/get-overlay-position.util.mjs +21 -0
  184. package/dist/esm2022/lib/methods/utils/initial-values.util.mjs +369 -0
  185. package/dist/esm2022/lib/methods/utils/meeting-timer/start-meeting-progress-timer.service.mjs +59 -0
  186. package/dist/esm2022/lib/methods/utils/mini-audio-player/mini-audio-player.component.mjs +260 -0
  187. package/dist/esm2022/lib/methods/utils/producer/a-params.service.mjs +21 -0
  188. package/dist/esm2022/lib/methods/utils/producer/h-params.service.mjs +37 -0
  189. package/dist/esm2022/lib/methods/utils/producer/screen-params.service.mjs +24 -0
  190. package/dist/esm2022/lib/methods/utils/producer/v-params.service.mjs +37 -0
  191. package/dist/esm2022/lib/methods/utils/producer/video-capture-constraints.service.mjs +38 -0
  192. package/dist/esm2022/lib/methods/utils/sleep.util.mjs +11 -0
  193. package/dist/esm2022/lib/methods/utils/sound-player.service.mjs +42 -0
  194. package/dist/esm2022/lib/methods/utils/validate-alphanumeric.service.mjs +33 -0
  195. package/dist/esm2022/lib/methods/waiting-methods/launch-waiting.service.mjs +23 -0
  196. package/dist/esm2022/lib/methods/waiting-methods/respond-to-waiting.service.mjs +40 -0
  197. package/dist/esm2022/lib/methods/whiteboard-methods/capture-canvas-stream.service.mjs +69 -0
  198. package/dist/esm2022/lib/methods/whiteboard-methods/launch-configure-whiteboard.service.mjs +24 -0
  199. package/dist/esm2022/lib/producer-client/producer-client-emits/create-device-client.service.mjs +51 -0
  200. package/dist/esm2022/lib/producer-client/producer-client-emits/join-room-client.service.mjs +65 -0
  201. package/dist/esm2022/lib/producer-client/producer-client-emits/update-room-parameters-client.service.mjs +232 -0
  202. package/dist/esm2022/lib/producers/producer-emits/join-con-room.service.mjs +114 -0
  203. package/dist/esm2022/lib/producers/producer-emits/join-room.service.mjs +114 -0
  204. package/dist/esm2022/lib/producers/socket-receive-methods/all-members-rest.service.mjs +155 -0
  205. package/dist/esm2022/lib/producers/socket-receive-methods/all-members.service.mjs +147 -0
  206. package/dist/esm2022/lib/producers/socket-receive-methods/all-waiting-room-members.service.mjs +30 -0
  207. package/dist/esm2022/lib/producers/socket-receive-methods/ban-participant.service.mjs +40 -0
  208. package/dist/esm2022/lib/producers/socket-receive-methods/control-media-host.service.mjs +146 -0
  209. package/dist/esm2022/lib/producers/socket-receive-methods/disconnect-user-self.service.mjs +26 -0
  210. package/dist/esm2022/lib/producers/socket-receive-methods/disconnect.service.mjs +38 -0
  211. package/dist/esm2022/lib/producers/socket-receive-methods/get-domains.service.mjs +63 -0
  212. package/dist/esm2022/lib/producers/socket-receive-methods/host-request-response.service.mjs +167 -0
  213. package/dist/esm2022/lib/producers/socket-receive-methods/meeting-ended.service.mjs +44 -0
  214. package/dist/esm2022/lib/producers/socket-receive-methods/meeting-still-there.service.mjs +24 -0
  215. package/dist/esm2022/lib/producers/socket-receive-methods/meeting-time-remaining.service.mjs +36 -0
  216. package/dist/esm2022/lib/producers/socket-receive-methods/participant-requested.service.mjs +32 -0
  217. package/dist/esm2022/lib/producers/socket-receive-methods/person-joined.service.mjs +29 -0
  218. package/dist/esm2022/lib/producers/socket-receive-methods/producer-media-closed.service.mjs +68 -0
  219. package/dist/esm2022/lib/producers/socket-receive-methods/producer-media-paused.service.mjs +90 -0
  220. package/dist/esm2022/lib/producers/socket-receive-methods/producer-media-resumed.service.mjs +54 -0
  221. package/dist/esm2022/lib/producers/socket-receive-methods/re-initiate-recording.service.mjs +38 -0
  222. package/dist/esm2022/lib/producers/socket-receive-methods/receive-message.service.mjs +96 -0
  223. package/dist/esm2022/lib/producers/socket-receive-methods/recording-notice.service.mjs +195 -0
  224. package/dist/esm2022/lib/producers/socket-receive-methods/room-record-params.service.mjs +59 -0
  225. package/dist/esm2022/lib/producers/socket-receive-methods/screen-producer-id.service.mjs +45 -0
  226. package/dist/esm2022/lib/producers/socket-receive-methods/start-records.service.mjs +35 -0
  227. package/dist/esm2022/lib/producers/socket-receive-methods/stopped-recording.service.mjs +37 -0
  228. package/dist/esm2022/lib/producers/socket-receive-methods/time-left-recording.service.mjs +36 -0
  229. package/dist/esm2022/lib/producers/socket-receive-methods/update-consuming-domains.service.mjs +63 -0
  230. package/dist/esm2022/lib/producers/socket-receive-methods/update-media-settings.service.mjs +36 -0
  231. package/dist/esm2022/lib/producers/socket-receive-methods/updated-co-host.service.mjs +56 -0
  232. package/dist/esm2022/lib/producers/socket-receive-methods/user-waiting.service.mjs +78 -0
  233. package/dist/esm2022/lib/sockets/socket-manager.service.mjs +73 -0
  234. package/dist/esm2022/mediasfu-angular.mjs +5 -0
  235. package/dist/esm2022/public-api.mjs +187 -0
  236. package/dist/fesm2022/mediasfu-angular.mjs +47885 -0
  237. package/dist/fesm2022/mediasfu-angular.mjs.map +1 -0
  238. package/dist/index.d.ts +5 -0
  239. package/dist/lib/@types/types.d.ts +634 -0
  240. package/dist/lib/components/background-components/background-modal/background-modal.component.d.ts +146 -0
  241. package/dist/lib/components/breakout-components/breakout-rooms-modal.component.d.ts +112 -0
  242. package/dist/lib/components/breakout-components/edit-room-modal/edit-room-modal.component.d.ts +54 -0
  243. package/dist/lib/components/breakout-components/room-list/room-list.component.d.ts +20 -0
  244. package/dist/lib/components/co-host-components/co-host-modal/co-host-modal.component.d.ts +86 -0
  245. package/dist/lib/components/display-components/alert-component/alert.component.component.d.ts +50 -0
  246. package/dist/lib/components/display-components/audio-card/audio-card.component.d.ts +84 -0
  247. package/dist/lib/components/display-components/audio-grid/audio-grid.component.d.ts +23 -0
  248. package/dist/lib/components/display-components/card-video-display/card-video-display.component.d.ts +37 -0
  249. package/dist/lib/components/display-components/control-buttons-alt-component/control-buttons-alt-component.component.d.ts +88 -0
  250. package/dist/lib/components/display-components/control-buttons-component/control-buttons-component.component.d.ts +52 -0
  251. package/dist/lib/components/display-components/control-buttons-component-touch/control-buttons-component-touch.component.d.ts +100 -0
  252. package/dist/lib/components/display-components/control-widgets/menu-participants-widget.component.d.ts +10 -0
  253. package/dist/lib/components/display-components/control-widgets/menu-record-widget.component.d.ts +18 -0
  254. package/dist/lib/components/display-components/control-widgets/menu-widget.component.d.ts +11 -0
  255. package/dist/lib/components/display-components/control-widgets/message-widget.component.d.ts +11 -0
  256. package/dist/lib/components/display-components/control-widgets/record-timer-widget.component.d.ts +7 -0
  257. package/dist/lib/components/display-components/control-widgets/screenshare-widget.component.d.ts +12 -0
  258. package/dist/lib/components/display-components/flexible-grid/flexible-grid.component.d.ts +70 -0
  259. package/dist/lib/components/display-components/flexible-video/flexible-video.component.d.ts +97 -0
  260. package/dist/lib/components/display-components/loading-modal/loading-modal.component.d.ts +70 -0
  261. package/dist/lib/components/display-components/main-aspect-component/main-aspect-component.component.d.ts +72 -0
  262. package/dist/lib/components/display-components/main-container-component/main-container-component.component.d.ts +63 -0
  263. package/dist/lib/components/display-components/main-grid-component/main-grid-component.component.d.ts +67 -0
  264. package/dist/lib/components/display-components/main-screen-component/main-screen-component.component.d.ts +82 -0
  265. package/dist/lib/components/display-components/meeting-progress-timer/meeting-progress-timer.component.d.ts +82 -0
  266. package/dist/lib/components/display-components/mini-audio/mini-audio.component.d.ts +128 -0
  267. package/dist/lib/components/display-components/mini-card/mini-card.component.d.ts +1085 -0
  268. package/dist/lib/components/display-components/mini-card-audio/mini-card-audio.component.d.ts +95 -0
  269. package/dist/lib/components/display-components/other-grid-component/other-grid-component.component.d.ts +45 -0
  270. package/dist/lib/components/display-components/pagination/pagination.component.d.ts +112 -0
  271. package/dist/lib/components/display-components/sub-aspect-component/sub-aspect-component.component.d.ts +61 -0
  272. package/dist/lib/components/display-components/video-card/video-card.component.d.ts +89 -0
  273. package/dist/lib/components/display-settings-components/display-settings-modal.component.d.ts +65 -0
  274. package/dist/lib/components/event-settings-components/event-settings-modal/event-settings-modal.component.d.ts +124 -0
  275. package/dist/lib/components/exit-components/confirm-exit-modal/confirm-exit-modal.component.d.ts +71 -0
  276. package/dist/lib/components/media-settings-components/media-settings-modal/media-settings-modal.component.d.ts +123 -0
  277. package/dist/lib/components/mediasfu-components/mediasfu-broadcast.component.d.ts +5264 -0
  278. package/dist/lib/components/mediasfu-components/mediasfu-chat.component.d.ts +5194 -0
  279. package/dist/lib/components/mediasfu-components/mediasfu-conference.component.d.ts +6825 -0
  280. package/dist/lib/components/mediasfu-components/mediasfu-generic.component.d.ts +6851 -0
  281. package/dist/lib/components/mediasfu-components/mediasfu-webinar.component.d.ts +6825 -0
  282. package/dist/lib/components/menu-components/custom-buttons/custom-buttons.component.d.ts +83 -0
  283. package/dist/lib/components/menu-components/meeting-id-component/meeting-id-component.component.d.ts +18 -0
  284. package/dist/lib/components/menu-components/meeting-passcode-component/meeting-passcode-component.component.d.ts +18 -0
  285. package/dist/lib/components/menu-components/menu-modal/menu-modal.component.d.ts +91 -0
  286. package/dist/lib/components/menu-components/share-buttons-component/share-buttons-component.component.d.ts +46 -0
  287. package/dist/lib/components/message-components/message-panel/message-panel.component.d.ts +112 -0
  288. package/dist/lib/components/message-components/messages-modal/messages-modal.component.d.ts +124 -0
  289. package/dist/lib/components/misc-components/confirm-here-modal/confirm-here-modal.component.d.ts +92 -0
  290. package/dist/lib/components/misc-components/pre-join-page/pre-join-page.component.d.ts +159 -0
  291. package/dist/lib/components/misc-components/share-event-modal/share-event-modal.component.d.ts +77 -0
  292. package/dist/lib/components/misc-components/welcome-page/welcome-page.component.d.ts +47 -0
  293. package/dist/lib/components/participants-components/participant-list/participant-list.component.d.ts +41 -0
  294. package/dist/lib/components/participants-components/participant-list-item/participant-list-item.component.d.ts +53 -0
  295. package/dist/lib/components/participants-components/participant-list-others/participant-list-others.component.d.ts +15 -0
  296. package/dist/lib/components/participants-components/participant-list-others-item/participant-list-others-item.component.d.ts +17 -0
  297. package/dist/lib/components/participants-components/participants-modal/participants-modal.component.d.ts +70 -0
  298. package/dist/lib/components/polls-components/poll-modal/poll-modal.component.d.ts +76 -0
  299. package/dist/lib/components/recording-components/advanced-panel-component/advanced-panel-components.component.d.ts +48 -0
  300. package/dist/lib/components/recording-components/recording-modal/recording-modal.component.d.ts +117 -0
  301. package/dist/lib/components/recording-components/standard-panel-component/standard-panel-component.component.d.ts +58 -0
  302. package/dist/lib/components/requests-components/render-request-component/render-request-component.component.d.ts +34 -0
  303. package/dist/lib/components/requests-components/requests-modal/requests-modal.component.d.ts +94 -0
  304. package/dist/lib/components/screenboard-components/screenboard/screenboard.component.d.ts +210 -0
  305. package/dist/lib/components/screenboard-components/screenboard-modal/screenboard-modal.component.d.ts +103 -0
  306. package/dist/lib/components/waiting-components/waiting-room-modal.component.d.ts +85 -0
  307. package/dist/lib/components/whiteboard-components/configure-whiteboard-modal/configure-whiteboard-modal.component.d.ts +103 -0
  308. package/dist/lib/components/whiteboard-components/whiteboard/whiteboard.component.d.ts +414 -0
  309. package/dist/lib/consumers/add-videos-grid.service.d.ts +35 -0
  310. package/dist/lib/consumers/auto-adjust.service.d.ts +25 -0
  311. package/dist/lib/consumers/calculate-rows-and-columns.service.d.ts +17 -0
  312. package/dist/lib/consumers/change-vids.service.d.ts +137 -0
  313. package/dist/lib/consumers/check-grid.service.d.ts +30 -0
  314. package/dist/lib/consumers/check-permission.service.d.ts +26 -0
  315. package/dist/lib/consumers/check-screen-share.service.d.ts +41 -0
  316. package/dist/lib/consumers/close-and-resize.service.d.ts +107 -0
  317. package/dist/lib/consumers/compare-active-names.service.d.ts +37 -0
  318. package/dist/lib/consumers/compare-screen-states.service.d.ts +40 -0
  319. package/dist/lib/consumers/connect-ips.service.d.ts +59 -0
  320. package/dist/lib/consumers/connect-recv-transport.service.d.ts +58 -0
  321. package/dist/lib/consumers/connect-send-transport-audio.service.d.ts +33 -0
  322. package/dist/lib/consumers/connect-send-transport-screen.service.d.ts +42 -0
  323. package/dist/lib/consumers/connect-send-transport-video.service.d.ts +41 -0
  324. package/dist/lib/consumers/connect-send-transport.service.d.ts +49 -0
  325. package/dist/lib/consumers/consumer-resume.service.d.ts +85 -0
  326. package/dist/lib/consumers/control-media.service.d.ts +40 -0
  327. package/dist/lib/consumers/create-send-transport.service.d.ts +46 -0
  328. package/dist/lib/consumers/disconnect-send-transport-audio.service.d.ts +49 -0
  329. package/dist/lib/consumers/disconnect-send-transport-screen.service.d.ts +36 -0
  330. package/dist/lib/consumers/disconnect-send-transport-video.service.d.ts +43 -0
  331. package/dist/lib/consumers/disp-streams.service.d.ts +92 -0
  332. package/dist/lib/consumers/generate-page-content.service.d.ts +41 -0
  333. package/dist/lib/consumers/get-estimate.service.d.ts +46 -0
  334. package/dist/lib/consumers/get-piped-producers-alt.service.d.ts +33 -0
  335. package/dist/lib/consumers/get-producers-piped.service.d.ts +33 -0
  336. package/dist/lib/consumers/get-videos.service.d.ts +28 -0
  337. package/dist/lib/consumers/mix-streams.service.d.ts +32 -0
  338. package/dist/lib/consumers/on-screen-changes.service.d.ts +44 -0
  339. package/dist/lib/consumers/prepopulate-user-media.service.d.ts +107 -0
  340. package/dist/lib/consumers/process-consumer-transports-audio.service.d.ts +30 -0
  341. package/dist/lib/consumers/process-consumer-transports.service.d.ts +42 -0
  342. package/dist/lib/consumers/re-port.service.d.ts +55 -0
  343. package/dist/lib/consumers/re-update-inter.service.d.ts +83 -0
  344. package/dist/lib/consumers/readjust.service.d.ts +48 -0
  345. package/dist/lib/consumers/receive-all-piped-transports.service.d.ts +33 -0
  346. package/dist/lib/consumers/receive-room-messages.service.d.ts +22 -0
  347. package/dist/lib/consumers/reorder-streams.service.d.ts +72 -0
  348. package/dist/lib/consumers/request-screen-share.service.d.ts +38 -0
  349. package/dist/lib/consumers/resume-pause-audio-streams.service.d.ts +41 -0
  350. package/dist/lib/consumers/resume-pause-streams.service.d.ts +36 -0
  351. package/dist/lib/consumers/resume-send-transport-audio.service.d.ts +43 -0
  352. package/dist/lib/consumers/signal-new-consumer-transport.service.d.ts +63 -0
  353. package/dist/lib/consumers/socket-receive-methods/join-consume-room.service.d.ts +43 -0
  354. package/dist/lib/consumers/socket-receive-methods/new-pipe-producer.service.d.ts +46 -0
  355. package/dist/lib/consumers/socket-receive-methods/producer-closed.service.d.ts +27 -0
  356. package/dist/lib/consumers/start-share-screen.service.d.ts +38 -0
  357. package/dist/lib/consumers/stop-share-screen.service.d.ts +86 -0
  358. package/dist/lib/consumers/stream-success-audio-switch.service.d.ts +90 -0
  359. package/dist/lib/consumers/stream-success-audio.service.d.ts +100 -0
  360. package/dist/lib/consumers/stream-success-screen.service.d.ts +78 -0
  361. package/dist/lib/consumers/stream-success-video.service.d.ts +76 -0
  362. package/dist/lib/consumers/switch-user-audio.service.d.ts +41 -0
  363. package/dist/lib/consumers/switch-user-video-alt.service.d.ts +43 -0
  364. package/dist/lib/consumers/switch-user-video.service.d.ts +61 -0
  365. package/dist/lib/consumers/trigger.service.d.ts +72 -0
  366. package/dist/lib/consumers/update-mini-cards-grid.service.d.ts +54 -0
  367. package/dist/lib/consumers/update-participant-audio-decibels.service.d.ts +25 -0
  368. package/dist/lib/methods/background-methods/launch-background.service.d.ts +18 -0
  369. package/dist/lib/methods/breakout-room-methods/breakout-room-updated.service.d.ts +63 -0
  370. package/dist/lib/methods/breakout-room-methods/launch-breakout-rooms.service.d.ts +17 -0
  371. package/dist/lib/methods/co-host-methods/launch-co-host.service.d.ts +17 -0
  372. package/dist/lib/methods/co-host-methods/modify-co-host-settings.service.d.ts +42 -0
  373. package/dist/lib/methods/display-settings-methods/launch-display-settings.service.d.ts +17 -0
  374. package/dist/lib/methods/display-settings-methods/modify-display-settings.service.d.ts +74 -0
  375. package/dist/lib/methods/exit-methods/confirm-exit.service.d.ts +24 -0
  376. package/dist/lib/methods/exit-methods/launch-confirm-exit.service.d.ts +17 -0
  377. package/dist/lib/methods/media-settings-methods/launch-media-settings.service.d.ts +27 -0
  378. package/dist/lib/methods/menu-methods/launch-menu-modal.service.d.ts +17 -0
  379. package/dist/lib/methods/message-methods/launch-messages.service.d.ts +18 -0
  380. package/dist/lib/methods/message-methods/send-message.service.d.ts +48 -0
  381. package/dist/lib/methods/participants-methods/launch-participants.service.d.ts +18 -0
  382. package/dist/lib/methods/participants-methods/message-participants.service.d.ts +34 -0
  383. package/dist/lib/methods/participants-methods/mute-participants.service.d.ts +36 -0
  384. package/dist/lib/methods/participants-methods/remove-participants.service.d.ts +38 -0
  385. package/dist/lib/methods/polls-methods/handle-create-poll.service.d.ts +24 -0
  386. package/dist/lib/methods/polls-methods/handle-end-poll.service.d.ts +27 -0
  387. package/dist/lib/methods/polls-methods/handle-vote-poll.service.d.ts +33 -0
  388. package/dist/lib/methods/polls-methods/launch-poll.service.d.ts +18 -0
  389. package/dist/lib/methods/polls-methods/poll-updated.service.d.ts +34 -0
  390. package/dist/lib/methods/recording-methods/check-pause-state.service.d.ts +26 -0
  391. package/dist/lib/methods/recording-methods/check-resume-state.service.d.ts +23 -0
  392. package/dist/lib/methods/recording-methods/confirm-recording.service.d.ts +78 -0
  393. package/dist/lib/methods/recording-methods/launch-recording.service.d.ts +42 -0
  394. package/dist/lib/methods/recording-methods/record-pause-timer.service.d.ts +25 -0
  395. package/dist/lib/methods/recording-methods/record-resume-timer.service.d.ts +47 -0
  396. package/dist/lib/methods/recording-methods/record-start-timer.service.d.ts +58 -0
  397. package/dist/lib/methods/recording-methods/record-update-timer.service.d.ts +29 -0
  398. package/dist/lib/methods/recording-methods/start-recording.service.d.ts +83 -0
  399. package/dist/lib/methods/recording-methods/stop-recording.service.d.ts +37 -0
  400. package/dist/lib/methods/recording-methods/update-recording.service.d.ts +88 -0
  401. package/dist/lib/methods/requests-methods/launch-requests.service.d.ts +19 -0
  402. package/dist/lib/methods/requests-methods/respond-to-requests.service.d.ts +30 -0
  403. package/dist/lib/methods/settings-methods/launch-settings.service.d.ts +19 -0
  404. package/dist/lib/methods/settings-methods/modify-settings.service.d.ts +44 -0
  405. package/dist/lib/methods/stream-methods/click-audio.service.d.ts +73 -0
  406. package/dist/lib/methods/stream-methods/click-chat.service.d.ts +27 -0
  407. package/dist/lib/methods/stream-methods/click-screen-share.service.d.ts +44 -0
  408. package/dist/lib/methods/stream-methods/click-video.service.d.ts +58 -0
  409. package/dist/lib/methods/stream-methods/switch-audio.service.d.ts +28 -0
  410. package/dist/lib/methods/stream-methods/switch-video-alt.service.d.ts +29 -0
  411. package/dist/lib/methods/stream-methods/switch-video.service.d.ts +35 -0
  412. package/dist/lib/methods/utils/format-number.service.d.ts +24 -0
  413. package/dist/lib/methods/utils/generate-random-messages.service.d.ts +26 -0
  414. package/dist/lib/methods/utils/generate-random-participants.service.d.ts +24 -0
  415. package/dist/lib/methods/utils/generate-random-polls.service.d.ts +18 -0
  416. package/dist/lib/methods/utils/generate-random-request-list.service.d.ts +24 -0
  417. package/dist/lib/methods/utils/generate-random-waiting-room-list.service.d.ts +19 -0
  418. package/dist/lib/methods/utils/get-modal-position.util.d.ts +15 -0
  419. package/dist/lib/methods/utils/get-overlay-position.util.d.ts +12 -0
  420. package/dist/lib/methods/utils/initial-values.util.d.ts +343 -0
  421. package/dist/lib/methods/utils/meeting-timer/start-meeting-progress-timer.service.d.ts +31 -0
  422. package/dist/lib/methods/utils/mini-audio-player/mini-audio-player.component.d.ts +46 -0
  423. package/dist/lib/methods/utils/producer/a-params.service.d.ts +11 -0
  424. package/dist/lib/methods/utils/producer/h-params.service.d.ts +11 -0
  425. package/dist/lib/methods/utils/producer/screen-params.service.d.ts +11 -0
  426. package/dist/lib/methods/utils/producer/v-params.service.d.ts +11 -0
  427. package/dist/lib/methods/utils/producer/video-capture-constraints.service.d.ts +131 -0
  428. package/dist/lib/methods/utils/sleep.util.d.ts +12 -0
  429. package/dist/lib/methods/utils/sound-player.service.d.ts +13 -0
  430. package/dist/lib/methods/utils/validate-alphanumeric.service.d.ts +17 -0
  431. package/dist/lib/methods/waiting-methods/launch-waiting.service.d.ts +17 -0
  432. package/dist/lib/methods/waiting-methods/respond-to-waiting.service.d.ts +31 -0
  433. package/dist/lib/methods/whiteboard-methods/capture-canvas-stream.service.d.ts +33 -0
  434. package/dist/lib/methods/whiteboard-methods/launch-configure-whiteboard.service.d.ts +17 -0
  435. package/dist/lib/producer-client/producer-client-emits/create-device-client.service.d.ts +20 -0
  436. package/dist/lib/producer-client/producer-client-emits/join-room-client.service.d.ts +36 -0
  437. package/dist/lib/producer-client/producer-client-emits/update-room-parameters-client.service.d.ts +104 -0
  438. package/dist/lib/producers/producer-emits/join-con-room.service.d.ts +44 -0
  439. package/dist/lib/producers/producer-emits/join-room.service.d.ts +34 -0
  440. package/dist/lib/producers/socket-receive-methods/all-members-rest.service.d.ts +75 -0
  441. package/dist/lib/producers/socket-receive-methods/all-members.service.d.ts +72 -0
  442. package/dist/lib/producers/socket-receive-methods/all-waiting-room-members.service.d.ts +22 -0
  443. package/dist/lib/producers/socket-receive-methods/ban-participant.service.d.ts +35 -0
  444. package/dist/lib/producers/socket-receive-methods/control-media-host.service.d.ts +60 -0
  445. package/dist/lib/producers/socket-receive-methods/disconnect-user-self.service.d.ts +22 -0
  446. package/dist/lib/producers/socket-receive-methods/disconnect.service.d.ts +23 -0
  447. package/dist/lib/producers/socket-receive-methods/get-domains.service.d.ts +48 -0
  448. package/dist/lib/producers/socket-receive-methods/host-request-response.service.d.ts +81 -0
  449. package/dist/lib/producers/socket-receive-methods/meeting-ended.service.d.ts +26 -0
  450. package/dist/lib/producers/socket-receive-methods/meeting-still-there.service.d.ts +17 -0
  451. package/dist/lib/producers/socket-receive-methods/meeting-time-remaining.service.d.ts +22 -0
  452. package/dist/lib/producers/socket-receive-methods/participant-requested.service.d.ts +26 -0
  453. package/dist/lib/producers/socket-receive-methods/person-joined.service.d.ts +20 -0
  454. package/dist/lib/producers/socket-receive-methods/producer-media-closed.service.d.ts +47 -0
  455. package/dist/lib/producers/socket-receive-methods/producer-media-paused.service.d.ts +51 -0
  456. package/dist/lib/producers/socket-receive-methods/producer-media-resumed.service.d.ts +44 -0
  457. package/dist/lib/producers/socket-receive-methods/re-initiate-recording.service.d.ts +25 -0
  458. package/dist/lib/producers/socket-receive-methods/receive-message.service.d.ts +37 -0
  459. package/dist/lib/producers/socket-receive-methods/recording-notice.service.d.ts +120 -0
  460. package/dist/lib/producers/socket-receive-methods/room-record-params.service.d.ts +75 -0
  461. package/dist/lib/producers/socket-receive-methods/screen-producer-id.service.d.ts +32 -0
  462. package/dist/lib/producers/socket-receive-methods/start-records.service.d.ts +23 -0
  463. package/dist/lib/producers/socket-receive-methods/stopped-recording.service.d.ts +22 -0
  464. package/dist/lib/producers/socket-receive-methods/time-left-recording.service.d.ts +21 -0
  465. package/dist/lib/producers/socket-receive-methods/update-consuming-domains.service.d.ts +44 -0
  466. package/dist/lib/producers/socket-receive-methods/update-media-settings.service.d.ts +27 -0
  467. package/dist/lib/producers/socket-receive-methods/updated-co-host.service.d.ts +37 -0
  468. package/dist/lib/producers/socket-receive-methods/user-waiting.service.d.ts +68 -0
  469. package/dist/lib/sockets/socket-manager.service.d.ts +26 -0
  470. package/dist/public-api.d.ts +177 -0
  471. package/package.json +89 -0
package/dist/README.md ADDED
@@ -0,0 +1,2068 @@
1
+ <p align="center">
2
+ <img src="https://www.mediasfu.com/logo192.png" width="100" alt="MediaSFU Logo">
3
+ </p>
4
+
5
+ <p align="center">
6
+ <a href="https://twitter.com/media_sfu">
7
+ <img src="https://img.icons8.com/color/48/000000/twitter--v1.png" alt="Twitter" style="margin-right: 10px;">
8
+ </a>
9
+ <a href="https://www.mediasfu.com/forums">
10
+ <img src="https://img.icons8.com/color/48/000000/communication--v1.png" alt="Community Forum" style="margin-right: 10px;">
11
+ </a>
12
+ <a href="https://github.com/MediaSFU">
13
+ <img src="https://img.icons8.com/fluent/48/000000/github.png" alt="Github" style="margin-right: 10px;">
14
+ </a>
15
+ <a href="https://www.mediasfu.com/">
16
+ <img src="https://img.icons8.com/color/48/000000/domain--v1.png" alt="Website" style="margin-right: 10px;">
17
+ </a>
18
+ <a href="https://www.youtube.com/channel/UCELghZRPKMgjih5qrmXLtqw">
19
+ <img src="https://img.icons8.com/color/48/000000/youtube--v1.png" alt="Youtube" style="margin-right: 10px;">
20
+ </a>
21
+ </p>
22
+
23
+
24
+ MediaSFU offers a cutting-edge streaming experience that empowers users to customize their recordings and engage their audience with high-quality streams. Whether you're a content creator, educator, or business professional, MediaSFU provides the tools you need to elevate your streaming game.
25
+
26
+ ---
27
+
28
+ # MediaSFU Angular Module Documentation
29
+
30
+ ## Table of Contents
31
+
32
+ - [Features](#features)
33
+ - [Getting Started](#getting-started)
34
+ - [Basic Usage Guide](#basic-usage-guide)
35
+ - [Intermediate Usage Guide](#intermediate-usage-guide)
36
+ - [Advanced Usage Guide](#advanced-usage-guide)
37
+ - [API Reference](#api-reference)
38
+ - [Troubleshooting](#troubleshooting)
39
+ - [Contributing](#contributing)
40
+
41
+ # Features <a name="features"></a>
42
+
43
+ MediaSFU's Angular SDK comes with a host of powerful features out of the box:
44
+
45
+ 1. **Screen Sharing with Annotation Support**: Share your screen with participants and annotate in real-time for enhanced presentations and collaborations.
46
+ 2. **Collaborative Whiteboards**: Create and share whiteboards for real-time collaborative drawing and brainstorming sessions.
47
+ 3. **Breakout Rooms**: Create multiple sub-meetings within a single session to enhance collaboration and focus.
48
+ 4. **Pagination**: Efficiently handle large participant lists with seamless pagination.
49
+ 5. **Polls**: Conduct real-time polls to gather instant feedback from participants.
50
+ 6. **Media Access Requests Management**: Manage media access requests with ease to ensure smooth operations.
51
+ 7. **Video Effects**: Apply various video effects, including virtual backgrounds, to enhance the visual experience.
52
+ 8. **Chat (Direct & Group)**: Facilitate communication with direct and group chat options.
53
+ 9. **Cloud Recording (track-based)**: Customize recordings with track-based options, including watermarks, name tags, background colors, and more.
54
+ 10. **Managed Events**: Manage events with features to handle abandoned and inactive participants, as well as enforce time and capacity limits.
55
+
56
+ # Getting Started <a name="getting-started"></a>
57
+
58
+ This section will guide users through the initial setup and installation of the npm module.
59
+
60
+ ## Installation
61
+
62
+ Instructions on how to install the module using npm.
63
+
64
+ 1. **Add the package to your project**
65
+
66
+ ```bash
67
+ npm install mediasfu-angular
68
+ ```
69
+
70
+ 2. **Bootstrap Integration**
71
+
72
+ The `mediasfu-angular` package requires Bootstrap for styling. Bootstrap is included by default with the package, so you do not need to install it separately. Ensure that Bootstrap's CSS is correctly added to your project's styles.
73
+
74
+ 1. **Check `angular.json`:**
75
+
76
+ Ensure that `node_modules/bootstrap/dist/css/bootstrap.min.css` is listed in the `styles` array of your Angular application's build options.
77
+
78
+ ```json
79
+ {
80
+ "projects": {
81
+ "your-app-name": {
82
+ "architect": {
83
+ "build": {
84
+ "options": {
85
+ "styles": [
86
+ "node_modules/bootstrap/dist/css/bootstrap.min.css",
87
+ "src/styles.css"
88
+ ],
89
+ // ... other configurations
90
+ }
91
+ }
92
+ }
93
+ }
94
+ }
95
+ }
96
+ ```
97
+
98
+ **Note:** The `mediasfu-angular` package should handle the Bootstrap's package installation automatically. If it's not present, you may need to add it manually install Bootstrap.
99
+
100
+
101
+ 3. **Configure MediaSFU's PreJoinPage Requirements**
102
+
103
+ If you intend to use MediaSFU's `PreJoinPage` component, additional configuration is required. You need to provide the `HttpClient` and `CookieService` providers in your application's configuration. These packages should have been installed by default as well else add manually.
104
+
105
+ #### Update `app.config.ts`
106
+
107
+ Add the necessary providers to your `app.config.ts` file. Below is an example configuration:
108
+
109
+ ```typescript
110
+ // app.config.ts
111
+ import { ApplicationConfig } from '@angular/core';
112
+ import { provideZoneChangeDetection } from '@angular/core';
113
+ import { provideClientHydration } from '@angular/platform-browser';
114
+ import { provideHttpClient } from '@angular/common/http';
115
+ import { CookieService } from 'ngx-cookie-service';
116
+
117
+ export const appConfig: ApplicationConfig = {
118
+ providers: [
119
+ provideZoneChangeDetection({ eventCoalescing: true }),
120
+ provideClientHydration(),
121
+ provideHttpClient(),
122
+ CookieService
123
+ ],
124
+ };
125
+
126
+ ```
127
+
128
+ 4. **Obtain an API key from MediaSFU.** You can get your API key by signing up or logging into your account at [mediasfu.com](https://www.mediasfu.com/).
129
+
130
+ <div style="background-color:#f0f0f0; padding: 10px; border-radius: 5px;">
131
+ <h4 style="color:#d9534f;">Important:</h4>
132
+ <p style="font-size: 1.2em;">You must obtain an API key from <a href="https://www.mediasfu.com/">mediasfu.com</a> to use this package.</p>
133
+ </div>
134
+
135
+
136
+
137
+ # Basic Usage Guide <a name="basic-usage-guide"></a>
138
+
139
+ A basic guide on how to use the module for common tasks.
140
+
141
+ This section will guide users through the initial setup and installation of the npm module.
142
+
143
+ *If users are interested in the Android/iOS (mobile) versions, they can refer to the Expo React Native project that is configured to produce both web and mobile apps. The source code for this project is available on GitHub at [*MediaSFU/MediaSFU*](https://github.com/MediaSFU/MediaSFU)*.
144
+
145
+ *For the community edition, users can visit the GitHub repository at [*MediaSFU/MediaSFUOpen*](https://github.com/MediaSFU/MediaSFUOpen)*.
146
+
147
+ *Users can follow the instructions provided in the README of the respective GitHub repositories to set up and install the projects for both web and mobile platforms, ensuring a consistent user experience across different platforms*.
148
+
149
+ *Users can follow the instructions provided here and in the README of the GitHub repository to set up and install the project for both web and mobile platforms using Expo. This allows for seamless development and deployment across multiple platforms, ensuring a consistent user experience*.
150
+
151
+ ## Introduction
152
+
153
+ MediaSFU is a 2-page application consisting of a prejoin/welcome page and the main events room page. This guide will walk you through the basic usage of the module for setting up these pages.
154
+
155
+ ## Prebuilt Event Rooms
156
+
157
+ MediaSFU provides prebuilt event rooms for various purposes. These rooms are rendered as full pages and can be easily imported and used in your application. Here are the available prebuilt event rooms:
158
+
159
+ 1. **MediasfuGeneric**: A generic event room suitable for various types of events.
160
+ 2. **MediasfuBroadcast**: A room optimized for broadcasting events.
161
+ 3. **MediasfuWebinar**: Specifically designed for hosting webinars.
162
+ 4. **MediasfuConference**: Ideal for hosting conferences.
163
+ 5. **MediasfuChat**: A room tailored for interactive chat sessions.
164
+
165
+ Users can easily pick an interface and render it in their app.
166
+
167
+ If no API credentials are provided, a default home page will be displayed where users can scan or manually enter the event details.
168
+
169
+ To use these prebuilt event rooms, simply import them into your application:
170
+
171
+ ```javascript
172
+ ## Simplest Usage
173
+
174
+ The simplest way to use MediaSFU in your Angular application is by directly rendering the prebuilt event room component, such as `MediasfuGeneric`.
175
+
176
+ ```typescript
177
+ // app.component.ts
178
+ import { Component } from '@angular/core';
179
+ import { MediasfuGeneric } from 'mediasfu-angular';
180
+
181
+ @Component({
182
+ selector: 'app-root',
183
+ standalone: true,
184
+ imports: [MediasfuGeneric],
185
+ template: `
186
+ <app-mediasfu-generic></app-mediasfu-generic>
187
+ `,
188
+ })
189
+ export class AppComponent { }
190
+ ```
191
+
192
+ ## Programmatically Fetching Tokens
193
+
194
+ If you prefer to fetch the required tokens programmatically without visiting MediaSFU's website, you can use the `PreJoinPage` component and pass your credentials as inputs.
195
+
196
+ ```typescript
197
+ // app.component.ts
198
+ import { Component } from '@angular/core';
199
+ import { MediasfuGeneric, PreJoinPage } from 'mediasfu-angular';
200
+
201
+ @Component({
202
+ selector: 'app-root',
203
+ standalone: true,
204
+ imports: [MediasfuGeneric],
205
+ template: `
206
+ <div class="container">
207
+ <app-mediasfu-generic
208
+ [PrejoinPage]="PreJoinPage"
209
+ [credentials]="credentials">
210
+ </app-mediasfu-generic>
211
+ </div>
212
+ `,
213
+ })
214
+ export class AppComponent {
215
+ // Reference to the PreJoinPage component
216
+ PreJoinPage = PreJoinPage;
217
+
218
+ // MediaSFU account credentials
219
+ credentials = {
220
+ apiUserName: 'yourAPIUserName',
221
+ apiKey: 'yourAPIKey',
222
+ };
223
+ }
224
+ ```
225
+
226
+ <div style="text-align: center;">
227
+
228
+ ### Preview of Welcome Page
229
+
230
+ <img src="https://mediasfu.com/images/prejoin.png" alt="Preview of Welcome Page" title="Welcome Page" style="max-height: 500px;">
231
+
232
+ <!-- Add a blank line for spacing -->
233
+ &nbsp;
234
+
235
+ ### Preview of Prejoin Page
236
+
237
+ <img src="https://mediasfu.com/images/prejoin3.png" alt="Preview of Prejoin Page" title="Prejoin Page" style="max-height: 500px;">
238
+
239
+ </div>
240
+
241
+
242
+
243
+
244
+ ## Custom Welcome/Prejoin Page
245
+
246
+ Alternatively, you can design your own welcome/prejoin page. The core function of this page is to fetch user tokens from MediaSFU's API and establish a connection with the returned link if valid.
247
+
248
+ ### Parameters Passed to Custom Page
249
+
250
+ MediaSFU passes relevant parameters to the custom welcome/prejoin page:
251
+
252
+ ```javascript
253
+ let { showAlert, updateIsLoadingModalVisible, connectSocket, updateSocket, updateValidated,
254
+ updateApiUserName, updateApiToken, updateLink, updateRoomName, updateMember } = parameters;
255
+ ```
256
+
257
+ Ensure that your custom page implements the following updates:
258
+
259
+ ```javascript
260
+ updateSocket(socket);
261
+ updateApiUserName(apiUserName);
262
+ updateApiToken(apiToken);
263
+ updateLink(link);
264
+ updateRoomName(apiUserName);
265
+ updateMember(userName);
266
+ updateValidated(true);
267
+ ```
268
+
269
+ See the following code for the PreJoinPage page logic:
270
+
271
+ ```javascript
272
+ import { Component, Inject, Input, Optional } from '@angular/core';
273
+ import { HttpClient, HttpHeaders } from '@angular/common/http';
274
+ import { FormBuilder, FormGroup, Validators, ReactiveFormsModule } from '@angular/forms';
275
+ import { CookieService } from 'ngx-cookie-service';
276
+ import { CommonModule } from '@angular/common';
277
+ import { Socket } from 'socket.io-client';
278
+ import { ConnectSocketType } from '../../../sockets/socket-manager.service';
279
+ import { ShowAlert } from '../../../@types/types';
280
+
281
+ export interface PreJoinPageParameters {
282
+ imgSrc?: string;
283
+ showAlert?: ShowAlert;
284
+ updateIsLoadingModalVisible: (visible: boolean) => void;
285
+ connectSocket: ConnectSocketType;
286
+ updateSocket: (socket: Socket) => void;
287
+ updateValidated: (validated: boolean) => void;
288
+ updateApiUserName: (userName: string) => void;
289
+ updateApiToken: (token: string) => void;
290
+ updateLink: (link: string) => void;
291
+ updateRoomName: (roomName: string) => void;
292
+ updateMember: (member: string) => void;
293
+ }
294
+
295
+ export interface Credentials {
296
+ apiUserName: string;
297
+ apiKey: string;
298
+ }
299
+
300
+ export interface PreJoinPageOptions {
301
+ parameters: PreJoinPageParameters;
302
+ credentials?: Credentials;
303
+ }
304
+
305
+ export interface CreateJoinRoomResponse {
306
+ message: string;
307
+ roomName: string;
308
+ secureCode?: string;
309
+ publicURL: string;
310
+ link: string;
311
+ secret: string;
312
+ success: boolean;
313
+ }
314
+
315
+ export interface CreateJoinRoomError {
316
+ error: string;
317
+ success?: boolean;
318
+ }
319
+
320
+ export type CreateJoinRoomType = (options: {
321
+ payload: any;
322
+ apiUserName: string;
323
+ apiKey: string;
324
+ }) => Promise<{
325
+ data: CreateJoinRoomResponse | CreateJoinRoomError | null;
326
+ success: boolean;
327
+ }>;
328
+
329
+ export type CreateRoomOnMediaSFUType = (options: {
330
+ payload: any;
331
+ apiUserName: string;
332
+ apiKey: string;
333
+ }) => Promise<{
334
+ data: CreateJoinRoomResponse | CreateJoinRoomError | null;
335
+ success: boolean;
336
+ }>;
337
+
338
+ export type PreJoinPageType = (options: PreJoinPageOptions) => void;
339
+
340
+ const MAX_ATTEMPTS = 20; // Maximum number of unsuccessful attempts before rate limiting
341
+ const RATE_LIMIT_DURATION = 3 * 60 * 60 * 1000; // 3 hours in milliseconds
342
+ const TIMEOUT_DURATION = 10000; // 5 seconds in milliseconds
343
+
344
+ /**
345
+ * @fileoverview PreJoinPage component for handling room creation and joining on MediaSFU.
346
+ *
347
+ * @component
348
+ * @selector app-pre-join-page
349
+ * @standalone true
350
+ * @templateUrl ./pre-join-page.component.html
351
+ * @styleUrls ./pre-join-page.component.css
352
+ * @imports [CommonModule, ReactiveFormsModule]
353
+ *
354
+ * @description
355
+ * This component provides functionality for users to create or join a room on MediaSFU.
356
+ * It includes form validation, error handling, and API requests to the MediaSFU service.
357
+ *
358
+ * @property {any} parameters - Input parameters for the component.
359
+ * @property {Object} credentials - API credentials for MediaSFU.
360
+ * @property {string} credentials.apiUserName - API username.
361
+ * @property {string} credentials.apiKey - API key.
362
+ * @property {boolean} isCreateMode - Flag to toggle between create and join modes.
363
+ * @property {FormGroup} preJoinForm - Form group for pre-join form.
364
+ * @property {string} error - Error message to display.
365
+ *
366
+ * @constructor
367
+ * @param {FormBuilder} fb - FormBuilder service for creating form groups.
368
+ * @param {HttpClient} http - HttpClient service for making HTTP requests.
369
+ * @param {CookieService} cookieService - CookieService for managing cookies.
370
+ *
371
+ * @method ngOnInit
372
+ * @description Lifecycle hook that is called after data-bound properties are initialized.
373
+ *
374
+ * @method toggleMode
375
+ * @description Toggles between create and join modes and resets the error message.
376
+ *
377
+ * @method handleCreateRoom
378
+ * @description Handles the creation of a room on MediaSFU. Validates form inputs, sends a request to create a room, and handles the response.
379
+ *
380
+ * @method handleJoinRoom
381
+ * @description Handles joining a room on MediaSFU. Validates form inputs, sends a request to join a room, and handles the response.
382
+ *
383
+ * @method checkLimitsAndMakeRequest
384
+ * @description Checks rate limits and makes a request to connect to a room. Handles unsuccessful attempts and updates the state accordingly.
385
+ *
386
+ * @method createRoomOnMediaSFU
387
+ * @description Sends a request to create a room on MediaSFU.
388
+ * @param {Object} params - Parameters for the request.
389
+ * @param {any} params.payload - Payload for the request.
390
+ * @param {string} params.apiUserName - API username.
391
+ * @param {string} params.apiKey - API key.
392
+ * @returns {Promise<{ data: CreateJoinRoomResponse | CreateJoinRoomError | null; success: boolean }>} Response from the API.
393
+ *
394
+ * @method joinRoomOnMediaSFU
395
+ * @description Sends a request to join a room on MediaSFU.
396
+ * @param {Object} params - Parameters for the request.
397
+ * @param {any} params.payload - Payload for the request.
398
+ * @param {string} params.apiUserName - API username.
399
+ * @param {string} params.apiKey - API key.
400
+ * @returns {Promise<{ data: CreateJoinRoomResponse | CreateJoinRoomError | null; success: boolean }>} Response from the API.
401
+ */
402
+ @Component({
403
+ selector: 'app-pre-join-page',
404
+ standalone: true,
405
+ templateUrl: './pre-join-page.component.html',
406
+ styleUrls: ['./pre-join-page.component.css'],
407
+ imports: [CommonModule, ReactiveFormsModule],
408
+ })
409
+ export class PreJoinPage {
410
+ @Input() parameters: PreJoinPageParameters = {} as PreJoinPageParameters;
411
+ @Input() credentials = { apiUserName: 'yourAPIUSERNAME', apiKey: 'yourAPIKEY' };
412
+
413
+ isCreateMode = false;
414
+ preJoinForm: FormGroup;
415
+ error = '';
416
+ imgSrc: string = this.parameters.imgSrc || '';
417
+
418
+ constructor(
419
+ private fb: FormBuilder,
420
+ private http: HttpClient,
421
+ private cookieService: CookieService,
422
+ @Optional() @Inject('parameters') injectedParameters: PreJoinPageParameters,
423
+ @Optional() @Inject('credentials') injectedCredentials: Credentials,
424
+ ) {
425
+ this.preJoinForm = this.fb.group({
426
+ name: ['', Validators.required],
427
+ duration: [''],
428
+ eventType: [''],
429
+ capacity: [''],
430
+ eventID: [''],
431
+ });
432
+ this.parameters = injectedParameters || this.parameters;
433
+ this.credentials = injectedCredentials || this.credentials;
434
+ }
435
+
436
+ toggleMode() {
437
+ this.isCreateMode = !this.isCreateMode;
438
+ this.error = '';
439
+ }
440
+
441
+ async handleCreateRoom() {
442
+ if (this.preJoinForm.invalid) {
443
+ this.error = 'Please fill all the fields.';
444
+ return;
445
+ }
446
+
447
+ const { name, duration, eventType, capacity } = this.preJoinForm.value;
448
+
449
+ if (!name || !duration || !eventType || !capacity) {
450
+ this.error = 'Please fill all the fields.';
451
+ return;
452
+ }
453
+
454
+ const payload = {
455
+ action: 'create',
456
+ duration: parseInt(duration),
457
+ capacity: parseInt(capacity),
458
+ eventType,
459
+ userName: name,
460
+ };
461
+
462
+ this.parameters.updateIsLoadingModalVisible(true);
463
+
464
+ try {
465
+ const response = await this.createRoomOnMediaSFU({
466
+ payload,
467
+ apiUserName: this.credentials.apiUserName,
468
+ apiKey: this.credentials.apiKey,
469
+ });
470
+
471
+ if (response.success && response.data && 'roomName' in response.data) {
472
+ await this.checkLimitsAndMakeRequest({
473
+ apiUserName: response.data.roomName,
474
+ apiToken: response.data.secret,
475
+ link: response.data.link,
476
+ userName: name,
477
+ });
478
+ this.error = '';
479
+ } else {
480
+ this.parameters.updateIsLoadingModalVisible(false);
481
+ this.error = `${
482
+ response.data ? ('error' in response.data ? response.data.error : '') : ''
483
+ }`;
484
+ }
485
+ } catch (error) {
486
+ this.parameters.updateIsLoadingModalVisible(false);
487
+ this.error = `Unable to connect. ${(error as any).message}`;
488
+ }
489
+ }
490
+
491
+ async handleJoinRoom() {
492
+ if (this.preJoinForm.invalid) {
493
+ this.error = 'Please fill all the fields.';
494
+ return;
495
+ }
496
+
497
+ const { name, eventID } = this.preJoinForm.value;
498
+
499
+ if (!name || !eventID) {
500
+ this.error = 'Please fill all the fields.';
501
+ return;
502
+ }
503
+
504
+ const payload = {
505
+ action: 'join',
506
+ meetingID: eventID,
507
+ userName: name,
508
+ };
509
+
510
+ this.parameters.updateIsLoadingModalVisible(true);
511
+
512
+ try {
513
+ const response = await this.joinRoomOnMediaSFU({
514
+ payload,
515
+ apiUserName: this.credentials.apiUserName,
516
+ apiKey: this.credentials.apiKey,
517
+ });
518
+
519
+ if (response.success && response.data && 'roomName' in response.data) {
520
+ await this.checkLimitsAndMakeRequest({
521
+ apiUserName: response.data.roomName,
522
+ apiToken: response.data.secret,
523
+ link: response.data.link,
524
+ userName: name,
525
+ });
526
+ this.error = '';
527
+ } else {
528
+ this.parameters.updateIsLoadingModalVisible(false);
529
+ this.error = `Unable to connect to room. ${
530
+ response.data ? ('error' in response.data ? response.data.error : '') : ''
531
+ }`;
532
+ }
533
+ } catch (error) {
534
+ this.parameters.updateIsLoadingModalVisible(false);
535
+ this.error = `Unable to connect. ${(error as any).message}`;
536
+ }
537
+ }
538
+
539
+ async checkLimitsAndMakeRequest({
540
+ apiUserName,
541
+ apiToken,
542
+ link,
543
+ apiKey = '',
544
+ userName,
545
+ }: {
546
+ apiUserName: string;
547
+ apiToken: string;
548
+ link: string;
549
+ apiKey?: string;
550
+ userName: string;
551
+ }) {
552
+ let unsuccessfulAttempts = parseInt(this.cookieService.get('unsuccessfulAttempts')) || 0;
553
+ let lastRequestTimestamp = parseInt(this.cookieService.get('lastRequestTimestamp')) || 0;
554
+
555
+ if (unsuccessfulAttempts >= MAX_ATTEMPTS) {
556
+ if (Date.now() - lastRequestTimestamp < RATE_LIMIT_DURATION) {
557
+ this.parameters.showAlert?.({
558
+ message: 'Too many unsuccessful attempts. Please try again later.',
559
+ type: 'danger',
560
+ duration: 3000,
561
+ });
562
+ this.cookieService.set('lastRequestTimestamp', Date.now().toString());
563
+ return;
564
+ } else {
565
+ unsuccessfulAttempts = 0;
566
+ this.cookieService.set('unsuccessfulAttempts', unsuccessfulAttempts.toString());
567
+ this.cookieService.set('lastRequestTimestamp', Date.now().toString());
568
+ }
569
+ }
570
+
571
+ try {
572
+ this.parameters.updateIsLoadingModalVisible(true);
573
+
574
+ const socketPromise = await this.parameters.connectSocket({
575
+ apiUserName,
576
+ apiKey,
577
+ apiToken,
578
+ link,
579
+ });
580
+
581
+ const timeoutPromise = new Promise((_, reject) =>
582
+ setTimeout(() => reject(new Error('Request timed out')), TIMEOUT_DURATION),
583
+ );
584
+
585
+ const socket = await Promise.race([socketPromise, timeoutPromise]);
586
+
587
+ if (socket && socket instanceof Socket && socket.id) {
588
+ unsuccessfulAttempts = 0;
589
+ this.cookieService.set('unsuccessfulAttempts', unsuccessfulAttempts.toString());
590
+ this.cookieService.set('lastRequestTimestamp', Date.now().toString());
591
+ this.parameters.updateSocket(socket);
592
+ this.parameters.updateApiUserName(apiUserName);
593
+ this.parameters.updateApiToken(apiToken);
594
+ this.parameters.updateLink(link);
595
+ this.parameters.updateRoomName(apiUserName);
596
+ this.parameters.updateMember(userName);
597
+ this.parameters.updateValidated(true);
598
+ } else {
599
+ unsuccessfulAttempts += 1;
600
+ this.cookieService.set('unsuccessfulAttempts', unsuccessfulAttempts.toString());
601
+ this.cookieService.set('lastRequestTimestamp', Date.now().toString());
602
+ this.parameters.updateIsLoadingModalVisible(false);
603
+
604
+ if (unsuccessfulAttempts >= MAX_ATTEMPTS) {
605
+ this.parameters.showAlert?.({
606
+ message: 'Too many unsuccessful attempts. Please try again later.',
607
+ type: 'danger',
608
+ duration: 3000,
609
+ });
610
+ } else {
611
+ this.parameters.showAlert?.({
612
+ message: 'Invalid credentials.',
613
+ type: 'danger',
614
+ duration: 3000,
615
+ });
616
+ }
617
+ }
618
+ } catch (error) {
619
+ this.parameters.showAlert?.({
620
+ message: 'Unable to connect. Check your credentials and try again.',
621
+ type: 'danger',
622
+ duration: 3000,
623
+ });
624
+
625
+ unsuccessfulAttempts += 1;
626
+ this.cookieService.set('unsuccessfulAttempts', unsuccessfulAttempts.toString());
627
+ this.cookieService.set('lastRequestTimestamp', Date.now().toString());
628
+ this.parameters.updateIsLoadingModalVisible(false);
629
+ }
630
+ }
631
+
632
+ async createRoomOnMediaSFU({
633
+ payload,
634
+ apiUserName,
635
+ apiKey,
636
+ }: {
637
+ payload: any;
638
+ apiUserName: string;
639
+ apiKey: string;
640
+ }): Promise<{ data: CreateJoinRoomResponse | CreateJoinRoomError | null; success: boolean }> {
641
+ try {
642
+ if (
643
+ !apiUserName ||
644
+ !apiKey ||
645
+ apiUserName === 'yourAPIUSERNAME' ||
646
+ apiKey === 'yourAPIKEY' ||
647
+ apiKey.length !== 64 ||
648
+ apiUserName.length < 6
649
+ ) {
650
+ return { data: { error: 'Invalid credentials' }, success: false };
651
+ }
652
+
653
+ const response = await this.http
654
+ .post<any>('https://mediasfu.com/v1/rooms/', payload, {
655
+ headers: new HttpHeaders({
656
+ 'Content-Type': 'application/json',
657
+ Authorization: `Bearer ${apiUserName}:${apiKey}`,
658
+ }),
659
+ })
660
+ .toPromise();
661
+
662
+ return { data: response, success: true };
663
+ } catch (error) {
664
+ const errorMessage = (error as any).reason ? (error as any).reason : 'unknown error';
665
+ return {
666
+ data: { error: `Unable to create room; something went wrong ${errorMessage}` },
667
+ success: false,
668
+ };
669
+ }
670
+ }
671
+
672
+ async joinRoomOnMediaSFU({
673
+ payload,
674
+ apiUserName,
675
+ apiKey,
676
+ }: {
677
+ payload: any;
678
+ apiUserName: string;
679
+ apiKey: string;
680
+ }): Promise<{ data: CreateJoinRoomResponse | CreateJoinRoomError | null; success: boolean }> {
681
+ try {
682
+ if (
683
+ !apiUserName ||
684
+ !apiKey ||
685
+ apiUserName === 'yourAPIUSERNAME' ||
686
+ apiKey === 'yourAPIKEY' ||
687
+ apiKey.length !== 64 ||
688
+ apiUserName.length < 6
689
+ ) {
690
+ return { data: { error: 'Invalid credentials' }, success: false };
691
+ }
692
+
693
+ const response = await this.http
694
+ .post<any>('https://mediasfu.com/v1/rooms/', payload, {
695
+ headers: new HttpHeaders({
696
+ 'Content-Type': 'application/json',
697
+ Authorization: `Bearer ${apiUserName}:${apiKey}`,
698
+ }),
699
+ })
700
+ .toPromise();
701
+
702
+ return { data: response, success: true };
703
+ } catch (error) {
704
+ const errorMessage = (error as any).reason ? (error as any).reason : 'unknown error';
705
+ return {
706
+ data: { error: `Unable to join room; something went wrong ${errorMessage}` },
707
+ success: false,
708
+ };
709
+ }
710
+ }
711
+ }
712
+ ```
713
+
714
+ ### IP Blockage Warning And Local UI Development
715
+
716
+ Entering the event room without the correct credentials may result in IP blockage, as the page automatically attempts to connect with MediaSFU servers, which rate limit bad requests based on IP address.
717
+
718
+ If users attempt to enter the event room without valid credentials or tokens, it may lead to IP blockage due to MediaSFU servers' rate limiting mechanism. To avoid unintentional connections to MediaSFU servers during UI development, users can pass the `useLocalUIMode` parameter as `true`.
719
+
720
+ In this mode, the module will operate locally without making requests to MediaSFU servers. However, to render certain UI elements such as messages, participants, requests, etc., users may need to provide seed data. They can achieve this by importing random data generators and passing the generated data to the event room component.
721
+
722
+ ### Example for Generic UI to Render Broadcast Room
723
+
724
+ ```javascript
725
+
726
+ import { Component, OnInit } from '@angular/core';
727
+ import {
728
+ MediasfuBroadcast,
729
+ GenerateRandomParticipants,
730
+ GenerateRandomMessages,
731
+ GenerateRandomRequestList,
732
+ GenerateRandomWaitingRoomList
733
+ } from 'mediasfu-angular';
734
+
735
+ @Component({
736
+ selector: 'app-root',
737
+ standalone: true,
738
+ imports: [MediasfuBroadcast],
739
+ template: `
740
+ <div class="container">
741
+ <app-mediasfu-broadcast
742
+ [useLocalUIMode]="useLocalUIMode"
743
+ [useSeed]="useSeed"
744
+ [seedData]="seedData">
745
+ </app-mediasfu-broadcast>
746
+ </div>
747
+ `,
748
+ providers: [
749
+ GenerateRandomParticipants,
750
+ GenerateRandomMessages,
751
+ ],
752
+ })
753
+ export class AppComponent implements OnInit {
754
+ // Whether to use seed data for generating random participants and messages
755
+ useSeed = true;
756
+ seedData: any = {};
757
+ eventType = 'broadcast';
758
+
759
+
760
+ // Whether to use local UI mode (prevents requests to MediaSFU servers)
761
+ useLocalUIMode = false;
762
+
763
+ constructor(
764
+ private generateRandomParticipants: GenerateRandomParticipants,
765
+ private generateRandomMessages: GenerateRandomMessages,
766
+ private generateRandomRequestList: GenerateRandomRequestList,
767
+ private generateRandomWaitingRoomList: GenerateRandomWaitingRoomList
768
+ ) { }
769
+
770
+ ngOnInit(): void {
771
+ if (this.useSeed) {
772
+ const memberName = 'Alice';
773
+ const hostName = 'Fred';
774
+
775
+
776
+
777
+ // Generate random participants
778
+ const participants_ =
779
+ this.generateRandomParticipants.generateRandomParticipants({
780
+ member: memberName,
781
+ coHost: '',
782
+ host: hostName,
783
+ forChatBroadcast:
784
+ this.eventType === 'broadcast' || this.eventType === 'chat',
785
+ });
786
+
787
+ // Generate random messages
788
+ const messages_ = this.generateRandomMessages.generateRandomMessages({
789
+ participants: participants_,
790
+ member: memberName,
791
+ host: hostName,
792
+ forChatBroadcast:
793
+ this.eventType === 'broadcast' || this.eventType === 'chat',
794
+ });
795
+
796
+ // Generate random request list
797
+ const requests_ =
798
+ this.generateRandomRequestList.generateRandomRequestList({
799
+ participants: participants_,
800
+ hostName: memberName,
801
+ coHostName: '',
802
+ numberOfRequests: 3,
803
+ });
804
+
805
+ // Generate random waiting room list
806
+ const waitingList_ =
807
+ this.generateRandomWaitingRoomList.generateRandomWaitingRoomList();
808
+
809
+ // Assign generated data to seedData
810
+ this.seedData = {
811
+ participants: participants_,
812
+ messages: messages_,
813
+ requests: requests_,
814
+ waitingList: waitingList_,
815
+ member: memberName,
816
+ host: hostName,
817
+ eventType: this.eventType,
818
+ };
819
+ }
820
+
821
+ // Determine whether to use local UI mode
822
+ this.useLocalUIMode = this.useSeed;
823
+ }
824
+ }
825
+
826
+ ```
827
+
828
+ ### Example for Generic View
829
+
830
+ ```javascript
831
+ import { Component, OnInit } from '@angular/core';
832
+ import {
833
+ GenerateRandomParticipants,
834
+ GenerateRandomMessages,
835
+ GenerateRandomRequestList,
836
+ GenerateRandomWaitingRoomList,
837
+ MediasfuGeneric,
838
+ MediasfuBroadcast,
839
+ MediasfuChat,
840
+ MediasfuWebinar,
841
+ MediasfuConference,
842
+ PreJoinPage,
843
+ } from 'mediasfu-angular';
844
+
845
+
846
+ @Component({
847
+ selector: 'app-root',
848
+ standalone: true,
849
+ imports: [
850
+ MediasfuGeneric,
851
+ MediasfuBroadcast,
852
+ MediasfuChat,
853
+ MediasfuWebinar,
854
+ MediasfuConference,
855
+ PreJoinPage,
856
+ ],
857
+ template: `
858
+ <app-mediasfu-generic [PrejoinPage]="PreJoinPage" [credentials]="credentials"></app-mediasfu-generic>
859
+
860
+ <!--
861
+ Welcome to the Mediasfu Angular Application!
862
+
863
+ Below are different use cases you can run. Uncomment the one you want to try.
864
+
865
+ 1. Simple Use Case (Welcome Page)
866
+ - Renders the default welcome page.
867
+ - No additional inputs required.
868
+
869
+ <app-mediasfu-generic></app-mediasfu-generic>
870
+
871
+ -------------------------------------------------
872
+
873
+ 2. Use Case with Pre-Join Page (Credentials Required)
874
+ - Uses a pre-join page that requires users to enter credentials.
875
+ - Provide your Mediasfu API username and key in the 'credentials' object.
876
+
877
+ <app-mediasfu-generic
878
+ [PrejoinPage]="PreJoinPage"
879
+ [credentials]="credentials"
880
+ ></app-mediasfu-generic>
881
+
882
+ -------------------------------------------------
883
+
884
+ 3. Use Case with Local UI Mode (Seed Data Required)
885
+ - Runs the application in local UI mode using seed data.
886
+ - Set 'useSeed' to true and provide seed data in 'seedData'.
887
+
888
+ <app-mediasfu-generic
889
+ [useLocalUIMode]="true"
890
+ [useSeed]="true"
891
+ [seedData]="seedData"
892
+ ></app-mediasfu-generic>
893
+
894
+ -------------------------------------------------
895
+
896
+ 4. Use Specific Event Type Components
897
+ - Uncomment the component corresponding to the event type you want to use.
898
+ - Options are 'broadcast', 'chat', 'webinar', 'conference'.
899
+ - Remember to set the 'eventType' property in the class.
900
+
901
+ Example for 'broadcast':
902
+
903
+ <app-mediasfu-broadcast
904
+ [credentials]="credentials"
905
+ [useLocalUIMode]="useLocalUIMode"
906
+ [useSeed]="useSeed"
907
+ [seedData]="useSeed ? seedData : {}"
908
+ ></app-mediasfu-broadcast>
909
+
910
+ -->
911
+
912
+ <!-- Uncomment one of the options below to run the corresponding use case -->
913
+
914
+ <!-- Simple Use Case (Welcome Page) -->
915
+ <!--
916
+ <app-mediasfu-generic></app-mediasfu-generic>
917
+ -->
918
+
919
+ <!-- Use Case with Pre-Join Page (Credentials Required) -->
920
+ <!--
921
+ <app-mediasfu-generic
922
+ [PrejoinPage]="PreJoinPage"
923
+ [credentials]="credentials"
924
+ ></app-mediasfu-generic>
925
+ -->
926
+
927
+ <!-- Use Case with Local UI Mode (Seed Data Required) -->
928
+ <!--
929
+ <app-mediasfu-generic
930
+ [useLocalUIMode]="true"
931
+ [useSeed]="true"
932
+ [seedData]="seedData"
933
+ ></app-mediasfu-generic>
934
+ -->
935
+
936
+ <!-- MediasfuBroadcast Component -->
937
+ <!-- Uncomment to use the broadcast event type -->
938
+ <!--
939
+ <app-mediasfu-broadcast
940
+ [credentials]="credentials"
941
+ [useLocalUIMode]="useLocalUIMode"
942
+ [useSeed]="useSeed"
943
+ [seedData]="useSeed ? seedData : {}"
944
+ ></app-mediasfu-broadcast>
945
+ -->
946
+
947
+ <!-- MediasfuChat Component -->
948
+ <!-- Uncomment to use the chat event type -->
949
+ <!--
950
+ <app-mediasfu-chat
951
+ [credentials]="credentials"
952
+ [useLocalUIMode]="useLocalUIMode"
953
+ [useSeed]="useSeed"
954
+ [seedData]="useSeed ? seedData : {}"
955
+ ></app-mediasfu-chat>
956
+ -->
957
+
958
+ <!-- MediasfuWebinar Component -->
959
+ <!-- Uncomment to use the webinar event type -->
960
+ <!--
961
+ <app-mediasfu-webinar
962
+ [credentials]="credentials"
963
+ [useLocalUIMode]="useLocalUIMode"
964
+ [useSeed]="useSeed"
965
+ [seedData]="useSeed ? seedData : {}"
966
+ ></app-mediasfu-webinar>
967
+ -->
968
+
969
+ <!-- MediasfuConference Component -->
970
+ <!-- Uncomment to use the conference event type -->
971
+ <!--
972
+ <app-mediasfu-conference
973
+ [credentials]="credentials"
974
+ [useLocalUIMode]="useLocalUIMode"
975
+ [useSeed]="useSeed"
976
+ [seedData]="useSeed ? seedData : {}"
977
+ ></app-mediasfu-conference>
978
+ -->
979
+ `
980
+ })
981
+ export class AppComponent implements OnInit {
982
+ // Reference to the PreJoinPage component
983
+ PreJoinPage = PreJoinPage;
984
+
985
+ // Mediasfu account credentials
986
+ // Replace 'your_api_username' and 'your_api_key' with your actual credentials
987
+ // Only if you are using the PreJoinPage component
988
+ credentials = {
989
+ apiUserName: 'your_api_username',
990
+ apiKey: 'your_api_key',
991
+ };
992
+
993
+ // Whether to use seed data for generating random participants and messages
994
+ // Set to true if you want to run the application in local UI mode with seed data
995
+ useSeed = false;
996
+ seedData: any = {};
997
+
998
+ // Event type ('broadcast', 'chat', 'webinar', 'conference')
999
+ // Set this to match the component you are using
1000
+ eventType: string = 'broadcast';
1001
+
1002
+ // Whether to use local UI mode (prevents requests to Mediasfu servers)
1003
+ // Automatically set to true if 'useSeed' is true
1004
+ useLocalUIMode: boolean = false;
1005
+
1006
+ // Inject the services in the constructor
1007
+ constructor(
1008
+ private generateRandomParticipants: GenerateRandomParticipants,
1009
+ private generateRandomMessages: GenerateRandomMessages,
1010
+ private generateRandomRequestList: GenerateRandomRequestList,
1011
+ private generateRandomWaitingRoomList: GenerateRandomWaitingRoomList
1012
+ ) { }
1013
+
1014
+ ngOnInit(): void {
1015
+ // If using seed data, generate random participants and messages
1016
+ if (this.useSeed) {
1017
+ const memberName = 'Prince';
1018
+ const hostName = 'Fred';
1019
+
1020
+ // Generate random participants
1021
+ const participants_ =
1022
+ this.generateRandomParticipants.generateRandomParticipants({
1023
+ member: memberName,
1024
+ coHost: '',
1025
+ host: hostName,
1026
+ forChatBroadcast:
1027
+ this.eventType === 'broadcast' || this.eventType === 'chat',
1028
+ });
1029
+
1030
+ // Generate random messages
1031
+ const messages_ = this.generateRandomMessages.generateRandomMessages({
1032
+ participants: participants_,
1033
+ member: memberName,
1034
+ host: hostName,
1035
+ forChatBroadcast:
1036
+ this.eventType === 'broadcast' || this.eventType === 'chat',
1037
+ });
1038
+
1039
+ // Generate random request list
1040
+ const requests_ =
1041
+ this.generateRandomRequestList.generateRandomRequestList({
1042
+ participants: participants_,
1043
+ hostName: memberName,
1044
+ coHostName: '',
1045
+ numberOfRequests: 3,
1046
+ });
1047
+
1048
+ // Generate random waiting room list
1049
+ const waitingList_ =
1050
+ this.generateRandomWaitingRoomList.generateRandomWaitingRoomList();
1051
+
1052
+ // Assign generated data to seedData
1053
+ this.seedData = {
1054
+ participants: participants_,
1055
+ messages: messages_,
1056
+ requests: requests_,
1057
+ waitingList: waitingList_,
1058
+ member: memberName,
1059
+ host: hostName,
1060
+ eventType: this.eventType,
1061
+ };
1062
+ }
1063
+
1064
+ // Determine whether to use local UI mode
1065
+ this.useLocalUIMode = this.useSeed;
1066
+ }
1067
+ }
1068
+
1069
+ ```
1070
+
1071
+ In the provided examples, users can set `useLocalUIMode` to `true` during UI development to prevent unwanted connections to MediaSFU servers. Additionally, they can generate seed data for rendering UI components locally by using random data generators provided by the module.
1072
+
1073
+ ### Local UI Development in MediaSFU Angular Module
1074
+
1075
+ During local UI development, the MediaSFU view is designed to be responsive to changes in screen size and orientation, adapting its layout accordingly. However, since UI changes are typically linked to communication with servers, developing the UI locally might result in less responsiveness due to the lack of real-time data updates. To mitigate this, users can force trigger changes in the UI by rotating the device, resizing the window, or simulating server responses by clicking on buttons within the page.
1076
+
1077
+ While developing locally, users may encounter occasional error warnings as the UI attempts to communicate with the server. These warnings can be safely ignored, as they are simply indicative of unsuccessful server requests in the local development environment.
1078
+
1079
+ If users experience responsiveness issues, whether during local development or in production, they can optimize their HTML configuration to ensure proper scaling and viewport settings. By adding the following meta tag to the HTML `<head>` section, users can specify viewport settings for optimal display:
1080
+
1081
+ ```html
1082
+ <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
1083
+ ```
1084
+
1085
+
1086
+
1087
+
1088
+ # Intermediate Usage Guide <a name="intermediate-usage-guide"></a>
1089
+
1090
+ Expands on the basic usage, covering more advanced features and scenarios.
1091
+
1092
+ ### Intermediate Usage Guide
1093
+
1094
+ In the Intermediate Usage Guide, we'll explore the core components and functionalities of the MediaSFU Angular module, focusing on media display, controls, and modal interactions.
1095
+
1096
+ #### Core Components Overview
1097
+
1098
+ The main items displayed on an event page are media components (such as video, audio, and blank cards) and control components (for pagination, navigation, etc.).
1099
+
1100
+ ##### Media Display Components:
1101
+
1102
+ | Component Name | Description |
1103
+ |--------------------------|-------------------------------------------------------------------------------------------------|
1104
+ | **Main Aspect Component**| Serves as a container for the primary aspect of the user interface, typically containing the main content or focus of the application. |
1105
+ | **Main Screen Component**| Responsible for rendering the main screen layout of the application, providing the foundation for displaying various elements and content. |
1106
+ | **Main Grid Component** | Crucial part of the user interface, organizing and displaying primary content or elements in a grid layout format. |
1107
+ | **Sub Aspect Component** | Acts as a secondary container within the user interface, often housing additional elements or controls related to the main aspect. |
1108
+ | **Main Container Component** | Primary container for the application's content, encapsulating all major components and providing structural organization. |
1109
+ | **Other Grid Component** | Complements the Main Grid Component by offering additional grid layouts, typically used for displaying secondary or auxiliary content. |
1110
+
1111
+ ### Control Components:
1112
+
1113
+ | Component Name | Description |
1114
+ |-------------------------------|-------------------------------------------------------------------------------------------------|
1115
+ | **Control Buttons Component** | Comprises a set of buttons or controls used for navigating, interacting, or managing various aspects of the application's functionality. |
1116
+ | **Control Buttons Alt Component** | Provides alternative button configurations or styles for controlling different aspects of the application. |
1117
+ | **Control Buttons Component Touch** | Specialized component designed for touch-enabled devices, offering floating buttons or controls for intuitive interaction with the application's features. |
1118
+
1119
+ These components collectively contribute to the overall user interface, facilitating navigation, interaction, and content display within the application.
1120
+
1121
+ ##### Modal Components:
1122
+
1123
+ | Modal Component | Description |
1124
+ |-----------------|-------------|
1125
+ | LoadingModal | Modal for displaying loading indicator during data fetching or processing. |
1126
+ | MainAspectComponent | Component responsible for displaying the main aspect of the event page. |
1127
+ | ControlButtonsComponent | Component for displaying control buttons such as pagination controls. |
1128
+ | ControlButtonsAltComponent | Alternate control buttons component for specific use cases. |
1129
+ | ControlButtonsComponentTouch | Touch-enabled control buttons component for mobile devices. |
1130
+ | OthergridComponent | Component for displaying additional grid elements on the event page. |
1131
+ | MainScreenComponent | Component for rendering the main screen content of the event. |
1132
+ | MainGridComponent | Main grid component for displaying primary event content. |
1133
+ | SubAspectComponent | Component for displaying secondary aspects of the event page. |
1134
+ | MainContainerComponent | Main container component for the event page content. |
1135
+ | AlertComponent | Modal for displaying alert messages to the user. |
1136
+ | MenuModal | Modal for displaying a menu with various options. |
1137
+ | RecordingModal | Modal for managing recording functionality during the event. |
1138
+ | RequestsModal | Modal for handling requests from participants during the event. |
1139
+ | WaitingRoomModal | Modal for managing waiting room functionality during the event. |
1140
+ | DisplaySettingsModal | Modal for adjusting display settings during the event. |
1141
+ | EventSettingsModal | Modal for configuring event settings. |
1142
+ | CoHostModal | Modal for managing co-host functionality during the event. |
1143
+ | ParticipantsModal | Modal for displaying participant information and controls. |
1144
+ | MessagesModal | Modal for managing messages and chat functionality during the event. |
1145
+ | MediaSettingsModal | Modal for adjusting media settings during the event. |
1146
+ | ConfirmExitModal | Modal for confirming exit from the event. |
1147
+ | ConfirmHereModal | Modal for confirming certain actions or selections. |
1148
+ | ShareEventModal | Modal for sharing the event with others. |
1149
+ | WelcomePage | Welcome page modal for the event. |
1150
+ | PreJoinPage | Prejoin page modal for the event. |
1151
+ | PollModal | Modal for conducting polls or surveys during the event. |
1152
+ | BreakoutRoomsModal | Modal for managing breakout rooms during the event. |
1153
+ | ConfigureWhiteboardModal | Modal for configuring whiteboard settings during the event. |
1154
+ | BackgroundModal | Modal for managing background settings during the event. |
1155
+ | ScreenboardModal | Modal for managing screen share annotations during the event. |
1156
+
1157
+ #### Modal Interactions
1158
+
1159
+ Each modal has corresponding functions to trigger its usage:
1160
+
1161
+ 1. `launchMenuModal`: Launches the menu modal for settings and configurations.
1162
+ 2. `launchRecording`: Initiates the recording modal for recording functionalities.
1163
+ 3. `startRecording`: Starts the recording process.
1164
+ 4. `confirmRecording`: Confirms and finalizes the recording.
1165
+ 5. `launchWaiting`: Opens the waiting room modal for managing waiting room interactions.
1166
+ 6. `launchCoHost`: Opens the co-host modal for managing co-host functionalities.
1167
+ 7. `launchMediaSettings`: Launches the media settings modal for adjusting media-related configurations.
1168
+ 8. `launchDisplaySettings`: Opens the display settings modal for adjusting display configurations.
1169
+ 9. `launchSettings`: Initiates the settings modal for general event settings and configurations.
1170
+ 10. `launchRequests`: Opens the requests modal for managing user requests.
1171
+ 11. `launchParticipants`: Displays the participants modal for viewing and managing event participants.
1172
+ 12. `launchMessages`: Opens the messages modal for communication through chat messages.
1173
+ 13. `launchConfirmExit`: Prompts users to confirm before exiting the event.
1174
+
1175
+ #### Media Display and Controls
1176
+
1177
+ These components facilitate media display and control functionalities:
1178
+
1179
+ 1. **Pagination**: Handles pagination and page switching.
1180
+ 2. **FlexibleGrid**: Renders flexible grid layouts for media display.
1181
+ 3. **FlexibleVideo**: Displays videos in a flexible manner within the grid.
1182
+ 4. **AudioGrid**: Renders audio components within the grid layout.
1183
+ 5. **Whiteboard**: Manages whiteboard functionalities for collaborative drawing.
1184
+ 6. **Screenboard**: Controls screen share annotations and interactions.
1185
+
1186
+ These components enable seamless media presentation and interaction within the event environment, providing users with a rich and immersive experience.
1187
+
1188
+ | UI Media Component | Description |
1189
+ |--------------|-------------|
1190
+ | MeetingProgressTimer | Component for displaying a timer indicating the progress of a meeting or event. |
1191
+ | MiniAudio | Component for rendering a compact audio player with basic controls. |
1192
+ | MiniCard | Component for displaying a minimized card view with essential information. |
1193
+ | AudioCard | Component for displaying audio content with control elements, details, and audio decibels. |
1194
+ | VideoCard | Component for displaying video content with control elements, details, and audio decibels. |
1195
+ | CardVideoDisplay | Video player component for displaying embedded videos with controls and details. |
1196
+ | MiniCardAudio | Component for rendering a compact card view with audio content and controls. |
1197
+ | MiniAudioPlayer | Utility method for playing audio and rendering a mini audio modal when the user is not actively displayed on the page. |
1198
+
1199
+
1200
+ ---
1201
+ With the Intermediate Usage Guide, users can explore and leverage the core components and functionalities of the MediaSFU Angular module to enhance their event hosting and participation experiences.
1202
+
1203
+ Here's a sample import and usage code for a Broadcast screen:
1204
+
1205
+ ```javascript
1206
+ import {
1207
+ Component,
1208
+ HostListener,
1209
+ Injector,
1210
+ ChangeDetectorRef,
1211
+ Input,
1212
+ OnDestroy,
1213
+ OnInit,
1214
+ } from '@angular/core';
1215
+ import { RouterOutlet } from '@angular/router';
1216
+ import { CommonModule } from '@angular/common';
1217
+ import { CookieService } from 'ngx-cookie-service';
1218
+ import { BehaviorSubject, Subscription, combineLatest } from 'rxjs';
1219
+ import { Socket } from 'socket.io-client';
1220
+ import {
1221
+ faMicrophoneSlash,
1222
+ faVideoSlash,
1223
+ } from '@fortawesome/free-solid-svg-icons';
1224
+
1225
+
1226
+ // Components for display - sample
1227
+ import { MainAspectComponent } from 'mediasfu-angular';
1228
+ import { LoadingModal } from 'mediasfu-angular';
1229
+ import {
1230
+ WelcomePage,
1231
+ WelcomePageOptions,
1232
+ } from 'mediasfu-angular';
1233
+
1234
+ // Import methods for control
1235
+ import { LaunchRecording } from 'mediasfu-angular';
1236
+ import { StartRecording } from 'mediasfu-angular';
1237
+ import { ConfirmRecording } from 'mediasfu-angular';
1238
+ import { LaunchParticipants } from 'mediasfu-angular';
1239
+
1240
+
1241
+ @Component({
1242
+ selector: 'app-mediasfu-broadcast',
1243
+ standalone: true,
1244
+ imports: [
1245
+ RouterOutlet,
1246
+ CommonModule,
1247
+ AlertComponent,
1248
+ AudioGrid,
1249
+ ControlButtonsComponentTouch,
1250
+ FlexibleVideo,
1251
+ LoadingModal,
1252
+ ConfirmExitModal,
1253
+ ],
1254
+ template: `
1255
+ <div
1256
+ class="MediaSFU"
1257
+ [ngStyle]="{
1258
+ height: '100vh',
1259
+ width: '100vw',
1260
+ maxWidth: '100vw',
1261
+ maxHeight: '100vh',
1262
+ overflow: 'hidden'
1263
+ }"
1264
+ >
1265
+ <!-- Conditional Rendering: PrejoinPage or Main Content -->
1266
+ <ng-container *ngIf="!validated.value; else mainContent">
1267
+ <ng-container
1268
+ *ngComponentOutlet="
1269
+ PrejoinPageComponent.component;
1270
+ injector: PrejoinPageComponent.injector
1271
+ "
1272
+ >
1273
+ </ng-container>
1274
+ </ng-container>
1275
+
1276
+ <!-- Main Content -->
1277
+ <ng-template #mainContent>
1278
+ <app-main-container-component>
1279
+ <!-- Main Aspect Component -->
1280
+ <app-main-aspect-component
1281
+ [backgroundColor]="'rgba(217, 227, 234, 0.99)'"
1282
+ [defaultFraction]="1 - controlHeight.value"
1283
+ [showControls]="eventType.value === 'webinar' || eventType.value === 'conference'"
1284
+ [updateIsWideScreen]="updateIsWideScreen"
1285
+ [updateIsMediumScreen]="updateIsMediumScreen"
1286
+ [updateIsSmallScreen]="updateIsSmallScreen"
1287
+ >
1288
+ <!-- Main Screen Component -->
1289
+ <app-main-screen-component
1290
+ [doStack]="true"
1291
+ [mainSize]="mainHeightWidth.value"
1292
+ [defaultFraction]="1 - controlHeight.value"
1293
+ [showControls]="eventType.value === 'webinar' || eventType.value === 'conference'"
1294
+ [updateComponentSizes]="updateComponentSizes"
1295
+ >
1296
+ <!-- Main Grid Component -->
1297
+ <app-main-grid-component
1298
+ [height]="componentSizes.value.mainHeight"
1299
+ [width]="componentSizes.value.mainWidth"
1300
+ [backgroundColor]="'rgba(217, 227, 234, 0.99)'"
1301
+ [mainSize]="mainHeightWidth.value"
1302
+ [showAspect]="mainHeightWidth.value > 0"
1303
+ [timeBackgroundColor]="recordState.value"
1304
+ [meetingProgressTime]="meetingProgressTime.value"
1305
+ >
1306
+ <app-flexible-video
1307
+ [customWidth]="componentSizes.value.mainWidth"
1308
+ [customHeight]="componentSizes.value.mainHeight"
1309
+ [rows]="1"
1310
+ [columns]="1"
1311
+ [componentsToRender]="mainGridStream.value"
1312
+ [showAspect]="
1313
+ mainGridStream.value.length > 0 &&
1314
+ !(whiteboardStarted.value && !whiteboardEnded.value)
1315
+ "
1316
+ >
1317
+ </app-flexible-video>
1318
+
1319
+ <!-- Control Buttons for Broadcast -->
1320
+ <app-control-buttons-component-touch
1321
+ [buttons]="controlBroadcastButtons"
1322
+ [position]="'right'"
1323
+ [location]="'bottom'"
1324
+ [direction]="'vertical'"
1325
+ [showAspect]="eventType.value === 'broadcast'"
1326
+ ></app-control-buttons-component-touch>
1327
+
1328
+ <!-- Recording Buttons -->
1329
+ <app-control-buttons-component-touch
1330
+ [buttons]="recordButton"
1331
+ [direction]="'horizontal'"
1332
+ [showAspect]="
1333
+ eventType.value === 'broadcast' &&
1334
+ !showRecordButtons.value &&
1335
+ islevel.value === '2'
1336
+ "
1337
+ [location]="'bottom'"
1338
+ [position]="'middle'"
1339
+ ></app-control-buttons-component-touch>
1340
+
1341
+ <app-control-buttons-component-touch
1342
+ [buttons]="recordButtons"
1343
+ [direction]="'horizontal'"
1344
+ [showAspect]="
1345
+ eventType.value === 'broadcast' &&
1346
+ showRecordButtons.value &&
1347
+ islevel.value === '2'
1348
+ "
1349
+ [location]="'bottom'"
1350
+ [position]="'middle'"
1351
+ ></app-control-buttons-component-touch>
1352
+
1353
+ <!-- AudioGrid -->
1354
+ <app-audio-grid [componentsToRender]="audioOnlyStreams.value"></app-audio-grid>
1355
+ </app-main-grid-component>
1356
+
1357
+ <!-- Other Grid Component is not included in MediasfuBroadcast -->
1358
+ </app-main-screen-component>
1359
+ </app-main-aspect-component>
1360
+ </app-main-container-component>
1361
+ </ng-template>
1362
+
1363
+ <!-- Modals to include -->
1364
+ <app-participants-modal
1365
+ [backgroundColor]="'rgba(217, 227, 234, 0.99)'"
1366
+ [isParticipantsModalVisible]="isParticipantsModalVisible.value"
1367
+ [onParticipantsClose]="onParticipantsClose"
1368
+ [participantsCounter]="participantsCounter.value"
1369
+ [onParticipantsFilterChange]="onParticipantsFilterChange"
1370
+ [parameters]="{
1371
+ updateParticipants: updateParticipants,
1372
+ updateIsParticipantsModalVisible: updateIsParticipantsModalVisible,
1373
+ updateDirectMessageDetails: updateDirectMessageDetails,
1374
+ updateStartDirectMessage: updateStartDirectMessage,
1375
+ updateIsMessagesModalVisible: updateIsMessagesModalVisible,
1376
+ showAlert: showAlert,
1377
+ filteredParticipants: filteredParticipants.value,
1378
+ participants: filteredParticipants.value,
1379
+ roomName: roomName.value,
1380
+ islevel: islevel.value,
1381
+ member: member.value,
1382
+ coHostResponsibility: coHostResponsibility.value,
1383
+ coHost: coHost.value,
1384
+ eventType: eventType.value,
1385
+ startDirectMessage: startDirectMessage.value,
1386
+ directMessageDetails: directMessageDetails.value,
1387
+ socket: socket.value,
1388
+ getUpdatedAllParams: getUpdatedAllParams,
1389
+ }"
1390
+ ></app-participants-modal>
1391
+
1392
+ <app-recording-modal
1393
+ [backgroundColor]="'rgba(217, 227, 234, 0.99)'"
1394
+ [isRecordingModalVisible]="isRecordingModalVisible.value"
1395
+ [onClose]="onRecordingClose"
1396
+ [startRecording]="startRecording.startRecording"
1397
+ [confirmRecording]="confirmRecording.confirmRecording"
1398
+ [parameters]="mediaSFUParameters"
1399
+ ></app-recording-modal>
1400
+
1401
+ <app-messages-modal
1402
+ [backgroundColor]="
1403
+ eventType.value === 'webinar' || eventType.value === 'conference'
1404
+ ? '#f5f5f5'
1405
+ : 'rgba(255, 255, 255, 0.25)'
1406
+ "
1407
+ [isMessagesModalVisible]="isMessagesModalVisible.value"
1408
+ [onMessagesClose]="onMessagesClose"
1409
+ [messages]="messages.value"
1410
+ [eventType]="eventType.value"
1411
+ [member]="member.value"
1412
+ [islevel]="islevel.value"
1413
+ [coHostResponsibility]="coHostResponsibility.value"
1414
+ [coHost]="coHost.value"
1415
+ [startDirectMessage]="startDirectMessage.value"
1416
+ [directMessageDetails]="directMessageDetails.value"
1417
+ [updateStartDirectMessage]="updateStartDirectMessage"
1418
+ [updateDirectMessageDetails]="updateDirectMessageDetails"
1419
+ [showAlert]="showAlert"
1420
+ [roomName]="roomName.value"
1421
+ [socket]="socket.value"
1422
+ [chatSetting]="chatSetting.value"
1423
+ ></app-messages-modal>
1424
+
1425
+ <app-confirm-exit-modal
1426
+ [backgroundColor]="'rgba(181, 233, 229, 0.97)'"
1427
+ [isConfirmExitModalVisible]="isConfirmExitModalVisible.value"
1428
+ [onConfirmExitClose]="onConfirmExitClose"
1429
+ [position]="'topRight'"
1430
+ [member]="member.value"
1431
+ [roomName]="roomName.value"
1432
+ [socket]="socket.value"
1433
+ [islevel]="islevel.value"
1434
+ ></app-confirm-exit-modal>
1435
+
1436
+ <app-confirm-here-modal
1437
+ [backgroundColor]="'rgba(181, 233, 229, 0.97)'"
1438
+ [isConfirmHereModalVisible]="isConfirmHereModalVisible.value"
1439
+ [onConfirmHereClose]="onConfirmHereClose"
1440
+ [member]="member.value"
1441
+ [roomName]="roomName.value"
1442
+ [socket]="socket.value"
1443
+ ></app-confirm-here-modal>
1444
+
1445
+ <app-share-event-modal
1446
+ [isShareEventModalVisible]="isShareEventModalVisible.value"
1447
+ [onShareEventClose]="onShareEventClose"
1448
+ [roomName]="roomName.value"
1449
+ [islevel]="islevel.value"
1450
+ [adminPasscode]="adminPasscode.value"
1451
+ [eventType]="eventType.value"
1452
+ ></app-share-event-modal>
1453
+
1454
+ <app-alert-component
1455
+ [visible]="alertVisible.value"
1456
+ [message]="alertMessage.value"
1457
+ [type]="alertType.value"
1458
+ [duration]="alertDuration.value"
1459
+ [onHide]="onAlertHide"
1460
+ textColor="#ffffff"
1461
+ ></app-alert-component>
1462
+
1463
+ <app-loading-modal
1464
+ [isVisible]="isLoadingModalVisible.value"
1465
+ [backgroundColor]="'rgba(217, 227, 234, 0.99)'"
1466
+ displayColor="black"
1467
+ ></app-loading-modal>
1468
+ </div>
1469
+ `,
1470
+ styles: [
1471
+ `
1472
+ .MediaSFU {
1473
+ /* Add any component-specific styles here */
1474
+ }
1475
+ `,
1476
+ ],
1477
+ providers: [CookieService],
1478
+ })
1479
+ export class MediasfuBroadcast implements OnInit, OnDestroy {
1480
+ @Input()
1481
+ PrejoinPage: any = WelcomePage;
1482
+ @Input() credentials: { apiUserName: string; apiKey: string } = { apiUserName: '', apiKey: '' };
1483
+ @Input() useLocalUIMode = false;
1484
+ @Input() seedData?: SeedData;
1485
+ @Input() useSeed = false;
1486
+ @Input() imgSrc = 'https://mediasfu.com/images/logo192.png';
1487
+
1488
+ title = 'MediaSFU-Broadcast';
1489
+
1490
+
1491
+ constructor(
1492
+ private cdr: ChangeDetectorRef,
1493
+ private injector: Injector,
1494
+
1495
+ public launchRecording: LaunchRecording,
1496
+ public startRecording: StartRecording,
1497
+ public confirmRecording: ConfirmRecording,
1498
+ public launchParticipants: LaunchParticipants,
1499
+
1500
+ ) {}
1501
+
1502
+
1503
+ // Initial values and constants
1504
+ validated = new BehaviorSubject<boolean>(false);
1505
+ localUIMode = new BehaviorSubject<boolean>(false);
1506
+ socket = new BehaviorSubject<Socket>({} as Socket);
1507
+ roomName = new BehaviorSubject<string>('');
1508
+
1509
+
1510
+ // Sample component sizes
1511
+ componentSizes = new BehaviorSubject<ComponentSizes>({
1512
+ mainHeight: 0,
1513
+ otherHeight: 0,
1514
+ mainWidth: 0,
1515
+ otherWidth: 0,
1516
+ });
1517
+
1518
+
1519
+ // Sample function to update component sizes
1520
+ updateComponentSizes = (sizes: ComponentSizes) => {
1521
+ this.componentSizes.next(sizes);
1522
+ };
1523
+
1524
+ }
1525
+
1526
+ ```
1527
+
1528
+ This sample code demonstrates the import and usage of various components and features for a Broadcast screen, including rendering different UI components based on the validation state, handling socket connections, displaying video streams, controlling recording, and managing component sizes.
1529
+
1530
+ Here's a sample usage of the control button components as used above:
1531
+
1532
+ ```jsx
1533
+ recordButton = [
1534
+ {
1535
+ icon: this.faRecordVinyl,
1536
+ text: 'Record',
1537
+ onPress: () => {
1538
+ this.launchRecording.launchRecording({
1539
+ updateIsRecordingModalVisible: this.updateIsRecordingModalVisible.bind(this),
1540
+ isRecordingModalVisible: this.isRecordingModalVisible.value,
1541
+ showAlert: this.showAlert.bind(this),
1542
+ stopLaunchRecord: this.stopLaunchRecord.value,
1543
+ canLaunchRecord: this.canLaunchRecord.value,
1544
+ recordingAudioSupport: this.recordingAudioSupport.value,
1545
+ recordingVideoSupport: this.recordingVideoSupport.value,
1546
+ updateCanRecord: this.updateCanRecord.bind(this),
1547
+ updateClearedToRecord: this.updateClearedToRecord.bind(this),
1548
+ recordStarted: this.recordStarted.value,
1549
+ recordPaused: this.recordPaused.value,
1550
+ localUIMode: this.localUIMode.value,
1551
+ });
1552
+ },
1553
+ activeColor: 'black',
1554
+ inActiveColor: 'black',
1555
+ show: true,
1556
+ },
1557
+ ];
1558
+
1559
+ recordButtons: MainButtonAlt[] = [];
1560
+
1561
+ recordButtonsArray: MainButtonAlt[] = [
1562
+ {
1563
+ icon: this.faPlayCircle,
1564
+ active: () => !this.recordPaused.value,
1565
+ onPress: () =>
1566
+ this.updateRecording.updateRecording({
1567
+ parameters: { ...this.getAllParams(), ...this.mediaSFUFunctions() },
1568
+ }),
1569
+ activeColor: 'black',
1570
+ inActiveColor: 'black',
1571
+ alternateIcon: this.faPauseCircle,
1572
+ show: () => true,
1573
+ },
1574
+ {
1575
+ icon: this.faStopCircle,
1576
+ active: () => false,
1577
+ onPress: () =>
1578
+ this.stopRecording.stopRecording({
1579
+ parameters: { ...this.getAllParams(), ...this.mediaSFUFunctions() },
1580
+ }),
1581
+ activeColor: 'green',
1582
+ inActiveColor: 'black',
1583
+ show: () => true,
1584
+ },
1585
+ {
1586
+ customComponent: () => this.updateRecordTimerWidget(),
1587
+ show: () => true,
1588
+ active: () => false,
1589
+ },
1590
+ {
1591
+ icon: this.faDotCircle,
1592
+ active: () => false,
1593
+ onPress: () => console.log('Status pressed'),
1594
+ activeColor: 'black',
1595
+ inActiveColor: () => (this.recordPaused.value ? 'yellow' : 'red'),
1596
+ show: () => true,
1597
+ },
1598
+ {
1599
+ icon: this.faCog,
1600
+ active: () => false,
1601
+ onPress: () =>
1602
+ this.launchRecording.launchRecording({
1603
+ updateIsRecordingModalVisible: this.updateIsRecordingModalVisible.bind(this),
1604
+ isRecordingModalVisible: this.isRecordingModalVisible.value,
1605
+ showAlert: this.showAlert.bind(this),
1606
+ stopLaunchRecord: this.stopLaunchRecord.value,
1607
+ canLaunchRecord: this.canLaunchRecord.value,
1608
+ recordingAudioSupport: this.recordingAudioSupport.value,
1609
+ recordingVideoSupport: this.recordingVideoSupport.value,
1610
+ updateCanRecord: this.updateCanRecord.bind(this),
1611
+ updateClearedToRecord: this.updateClearedToRecord.bind(this),
1612
+ recordStarted: this.recordStarted.value,
1613
+ recordPaused: this.recordPaused.value,
1614
+ localUIMode: this.localUIMode.value,
1615
+ }),
1616
+ activeColor: 'green',
1617
+ inActiveColor: 'black',
1618
+ show: () => true,
1619
+ },
1620
+ ];
1621
+
1622
+ controlBroadcastButtonsArray: ButtonTouch[] = [
1623
+ {
1624
+ icon: this.faUsers,
1625
+ active: true,
1626
+ alternateIcon: this.faUsers,
1627
+ onPress: () =>
1628
+ this.launchParticipants.launchParticipants({
1629
+ updateIsParticipantsModalVisible: this.updateIsParticipantsModalVisible.bind(this),
1630
+ isParticipantsModalVisible: this.isParticipantsModalVisible.value,
1631
+ }),
1632
+ activeColor: 'black',
1633
+ inActiveColor: 'black',
1634
+ show: () => this.islevel.value == '2',
1635
+ },
1636
+ {
1637
+ icon: this.faShareAlt,
1638
+ active: true,
1639
+ alternateIcon: this.faShareAlt,
1640
+ onPress: () => this.updateIsShareEventModalVisible(!this.isShareEventModalVisible.value),
1641
+ activeColor: 'black',
1642
+ inActiveColor: 'black',
1643
+ show: () => true,
1644
+ },
1645
+ {
1646
+ customComponent: this.messageWidget,
1647
+ onPress: () =>
1648
+ this.launchMessages.launchMessages({
1649
+ updateIsMessagesModalVisible: this.updateIsMessagesModalVisible.bind(this),
1650
+ isMessagesModalVisible: this.isMessagesModalVisible.value,
1651
+ }),
1652
+ show: () => true,
1653
+ },
1654
+ {
1655
+ icon: this.faSync,
1656
+ active: true,
1657
+ alternateIcon: this.faSync,
1658
+ onPress: () =>
1659
+ this.switchVideoAlt.switchVideoAlt({
1660
+ parameters: {
1661
+ ...this.getAllParams(),
1662
+ ...this.mediaSFUFunctions(),
1663
+ },
1664
+ }),
1665
+ activeColor: 'black',
1666
+ inActiveColor: 'black',
1667
+ show: () => this.islevel.value == '2',
1668
+ },
1669
+ {
1670
+ icon: this.faVideoSlash,
1671
+ alternateIcon: this.faVideo,
1672
+ active: () => this.videoActive.value,
1673
+ onPress: () =>
1674
+ this.clickVideo.clickVideo({
1675
+ parameters: {
1676
+ ...this.getAllParams(),
1677
+ ...this.mediaSFUFunctions(),
1678
+ },
1679
+ }),
1680
+ show: () => this.islevel.value == '2',
1681
+ activeColor: 'green',
1682
+ inActiveColor: 'red',
1683
+ },
1684
+ {
1685
+ icon: this.faMicrophoneSlash,
1686
+ alternateIcon: this.faMicrophone,
1687
+ active: () => this.micActive.value,
1688
+ onPress: () =>
1689
+ this.clickAudio.clickAudio({
1690
+ parameters: {
1691
+ ...this.getAllParams(),
1692
+ ...this.mediaSFUFunctions(),
1693
+ },
1694
+ }),
1695
+ activeColor: 'green',
1696
+ inActiveColor: 'red',
1697
+ show: () => this.islevel.value == '2',
1698
+ },
1699
+ {
1700
+ customComponent: () => this.menuParticipantsWidget,
1701
+ show: () => this.islevel.value == '2',
1702
+ },
1703
+ {
1704
+ icon: this.faPhone,
1705
+ active: this.endCallActive.value,
1706
+ onPress: () =>
1707
+ this.launchConfirmExit.launchConfirmExit({
1708
+ updateIsConfirmExitModalVisible: this.updateIsConfirmExitModalVisible.bind(this),
1709
+ isConfirmExitModalVisible: this.isConfirmExitModalVisible.value,
1710
+ }),
1711
+ activeColor: 'green',
1712
+ inActiveColor: 'red',
1713
+ show: () => true,
1714
+ },
1715
+ {
1716
+ icon: this.faPhone,
1717
+ active: this.endCallActive.value,
1718
+ onPress: () => console.log('End Call pressed'),
1719
+ activeColor: 'transparent',
1720
+ inActiveColor: 'transparent',
1721
+ backgroundColor: { default: 'transparent' },
1722
+ show: () => false,
1723
+ },
1724
+ ];
1725
+ ```
1726
+
1727
+ This sample code defines arrays `recordButtons` and `controlBroadcastButtons`, each containing configuration objects for different control buttons. These configurations include properties such as icon, active state, onPress function, activeColor, inActiveColor, and show flag to control the visibility of each button.
1728
+
1729
+ You can customize these configurations according to your requirements, adding, removing, or modifying buttons as needed. Additionally, you can refer to the relevant component files (`ControlButtonsAltComponent` and `ControlButtonsComponentTouch`) for more details on how to add custom buttons.
1730
+
1731
+ <div style="text-align: center;">
1732
+ Preview of Broadcast Page
1733
+
1734
+ <img src="https://mediasfu.com/images/broadcast.png" alt="Preview of Welcome Page" title="Welcome Page" style="max-height: 500px;">
1735
+
1736
+ <!-- Add a blank line for spacing -->
1737
+ &nbsp;
1738
+
1739
+ Preview of Conference Page
1740
+
1741
+ <img src="https://mediasfu.com/images/conference1.png" alt="Preview of Prejoin Page" title="Prejoin Page" style="max-height: 500px;">
1742
+
1743
+
1744
+ ### Preview of Conference Page's Mini Grids
1745
+
1746
+ <img src="https://mediasfu.com/images/conference2.png" alt="Preview of Prejoin Page" title="Prejoin Page" style="max-height: 500px;">
1747
+
1748
+ </div>
1749
+ <br />
1750
+
1751
+
1752
+ # Advanced Usage Guide <a name="advanced-usage-guide"></a>
1753
+
1754
+ In-depth documentation for advanced users, covering complex functionalities and customization options.
1755
+
1756
+ **Introduction to Advanced Media Control Functions:**
1757
+
1758
+ In advanced usage scenarios, users often encounter complex tasks related to media control, connectivity, and streaming management within their applications. To facilitate these tasks, a comprehensive set of functions is provided, offering granular control over various aspects of media handling and communication with servers.
1759
+
1760
+ These advanced media control functions encompass a wide range of functionalities, including connecting to and disconnecting from WebSocket servers, joining and updating room parameters, managing device creation, switching between different media streams, handling permissions, processing consumer transports, managing screen sharing, adjusting layouts dynamically, and much more.
1761
+
1762
+ This robust collection of functions empowers developers to tailor their applications to specific requirements, whether it involves intricate media streaming setups, real-time communication protocols, or sophisticated user interface interactions. With these tools at their disposal, developers can create rich and responsive media experiences that meet the demands of their users and applications.
1763
+
1764
+ Here's a tabulated list of advanced control functions along with brief explanations:
1765
+
1766
+ | Function | Explanation |
1767
+ |----------------------------------|---------------------------------------------------------------------------------------------------------|
1768
+ | `connectSocket` | Connects to the WebSocket server. |
1769
+ | `disconnectSocket` | Disconnects from the WebSocket server. |
1770
+ | `joinRoomClient` | Joins a room as a client. |
1771
+ | `updateRoomParametersClient` | Updates room parameters as a client. |
1772
+ | `createDeviceClient` | Creates a device as a client. |
1773
+ | `switchVideoAlt` | Switches video/camera streams. |
1774
+ | `clickVideo` | Handles clicking on video controls. |
1775
+ | `clickAudio` | Handles clicking on audio controls. |
1776
+ | `clickScreenShare` | Handles clicking on screen share controls. |
1777
+ | `streamSuccessVideo` | Handles successful video streaming. |
1778
+ | `streamSuccessAudio` | Handles successful audio streaming. |
1779
+ | `streamSuccessScreen` | Handles successful screen sharing. |
1780
+ | `streamSuccessAudioSwitch` | Handles successful audio switching. |
1781
+ | `checkPermission` | Checks for media access permissions. |
1782
+ | `producerClosed` | Handles the closure of a producer. |
1783
+ | `newPipeProducer` | Creates receive transport for a new piped producer. |
1784
+ | `updateMiniCardsGrid` | Updates the mini-grids (mini cards) grid. |
1785
+ | `mixStreams` | Mixes streams and prioritizes interesting ones together. |
1786
+ | `dispStreams` | Displays streams (media). |
1787
+ | `stopShareScreen` | Stops screen sharing. |
1788
+ | `checkScreenShare` | Checks for screen sharing availability. |
1789
+ | `startShareScreen` | Starts screen sharing. |
1790
+ | `requestScreenShare` | Requests permission for screen sharing. |
1791
+ | `reorderStreams` | Reorders streams (based on interest level). |
1792
+ | `prepopulateUserMedia` | Populates user media (for main grid). |
1793
+ | `getVideos` | Retrieves videos that are pending. |
1794
+ | `rePort` | Handles re-porting (updates of changes in UI when recording). |
1795
+ | `trigger` | Triggers actions (reports changes in UI to backend for recording). |
1796
+ | `consumerResume` | Resumes consumers. |
1797
+ | `connectSendTransportAudio` | Connects send transport for audio. |
1798
+ | `connectSendTransportVideo` | Connects send transport for video. |
1799
+ | `connectSendTransportScreen` | Connects send transport for screen sharing. |
1800
+ | `processConsumerTransports` | Processes consumer transports to pause/resume based on the current active page. |
1801
+ | `resumePauseStreams` | Resumes or pauses streams. |
1802
+ | `readjust` | Readjusts display elements. |
1803
+ | `checkGrid` | Checks the grid sizes to display. |
1804
+ | `getEstimate` | Gets an estimate of grids to add. |
1805
+ | `calculateRowsAndColumns` | Calculates rows and columns for the grid. |
1806
+ | `addVideosGrid` | Adds videos to the grid. |
1807
+ | `onScreenChanges` | Handles screen changes (orientation and resize). |
1808
+ | `sleep` | Pauses execution for a specified duration. |
1809
+ | `changeVids` | Changes videos. |
1810
+ | `compareActiveNames` | Compares active names (for recording UI changes reporting). |
1811
+ | `compareScreenStates` | Compares screen states (for recording changes in grid sizes reporting). |
1812
+ | `createSendTransport` | Creates a send transport. |
1813
+ | `resumeSendTransportAudio` | Resumes a send transport for audio. |
1814
+ | `receiveAllPipedTransports` | Receives all piped transports. |
1815
+ | `disconnectSendTransportVideo` | Disconnects send transport for video. |
1816
+ | `disconnectSendTransportAudio` | Disconnects send transport for audio. |
1817
+ | `disconnectSendTransportScreen` | Disconnects send transport for screen sharing. |
1818
+ | `connectSendTransport` | Connects a send transport. |
1819
+ | `getPipedProducersAlt` | Gets piped producers. |
1820
+ | `signalNewConsumerTransport` | Signals a new consumer transport. |
1821
+ | `connectRecvTransport` | Connects a receive transport. |
1822
+ | `reUpdateInter` | Re-updates the interface based on audio decibels. |
1823
+ | `updateParticipantAudioDecibels` | Updates participant audio decibels. |
1824
+ | `closeAndResize` | Closes and resizes the media elements. |
1825
+ | `autoAdjust` | Automatically adjusts display elements. |
1826
+ | `switchUserVideoAlt` | Switches user video (alternate) (back/front). |
1827
+ | `switchUserVideo` | Switches user video (specific video id). |
1828
+ | `switchUserAudio` | Switches user audio. |
1829
+ | `receiveRoomMessages` | Receives room messages. |
1830
+ | `formatNumber` | Formats a number (for broadcast viewers). |
1831
+ | `connectIps` | Connects IPs (connect to consuming servers)
1832
+ | `startMeetingProgressTimer` | Starts the meeting progress timer. |
1833
+ | `stopRecording` | Stops the recording process. |
1834
+ | `pollUpdated` | Handles updated poll data. |
1835
+ | `handleVotePoll` | Handles voting in a poll. |
1836
+ | `handleCreatePoll` | Handles creating a poll. |
1837
+ | `handleEndPoll` | Handles ending a poll. |
1838
+ | `breakoutRoomUpdated` | Handles updated breakout room data. |
1839
+ | `captureCanvasStream` | Captures a canvas stream. |
1840
+ | `resumePauseAudioStreams` | Resumes or pauses audio streams. |
1841
+ |`processConsumerTransportsAudio` | Processes consumer transports for audio. |
1842
+
1843
+ ### Room Socket Events
1844
+
1845
+ In the context of a room's real-time communication, various events occur, such as user actions, room management updates, media controls, and meeting status changes. To effectively handle these events and synchronize the application's state with the server, specific functions are provided. These functions act as listeners for socket events, allowing the application to react accordingly.
1846
+
1847
+ #### Provided Socket Event Handling Functions:
1848
+
1849
+ | Function | Explanation |
1850
+ |-------------------------------|---------------------------------------------------------------------------------------------------------|
1851
+ | `userWaiting` | Triggered when a user is waiting. |
1852
+ | `personJoined` | Triggered when a person joins the room. |
1853
+ | `allWaitingRoomMembers` | Triggered when information about all waiting room members is received. |
1854
+ | `roomRecordParams` | Triggered when room recording parameters are received. |
1855
+ | `banParticipant` | Triggered when a participant is banned. |
1856
+ | `updatedCoHost` | Triggered when the co-host information is updated. |
1857
+ | `participantRequested` | Triggered when a participant requests access. |
1858
+ | `screenProducerId` | Triggered when the screen producer ID is received. |
1859
+ | `updateMediaSettings` | Triggered when media settings are updated. |
1860
+ | `producerMediaPaused` | Triggered when producer media is paused. |
1861
+ | `producerMediaResumed` | Triggered when producer media is resumed. |
1862
+ | `producerMediaClosed` | Triggered when producer media is closed. |
1863
+ | `controlMediaHost` | Triggered when media control is hosted. |
1864
+ | `meetingEnded` | Triggered when the meeting ends. |
1865
+ | `disconnectUserSelf` | Triggered when a user disconnects. |
1866
+ | `receiveMessage` | Triggered when a message is received. |
1867
+ | `meetingTimeRemaining` | Triggered when meeting time remaining is received. |
1868
+ | `meetingStillThere` | Triggered when the meeting is still active. |
1869
+ | `startRecords` | Triggered when recording starts. |
1870
+ | `reInitiateRecording` | Triggered when recording needs to be re-initiated. |
1871
+ | `getDomains` | Triggered when domains are received. |
1872
+ | `updateConsumingDomains` | Triggered when consuming domains are updated. |
1873
+ | `recordingNotice` | Triggered when a recording notice is received. |
1874
+ | `timeLeftRecording` | Triggered when time left for recording is received. |
1875
+ | `stoppedRecording` | Triggered when recording stops. |
1876
+ | `hostRequestResponse` | Triggered when the host request response is received. |
1877
+ | `allMembers` | Triggered when information about all members is received. |
1878
+ | `allMembersRest` | Triggered when information about all members is received (rest of the members). |
1879
+ | `disconnect` | Triggered when a disconnect event occurs. |
1880
+ | `pollUpdated` | Triggered when a poll is updated. |
1881
+ | `breakoutRoomUpdated` | Triggered when a breakout room is updated.
1882
+ | `whiteboardUpdated` | Handles updated whiteboard data.
1883
+ | `whiteboardAction` | Handles whiteboard actions. | |
1884
+
1885
+ #### Sample Usage:
1886
+
1887
+ ```javascript
1888
+ // Example usage of provided socket event handling functions
1889
+
1890
+ // your-component.component.ts
1891
+ import { Component, OnInit } from '@angular/core';
1892
+ import {
1893
+ ParticipantRequested,
1894
+ ScreenProducerId,
1895
+ UpdateMediaSettings
1896
+ } from 'mediasfu-angular';
1897
+
1898
+ @Component({
1899
+ selector: 'app-your-component',
1900
+ standalone: true,
1901
+ imports: [
1902
+ // Import necessary MediasfuAngular components if any
1903
+ ],
1904
+ template: `
1905
+ <!-- Your component template goes here -->
1906
+ `,
1907
+ providers: [
1908
+ ParticipantRequested,
1909
+ ScreenProducerId,
1910
+ UpdateMediaSettings,
1911
+ // Add other providers as needed
1912
+ ],
1913
+ })
1914
+
1915
+ export class YourComponent implements OnInit {
1916
+ // Inject MediasfuAngular services as public properties
1917
+ constructor(
1918
+ public participantRequested: ParticipantRequested,
1919
+ public screenProducerId: ScreenProducerId,
1920
+ public updateMediaSettings: UpdateMediaSettings,
1921
+ // Inject other services if necessary
1922
+ ) {}
1923
+
1924
+
1925
+ // truncated and simplified for brevity
1926
+
1927
+ this.socket.value.on(
1928
+ 'participantRequested',
1929
+ async ({ userRequest }: { userRequest: Request }) => {
1930
+ await this.participantRequested.participantRequested({
1931
+ userRequest,
1932
+ requestList: this.requestList.value,
1933
+ waitingRoomList: this.waitingRoomList.value,
1934
+ updateTotalReqWait: this.updateTotalReqWait.bind(this),
1935
+ updateRequestList: this.updateRequestList.bind(this),
1936
+ });
1937
+ },
1938
+ );
1939
+
1940
+ this.socket.value.on('screenProducerId', async ({ producerId }: { producerId: string }) => {
1941
+ this.screenProducerId.screenProducerId({
1942
+ producerId,
1943
+ screenId: this.screenId.value,
1944
+ membersReceived: this.membersReceived.value,
1945
+ shareScreenStarted: this.shareScreenStarted.value,
1946
+ deferScreenReceived: this.deferScreenReceived.value,
1947
+ participants: this.participants.value,
1948
+ updateScreenId: this.updateScreenId.bind(this),
1949
+ updateShareScreenStarted: this.updateShareScreenStarted.bind(this),
1950
+ updateDeferScreenReceived: this.updateDeferScreenReceived.bind(this),
1951
+ });
1952
+ });
1953
+
1954
+
1955
+ this.socket.value.on('updateMediaSettings', async ({ settings }: { settings: Settings }) => {
1956
+ this.updateMediaSettings.updateMediaSettings({
1957
+ settings,
1958
+ updateAudioSetting: this.updateAudioSetting.bind(this),
1959
+ updateVideoSetting: this.updateVideoSetting.bind(this),
1960
+ updateScreenshareSetting: this.updateScreenshareSetting.bind(this),
1961
+ updateChatSetting: this.updateChatSetting.bind(this),
1962
+ });
1963
+ });
1964
+
1965
+ }
1966
+ ```
1967
+
1968
+ These functions enable seamless interaction with the server and ensure that the application stays synchronized with the real-time events occurring within the room.
1969
+
1970
+ ### Customizing Media Display in MediaSFU
1971
+
1972
+ By default, media display in MediaSFU is handled by the following key functions:
1973
+
1974
+ - **`prepopulateUserMedia`**: This function controls the main media grid, such as the host's video in webinar or broadcast views (MainGrid).
1975
+ - **`addVideosGrid`**: This function manages the mini grid's media, such as participants' media in MiniGrid views (MiniCards, AudioCards, VideoCards).
1976
+
1977
+ #### Customizing the Media Display
1978
+
1979
+ If you want to modify the default content displayed by MediaSFU components, such as the `MiniCard`, `AudioCard`, or `VideoCard`, you can replace the default UI with your own custom components.
1980
+
1981
+ To implement your custom UI for media display:
1982
+
1983
+ 1. **Custom MainGrid (Host's Video)**:
1984
+ - Modify the UI in the `prepopulateUserMedia` function.
1985
+ - Example link to MediaSFU's default implementation: [`prepopulateUserMedia`](https://github.com/MediaSFU/MediaSFU-Angular/tree/main/src/lib/consumers/prepopulate-user-media.service.ts).
1986
+
1987
+ 2. **Custom MiniGrid (Participants' Media)**:
1988
+ - Modify the UI in the `addVideosGrid` function.
1989
+ - Example link to MediaSFU's default implementation: [`addVideosGrid`](https://github.com/MediaSFU/MediaSFU-Angular/tree/main/src/lib/consumers/add-videos-grid.service.ts).
1990
+
1991
+ To create a custom UI, you can refer to existing MediaSFU implementations like:
1992
+
1993
+ - [MediasfuGeneric](https://github.com/MediaSFU/MediaSFU-Angular/tree/main/src/lib/components/mediasfu-components/mediasfu-generic.component.ts)
1994
+ - [MediasfuBroadcast](https://github.com/MediaSFU/MediaSFU-Angular/tree/main/src/lib/components/mediasfu-components/mediasfu-broadcast.component.ts)
1995
+
1996
+ Once your custom components are built, modify the imports of `prepopulateUserMedia` and `addVideosGrid` to point to your custom implementations instead of the default MediaSFU ones.
1997
+
1998
+ This allows for full flexibility in how media is displayed in both the main and mini grids, giving you the ability to tailor the user experience to your specific needs.
1999
+
2000
+
2001
+ # API Reference <a name="api-reference"></a>
2002
+
2003
+ For detailed information on the API methods and usage, please refer to the [MediaSFU API Documentation](https://mediasfu.com/developers).
2004
+
2005
+ If you need further assistance or have any questions, feel free to ask!
2006
+
2007
+ For sample codes and practical implementations, visit the [MediaSFU Sandbox](https://www.mediasfu.com/sandbox).
2008
+
2009
+ # Troubleshooting <a name="troubleshooting"></a>
2010
+
2011
+ 1. **Optimizing HTML Configuration**:
2012
+ If users experience responsiveness issues, whether during local development or in production, they can optimize their HTML configuration to ensure proper scaling and viewport settings. By adding the following meta tag to the HTML `<head>` section, users can specify viewport settings for optimal display:
2013
+ ```html
2014
+ <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
2015
+ ```
2016
+
2017
+ 2. **Issues with Starting User Media (Audio/Video)**:
2018
+ If users encounter issues with starting user media (audio/video), they should try running in HTTPS mode. To enable HTTPS mode, users can modify their start script using:
2019
+ ```json
2020
+ ng serve --ssl true
2021
+ ```
2022
+
2023
+ 3. **Handling Overflow in Prebuilt Components**:
2024
+ If users experience overflow issues when using any of the prebuilt MediaSFU components such as app-mediasfu-generic, app-mediasfu-broadcast, app-mediasfu-chat, etc., they can add a CSS rule in their main styles.css file to manage component dimensions and overflow behavior. For example, to handle overflow in the generic component, users can add:
2025
+
2026
+ ```css
2027
+ app-mediasfu-generic {
2028
+ flex: 1;
2029
+ width: 100%;
2030
+ max-width: 100%;
2031
+ overflow: auto;
2032
+ }
2033
+
2034
+ app-mediasfu-chat {
2035
+ flex: 1;
2036
+ width: 100%;
2037
+ max-width: 100%;
2038
+ overflow: auto;
2039
+ }
2040
+
2041
+ // same for rest
2042
+ ```
2043
+
2044
+
2045
+ 4. **Interactive Testing with MediaSFU's Frontend**:
2046
+ Users can interactively join MediaSFU's frontend in the same room to analyze if various events or media transmissions are happening as expected. For example, adding a user there to check changes made by the host and vice versa.
2047
+
2048
+ These troubleshooting steps should help users address common issues and optimize their experience with MediaSFU. If the issues persist or additional assistance is needed, users can refer to the [documentation](https://mediasfu.com/docs) or reach out to the support team for further assistance.
2049
+
2050
+ <div style="text-align: center;">
2051
+
2052
+ https://github.com/MediaSFU/MediaSFU-ReactJS/assets/157974639/a6396722-5b2f-4e93-a5b3-dd53ffd20eb7
2053
+
2054
+ </div>
2055
+
2056
+ # Contributing <a name="contributing"></a>
2057
+
2058
+ We welcome contributions from the community to improve the project! If you'd like to contribute, please check out our [GitHub repository](https://github.com/MediaSFU-Angular) and follow the guidelines outlined in the README.
2059
+
2060
+ If you encounter any issues or have suggestions for improvement, please feel free to open an issue on GitHub.
2061
+
2062
+ We appreciate your interest in contributing to the project!
2063
+
2064
+ If you need further assistance or have any questions, feel free to ask!
2065
+ ```
2066
+
2067
+
2068
+