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 9db7796 commit 8728048Copy full SHA for 8728048
testpage/poster-image-availability.html
@@ -53,7 +53,13 @@
53
54
$('form').on('submit', (e) => {
55
const value = $('input').value;
56
- const videoid = value.length < 20 ? value : new URL(value).searchParams.get('v');
+ let videoid = value.length < 20 ? value : new URL(value).searchParams.get('v');
57
+ if (!videoid) {
58
+ const u = URL.parse(value);
59
+ if (u.host === 'youtu.be') {
60
+ videoid = u.pathname.slice(1);
61
+ }
62
63
$('input').value = videoid;
64
});
65
0 commit comments