const video = {
  state: {
    videoRoom: 0,
    isBusy: false,
    dispatching: false,
  },
  mutations: {
    GENERATE_VIDEO_ROOM(state, videoRoom) {
      if (videoRoom) {
        state.videoRoom = videoRoom;
      } else {
        state.videoRoom = Math.ceil(Math.random() * (2 ** 32 - 1));
      }
    },
    UPDATE_ISBUSY(state, isBusy) {
      state.isBusy = isBusy;
    },
    TOGGLE_DISPATCHING(state, dispatching) {
      state.dispatching = dispatching;
    },
  },
};

export default video;
