Stop opening a figure window while using uiwait to pause a playing video in app designer

6 ビュー (過去 30 日間)
In my developed GUI, videos corresponding to alphabets are playing. I wanted to pause and resume those videos using push button. So, I used two different push button for pausing and resuming the playing video and used uiwait and uiresume functions, respectively. Now, when I click the push button of pause while playing the video, a blank figure window opens.
Can anyone suggest me a way to stop opening the figure window?
In case you need details, feel free to comment.
  2 件のコメント
Voss
Voss 2023 年 8 月 26 日
編集済み: Voss 2023 年 8 月 26 日
Please share the code; at least share the callback of the pause button.
NAVNEET NAYAN
NAVNEET NAYAN 2023 年 8 月 26 日
% Button pushed function: PlayButton
function PlayButtonPushed(app, event)
alph = app.InputDataEditField.Value;
Folder = 'F:\test_vids';
for k=1:length(alph)
aFile = fullfile(Folder, alph(k) + ".avi");
videoFReader = VideoReader(aFile);
n=videoFReader.NumberOfFrames;
for m=1:n
frames=read(videoFReader,m);
imshow(frames, 'Parent', app.UIAxes);
end
end
end
function PauseButtonValueChanged(app, event)
uiwait
end
function ResumeButtonPushed(app, event)
uiresume
end
Anything else do you require? First code is to play the video. 2nd one is for pause and resume push buttons

サインインしてコメントする。

採用された回答

Voss
Voss 2023 年 8 月 26 日

Use

uiwait(app.UIFigure)

and

uiresume(app.UIFigure)

(or whatever the handle to your app's uifigure is, if you changed it from the default app.UIFigure)

  2 件のコメント
NAVNEET NAYAN
NAVNEET NAYAN 2023 年 8 月 26 日
編集済み: NAVNEET NAYAN 2023 年 8 月 26 日
No, I have not changed the default one. Thank you @Voss for your answer. It is working.
Voss
Voss 2023 年 8 月 26 日
You're welcome!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMaintain or Transition figure-Based Apps についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by