#
AttachmentConfigurationServiceThe AttachmentConfigurationService
provides customization for certain attributes of attachments displayed inside the message component. If you're using your own CDN, you can integrate resizing features of it by providing your own handlers.
#
Type parametersName | Type |
---|---|
T | extends DefaultStreamChatGenerics = DefaultStreamChatGenerics |
#
Properties#
customGiphyAttachmentConfigurationHandler• Optional
customGiphyAttachmentConfigurationHandler: (a
: Attachment
<T
>) => AttachmentConfigration
#
Type declaration▸ (a
): AttachmentConfigration
A custom handler can be provided to override the default giphy attachment (GIFs sent with the /giphy command) configuration. By default the SDK uses fixed height (a size that's known before the GIF is loaded), if you override that with dynamic height (for example: height: 100%) the scrolling logic inside the message list can break.
#
ParametersName | Type |
---|---|
a | Attachment <T > |
#
ReturnsAttachmentConfigration
#
Defined inlib/attachment-configuration.service.ts:37
#
customImageAttachmentConfigurationHandler• Optional
customImageAttachmentConfigurationHandler: (a
: Attachment
<T
>, type
: "gallery"
| "single"
| "carousel"
, containerElement
: HTMLElement
) => ImageAttachmentConfiguration
#
Type declaration▸ (a
, type
, containerElement
): ImageAttachmentConfiguration
A custom handler can be provided to override the default image attachment (images uploaded from files) configuration. By default the SDK uses fixed image height (a size that's known before image is loaded), if you override that with dynamic image height (for example: height: 100%) the scrolling logic inside the message list can break.
#
ParametersName | Type |
---|---|
a | Attachment <T > |
type | "gallery" | "single" | "carousel" |
containerElement | HTMLElement |
#
ReturnsImageAttachmentConfiguration
#
Defined inlib/attachment-configuration.service.ts:22
#
customScrapedImageAttachmentConfigurationHandler• Optional
customScrapedImageAttachmentConfigurationHandler: (a
: Attachment
<T
>) => AttachmentConfigration
#
Type declaration▸ (a
): AttachmentConfigration
A custom handler can be provided to override the default scraped image attachment (images found in links inside messages) configuration. By default the SDK uses fixed height (a size that's known before image is loaded), if you override that with dynamic height (for example: height: 100%) the scrolling logic inside the message list can break.
#
ParametersName | Type |
---|---|
a | Attachment <T > |
#
ReturnsAttachmentConfigration
#
Defined inlib/attachment-configuration.service.ts:43
#
customVideoAttachmentConfigurationHandler• Optional
customVideoAttachmentConfigurationHandler: (a
: Attachment
<T
>, containerElement
: HTMLElement
) => VideoAttachmentConfiguration
#
Type declaration▸ (a
, containerElement
): VideoAttachmentConfiguration
A custom handler can be provided to override the default video attachment (videos uploaded from files) configuration. By default the SDK uses fixed height (a size that's known before video is loaded), if you override that with dynamic height (for example: height: 100%) the scrolling logic inside the message list can break.
#
ParametersName | Type |
---|---|
a | Attachment <T > |
containerElement | HTMLElement |
#
ReturnsVideoAttachmentConfiguration
#
Defined inlib/attachment-configuration.service.ts:30
#
shouldGenerateVideoThumbnail• shouldGenerateVideoThumbnail: boolean
= true
You can turn on/off thumbnail generation for video attachments
#
Defined inlib/attachment-configuration.service.ts:49
#
Methods#
getGiphyAttachmentConfiguration▸ getGiphyAttachmentConfiguration(attachment
): AttachmentConfigration
Handles the configuration for giphy attachments, it's possible to provide your own function to override the default logic
#
ParametersName | Type | Description |
---|---|---|
attachment | Attachment <T > | The attachment to configure |
#
ReturnsAttachmentConfigration
#
Defined inlib/attachment-configuration.service.ts:164
#
getImageAttachmentConfiguration▸ getImageAttachmentConfiguration(attachment
, location
, element
): ImageAttachmentConfiguration
Handles the configuration for image attachments, it's possible to provide your own function to override the default logic
#
ParametersName | Type | Description |
---|---|---|
attachment | Attachment <T > | The attachment to configure |
location | "gallery" | "single" | "carousel" | Specifies where the image is being displayed |
element | HTMLElement | The default resizing logics reads the height/max-height and max-width propperties of this element and reduces file size based on the given values. File size reduction is done by Stream's CDN. |
#
ReturnsImageAttachmentConfiguration
#
Defined inlib/attachment-configuration.service.ts:57
#
getScrapedImageAttachmentConfiguration▸ getScrapedImageAttachmentConfiguration(attachment
): AttachmentConfigration
Handles the configuration for scraped image attachments, it's possible to provide your own function to override the default logic
#
ParametersName | Type | Description |
---|---|---|
attachment | Attachment <T > | The attachment to configure |
#
ReturnsAttachmentConfigration
#
Defined inlib/attachment-configuration.service.ts:184
#
getVideoAttachmentConfiguration▸ getVideoAttachmentConfiguration(attachment
, element
): VideoAttachmentConfiguration
Handles the configuration for video attachments, it's possible to provide your own function to override the default logic
#
ParametersName | Type | Description |
---|---|---|
attachment | Attachment <T > | The attachment to configure |
element | HTMLElement | The default resizing logics reads the height/max-height and max-width propperties of this element and reduces file size based on the given values. File size reduction is done by Stream's CDN. |
#
ReturnsVideoAttachmentConfiguration