I have also tried to kill the axes that the video is running in (using the axes handle), but I get an error (presumably because movie() is still actively using the axes?)
How can I interrupt a movie based on user input to a GUI
조회 수: 1 (최근 30일)
이전 댓글 표시
I have a GUI that displays video to a user. I want the video to stop playing when the user presses a particular button. Unfortunately, the movie (I am using the movie() command) continues to play until it is done on its own.
How can I interrupt the playback of movie() based on a buttonpress event (i.e. from a user event callback).
BTW, I don't believe Ctrl-C will work, because I don't want the GUI to stop running. I want to terminate the movie running in a particular axes on the GUI, and start another movie in the same axes.
Thanks in advance, Sean
채택된 답변
Sean de Wolski
2011년 7월 15일
A totally different approach:
Instead of playing the movie with movie; write a function that traverses the frames and displays them using imshow. Start the movie, set the frame rate etc. using a timer and stop the timer to stop the movie. Useful documentation:
doc timer
This obviously will require more work; but can be tuned to give you exactly what you want.
추가 답변 (2개)
Sean de Wolski
2011년 7월 15일
You could kill the axes inside a try/catch block so that the error is not reported and so that nothing bad happens.
참고 항목
카테고리
Help Center 및 File Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!