javascript - How to automatically manipulate an html5 video? -
I am testing automation for an html5 video related project.
Target: When I run my script, embedded video starts automatically, stops and jumps to a specific point.
& lt; Video control = "control" id = "asset-element" class = "video-asset" preload = "auto" allowed screen = "" & gt; & Lt; Source src = "sample.mp4" type = "video / mp34" & gt; Your browser does not support the video tag. & Lt; / Video & gt;
I'm only able to start the video because the video landing page has a 'Start button' image, which triggers an event:
& Lt; Img id = "playbutton" class = "play-button" src = "sample.png" onclick = "showvideo endplay ()" \ & gt;
and the following code 'Start' will work:
driver.findElement (webdriver.By.id ('playButton')). Click ( );
However, I do not know how to stop this video or look for any point.
Is there a JS Libs to do this?
I tried to stop like this:
var video = driver.findElement (webdriver.By.id ('asset-element')); Video.pause ();
But it throws:
video.pause (); ^ TypeError: There is no way 'pause' in object [object object]
Pre-appreciate it!
Comments
Post a Comment