Show video in App designers
2 次查看(过去 30 天)
显示 更早的评论
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.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/665010/image.jpeg)
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.
0 个评论
采纳的回答
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 个评论
更多回答(1 个)
evaydh
2022-6-27
Try using uiimage to play video and timer to control video playback. Don't worry. Mainstream computer configurations are sufficient.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Develop Apps Using App Designer 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!