1
0
mirror of https://github.com/algora-io/tv.git synced 2024-11-16 00:58:59 +02:00

use snapshot from video as channel og image

This commit is contained in:
zafer 2024-05-08 00:21:04 +03:00
parent d8e468f731
commit 5de36fd8d7
4 changed files with 6 additions and 4 deletions

View File

@ -314,10 +314,12 @@ defmodule AlgoraWeb.ChannelLive do
end
defp apply_action(socket, :show, params) do
user = Accounts.get_user!(socket.assigns.channel.user_id)
socket
|> assign(:page_title, socket.assigns.channel.name || params["channel_handle"])
|> assign(:page_description, socket.assigns.channel.tagline)
|> assign(:page_image, "#{AlgoraWeb.Endpoint.url()}/images/og/default.png")
|> assign(:page_image, Library.get_thumbnail_url(user))
end
defp show_stream_modal(socket) do

View File

@ -184,6 +184,6 @@ defmodule AlgoraWeb.ChatLive do
socket
|> assign(:page_title, socket.assigns.channel.name || params["channel_handle"])
|> assign(:page_description, socket.assigns.channel.tagline)
|> assign(:page_image, "#{AlgoraWeb.Endpoint.url()}/images/og/default.png")
|> assign(:page_image, Library.get_thumbnail_url(socket.assigns.video))
end
end

View File

@ -154,6 +154,6 @@ defmodule AlgoraWeb.EmbedLive do
socket
|> assign(:page_title, socket.assigns.channel.name || params["channel_handle"])
|> assign(:page_description, socket.assigns.channel.tagline)
|> assign(:page_image, "#{AlgoraWeb.Endpoint.url()}/images/og/default.png")
|> assign(:page_image, Library.get_thumbnail_url(socket.assigns.video))
end
end

View File

@ -634,7 +634,7 @@ defmodule AlgoraWeb.VideoLive do
socket
|> assign(:page_title, socket.assigns.channel.name || params["channel_handle"])
|> assign(:page_description, socket.assigns.channel.tagline)
|> assign(:page_image, "#{AlgoraWeb.Endpoint.url()}/images/og/default.png")
|> assign(:page_image, Library.get_thumbnail_url(socket.assigns.video))
end
defp show_stream_modal(socket) do