We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4280198 commit f24a791Copy full SHA for f24a791
src/transformers/YouTube.js
@@ -24,13 +24,13 @@ export const getTimeValueInSeconds = (timeValue) => {
24
};
25
export const getYouTubeIFrameSrc = (urlString) => {
26
const url = new URL(urlString);
27
- let id = url.searchParams.get('v');
28
- if (url.host === 'youtu.be') {
29
- id = url.pathname.slice(1);
30
- }
+ const id =
+ url.host === 'youtu.be' ? url.pathname.slice(1) : url.searchParams.get('v');
+
31
const embedUrl = new URL(
32
`https://www.youtube-nocookie.com/embed/${id}?rel=0`
33
);
34
url.searchParams.forEach((value, name) => {
35
if (name === 'v') {
36
return;
0 commit comments