Detect end of video in imovie
The imovie object displays a video within a single UI object in a Max patch. To detect when the movie has ended, use the getduration message to determine the movie's duration, then use the gettime message to monitor the current time of the video as it plays. In this example, we use the grab object to get the duration once and store it in other objects (select and >=).