forked from snxraven/LinkUp-P2P-Chat
Up to date fork #1
6
app.js
6
app.js
@ -539,7 +539,7 @@ function addFileMessage(from, fileName, fileUrl, fileType, avatar, topic) {
|
|||||||
$div.classList.add('message');
|
$div.classList.add('message');
|
||||||
|
|
||||||
const $img = document.createElement('img');
|
const $img = document.createElement('img');
|
||||||
$img.src = avatar || 'https://via.placeholder.com/40';
|
$img.src = updatePortInUrl(avatar) || 'https://via.placeholder.com/40';
|
||||||
$img.classList.add('avatar');
|
$img.classList.add('avatar');
|
||||||
$div.appendChild($img);
|
$div.appendChild($img);
|
||||||
|
|
||||||
@ -553,7 +553,7 @@ function addFileMessage(from, fileName, fileUrl, fileType, avatar, topic) {
|
|||||||
|
|
||||||
if (fileType.startsWith('image/')) {
|
if (fileType.startsWith('image/')) {
|
||||||
const $image = document.createElement('img');
|
const $image = document.createElement('img');
|
||||||
$image.src = fileUrl;
|
$image.src = updatePortInUrl(fileUrl);
|
||||||
$image.alt = fileName;
|
$image.alt = fileName;
|
||||||
$image.classList.add('attached-image');
|
$image.classList.add('attached-image');
|
||||||
$content.appendChild($image);
|
$content.appendChild($image);
|
||||||
@ -664,7 +664,7 @@ function addAudioMessage(from, audioUrl, avatar, topic) {
|
|||||||
if (from !== config.userName) {
|
if (from !== config.userName) {
|
||||||
$audio.autoplay = true; // Add autoplay attribute for peers only
|
$audio.autoplay = true; // Add autoplay attribute for peers only
|
||||||
}
|
}
|
||||||
$audio.src = audioUrl;
|
$audio.src = updatePortInUrl(audioUrl);
|
||||||
$audio.classList.add('attached-audio');
|
$audio.classList.add('attached-audio');
|
||||||
$content.appendChild($audio);
|
$content.appendChild($audio);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user