Skip to main content
Version: v4

Video Bubble

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

Properties

MethodsTypeDescription
set(videoURL: String)Stringthe url of the video to play
set(thumnailImageUrl: String)Stringused to set a custom thumbnail for the video
set(style: VideoBubbleStyle)VideoBubbleStyleused to customize appearance of this bubble
onClick(onClick: (() -> ())onClickcustom action on tapping the video bubble play icon

VideoBubbleStyle

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

MethodsTypeDescription
set(background: UIColor)UIColorused to set background color
set(borderWidth: CGFloat)CGFloatused to set border
set(cornerRadius: CometChatCornerStyle)CometChatCornerStyleused to set border radius
set(borderColor: UIColor)UIColorused to set border color
set(playIconTint: UIColor)UIColorused to set play icon tint color
set(playIconBackgroundColor: UIColor)UIColorused to set play icon background color

Usage

//create video bubble style object
let videoBubbleStyle = VideoBubbleStyle()

//create object for video bubble
let videoBubble = CometChatVideoBubble()

//modify style properties
videoBubbleStyle.set(backgroundColor: .black)
videoBubbleStyle.set(borderWidth: 5.0)
videoBubbleStyle.set(borderColor: .red)
videoBubbleStyle.set(corner: CometChatCornerStyle(cornerRadius: 10.0))
videoBubbleStyle.set(playIconTint: .red)
videoBubbleStyle.set(playIconBackgroundColor: .yello)

//set style to the video bubble object
videoBubble.set(style: videoBubbleStyle)