function pushbutton1_Callback(hObject, eventdata, handles)
if ~isfield('handles', 'active_player')
handles.active_player = 0;
end
handles.active_player = 1;
guidata(hObject, handles);
obj = VideoReader('supernewtable.mp4');
video = obj.read();
axes(handles.axes1);
fps=120;
for i=1:max(video(1,1,1,:))
handles = guidata(hObject);
if handles.active_player ~= 1; break; end
imshow(video(:,:,:,i));
pause(0.5/fps);
end
function pushbutton2_Callback(hObject, eventdata, handles)
if ~isfield('handles', 'active_player')
handles.active_player = 0;
end
handles.active_player = 2;
guidata(hObject, handles);
obj = VideoReader('contgantry.mp4');
video = obj.read();
axes(handles.axes1);
fps=120;
for i=1:max(video(1,1,1,:))
handles = guidata(hObject);
if handles.active_player ~= 2; break; end
imshow(video(:,:,:,i));
pause(0.5/fps);
end
Best Answer