Hi Amit,
This is sort of a tricky thing to do. There is an OSMF way to do this,
but it doesn't work with the MAST plug-in. What I've had to do in the
past is listen for the adding of a DisplayObjectTrait on the media. If
the trait is of the DisplayObjectTrait, that usually means that the
current video being played has changed. It can be triggered by other
things, though. You'll need some way to check to see whether the video
playing is the main video or an ad. I have checked for metadata that
my main video will always have, but that may not be available for you.
You'll need to find something that makes a distinction between the ad
and the content.
Nils