Skip to content

Commit

Permalink
feat(channel-web): add support for audio and video display (#4989)
Browse files Browse the repository at this point in the history
Co-authored-by: Samuel Massé <59894025+samuelmasse@users.noreply.github.com>
  • Loading branch information
laurentlp and samuelmasse committed May 10, 2021
1 parent dfffc7d commit 6453637
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/channel-web/src/backend/socket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import path from 'path'

import Database from './db'

const outgoingTypes = ['text', 'typing', 'login_prompt', 'file', 'carousel', 'custom', 'data']
const outgoingTypes = ['text', 'typing', 'login_prompt', 'file', 'carousel', 'custom', 'data', 'video', 'audio']

export default async (bp: typeof sdk, db: Database) => {
const config: any = {} // FIXME
Expand Down Expand Up @@ -34,7 +34,7 @@ export default async (bp: typeof sdk, db: Database) => {
return next(undefined, true)
}

const standardTypes = ['text', 'carousel', 'custom', 'file', 'login_prompt']
const standardTypes = ['text', 'carousel', 'custom', 'file', 'login_prompt', 'video', 'audio']

if (!event.payload.type) {
event.payload.type = messageType
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,14 @@ class Message extends Component<MessageProps> {
)
}

render_audio() {
return <FileMessage file={this.props.payload} escapeTextHTML={this.props.store.escapeHTML} />
}

render_video() {
return <FileMessage file={this.props.payload} escapeTextHTML={this.props.store.escapeHTML} />
}

render_file() {
return <FileMessage file={this.props.payload} escapeTextHTML={this.props.store.escapeHTML} />
}
Expand Down

0 comments on commit 6453637

Please sign in to comment.