I'm fairly new to javascript, but I'm trying to create a userscript to preview youtube videos by hovering over the thumbnail. Here is what I did so far: YouTubePreview.js
It works on main, subscriptions and search pages. However it does not work on the video pages. It plays the audio and I can fast-forward and rewind with my mouse, but the iframe just seems transparent. It still shows the thumbnail image, but if I remove it, it just turns white (there's no video underneath).
What is the reason behind this weird behaviour? Is it interfering with the player on the video page?
Fixed it myself: playerTag.style.zIndex = '1';