MATLAB Answers

Is it possible to modify the menu options in vision.VideoPlayer system object from command-line?

13 views (last 30 days)
I am using the vision.VideoPlayer System object, and would like to make changes to menu options like “Drop frame to improve performance”, “Fit to Window”, etc. Is there a way to this programmatically, rather than using the menu bar in the Video Player window?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 30 May 2017
There is no direct way for modifying the vision.VideoPlayer menu objects.  However, as a workaround, you may gain access to figure handle of the object and then access the individual parameters using 'findobj'.  For example, the two parameters "Drop frame to improve performance" and " Fit to Window" can be modified by executing the following commands:
1. Gain access to figure handle of the vision.VideoPlayer object
>> set(0,'showHiddenHandles','on')
>> fig_handle = gcf ;
>> fig_handle.findobj % to view all the linked objects with the vision.VideoPlayer
2. Modify and execute "Fit to Window" option.
>>ftw = fig_handle.findobj ('TooltipString', 'Maintain fit to window') % this will search the object in the figure which has the respective 'TooltipString' parameter.
>>ftw.ClickedCallback() % execute the callback linked with this object
3. Modify and toggle "Drop frame to improve performance" parameter. Note that the object can also be searched by sequentially navigating through the Children properties of the 'Playback' menu option.
>> df = fig_handle.findobj('Label', 'Dr&op Frames to Improve Performance') %The & symbol denotes accelerator key
>> df.Callback(); % This command toggles the check mark every time it is executed
More information on navigating object handles may be found in the documentation at the following links:

  0 Comments

Sign in to comment.

More Answers (1)

Krista Marrero
Krista Marrero on 2 Aug 2018
Dear MathWorks Support, I have been searching for this answer (albeit through google and MATLAB implay properties) for, literally, months. Thank you so much for this answer ! ! !

  0 Comments

Sign in to comment.

Sign in to answer this question.