This code is basically impossible to understand without comments.  If it is really necessary to use a condition this complex to determine whether the video is loading or not, then we need to file a gecko bug about it, and this code should be clearly marked as a workaround so that it can be removed when the underlying bug is fixed.

I suspect, though, that there is not a bug in gekco and that we can find simpler code that will work here.