Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

functions.any.js 956B

123456789101112131415161718192021222324
  1. import { MEDIA_TYPE } from '../base/media';
  2. import { toState } from '../base/redux';
  3. import { isLocalCameraTrackMuted, isLocalTrackMuted } from '../base/tracks';
  4. import { addHashParamsToURL } from '../base/util';
  5. /**
  6. * Adds the current track state to the passed URL.
  7. *
  8. * @param {URL} url - The URL that will be modified.
  9. * @param {Function|Object} stateful - The redux store or {@code getState} function.
  10. * @returns {URL} - Returns the modified URL.
  11. */
  12. export function addTrackStateToURL(url, stateful) {
  13. const state = toState(stateful);
  14. const tracks = state['features/base/tracks'];
  15. const isVideoMuted = isLocalCameraTrackMuted(tracks);
  16. const isAudioMuted = isLocalTrackMuted(tracks, MEDIA_TYPE.AUDIO);
  17. return addHashParamsToURL(new URL(url), { // use new URL object in order to not pollute the passed parameter.
  18. 'config.startWithAudioMuted': isAudioMuted,
  19. 'config.startWithVideoMuted': isVideoMuted
  20. });
  21. }