Skip to main content
Version: v4

Video Bubble

CometChatVideoBubble is the content view for a MediaMessage if the media sent is a video.

Properties

MethodsparametersTypeDescription
setVideoUrl(String videoUrl, @DrawableRes int placeHolderImage)Stringthe url of the video to play
setThumbnailUrl(String thumbnailUrl, @DrawableRes int placeHolderImage)Stringused to set a custom thumbnail for the video
setStyle(VideoBubbleStyle style)VideoBubbleStyleused to customize appearance of this widget
setPlayIcon(@DrawableRes int playIcon)@DrawableRes inticon to display stacked on top of the bubble
setOnClick(OnClick onClick)OnClickcustom action on tapping the video bubble play icon

VideoBubbleStyle

VideoBubbleStyle is the class containing attributes to customize appearance of this widget.

MethodsTypeDescription
setBackground@ColorInt intused to set the background color
setBackgroundDrawableused to set background drawable
setBorderWidth@Dimension intused to set border
setCornerRadiusfloatused to set border radius
setBorderColor@ColorInt intused to set border color
setPlayIconTint@ColorInt intused to set play icon tint color
setPlayIconBackgroundColor@ColorInt intused to set play icon background color

Usage

//create video bubble style object
VideoBubbleStyle style=new VideoBubbleStyle()
.setPlayIconTint(getResources().getColor(R.color.primary));

//create view object for video bubble
CometChatVideoBubble videoBubble=new CometChatVideoBubble(getContext());

//set style to the view object
videoBubble.setStyle(style);