in reply to detect end of video
You should be able to detect the position/state of the video by polling:
my( $value, $type ) = $mech->eval_in_page(<<'JS'); var videoElement = find_video_element(); // you need to write that + yourself return videoElement.ended; JS
Also of interest could be videoElement.currentTime; to maybe better synchronize your playback.
You could also use more fancy Javascript to send events to a Perl webserver when the playback starts/ends or every five seconds etc.
|
|---|