diff --git a/public/css/Room.css b/public/css/Room.css
index bf64d83f..7f0f7f6f 100644
--- a/public/css/Room.css
+++ b/public/css/Room.css
@@ -440,11 +440,16 @@ body {
}
.msg-text {
+ display: inline-block;
overflow-wrap: break-word;
word-wrap: break-word;
hyphens: auto;
}
+.msg-text iframe {
+ width: 100%;
+}
+
.msg-a {
color: #fff;
}
diff --git a/public/js/RoomClient.js b/public/js/RoomClient.js
index 97d124b8..16c86cbc 100644
--- a/public/js/RoomClient.js
+++ b/public/js/RoomClient.js
@@ -2357,6 +2357,7 @@ class RoomClient {
if (this.isHtml(message)) return this.stripHtml(message);
if (this.isValidHttpURL(message)) {
if (isImageURL(message)) return '
';
+ if (this.isVideoTypeSupported(message)) return this.getIframe(message);
return '' + message + '';
}
if (isChatMarkdownOn) return marked.parse(message);
@@ -2395,6 +2396,20 @@ class RoomClient {
return url.protocol === 'http:' || url.protocol === 'https:';
}
+ getIframe(url) {
+ let is_youtube = this.getVideoType(url) == 'na' ? true : false;
+ let video_audio_url = is_youtube ? this.getYoutubeEmbed(url) : url;
+ return `
+ `;
+ }
+
getLineBreaks(message) {
return (message.match(/\n/g) || []).length;
}