File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -16,14 +16,16 @@ url.searchParams.set("letterboxColor", "transparent");
1616
1717
1818// full url option
19- if (! thumbnailTimeOrURL .startsWith (" http" )) {
20- const thumbnailUrl = new URL (` ${videoId }/thumbnails/thumbnail.jpg ` , baseUrl );
21- thumbnailUrl .searchParams .set (" fit" , " crop" );
22- thumbnailUrl .searchParams .set (" time" , thumbnailTimeOrURL );
23-
24- url .searchParams .set (" poster" , encodeURI (thumbnailUrl .toString ()));
25- } else {
26- url .searchParams .set (" poster" , thumbnailTimeOrURL );
19+ if (thumbnailTimeOrURL !== undefined ) {
20+ if (! thumbnailTimeOrURL .startsWith (" http" )) {
21+ const thumbnailUrl = new URL (` ${videoId }/thumbnails/thumbnail.jpg ` , baseUrl );
22+ thumbnailUrl .searchParams .set (" fit" , " crop" );
23+ thumbnailUrl .searchParams .set (" time" , thumbnailTimeOrURL );
24+
25+ url .searchParams .set (" poster" , encodeURI (thumbnailUrl .toString ()));
26+ } else {
27+ url .searchParams .set (" poster" , thumbnailTimeOrURL );
28+ }
2729}
2830
2931---
You can’t perform that action at this time.
0 commit comments