Show video in App designers

조회 수: 11 (최근 30일)
Le Dinh Minh Nhat
Le Dinh Minh Nhat 2021년 6월 25일
답변: evaydh 2022년 6월 27일
Hi, I read a lot of answer how to show video in App designer. I want to show it in UI Figure not popup a new figure.
Would you mind have a look to my code and give me some suggestions ?
% Callbacks that handle component events
methods (Access = private)
% Image clicked function: Image
function ImageClicked(app, event)
vidObj = VideoReader('testvideo.mp4');
vidObj.CurrentTime = 0;
while hasFrame(vidObj)
vidFrame = readFrame(vidObj);
image(vidFrame, "Visible","on")
%imshow(vidFrame, "Parent",ax);
pause(0.01);
end
end
end
Thank you very much.

채택된 답변

Mohammad Sami
Mohammad Sami 2021년 6월 25일
Do you need to get the frames of the video for some reason. If not I propose you use uihtml to display the video instead.
The example on how to do this is available in the uihtml documentations here.
  댓글 수: 2
Le Dinh Minh Nhat
Le Dinh Minh Nhat 2021년 6월 25일
Thank you for your suggestion. I just want to show the video in figure. I will try to use uihtml and reply you later
Fahad Halawani
Fahad Halawani 2022년 5월 22일
Was this possible? I am finding difficulty implementing this to my app

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

evaydh
evaydh 2022년 6월 27일
Try using uiimage to play video and timer to control video playback. Don't worry. Mainstream computer configurations are sufficient.

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by