From 13b72c8c16e92172201ebe1ea6483875642d4b40 Mon Sep 17 00:00:00 2001 From: arbadacarba <63317640+arbadacarbaYK@users.noreply.github.com> Date: Sun, 24 Nov 2024 00:52:24 +0100 Subject: [PATCH] Add files via upload stream issue fixed --- src/popup.js | 40 +++++++++++++++------------------------- src/style.css | 10 +++++++--- 2 files changed, 22 insertions(+), 28 deletions(-) diff --git a/src/popup.js b/src/popup.js index 6105ab0..3557c12 100644 --- a/src/popup.js +++ b/src/popup.js @@ -553,8 +553,8 @@ async function renderMessages(messages) { messageList.appendChild(messageElement); }); - // Scroll to bottom after rendering - messageList.scrollIntoView({ behavior: 'smooth', block: 'end' }); + // Force scroll to bottom + chatContainer.scrollTop = chatContainer.scrollHeight; } // Setup message input handlers @@ -629,34 +629,24 @@ gifButton.addEventListener('click', () => { async function handleStreamChat(pubkey, header, container) { const channel = contactManager.channels.get(pubkey); if (!channel) { - console.error('Stream channel not found:', pubkey); container.innerHTML = '
Stream not available
'; return; } - // Clear any existing chat content container.innerHTML = ''; - - // Create and append stream container - const streamContainer = document.createElement('div'); - streamContainer.className = 'video-container'; - + const videoContainer = document.createElement('div'); + videoContainer.className = 'video-container'; + const iframe = document.createElement('iframe'); - iframe.src = `https://zap.stream/embed/${channel.streamUrl}`; - iframe.allow = 'accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture'; - iframe.allowFullscreen = true; - - streamContainer.appendChild(iframe); - container.appendChild(streamContainer); - - // Update header - header.innerHTML = ` - ${channel.displayName} - ${channel.displayName} - ${channel.about ? `
${channel.about}
` : ''} - `; + iframe.src = `https://zap.stream`; + iframe.style.width = '100%'; + iframe.style.height = '100%'; + iframe.style.border = 'none'; + + videoContainer.appendChild(iframe); + container.appendChild(videoContainer); + + updateChatHeader(header, channel); } async function subscribeToChannelEvents(channelPubkey) { @@ -920,7 +910,7 @@ async function initializeStreamSection() { displayName: 'Noderunners Radio', isChannel: true, avatarUrl: 'https://image.nostr.build/9a9c9e5dba5ed17361f2f593dda02bd2ba85a14e69db1f251b27423f43864efe.webp', - streamUrl: 'naddr1qqjrvvt9vdjkzc3c943nxdmr956rqc3k95urjdps95crqdmrvd3nxvtxvdskxqghwaehxw309aex2mrp0yhxummnw3ezucnpdejz7qgewaehxw309aex2mrp0yh8xmn0wf6zuum0vd5kzmp0qy88wumn8ghj7mn0wvhxcmmv9uq32amnwvaz7tmjv4kxz7fwv3sk6atn9e5k7tcpz9mhxue69uhkummnw3ezumrpdejz7qg7waehxw309ahx7um5wgkhqatz9emk2mrvdaexgetj9ehx2ap0qyghwumn8ghj7mn0wd68ytnhd9hx2tcpz4mhxue69uhhyetvv9ujumn0wd68ytnzvuhsz9thwden5te0dehhxarj9ehhsarj9ejx2a30qgsv73dxhgfk8tt76gf6q788zrfyz9dwwgwfk3aar6l5gk82a76v9fgrqsqqqan8acwaac' + streamUrl: 'naddr1qqjrvvt9vdjkzc3c943nxdmr956rqc3k95urjdps95crqdmrvd3nxvtxvdskxqghwaehxw309aex2mrp0yhxummnw3ezucnpdejz7qgewaehxw309aex2mrp0yh8xmn0wf6zuum0vd5kzmp0qy88wumn8ghj7mn0wvhxcmmv9uq32amnwvaz7tmjv4kxz7fwv3sk6atn9e5k7tcpz9mhxue69uhkummnw3ezumrpdejz7qg7waehxw309ahx7um5wgkhqatz9emk2mrvdaexgetj9ehx2ap0qyghwumn8ghj7mn0wd68ytnhd9hx2tcpz4mhxue69uhhyetvv9ujumn0wd68ytnzvuhsz9thwden5te0dehhxarj9ehhsarj9ejx2a30qgsv73dxhgfk8tt76gf6q788zrfyz9dwwgwfk3aar6l5gk82a76v9fgrqsqqqan8f2t2m0' }; const channel = { diff --git a/src/style.css b/src/style.css index 17f95b1..f6d339c 100644 --- a/src/style.css +++ b/src/style.css @@ -194,18 +194,22 @@ body { #chatContainer { flex: 1; overflow-y: auto; - padding: 16px; + padding: 0; background-color: var(--background-color); position: relative; - height: calc(100vh - 120px); + height: calc(100vh - 180px); + scrollbar-width: thin; + scrollbar-color: var(--border-color) transparent; } .message-list { display: flex; flex-direction: column; min-height: 100%; + padding: 16px 16px 76px 16px; + margin: 0; + overflow-y: auto; justify-content: flex-end; - padding-bottom: 76px; } .no-messages {