From WxWiki
Jump to: navigation, search
Official Classes SmallBlocks.png Archive Containers Controls Data Structures Database Date & Time Debug Device Contexts Dialogs Document & Views Drag & Drop Events Filesystem Frames Graphics Grid Cell Help HTML Logging Miscellaneous Networking Printing Sizers Streams Threading Windows

wxMediaCtrl is a class for displaying types of media, such as videos, audio files, natively through native codecs.

wxMediaCtrl uses native backends to render media, for example on Windows there is a ActiveMovie/DirectShow backend, and on Macintosh there is a QuickTime backend.

Platform Specific Quirks

  1. Loading on windows may fail after the call to Load() but before the wxEVT_MEDIA_LOADED event is sent, and in this case the user will notified with a message dialog
  2. On Linux, the size of the video through GetBestSize() and the duration is not available until AFTER the media starts playing for a while
  3. GetBestSize() on mac with player controls enabled does not return the video size but instead returns the video size plus the size of the player controls
  4. Be sure to call Play() in wxEVT_MEDIA_LOADED and not right after Load() as on most platforms that won't work anymore
  5. The documentation at wxMediaCtrl is not up to date the second and third parameter of the constructor are switched. The windowId is the second parameter and the filename is the third.

To build wxWidgets with wxMediaCtrl enabled on linux (gstreamer 0.10) libgconf2-dev and libgstreamer0.10-dev are required.

See Also