您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

actions.js 1.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. import {
  2. SET_AUDIO_INPUT_DEVICE,
  3. SET_AUDIO_OUTPUT_DEVICE,
  4. SET_VIDEO_INPUT_DEVICE,
  5. UPDATE_DEVICE_LIST
  6. } from './actionTypes';
  7. /**
  8. * Signals to update the currently used audio input device.
  9. *
  10. * @param {string} deviceId - The id of the new audio input device.
  11. * @returns {{
  12. * type: SET_AUDIO_INPUT_DEVICE,
  13. * deviceId: string
  14. * }}
  15. */
  16. export function setAudioInputDevice(deviceId) {
  17. return {
  18. type: SET_AUDIO_INPUT_DEVICE,
  19. deviceId
  20. };
  21. }
  22. /**
  23. * Signals to update the currently used audio output device.
  24. *
  25. * @param {string} deviceId - The id of the new audio ouput device.
  26. * @returns {{
  27. * type: SET_AUDIO_OUTPUT_DEVICE,
  28. * deviceId: string
  29. * }}
  30. */
  31. export function setAudioOutputDevice(deviceId) {
  32. return {
  33. type: SET_AUDIO_OUTPUT_DEVICE,
  34. deviceId
  35. };
  36. }
  37. /**
  38. * Signals to update the currently used video input device.
  39. *
  40. * @param {string} deviceId - The id of the new video input device.
  41. * @returns {{
  42. * type: SET_VIDEO_INPUT_DEVICE,
  43. * deviceId: string
  44. * }}
  45. */
  46. export function setVideoInputDevice(deviceId) {
  47. return {
  48. type: SET_VIDEO_INPUT_DEVICE,
  49. deviceId
  50. };
  51. }
  52. /**
  53. * Signals to update the list of known audio and video devices.
  54. *
  55. * @param {Array<MediaDeviceInfo>} devices - All known available audio input,
  56. * audio output, and video input devices.
  57. * @returns {{
  58. * type: UPDATE_DEVICE_LIST,
  59. * devices: Array<MediaDeviceInfo>
  60. * }}
  61. */
  62. export function updateDeviceList(devices) {
  63. return {
  64. type: UPDATE_DEVICE_LIST,
  65. devices
  66. };
  67. }