OverviewFilesCommitsIssuesDocsReleasesPeers

holepunchto-deps / @holepunchto / keet-media / shared / constants.js

76 lines · javascript ref:
const DEFAULT_MIME_TYPE = 'image/webp'
const DEFAULT_MAX_BYTES = 512 * 1024

export const CHAT_MESSAGE_MAX_FRAMES = 200

export const CHAT_MESSAGE_PREVIEW = {
  small: {
    resize: {
      maxWidth: 32,
      maxHeight: 32
    },
    encode: {
      mimetype: DEFAULT_MIME_TYPE,
      maxBytes: DEFAULT_MAX_BYTES
    },
    base64: true
  },
  medium: {
    resize: {
      maxWidth: 640,
      maxHeight: 640
    },
    encode: {
      mimetype: DEFAULT_MIME_TYPE,
      maxBytes: DEFAULT_MAX_BYTES
    },
    base64: true
  },
  large: {
    resize: {
      maxWidth: 2560,
      maxHeight: 2560
    },
    encode: {
      mimetype: DEFAULT_MIME_TYPE
    }
  }
}

export const CHAT_LINK_PREVIEW = {
  resize: {
    maxWidth: 640,
    maxHeight: 640
  },
  encode: {
    mimetype: DEFAULT_MIME_TYPE,
    maxBytes: DEFAULT_MAX_BYTES
  }
}

const _AVATAR = {
  small: {
    resize: {
      maxWidth: 165,
      maxHeight: 165
    },
    encode: {
      mimetype: DEFAULT_MIME_TYPE,
      maxBytes: DEFAULT_MAX_BYTES
    }
  },
  medium: {
    resize: {
      maxWidth: 288,
      maxHeight: 288
    },
    encode: {
      mimetype: DEFAULT_MIME_TYPE,
      maxBytes: DEFAULT_MAX_BYTES
    }
  }
}

export const PROFILE_AVATAR = _AVATAR
export const ROOM_AVATAR = _AVATAR