YTCget/docs/ytcg.js

14 lines
461 B
JavaScript
Raw Normal View History

2017-10-29 00:45:46 +03:00
function getCover()
{
var videoUrl = document.getElementById('videoUrl').value;
2017-10-29 01:06:47 +03:00
var videoCover = new Image();
2022-09-25 01:12:00 +03:00
2017-10-29 01:06:47 +03:00
videoCover.onload = function()
{
document.getElementById('ytImage').innerHTML =
2021-06-05 18:01:32 +03:00
'<a title="' + videoCover.width + 'x' + videoCover.height + '" href="' + videoCover.src + '" download="cover"><img src="'+ videoCover.src +'"></a>';
2017-10-29 01:06:47 +03:00
}
videoCover.src = 'https://img.youtube.com/vi/' + YouTubeGetID(videoUrl) + '/maxresdefault.jpg';
2017-10-29 00:45:46 +03:00
}