From baf13be5bb11bb061b0554c0169441eefbf74f57 Mon Sep 17 00:00:00 2001 From: Punyakrit Date: Mon, 13 May 2024 03:29:06 +0530 Subject: [PATCH 1/2] overflow ui fix --- src/app/questions/page.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/questions/page.tsx b/src/app/questions/page.tsx index 152cbe30b..98d370b8f 100644 --- a/src/app/questions/page.tsx +++ b/src/app/questions/page.tsx @@ -140,7 +140,7 @@ export default async function Home({ return ( <> -
+

Questions

@@ -159,7 +159,7 @@ export default async function Home({
-
+
@@ -215,7 +215,7 @@ export default async function Home({
-
+
{response?.data?.map((post) => ( Date: Thu, 16 May 2024 23:46:21 +0530 Subject: [PATCH 2/2] add keyboard control for and video progress handling --- package.json | 2 +- src/components/VideoPlayer2.tsx | 43 ++++++++++++++++++++++++++++++++- 2 files changed, 43 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 4abcf7930..f88c4c3ff 100644 --- a/package.json +++ b/package.json @@ -109,6 +109,6 @@ "prettier": "^3.2.4", "prisma": "^5.6.0", "tailwindcss": "^3.3.0", - "ts-node": "^10.9.2", + "ts-node": "^10.9.2" } } diff --git a/src/components/VideoPlayer2.tsx b/src/components/VideoPlayer2.tsx index b7a484689..526d2dca1 100644 --- a/src/components/VideoPlayer2.tsx +++ b/src/components/VideoPlayer2.tsx @@ -40,6 +40,7 @@ export const VideoPlayer: FunctionComponent = ({ const [player, setPlayer] = useState(null); const searchParams = useSearchParams(); const vidUrl = options.sources[0].src; + useEffect(() => { const t = searchParams.get('timestamp'); if (contentId && player && !t) { @@ -146,7 +147,7 @@ export const VideoPlayer: FunctionComponent = ({ player.currentTime(player.currentTime() - 5); event.stopPropagation(); break; - case 'ArrowUp': // Arrow up for increasing volume + case 'ArrowUp': // Arrow up for increasing volume event.preventDefault(); player.volume(player.volume() + 0.1); event.stopPropagation(); @@ -202,6 +203,46 @@ export const VideoPlayer: FunctionComponent = ({ } } break; + case 'Digit1': + player.currentTime(player.duration() * 0.1); + event.stopPropagation(); + break; + case 'Digit2': + player.currentTime(player.duration() * 0.2); + event.stopPropagation(); + break; + case 'Digit3': + player.currentTime(player.duration() * 0.3); + event.stopPropagation(); + break; + case 'Digit4': + player.currentTime(player.duration() * 0.4); + event.stopPropagation(); + break; + case 'Digit5': + player.currentTime(player.duration() * 0.5); + event.stopPropagation(); + break; + case 'Digit6': + player.currentTime(player.duration() * 0.6); + event.stopPropagation(); + break; + case 'Digit7': + player.currentTime(player.duration() * 0.7); + event.stopPropagation(); + break; + case 'Digit8': + player.currentTime(player.duration() * 0.8); + event.stopPropagation(); + break; + case 'Digit9': + player.currentTime(player.duration() * 0.9); + event.stopPropagation(); + break; + case 'Digit0': + player.currentTime(0); + event.stopPropagation(); + break; } } };