VideoPuppeteer(marionette, url, video_selector='video', interval=1, set_duration=0, stall_wait_time=0, timeout=60, autostart=True)¶
Wrapper to control and introspect HTML5 video elements.
A note about properties like current_time and duration: These describe whatever stream is playing when the state is checked. It is possible that many different streams are dynamically spliced together, so the video stream that is currently playing might be the main video or it might be something else, like an ad, for example.
- marionette – The marionette instance this runs in.
- url – the URL of the page containing the video element.
- video_selector – the selector of the element that we want to watch. This is set by default to ‘video’, which is what most sites use, but others should work.
- interval – The polling interval that is used to check progress.
- set_duration – When set to >0, the polling and checking will stop at the number of seconds specified. Otherwise, this will stop at the end of the video.
- stall_wait_time – The amount of time to wait to see if a stall has cleared. If 0, do not check for stalls.
- timeout – The amount of time to wait until the video starts.
Get Firefox internal debugging for the video element.
Returns: A text string that has Firefox-internal debugging information.
Tell the video element to Pause.
Tell the video element to Play.
If we are near the end and there is still a video element, then we are essentially done. If this happens to be last time we are polled before the video ends, we won’t get another chance.
Parameters: self – The VideoPuppeteer instance that we are interested in. Returns: True if we are close enough to the end of playback; False otherwise.
Determine if video has started
Parameters: self – The VideoPuppeteer instance that we are interested in. Returns: True if is playing; False otherwise
Exception class to use for video-specific error processing.