Previous | Next |
The Play method plays at the current seek position. If the IMDSPDeviceControl::Seek method has not been called, then playing begins at the beginning of the first file and play length is not defined.
Syntax
HRESULT Play();
Parameters
This method takes no parameters.
Return Values
If the method succeeds, it returns S_OK. If it fails, it returns an HRESULT error code.
Return code | Description |
E_BUSY | The device is busy. |
WMDM_E_NOTSUPPORTED | The play function is not implemented on this device. |
E_FAIL | An unspecified error occurred. |
Remarks
This method is used to invoke both device playback (playback of an audio track on a storage medium of the media device) and streaming audio playback (streaming audio data from the user’s computer to the media device, where it is played). The IMDSPDeviceControl::Seek method determines the form of playback that occurs.
Some devices do not support either device playback or streaming audio playback. Before attempting to start playback of a particular type, the IMDSPDeviceControl::GetCapabilities method must be called. If unsupported playback is attempted, this method returns WMDM_E_NOTSUPPORTED.
To determine whether an audio format can be played by the media device before invoking the play operation, you can call the IMDSPDevice::GetFormatSupport method.
See Also
Previous | Next |