Video Bubble
CometChatVideoBubble
is the content view for a MediaMessage if the media sent is a video.
Properties
Methods | Type | Description |
---|---|---|
set(videoURL: String) | String | the url of the video to play |
set(thumnailImageUrl: String) | String | used to set a custom thumbnail for the video |
set(style: VideoBubbleStyle) | VideoBubbleStyle | used to customize appearance of this bubble |
onClick(onClick: (() -> ()) | onClick | custom action on tapping the video bubble play icon |
VideoBubbleStyle
VideoBubbleStyle is the class containing attributes to customize appearance of this bubble.
Methods | Type | Description |
---|---|---|
set(background: UIColor) | UIColor | used to set background color |
set(borderWidth: CGFloat) | CGFloat | used to set border |
set(cornerRadius: CometChatCornerStyle) | CometChatCornerStyle | used to set border radius |
set(borderColor: UIColor) | UIColor | used to set border color |
set(playIconTint: UIColor) | UIColor | used to set play icon tint color |
set(playIconBackgroundColor: UIColor) | UIColor | used to set play icon background color |
Usage
- Swift
//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)