So I'm fairly new to tampermonkey. I just need to know, say I had a video on a website. For example, on the MyMaths page: https://www.mymaths.co.uk/primary.html it has a video about cumnor primary school at this youtube url: https://youtu.be/D5kVFVwkdLs and say I wanted to replace it with another video, say, "How to safely remove asbestos" at youtube url: https://www.youtube.com/watch?v=L_1xtqwfLrU
This may be something rally obvious that I'm missing but could anyone help me? Thanks.
This depends on how the video is embedded. If it is embedded like the video on the startpage of mymaths.co.uk:
<iframe src="https://www.youtube.com/embed/D5kVFVwkdLs?rel=0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen="" width="560" height="315" frameborder="0"></iframe>you would simply try to get thesrc, which in this case is set in the first iframe-tag and replace it.document.getElementsByTagName("iframe")[0].src = document.getElementsByTagName("iframe")[0].src.replace("D5kVFVwkdLs","L_1xtqwfLrU");