The ltmmPlay object allows the user to playback multimedia files.
To begin a simple playback you will first need to create an instance of the ltmmPlay class. This is accomplished using the Win32 CoCreateInstance function as follows:
IltmmPlay* pPlay;
CoCreateInstance(&CLSID_ltmmPlay, NULL, CLSCTX_INPROC_SERVER, &IID_IltmmPlay, (void**) &pPlay);
IltmmPlay* pPlay;
CoCreateInstance(&CLSID_ltmmPlay, NULL, CLSCTX_INPROC_SERVER, &IID_IltmmPlay, (void**) &pPlay);
The function creates an instance of ltmmPlay and returns an IltmmPlay interface pointer. It is through the IltmmPlay interface that playback is controlled.
Define a frame window for the playback:
HWND hwndFrame;
IltmmPlay_put_VideoWindowFrame (pPlay, (long) hwndFrame);
HWND hwndFrame;
pPlay->put_VideoWindowFrame((long) hwndFrame);
The user is required to create the window that serves as the video frame. ltmmPlay will subclass this window, so there is no need to forward any messages to the ltmmPlay object. By default, ltmmPlay will automatically maximize the video within the frame window. The video will automatically resize when the frame window size changes.
Define the source or input file. As demonstrated with the following code:
BSTR bstr;
// create a string containing the source file path
bstr = SysAllocString(L"c:\\source.avi");
// assign the source file path to the play object
IltmmPlay_put_SourceFile (pPlay, bstr);
// free the string
SysFreeString(bstr);
BSTR bstr;
// create a string containing the source file path
bstr = SysAllocString(L"c:\\source.avi");
// assign the source file path to the play object
pPlay->put_SourceFile(bstr);
// free the string
SysFreeString(bstr);
The code above allocates a string containing an AVI file path and assigns the path to the play object with a call to put_SourceFile.
Start the playback:
IltmmPlay_Run (pPlay);
pPlay->Run ();
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document