Skip to content

Commit 4896d34

Browse files
authored
Remove params from videoId, adjust thumbnail position (#523)
* Remove params from videoId, adjust thumbnail position Signed-off-by: Tomás Castillo <tcastilloboireau@gmail.com> * Add TODO to check regex for videoId Signed-off-by: Tomás Castillo <tcastilloboireau@gmail.com> --------- Signed-off-by: Tomás Castillo <tcastilloboireau@gmail.com>
1 parent 1a9cb8e commit 4896d34

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/components/LazyLoadVideo/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ function LazyLoadVideo({ videoUrl }) {
1515
}, []);
1616

1717
const getVideoId = (url) => {
18-
return url.replace('https://www.youtube.com/embed/', '');
18+
// TODO: get a better match method ( regex )
19+
return url.replace('https://www.youtube.com/embed/', '').split('?')[0];
1920
}
2021

2122
const loadVideo = () => {

src/components/LazyLoadVideo/index.module.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
position: absolute;
1111
width: 100%;
1212
height: auto;
13-
top: 0;
13+
top: -30px;
1414
left: 0;
1515
opacity: 0.7;
1616
}

0 commit comments

Comments
 (0)