Callback functions for displaying videos
Show older comments
I am making a GUI in Matlab using AppDesigner. It displays a video after pressing the push button. This video is already stored in a folder and I am reading it first and then playing it. But the problem is "The video is displayed in a different window". How can I display the video in the same window where push button was pressed. I am attaching here the piece of code used as callback function for dispalying window.
function ButtonPushed(app, event)
app1.VFR= vision.VideoFileReader('newfile.avi');
app1.VPR = vision.VideoPlayer;
% Play video. Every call to the step method reads another frame.
while ~isDone(app1.VFR)
frame = step(app1.VFR);
step(app1.VPR,frame);
end
end
Please suggest a way for this. In case anyone need details regarding the problem please leave a comment.
2 Comments
Mohammad Sami
on 6 Jan 2020
If you have the latest version of Matlab and your videos are mp4 standard, you can use the uihtml element to embed your video as an html.
The html tags for embedding a video can be seen here.
NAVNEET NAYAN
on 6 Jan 2020
Accepted Answer
More Answers (0)
Categories
Find more on Video Formats and Interfaces in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!