Search code examples
c#.netwinformswindows-media-playeraxwindowsmediaplayer

Captions only working in full screen


I'm using axwindowsmediaplayer control in Windows Forms application to show *.SMI caption file with the video being played. The problem is captions are only shown when WMP control is in full screen mode.

I have looked very hard but I have not been to determine why the same video and .SMI file doesn't work when WMP control is not in full screen mode.

When I play the video in WMP application the .SMI caption file is shown regardless of what size the player is in.

Any ideas?


Solution

  • Maybe that's not the answer you want to hear, but Microsoft itself says that the WMP wasn't made for showing external captions. In MSDN they advise you to use some "more powerful" player like VLC, etc..

    So a possible solution would be to use VLC. (Atleast if you're not contracted to WMP.)

    1) Add the VLC ActiveX component to Visual Studios toolbox. (Toolbox -> right-click -> add elements -> COM components tab -> axVLCPlugin21)

    2) Position the component on your WPF/WinForm window

    3) Load and play video.

    var convertedURI = new Uri("file:///" + Application.StartupPath +
                               "\\Wildlife.wmv").AbsoluteUri;
    axVLCPlugin21.playlist.add(convertedURI);
    axVLCPlugin21.playlist.play();
    

    4) To add captions just name the caption file like the video and place it inside the same directory as the video-file. (e.g. Wildlife.smi)
    VLC will load the captions/subtitles automatically.