From cdda71226b3d509b5171dec6b68aa7ee16a1d1db Mon Sep 17 00:00:00 2001 From: Zeliha Pala Date: Sat, 25 May 2024 17:54:04 +0100 Subject: [PATCH] embed link bug fixed --- client/src/VideoRecommendations.jsx | 37 +++++++++++++++++++---------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/client/src/VideoRecommendations.jsx b/client/src/VideoRecommendations.jsx index 507dc97dfa..c18d07cd47 100644 --- a/client/src/VideoRecommendations.jsx +++ b/client/src/VideoRecommendations.jsx @@ -21,24 +21,35 @@ const VideoList = () => { }); }, []); + function changeYTLinkToEmbed(watchLink) { + const embedLink = watchLink.replace("watch?v=", "embed/"); + return embedLink; + } + return (
- {videos.map((videoData, i) => ( -
-
- + {videos.map((videoData, i) => { + const embededLink = changeYTLinkToEmbed(videoData.src); + return ( +
+
+ +
-
- ))} + ); + })}
); + () => { + return askxjsnj; + }; }; export default VideoList;