Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

actions.web.ts 948B

12345678910111213141516171819202122232425
  1. import { IStore } from '../../app/types';
  2. import { gumPending } from '../media/actions';
  3. import { MEDIA_TYPE, MediaType } from '../media/constants';
  4. import { IGUMPendingState } from '../media/types';
  5. import { createAndAddInitialAVTracks } from '../tracks/actions.web';
  6. export * from './actions.any';
  7. /**
  8. * Starts audio and/or video for the visitor.
  9. *
  10. * @param {Array<MediaType>} media - The media types that need to be started.
  11. * @returns {Function}
  12. */
  13. export function setupVisitorStartupMedia(media: Array<MediaType>) {
  14. return (dispatch: IStore['dispatch']) => {
  15. // Clear the gum pending state in case we have set it to pending since we are starting the
  16. // conference without tracks.
  17. dispatch(gumPending([ MEDIA_TYPE.AUDIO, MEDIA_TYPE.VIDEO ], IGUMPendingState.NONE));
  18. if (media && Array.isArray(media) && media.length > 0) {
  19. dispatch(createAndAddInitialAVTracks(media));
  20. }
  21. };
  22. }