libjitsimeet.pp 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549
  1. {
  2. This file is part of the Pas2JS run time library.
  3. Copyright (c) 2020 by the Pas2JS development team.
  4. This unit defines Jitsi external meet API
  5. (not to be confused with internal APIs)
  6. See the file COPYING.FPC, included in this distribution,
  7. for details about the copyright.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  11. **********************************************************************}
  12. {$mode objfpc}
  13. {$modeswitch externalclass}
  14. unit libjitsimeet;
  15. interface
  16. uses
  17. JS, web;
  18. Const
  19. // Event names
  20. EventAudioAvailabilityChanged = 'audioAvailabilityChanged';
  21. EventAudioMuteStatusChanged = 'audioMuteStatusChanged';
  22. EventAvatarChanged = 'avatarChanged';
  23. EventCameraError = 'cameraError';
  24. EventDeviceListChanged = 'deviceListChanged';
  25. EventDisplayNameChange = 'displayNameChange';
  26. EventdominantSpeakerChanged = 'dominantSpeakerChanged';
  27. EventEmailChange = 'emailChange';
  28. EventEndpointTextMessageReceived = 'endpointTextMessageReceived';
  29. EventFeedbackSubmitted = 'feedbackSubmitted';
  30. EventFilmstripDisplayChanged = 'filmstripDisplayChanged';
  31. EventIncomingMessage = 'incomingMessage';
  32. EventMicError = 'micError';
  33. EventOutgoingMessage = 'outgoingMessage';
  34. EventParticipantJoined = 'participantJoined';
  35. EventParticipantKickedOut = 'participantKickedOut';
  36. EventParticipantLeft = 'participantLeft';
  37. EventPasswordRequired = 'passwordRequired';
  38. EventReadyToClose = 'readyToClose';
  39. EventScreenSharingStatusChanged = 'screenSharingStatusChanged';
  40. EventSubjectChange = 'subjectChange';
  41. EventSuspendDetected = 'suspendDetected';
  42. EventTileViewChanged = 'tileViewChanged';
  43. EventVideoAvailabilityChanged = 'videoAvailabilityChanged';
  44. EventVideoConferenceJoined = 'videoConferenceJoined';
  45. EventVideoConferenceLeft = 'videoConferenceLeft';
  46. EventVideoMuteStatusChanged = 'videoMuteStatusChanged';
  47. // Command names. You can use the class helper instead.
  48. CommandAvatarURL = 'avatarURL';
  49. CommandDisplayName = 'displayName';
  50. CommandEmail = 'email';
  51. CommandHangup = 'hangup';
  52. CommandPassword = 'password';
  53. CommandSendEndPointTextMessage = 'sendEndpointTextMessage';
  54. CommandSendTones = 'sendTones';
  55. CommandSubject = 'subject';
  56. CommandToggleAudio = 'toggleAudio';
  57. CommandToggleChat = 'toggleChat';
  58. CommandToggleFilmStrip = 'toggleFilmStrip';
  59. CommandToggleTileView = 'toggleTileView';
  60. CommandToggleVideo = 'toggleVideo';
  61. CommandToggleShareScreen = 'toggleShareScreen';
  62. // UI elements
  63. UIMicrophone = 'microphone';
  64. UICamera = 'camera';
  65. UIClosedCaptions = 'closedcaptions';
  66. UIDesktop = 'desktop';
  67. UIFullScreen = 'fullscreen';
  68. UIFODeviceSelection = 'fodeviceselection';
  69. UIHangup = 'hangup';
  70. UIChat = 'chat';
  71. UIRecording = 'recording';
  72. UILiveStreaming = 'livestreaming';
  73. UIEtherPad = 'etherpad';
  74. UISharedVideo = 'sharedvideo';
  75. UISettings = 'settings';
  76. UIVideoQuality = 'videoquality';
  77. UIFilmStrip = 'filmstrip';
  78. UIFeedBack = 'feedback';
  79. UIStats = 'stats';
  80. UIShortCuts = 'shortcuts';
  81. UITileView = 'tileview';
  82. UIVideoBackgroundBlur = 'videobackgroundblur';
  83. UIDownload = 'download';
  84. UIHelp = 'help';
  85. UIMuteEveryone = 'mute-everyone';
  86. UIProfile = 'profile';
  87. UIInfo = 'info';
  88. UIRaiseHand = 'raisehand';
  89. UIInvite = 'invite';
  90. UISettingDevices = 'devices';
  91. UISettingLanguage = 'language';
  92. UISettingModerator = 'moderator';
  93. UISettingProfile = 'profile';
  94. UISettingCalendar = 'calendar';
  95. Type
  96. // Not documented or possible to define statically :(
  97. TJMCommands = TJSObject;
  98. TJMInvite = TJSObject;
  99. TJMInviteDynArray = Array of TJMInvite;
  100. TJMEventHandler = reference to Procedure(Arg : JSValue);
  101. TJMInvitee = class external name 'Object' (TJSObject);
  102. TJMInviteeDynArray = array of TJMInvitee;
  103. TJMUIElement = (uieMicrophone, uieCamera, uieClosedCaptions, uieDesktop,
  104. uieFullScreen, uieFODeviceSelection, uieHangup, uieChat, uieRecording,
  105. uieLiveStreaming, uieEtherPad, uieSharedVideo, uieSettings, uieVideoQuality,
  106. uieFilmStrip, uieFeedBack, uieStats, uieShortCuts, uieTileView,
  107. uieVideoBackgroundBlur, uieDownload, uieHelp, uieMuteEveryone,
  108. uieProfile, uieInfo, uieRaiseHand, uieInvite);
  109. TJMUIElements = set of TJMUIElement;
  110. TJMUISetting = (usDevices, usLanguage, usModerator, usProfile, usCalendar);
  111. TJMUISettings = set of TJMUISetting;
  112. { TJMDevices }
  113. TJMDevices = class external name 'Object' (TJSObject)
  114. private
  115. FAudioInput: String; external name 'audioInput';
  116. FAudioOutput: String; external name 'audioOutput';
  117. FVideoInput: String; external name 'videoInput';
  118. Public
  119. Property AudioInput : String Read FAudioInput Write FAudioInput;
  120. Property audioOutput : String read FAudioOutput Write FAudioOutput;
  121. Property videoInput : String read FVideoInput Write FVideoInput;
  122. end;
  123. { TJMUserInfo }
  124. TJMUserInfo = class external name 'Object' (TJSObject)
  125. private
  126. FEmail: String; external name 'email';
  127. Public
  128. Property Email : String Read FEmail Write FEmail;
  129. end;
  130. { TJMInterfaceConfig }
  131. TJMInterfaceConfig = class external name 'Object' (TJSObject)
  132. private
  133. FAndroidAppPackage : string; external name 'ANDROID_APP_PACKAGE';
  134. FAppName: String; external name 'APP_NAME';
  135. FAppScheme : string; external name 'APP_SCHEME';
  136. FAudioLevelPrimaryColor : string; external name 'AUDIO_LEVEL_PRIMARY_COLOR';
  137. FAudioLevelSecondaryColor : string; external name 'AUDIO_LEVEL_SECONDARY_COLOR';
  138. FAuthenticationEnable: Boolean; external name 'AUTHENTICATION_ENABLE';
  139. FAutoPinLatestScreenShare : String; external name 'AUTO_PIN_LATEST_SCREEN_SHARE';
  140. FBrandWaterMarkLink: String; external name 'BRAND_WATERMARK_LINK';
  141. FClosePageGuestHint: String; external name 'CLOSE_PAGE_GUEST_HINT';
  142. FConnectionIndicatorAutoHideEnabled : boolean; external name 'CONNECTION_INDICATOR_AUTO_HIDE_ENABLED';
  143. FConnectionIndicatorAutoHideTimeout : nativeint ; external name 'CONNECTION_INDICATOR_AUTO_HIDE_TIMEOUT';
  144. FConnectionIndicatorDisabled : boolean; external name 'CONNECTION_INDICATOR_DISABLED';
  145. FDefaultBackground: String; external name 'DEFAULT_BACKGROUND';
  146. FDefaultLocalDisplayName: String; external name 'DEFAULT_LOCAL_DISPLAY_NAME';
  147. FDefaultRemoteDisplayName: String; external name 'DEFAULT_REMOTE_DISPLAY_NAME';
  148. FDisableDominantSpeakerIndicator: Boolean; external name 'DISABLE_DOMINANT_SPEAKER_INDICATOR';
  149. FDisableFocusIndicator: Boolean; external name 'DISABLE_FOCUS_INDICATOR';
  150. FDisableJoinLeaveNotifications :boolean ; external name 'DISABLE_JOIN_LEAVE_NOTIFICATIONS';
  151. FDisablePresenceStatus : boolean; external name 'DISABLE_PRESENCE_STATUS';
  152. FDisableRinging : Boolean; external name 'DISABLE_RINGING';
  153. FDisableTranscriptionSubtitles: Boolean; external name 'DISABLE_TRANSCRIPTION_SUBTITLES';
  154. FDisableVideoBackground: Boolean; external name 'DISABLE_VIDEO_BACKGROUND';
  155. FDisplayWelcomePageContent: Boolean; external name 'DISPLAY_WELCOME_PAGE_CONTENT';
  156. FDisplayWelcomePageToolbarAdditionalContent: Boolean; external name 'DISPLAY_WELCOME_PAGE_TOOLBAR_ADDITIONAL_CONTENT';
  157. FEnableFeedBackAnimation: Boolean; external name 'ENABLE_FEEDBACK_ANIMATION';
  158. FEnforceNotificationAutoDismissTimeout : NativeInt; external name 'ENFORCE_NOTIFICATION_AUTO_DISMISS_TIMEOUT';
  159. FFilmStripMaxHeight: NativeInt; external name 'FILM_STRIP_MAX_HEIGHT';
  160. FFilmStripOnly: Boolean; external name 'filmStripOnly';
  161. FGenerateRoomNamesOnWelcomePage: Boolean; external name 'GENERATE_ROOMNAMES_ON_WELCOME_PAGE';
  162. FInitialToolbarTimeOut: NativeInt; external name 'INITIAL_TOOLBAR_TIMEOUT';
  163. FInvitationPoweredBy: Boolean; external name 'INVITATION_POWERED_BY';
  164. FJitsiWaterMarkLink: String; external name 'JITSI_WATERMARK_LINK';
  165. FLangDetection: Boolean; external name 'LANG_DETECTION';
  166. FLiveStreamingHelpLink : string; external name 'LIVE_STREAMING_HELP_LINK';
  167. FLocalThumbnailRatio : double ; external name 'LOCAL_THUMBNAIL_RATIO';
  168. FMaximumZoomingCoefficient : double ; external name 'MAXIMUM_ZOOMING_COEFFICIENT';
  169. FMobileAppPromo :Boolean ; external name 'MOBILE_APP_PROMO';
  170. FMobileDownloadLinkAndroid : string ; external name 'MOBILE_DOWNLOAD_LINK_ANDROID';
  171. FMobileDownloadLinkIos : string; external name 'MOBILE_DOWNLOAD_LINK_IOS';
  172. FNativeAppName: STring; external name 'NATIVE_APP_NAME';
  173. FOptimalBrowsers : TStringDynArray ; external name 'OPTIMAL_BROWSERS';
  174. FPolicyLogo : string; external name 'POLICY_LOGO';
  175. FProviderName: string; external name 'PROVIDER_NAME';
  176. FRandomAvatarURLPrefix: String; external name 'RANDOM_AVATAR_URL_PREFIX';
  177. FRandomAvatarURLSuffix: String; external name 'RANDOM_AVATAR_URL_SUFFIX';
  178. FRecentListEnabled :boolean ; external name 'RECENT_LIST_ENABLED';
  179. FRemoteThumbnailRatio : double ; external name 'REMOTE_THUMBNAIL_RATIO';
  180. FSettingSections: TStringDynArray; external name 'SETTINGS_SECTIONS';
  181. FShowBrandWaterMark: Boolean; external name 'SHOW_BRAND_WATERMARK';
  182. FShowChromeExtensionBanner : Boolean; external name 'SHOW_CHROME_EXTENSION_BANNER';
  183. FShowDeepLinkingImage: Boolean; external name 'SHOW_DEEP_LINKING_IMAGE';
  184. FShowJitsiWaterMark: Boolean; external name 'SHOW_JITSI_WATERMARK';
  185. FShowPoweredBy: Boolean; external name 'SHOW_POWERED_BY';
  186. FShowPromotionalClosePage: Boolean; external name 'SHOW_PROMOTIONAL_CLOSE_PAGE';
  187. FShowWaterMarkForGuests: Boolean; external name 'SHOW_WATERMARK_FOR_GUESTS';
  188. FSupportUrl : string ; external name 'SUPPORT_URL';
  189. FTileViewMaxColumns : nativeint; external name 'TILE_VIEW_MAX_COLUMNS';
  190. FToolbarAlwaysVisible: Boolean; external name 'TOOLBAR_ALWAYS_VISIBLE';
  191. FToolbarButtons: TStringDynArray; external name 'TOOLBAR_BUTTONS';
  192. FToolbarTimeOut: NativeInt; external name 'TOOLBAR_TIMEOUT';
  193. FUnsupportedBrowsers : TStringDynArray; external name 'UNSUPPORTED_BROWSERS';
  194. FVerticalFilmStrip: Boolean; external name 'VERTICAL_FILMSTRIP';
  195. FVideoLayoutFit: String; external name 'VIDEO_LAYOUT_FIT';
  196. FVideoQualityLabelDisabled : boolean; external name 'VIDEO_QUALITY_LABEL_DISABLED';
  197. Public
  198. Property AndroidAppPackage : String Read FAndroidAppPackage write FAndroidAppPackage; // ANDROID_APP_PACKAGE: 'org.jitsi.meet',
  199. Property AppName : String Read FAppName Write FAppName; // APP_NAME: 'Jitsi Meet',
  200. Property AppScheme : String Read FAppScheme write FAppScheme; // APP_SCHEME: 'org.jitsi.meet',
  201. Property AudioLevelPrimaryColor : string Read FAudioLevelPrimaryColor write FAudioLevelPrimaryColor; // AUDIO_LEVEL_PRIMARY_COLOR: 'rgba(255,255,255,0.4)',
  202. Property AudioLevelSecondaryColor : string Read FAudioLevelSecondaryColor write FAudioLevelSecondaryColor; // AUDIO_LEVEL_SECONDARY_COLOR: 'rgba(255,255,255,0.2)',
  203. Property AuthenticationEnable : Boolean Read FAuthenticationEnable Write FAuthenticationEnable; // AUTHENTICATION_ENABLE: true,
  204. Property AutoPinLatestScreenShare : string Read FAutoPinLatestScreenShare write FAutoPinLatestScreenShare; // AUTO_PIN_LATEST_SCREEN_SHARE: 'remote-only',
  205. Property BrandWaterMarkLink : String Read FBrandWaterMarkLink Write FBrandWaterMarkLink; // BRAND_WATERMARK_LINK: '',
  206. Property ClosePageGuestHint : String Read FClosePageGuestHint Write FClosePageGuestHint; // CLOSE_PAGE_GUEST_HINT
  207. Property ConnectionIndicatorAutoHideEnabled : Boolean Read FConnectionIndicatorAutoHideEnabled write FConnectionIndicatorAutoHideEnabled; // CONNECTION_INDICATOR_AUTO_HIDE_ENABLED: true,
  208. Property ConnectionIndicatorAutoHideTimeout : NativeInt Read FConnectionIndicatorAutoHideTimeout write FConnectionIndicatorAutoHideTimeout; // CONNECTION_INDICATOR_AUTO_HIDE_TIMEOUT: 5000,
  209. Property ConnectionIndicatorDisabled : Boolean Read FConnectionIndicatorDisabled write FConnectionIndicatorDisabled; // CONNECTION_INDICATOR_DISABLED: false,
  210. Property DefaultBackground : String Read FDefaultBackground Write FDefaultBackground; // DEFAULT_BACKGROUND: String;
  211. Property DefaultLocalDisplayName : String Read FDefaultLocalDisplayName Write FDefaultLocalDisplayName; // DEFAULT_LOCAL_DISPLAY_NAME: 'me',
  212. Property DefaultRemoteDisplayName : String Read FDefaultRemoteDisplayName Write FDefaultRemoteDisplayName; // DEFAULT_REMOTE_DISPLAY_NAME: 'Fellow Jitster',
  213. Property DisableDominantSpeakerIndicator : Boolean Read FDisableDominantSpeakerIndicator Write FDisableDominantSpeakerIndicator; // DISABLE_DOMINANT_SPEAKER_INDICATOR: false,
  214. Property DisableFocusIndicator: Boolean Read FDisableFocusIndicator Write FDisableFocusIndicator; // DISABLE_FOCUS_INDICATOR: true,
  215. Property DisableJoinLeaveNotifications : boolean Read FDisableJoinLeaveNotifications write FDisableJoinLeaveNotifications; // DISABLE_JOIN_LEAVE_NOTIFICATIONS: true
  216. Property DisablePresenceStatus : boolean Read FDisablePresenceStatus write FDisablePresenceStatus; // DISABLE_PRESENCE_STATUS: true,
  217. Property DisableRinging : Boolean Read FDisableRinging write FDisableRinging; // DISABLE_RINGING: false,
  218. Property DisableTranscriptionSubtitles : Boolean Read FDisableTranscriptionSubtitles Write FDisableTranscriptionSubtitles; // DISABLE_TRANSCRIPTION_SUBTITLES: false,
  219. Property DisableVideoBackground : Boolean Read FDisableVideoBackground Write FDisableVideoBackground; // DISABLE_VIDEO_BACKGROUND: false,
  220. Property DisplayWelcomePageContent : Boolean Read FDisplayWelcomePageContent Write FDisplayWelcomePageContent; // DISPLAY_WELCOME_PAGE_CONTENT: true,
  221. Property DisplayWelcomePageToolbarAdditionalContent : Boolean Read FDisplayWelcomePageToolbarAdditionalContent Write FDisplayWelcomePageToolbarAdditionalContent; // DISPLAY_WELCOME_PAGE_TOOLBAR_ADDITIONAL_CONTENT: false,
  222. Property EnableFeedBackAnimation : Boolean Read FEnableFeedBackAnimation Write FEnableFeedBackAnimation; // ENABLE_FEEDBACK_ANIMATION: false,
  223. Property EnforceNotificationAutoDismissTimeout : Nativeint Read FEnforceNotificationAutoDismissTimeout write FEnforceNotificationAutoDismissTimeout; // ENFORCE_NOTIFICATION_AUTO_DISMISS_TIMEOUT: 15000,
  224. Property FilmStripMaxHeight : NativeInt Read FFilmStripMaxHeight Write FFilmStripMaxHeight; // FILM_STRIP_MAX_HEIGHT: 120,
  225. Property FilmStripOnly : Boolean Read FFilmStripOnly Write FFilmStripOnly; // filmStripOnly: false,
  226. Property GenerateRoomNamesOnWelcomePage : Boolean Read FGenerateRoomNamesOnWelcomePage Write FGenerateRoomNamesOnWelcomePage; // GENERATE_ROOMNAMES_ON_WELCOME_PAGE: true,
  227. Property InitialToolbarTimeOut : NativeInt Read FInitialToolbarTimeOut Write FInitialToolbarTimeOut; // INITIAL_TOOLBAR_TIMEOUT: 20000,
  228. Property InvitationPoweredBy : Boolean Read FInvitationPoweredBy Write FInvitationPoweredBy; // INVITATION_POWERED_BY: true,
  229. Property JitsiWaterMarkLink : String Read FJitsiWaterMarkLink Write FJitsiWaterMarkLink; // JITSI_WATERMARK_LINK: 'https://jitsi.org',
  230. Property LangDetection : Boolean Read FLangDetection Write FLangDetection; // LANG_DETECTION: false, // Allow i18n to detect the system language
  231. Property LiveStreamingHelpLink : string Read FLiveStreamingHelpLink write FLiveStreamingHelpLink; // LIVE_STREAMING_HELP_LINK: 'https://jitsi.org/live',
  232. Property LocalThumbnailRatio : Double Read FLocalThumbnailRatio write FLocalThumbnailRatio; // LOCAL_THUMBNAIL_RATIO: 16 / 9, // 16:9
  233. Property MaximumZoomingCoefficient : Double Read FMaximumZoomingCoefficient write FMaximumZoomingCoefficient; // MAXIMUM_ZOOMING_COEFFICIENT: 1.3,
  234. Property MobileAppPromo : Boolean Read FMobileAppPromo write FMobileAppPromo; // MOBILE_APP_PROMO: true,
  235. Property MobileDownloadLinkAndroid : String Read FMobileDownloadLinkAndroid write FMobileDownloadLinkAndroid; // MOBILE_DOWNLOAD_LINK_ANDROID: 'https://play.google.com/store/apps/details?id=org.jitsi.meet',
  236. Property MobileDownloadLinkIos : String Read FMobileDownloadLinkIos write FMobileDownloadLinkIos; // MOBILE_DOWNLOAD_LINK_IOS: 'https://itunes.apple.com/us/app/jitsi-meet/id1165103905',
  237. Property NativeAppName : STring Read FNativeAppName Write FNativeAppName; // NATIVE_APP_NAME: 'Jitsi Meet',
  238. Property OptimalBrowsers : TStringDynArray Read FOptimalBrowsers write FOptimalBrowsers; // OPTIMAL_BROWSERS: [ 'chrome', 'chromium', 'nwjs', 'electron' ],
  239. Property PolicyLogo : String Read FPolicyLogo write FPolicyLogo; // POLICY_LOGO: null,
  240. Property ProviderName : string Read FProviderName Write FProviderName; // PROVIDER_NAME: 'Jitsi',
  241. Property RandomAvatarURLPrefix : String Read FRandomAvatarURLPrefix Write FRandomAvatarURLPrefix; // RANDOM_AVATAR_URL_PREFIX
  242. Property RandomAvatarURLSuffix : String Read FRandomAvatarURLSuffix Write FRandomAvatarURLSuffix; // RANDOM_AVATAR_URL_SUFFIX
  243. Property RecentListEnabled : Boolean Read FRecentListEnabled write FRecentListEnabled; // RECENT_LIST_ENABLED: true,
  244. Property RemoteThumbnailRatio : Double Read FRemoteThumbnailRatio write FRemoteThumbnailRatio; // REMOTE_THUMBNAIL_RATIO: 1, // 1:1
  245. Property SettingSections : TStringDynArray Read FSettingSections Write FSettingSections; // SETTINGS_SECTIONS:
  246. Property ShowBrandWaterMark : Boolean Read FShowBrandWaterMark Write FShowBrandWaterMark; // SHOW_BRAND_WATERMARK: false,
  247. Property ShowChromeExtensionBanner : boolean Read FShowChromeExtensionBanner write FShowChromeExtensionBanner; // SHOW_CHROME_EXTENSION_BANNER: true,
  248. Property ShowDeepLinkingImage : Boolean Read FShowDeepLinkingImage Write FShowDeepLinkingImage; // SHOW_DEEP_LINKING_IMAGE: false,
  249. Property ShowJitsiWaterMark : Boolean Read FShowJitsiWaterMark Write FShowJitsiWaterMark; // SHOW_JITSI_WATERMARK: true,
  250. Property ShowPoweredBy : Boolean Read FShowPoweredBy Write FShowPoweredBy; // SHOW_POWERED_BY: false,
  251. Property ShowPromotionalClosePage : Boolean Read FShowPromotionalClosePage Write FShowPromotionalClosePage; // SHOW_PROMOTIONAL_CLOSE_PAGE
  252. Property ShowWaterMarkForGuests : Boolean Read FShowWaterMarkForGuests Write FShowWaterMarkForGuests; // SHOW_WATERMARK_FOR_GUESTS: true,
  253. Property SupportUrl : String Read FSupportUrl write FSupportUrl; // SUPPORT_URL: 'https://github.com/jitsi/jitsi-meet/issues/new',
  254. Property TileViewMaxColumns : NativeInt Read FTileViewMaxColumns write FTileViewMaxColumns; // TILE_VIEW_MAX_COLUMNS: 5,
  255. Property ToolbarAlwaysVisible: Boolean Read FToolbarAlwaysVisible Write FToolbarAlwaysVisible; // TOOLBAR_ALWAYS_VISIBLE: false,
  256. Property ToolbarButtons : TStringDynArray Read FToolbarButtons Write FToolbarButtons; // TOOLBAR_BUTTONS:
  257. Property ToolbarTimeOut : NativeInt Read FToolbarTimeOut Write FToolbarTimeOut; // TOOLBAR_TIMEOUT: 4000,
  258. Property UnsupportedBrowsers : TStringDynArray Read FUnsupportedBrowsers write FUnsupportedBrowsers; // UNSUPPORTED_BROWSERS: [],
  259. Property VerticalFilmStrip : Boolean Read FVerticalFilmStrip Write FVerticalFilmStrip; // VERTICAL_FILMSTRIP: true,
  260. Property VideoLayoutFit : String Read FVideoLayoutFit Write FVideoLayoutFit; // VIDEO_LAYOUT_FIT: 'both',
  261. Property VideoQualityLabelDisabled : Boolean Read FVideoQualityLabelDisabled write FVideoQualityLabelDisabled; // VIDEO_QUALITY_LABEL_DISABLED: false,
  262. end;
  263. TJMMeetOptions = class external name 'Object' (TJSObject)
  264. Public
  265. roomName : String;
  266. width : Integer;
  267. widthString : String; external name 'width';
  268. height : Integer;
  269. heightString : String; external name 'height';
  270. parentNode : TJSHTMLElement;
  271. configOverwrite: TJSObject;
  272. interfaceConfigOverwrite: TJMInterfaceConfig;
  273. noSSL : Boolean;
  274. jwt : String;
  275. onload : TJSRawEventHandler;
  276. invitees : TJMInviteeDynArray;
  277. devices : TJMDevices;
  278. userInfo : TJMUserInfo;
  279. end;
  280. { TJMMediaDevice }
  281. TJMMediaDevice = class external name 'Object' (TJSObject)
  282. private
  283. FDeviceID: String; external name 'deviceId';
  284. FGroupID: String; external name 'groupId';
  285. FKind: String; external name 'lind';
  286. FLabel: String; external name 'label';
  287. public
  288. Property DeviceId : String Read FDeviceID;
  289. Property GroupId : String Read FGroupID;
  290. Property Kind : String Read FKind;
  291. Property Label_ : String read FLabel;
  292. end;
  293. TJMMediaDeviceDynArray = Array of TJMMediaDevice;
  294. { TJMAvailableDevicesResponse }
  295. TJMAvailableDevicesResponse = class external name 'Object' (TJSObject)
  296. private
  297. FAudioInput: TJMMediaDeviceDynArray; external name 'audioInput';
  298. FAudioOutput: TJMMediaDeviceDynArray; external name 'audioOutput';
  299. FVideoInput: TJMMediaDeviceDynArray; external name 'videoInput';
  300. Public
  301. property AudioInput : TJMMediaDeviceDynArray read FAudioInput;
  302. property AudioOutput : TJMMediaDeviceDynArray read FAudioOutput;
  303. property VideoInput : TJMMediaDeviceDynArray Read FVideoInput;
  304. end;
  305. { TJMCurrentDevicesResponse }
  306. TJMCurrentDevicesResponse = class external name 'Object' (TJSObject)
  307. private
  308. fAudioInput: TJMMediaDeviceDynArray; external name 'audioInput';
  309. fAudioOutput: TJMMediaDeviceDynArray; external name 'audioOutput';
  310. fVideoInput: TJMMediaDeviceDynArray; external name 'videoInput';
  311. Public
  312. property AudioInput : TJMMediaDeviceDynArray read fAudioInput;
  313. property AudioOutput : TJMMediaDeviceDynArray read fAudioOutput;
  314. property VideoInput : TJMMediaDeviceDynArray read fVideoInput;
  315. end;
  316. TJMEventEmitter = class external name 'Object' (TJSObject)
  317. Public
  318. Procedure addListener(aName : String; aCallBack : TJMEventHandler);
  319. Procedure On_(aName : String; aCallBack : TJMEventHandler); external name 'on';
  320. Procedure Off(aName : String; aCallBack : TJMEventHandler); external name 'off';
  321. Procedure removeAllListeners(aName : String);
  322. Procedure removeListener(aName : String; aCallBack : TJMEventHandler);
  323. end;
  324. TJMExternalAPI = class external name 'JitsiMeetExternalAPI' (TJMEventEmitter)
  325. Public
  326. Constructor new (aDomain : String; aOptions : TJMMeetOptions);
  327. Procedure dispose;
  328. Procedure executeCommand(aCommand : String); overload;
  329. Procedure executeCommand(aCommand : String; Arg : String); overload;
  330. Procedure executeCommand(aCommand : String; Arg1,Arg2 : String); overload;
  331. Procedure executeCommand(aCommand : String; Options : TJSObject); overload;
  332. Procedure executeCommands(commands : TJMCommands);
  333. Function getAvailableDevices : TJSPromise;
  334. Function getAvatarURL : String;
  335. Function getCurrentDevices : TJSPromise;
  336. Function getDisplayName : String;
  337. Function getEmail : String;
  338. Function getIFrame : TJSHTMLElement;
  339. Function getNumberOfParticipants : NativeInt;
  340. Function invite(aInvitees : TJMInviteDynArray): TJSPromise;
  341. Function isAudioAvailable : TJSPromise;
  342. Function isAudioMuted : TJSPromise;
  343. Function isDeviceChangeAvailable(const aDeviceType : String) : TJSPromise;
  344. Function isDeviceListAvailable : TJSPromise;
  345. Function isMultipleAudioInputSupported : TJSPromise;
  346. Function isVideoAvailable : TJSPromise;
  347. Function isVideoMuted : TJSPromise;
  348. Procedure setAudioInputDevice(const aDeviceLabel,aDeviceId : String);
  349. Procedure setAudioOutputDevice(const aDeviceLabel,aDeviceId : String);
  350. Procedure setVideoInputDevice(const aDeviceLabel,aDeviceId : String);
  351. end;
  352. { TJSMSendTones }
  353. TJMSendTones = class external name 'Object' (TJSObject)
  354. private
  355. FDuration: NativeInt; external name 'duration';
  356. FPause: NativeInt; external name 'pause';
  357. FTones: String; external name 'tones';
  358. Public
  359. Property Tones : String Read FTones Write FTones;
  360. Property Duration : NativeInt Read FDuration Write FDuration;
  361. Property Pause : NativeInt Read FPause Write FPause;
  362. end;
  363. { TJMExternalAPIHelper }
  364. TJMExternalAPIHelper = class helper for TJMExternalAPI
  365. Public
  366. procedure SetDisplayName (Const aName : string);
  367. procedure SetPassword (Const aPassword : string);
  368. procedure SendTones (aTones :TJMSendTones);
  369. procedure SetSubject(Const aSubject : string);
  370. procedure ToggleAudio;
  371. procedure ToggleVideo;
  372. procedure ToggleFilmStrip;
  373. procedure ToggleChat;
  374. procedure ToggleShareScreen;
  375. procedure ToggleTileView;
  376. procedure Hangup;
  377. procedure Email(Const aEmail : string);
  378. procedure AvatarURL(Const aURL : string);
  379. procedure SendEndPointTextMessage(Const aParticipantID,aText : string);
  380. end;
  381. function UIElementsStrings(aElements : TJMUIElements) : TStringDynArray;
  382. function UISettingsStrings(aUISettings : TJMUISettings) : TStringDynArray;
  383. Const
  384. UIElementNames : Array[TJMUIElement] of string = (
  385. UIMicrophone, UICamera, UIClosedCaptions, UIDesktop,
  386. UIFullScreen, UIFODeviceSelection, UIHangup, UIChat, UIRecording,
  387. UILiveStreaming, UIEtherPad, UISharedVideo, UISettings, UIVideoQuality,
  388. UIFilmStrip, UIFeedBack, UIStats, UIShortCuts, UITileView,
  389. UIVideoBackgroundBlur, UIDownload, UIHelp, UIMuteEveryone,
  390. UIProfile, UIInfo, UIRaiseHand, UIInvite
  391. );
  392. UISettingNames : Array[TJMUISetting] of string =
  393. (UISettingDevices, UISettingLanguage, UISettingModerator, UISettingProfile, UISettingCalendar);
  394. implementation
  395. { TJMExternalAPIHelper }
  396. procedure TJMExternalAPIHelper.SetDisplayName(const aName: string);
  397. begin
  398. ExecuteCommand(CommandDisplayName,aName);
  399. end;
  400. procedure TJMExternalAPIHelper.SetPassword(const aPassword: string);
  401. begin
  402. ExecuteCommand(CommandPassword,aPassword);
  403. end;
  404. procedure TJMExternalAPIHelper.SendTones(aTones: TJMSendTones);
  405. begin
  406. executeCommand(CommandSendTones,aTones);
  407. end;
  408. procedure TJMExternalAPIHelper.SetSubject(const aSubject: string);
  409. begin
  410. ExecuteCommand(CommandSubject,aSubject);
  411. end;
  412. procedure TJMExternalAPIHelper.ToggleAudio;
  413. begin
  414. ExecuteCommand(CommandToggleAudio);
  415. end;
  416. procedure TJMExternalAPIHelper.ToggleVideo;
  417. begin
  418. ExecuteCommand(CommandToggleVideo);
  419. end;
  420. procedure TJMExternalAPIHelper.ToggleFilmStrip;
  421. begin
  422. ExecuteCommand(CommandToggleFilmStrip);
  423. end;
  424. procedure TJMExternalAPIHelper.ToggleChat;
  425. begin
  426. ExecuteCommand(CommandToggleChat);
  427. end;
  428. procedure TJMExternalAPIHelper.ToggleShareScreen;
  429. begin
  430. ExecuteCommand(CommandToggleShareScreen);
  431. end;
  432. procedure TJMExternalAPIHelper.ToggleTileView;
  433. begin
  434. ExecuteCommand(CommandToggleTileView);
  435. end;
  436. procedure TJMExternalAPIHelper.Hangup;
  437. begin
  438. ExecuteCommand(CommandHangup);
  439. end;
  440. procedure TJMExternalAPIHelper.Email(const aEmail: string);
  441. begin
  442. ExecuteCommand(commandEmail,aEmail);
  443. end;
  444. procedure TJMExternalAPIHelper.AvatarURL(const aURL: string);
  445. begin
  446. ExecuteCommand(CommandAvatarURL,aURL);
  447. end;
  448. procedure TJMExternalAPIHelper.SendEndPointTextMessage(const aParticipantID, aText: string);
  449. begin
  450. ExecuteCommand(CommandSendEndPointTextMessage,aParticipantID,atext);
  451. end;
  452. function UISettingsStrings(aUISettings: TJMUISettings): TStringDynArray;
  453. Var
  454. Len: Integer;
  455. S : TJMUISetting;
  456. begin
  457. Len:=0;
  458. SetLength(Result,Ord(High(TJMUISetting)));
  459. For S in TJMUISetting do
  460. if S in aUISettings then
  461. begin
  462. Result[Len]:=UISettingNames[S];
  463. Inc(Len);
  464. end;
  465. SetLength(Result,len);
  466. end;
  467. function UIElementsStrings(aElements: TJMUIElements): TStringDynArray;
  468. Var
  469. Len: Integer;
  470. J : TJMUIElement;
  471. begin
  472. Len:=0;
  473. SetLength(Result,Ord(High(TJMUIElement)));
  474. For J in TJMUIElement do
  475. if J in aElements then
  476. begin
  477. Result[Len]:=UIElementNames[J];
  478. Inc(Len);
  479. end;
  480. SetLength(Result,len);
  481. end;
  482. end.