From 24f6bb1ea506b3c116a107795430f5824a346c15 Mon Sep 17 00:00:00 2001 From: Gabe Kangas Date: Mon, 23 Jan 2023 19:28:32 -0800 Subject: [PATCH] Add aria-title attribute to video player. For #1826 --- web/components/ui/Content/Content.tsx | 8 +++++++- .../video/OwncastPlayer/OwncastPlayer.stories.tsx | 1 + web/components/video/OwncastPlayer/OwncastPlayer.tsx | 9 +++++---- web/pages/embed/video/index.tsx | 3 ++- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/web/components/ui/Content/Content.tsx b/web/components/ui/Content/Content.tsx index fe077b0dc..53194cb42 100644 --- a/web/components/ui/Content/Content.tsx +++ b/web/components/ui/Content/Content.tsx @@ -335,7 +335,13 @@ export const Content: FC = () => {
{appState.appLoading && } - {online && } + {online && ( + + )} {!online && !appState.appLoading && ( = ({ source, online, initiallyMuted = false, + title, }) => { const playerRef = React.useRef(null); const [videoPlaying, setVideoPlaying] = useRecoilState(isVideoPlayingAtom); @@ -85,13 +86,13 @@ export const OwncastPlayer: FC = ({ } }; - const setLatencyCompensatorItemTitle = title => { + const setLatencyCompensatorItemTitle = t => { const item = document.querySelector('.latency-toggle-item > .vjs-menu-item-text'); if (!item) { return; } - item.innerHTML = title; + item.innerHTML = t; }; const startLatencyCompensator = () => { @@ -310,7 +311,7 @@ export const OwncastPlayer: FC = ({
{online && (
- +
)}
diff --git a/web/pages/embed/video/index.tsx b/web/pages/embed/video/index.tsx index 9f3289483..a3dbe1df2 100644 --- a/web/pages/embed/video/index.tsx +++ b/web/pages/embed/video/index.tsx @@ -20,7 +20,7 @@ export default function VideoEmbed() { const { name } = clientConfig; const { offlineMessage } = clientConfig; - const { viewerCount, lastConnectTime, lastDisconnectTime } = status; + const { viewerCount, lastConnectTime, lastDisconnectTime, streamTitle } = status; const online = useRecoilValue(isOnlineSelector); const router = useRouter(); @@ -48,6 +48,7 @@ export default function VideoEmbed() { source="/hls/stream.m3u8" online={online} initiallyMuted={initiallyMuted} + title={streamTitle || name} /> )} {!online && (