app.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. import Uppy from '@uppy/core'
  2. import Dashboard from '@uppy/dashboard'
  3. import RemoteSources from '@uppy/remote-sources'
  4. import Webcam from '@uppy/webcam'
  5. import ScreenCapture from '@uppy/screen-capture'
  6. import GoldenRetriever from '@uppy/golden-retriever'
  7. import ImageEditor from '@uppy/image-editor'
  8. import DropTarget from '@uppy/drop-target'
  9. import Audio from '@uppy/audio'
  10. import Compressor from '@uppy/compressor'
  11. import '@uppy/core/dist/style.css'
  12. import '@uppy/dashboard/dist/style.css'
  13. const COMPANION_URL = 'http://companion.uppy.io'
  14. const uppy = new Uppy()
  15. .use(Dashboard, { target: '#app', inline: true })
  16. .use(RemoteSources, { companionUrl: COMPANION_URL })
  17. .use(Webcam, {
  18. target: Dashboard,
  19. showVideoSourceDropdown: true,
  20. showRecordingLength: true,
  21. })
  22. .use(Audio, {
  23. target: Dashboard,
  24. showRecordingLength: true,
  25. })
  26. .use(ScreenCapture, { target: Dashboard })
  27. .use(ImageEditor, { target: Dashboard })
  28. .use(DropTarget, { target: document.body })
  29. .use(Compressor)
  30. .use(GoldenRetriever, { serviceWorker: true })
  31. // Keep this here to access uppy in tests
  32. window.uppy = uppy