YouTube: log video technical info
Prints the resolution, duration, speed and metadata of the currently playing video to the console.
Code to copy
// Log technical details of the current video to the console
const v = document.querySelector('video.html5-main-video');
const p = document.querySelector('.html5-video-player');
if (v) {
console.group('YouTube video info');
console.log('resolution :', v.videoWidth + 'x' + v.videoHeight);
console.log('duration :', v.duration.toFixed(1) + 's');
console.log('current :', v.currentTime.toFixed(1) + 's');
console.log('rate :', v.playbackRate + 'x');
if (p && p.getVideoData) console.log('videoData :', p.getVideoData());
console.groupEnd();
} else {
console.warn('No video element found on this page.');
}
How to use this example
- Copy the code with the button above.
- Install JustZix (2 minutes) and open the extension on the target page.
- Add a new rule matching that page.
- Paste the code into the rule's JavaScript panel and save — it runs on every page visit.
Rate this example
No ratings yet — be the first.