Is anyone here familiar with Sikuli?
I am using Sikuli to detect videos on a webpage, and to check if the video has ended.
I have tried 2 different ways of going about this.
The first method is using the event handler in Sikuli.
The event handler will detect for changes in a region (which is an area on the screen that I've declared). When there are changes on the screen (a minimum 50 pixels change), it will print 'Video playing'.
The thing is, if there aren't any changes, the event handler will not do anything. I want to be able to detect when there are no longer any changes on the region and be able to stop the observer.
The second method that I've tried is by comparing my region (which is my active web browser window) to a screen capture of the region I have taken while the video is playing.
If it doesn't match, that means the video is still playing and I will take a new screen capture, which will be run through the while loop again for comparison.
If it matches, it means the video has stopped and will exit the while loop.
It works when it first goes through the loop. The while loop returns null which means the video is playing. However, on the second time it loops, it will exit the while loop and tell me my video has stopped but it clearly hasn't.
Is my logic flawed?
A solution to either method is fine, the end goal is to be able to detect when a video has ended.