Skip to content

Commit

Permalink
video added
Browse files Browse the repository at this point in the history
  • Loading branch information
prtkjakhar committed Feb 9, 2024
1 parent 7097a64 commit aa3e6fa
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 15 deletions.
17 changes: 4 additions & 13 deletions apps/amakrushi/src/components/chat-message-item/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -570,23 +570,14 @@ const ChatMessageItem: FC<ChatMessageItemPropType> = ({ message, onSend }) => {

case 'video': {
const url = content?.data?.payload?.media?.url || content?.data?.videoUrl;
const videoId = url.split("=")[1];
return (
<>
{content?.data?.position === 'left' && (
<div
style={{
width: '40px',
marginRight: '4px',
textAlign: 'center',
}}></div>
)}
<Bubble type="image">
<div style={{ padding: '7px' }}>
<Video
cover="https://uxwing.com/wp-content/themes/uxwing/download/video-photography-multimedia/video-icon.png"
src={url}
/>

<iframe width="100%" height="fit-content"
src={`https://www.youtube.com/embed/`+videoId}
frameBorder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowFullScreen></iframe>
<div
style={{
display: 'flex',
Expand Down
2 changes: 1 addition & 1 deletion apps/amakrushi/src/context/ContextProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ const ContextProvider: FC<{
) {
await updateMsgState({
msg: msg,
media: { imageUrls: msg?.content?.media_url },
media: { imageUrl: msg?.content?.media_url },
});
}
} else if (msg.content.msg_type.toUpperCase() === 'AUDIO') {
Expand Down
2 changes: 1 addition & 1 deletion packages/chat-ui/dist/index.js

Large diffs are not rendered by default.

0 comments on commit aa3e6fa

Please sign in to comment.