I am writing a script and want to be able to set autoplay for any HTML5 Stream or Video. If even better, I would like to block or remove it temporarily from the site I am on. I will provide the inspected element as well.
If no one knows the above, is there way I can block a certain video id or class
<video id="still_video_object_html5_api" class="vjs-tech"
These are also the scripts that are unchanging to the HTML5 Live Stream
webkit-playsinline="" playsinline="" autoplay="" tabindex="-1"
type="application/x-mpegURL"></video>
I am using: Python, Selenium Webdriver, & Chrome on Windows 10
Tested with Chrome 67 and the C# version of the ChromeDriver, here's the code that allowed me to have YouTube videos autoplayed (whereas the default behaviour since Chrome 66 is to disable autoplay) :
var options = new ChromeOptions();
options.AddArgument("--autoplay-policy=no-user-gesture-required");
IWebDriver browserDriver = new ChromeDriver(AppContext.BaseDirectory, options);
The Python API certainly has equivalent to the AddArgument(string)
method.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With