zoom.mdx 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. ---
  2. slug: /zoom
  3. ---
  4. import Tabs from '@theme/Tabs';
  5. import TabItem from '@theme/TabItem';
  6. import UppyCdnExample from '/src/components/UppyCdnExample';
  7. # Zoom
  8. The `@uppy/zoom` plugin lets users import cloud video recordings from their
  9. [Zoom](https://zoom.com) account. Note that
  10. [only licensed](https://support.zoom.com/hc/en/article?id=zm_kb&sysparm_article=KB0063923)
  11. Zoom accounts can store their recordings in the cloud, so this functionality
  12. will only be available to users with a paid Zoom account.
  13. :::tip
  14. [Try out the live example](/examples) or take it for a spin in
  15. [StackBlitz](https://stackblitz.com/edit/vitejs-vite-zaqyaf?file=main.js).
  16. :::
  17. ## When should I use this?
  18. When you want to let users import cloud video recordings from their
  19. [Zoom](https://zoom.com) account.
  20. A [Companion](/docs/companion) instance is required for the Zoom plugin to work.
  21. Companion handles authentication with Zoom, downloads the files, and uploads
  22. them to the destination. This saves the user bandwidth, especially helpful if
  23. they are on a mobile connection.
  24. You can self-host Companion or get a hosted version with any
  25. [Transloadit plan](https://transloadit.com/pricing/).
  26. <Tabs>
  27. <TabItem value="npm" label="NPM" default>
  28. ```shell
  29. npm install @uppy/zoom
  30. ```
  31. </TabItem>
  32. <TabItem value="yarn" label="Yarn">
  33. ```shell
  34. yarn add @uppy/zoom
  35. ```
  36. </TabItem>
  37. <TabItem value="cdn" label="CDN">
  38. <UppyCdnExample>
  39. {`
  40. import { Uppy, Zoom } from "{{UPPY_JS_URL}}"
  41. const uppy = new Uppy()
  42. uppy.use(Zoom, {
  43. // Options
  44. })
  45. `}
  46. </UppyCdnExample>
  47. </TabItem>
  48. </Tabs>
  49. ## Use
  50. Using Zoom requires setup in both Uppy and Companion.
  51. ### Use in Uppy
  52. ```js {10-13} showLineNumbers
  53. import Uppy from '@uppy/core';
  54. import Dashboard from '@uppy/dashboard';
  55. import Zoom from '@uppy/zoom';
  56. import '@uppy/core/dist/style.min.css';
  57. import '@uppy/dashboard/dist/style.min.css';
  58. new Uppy()
  59. .use(Dashboard, { inline: true, target: '#dashboard' })
  60. .use(Zoom, { companionUrl: 'https://your-companion.com' });
  61. ```
  62. ### Use with Transloadit
  63. ```js
  64. import { COMPANION_URL, COMPANION_ALLOWED_HOSTS } from '@uppy/transloadit';
  65. import Zoom from '@uppy/zoom';
  66. uppy.use(Zoom, {
  67. companionUrl: COMPANION_URL,
  68. companionAllowedHosts: COMPANION_ALLOWED_HOSTS,
  69. });
  70. ```
  71. You may also hit rate limits, because the OAuth application is shared between
  72. everyone using Transloadit.
  73. To solve that, you can use your own OAuth keys with Transloadit’s hosted
  74. Companion servers by using Transloadit Template Credentials. [Create a Template
  75. Credential][template-credentials] on the Transloadit site. Select “Companion
  76. OAuth” for the service, and enter the key and secret for the provider you want
  77. to use. Then you can pass the name of the new credentials to that provider:
  78. ```js
  79. import { COMPANION_URL, COMPANION_ALLOWED_HOSTS } from '@uppy/transloadit';
  80. import Zoom from '@uppy/zoom';
  81. uppy.use(Zoom, {
  82. companionUrl: COMPANION_URL,
  83. companionAllowedHosts: COMPANION_ALLOWED_HOSTS,
  84. companionKeysParams: {
  85. key: 'YOUR_TRANSLOADIT_API_KEY',
  86. credentialsName: 'my_companion_dropbox_creds',
  87. },
  88. });
  89. ```
  90. ### Use in Companion
  91. To sign up for API keys, go through the following steps:
  92. 1. Sign up on [Zoom Marketplace](https://marketplace.zoom.us)
  93. 2. Go to [https://marketplace.zoom.us](https://marketplace.zoom.us). There will
  94. be a dropdown in the header called “Develop”. From that dropdown, select
  95. “Build app”.
  96. 3. In the “Basic Information” tab, Zoom shows your new “Client ID” and “Client
  97. Secret” - copy them.
  98. With the standalone Companion server, specify environment variables:
  99. ```shell
  100. export COMPANION_ZOOM_KEY="Zoom API key"
  101. export COMPANION_ZOOM_SECRET="Zoom API secret"
  102. ```
  103. When using the Companion Node.js API, configure these options:
  104. ```js
  105. companion.app({
  106. providerOptions: {
  107. zoom: {
  108. key: 'Zoom API key',
  109. secret: 'Zoom API secret',
  110. },
  111. },
  112. });
  113. ```
  114. 4. In the “Basic Information” tab, set “OAuth Redirect URL” input field to:
  115. ```
  116. https://$YOUR_COMPANION_HOST_NAME/zoom/redirect
  117. ```
  118. If you are using Transloadit hosted Companion:
  119. ```
  120. https://api2.transloadit.com/companion/zoom/redirect
  121. ```
  122. 5. In the “Scopes” tab, add “cloud_recording:read:list_user_recordings” and
  123. “user:read:user” scopes. If Zoom asks for further permissions when you
  124. interact with your Zoom integration - add those too.
  125. ## API
  126. ### Options
  127. #### `id`
  128. A unique identifier for this plugin (`string`, default: `'Zoom'`).
  129. #### `title`
  130. Title / name shown in the UI, such as Dashboard tabs (`string`, default:
  131. `'Zoom'`).
  132. #### `target`
  133. DOM element, CSS selector, or plugin to place the drag and drop area into
  134. (`string`, `Element`, `Function`, or `UIPlugin`, default:
  135. [`Dashboard`](/docs/dashboard)).
  136. #### `companionUrl`
  137. URL to a [Companion](/docs/companion) instance (`string`, default: `null`).
  138. #### `companionHeaders`
  139. Custom headers that should be sent along to [Companion](/docs/companion) on
  140. every request (`Object`, default: `{}`).
  141. #### `companionAllowedHosts`
  142. The valid and authorised URL(s) from which OAuth responses should be accepted
  143. (`string` or `RegExp` or `Array`, default: `companionUrl`).
  144. This value can be a `string`, a `RegExp` pattern, or an `Array` of both. This is
  145. useful when you have your [Companion](/docs/companion) running on several hosts.
  146. Otherwise, the default value should do fine.
  147. #### `companionCookiesRule`
  148. This option correlates to the
  149. [RequestCredentials value](https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials)
  150. (`string`, default: `'same-origin'`).
  151. This tells the plugin whether to send cookies to [Companion](/docs/companion).
  152. #### `locale`
  153. ```js
  154. export default {
  155. strings: {
  156. pluginNameZoom: 'Zoom',
  157. },
  158. };
  159. ```
  160. [template-credentials]:
  161. https://transloadit.com/docs/#how-to-create-template-credentials