Error processing SSI file
LEADTOOLS Multimedia (Leadtools.MediaFoundation assembly)

Show in webframe

GetPreferredMediaSourceHandler Method (PlayCtrl)






A PreferredMediaSourceHandler enumeration value specifying the desired media source handler type
Retrieves the preferred media source handler's GUID set using SetPreferredMediaSourceHandler.
Syntax
public virtual string GetPreferredMediaSourceHandler( 
   PreferredMediaSourceHandler MediaSourceHandlerType
)
'Declaration
 
Public Overridable Function GetPreferredMediaSourceHandler( _
   ByVal MediaSourceHandlerType As PreferredMediaSourceHandler _
) As String
'Usage
 
Dim instance As PlayCtrl
Dim MediaSourceHandlerType As PreferredMediaSourceHandler
Dim value As String
 
value = instance.GetPreferredMediaSourceHandler(MediaSourceHandlerType)
public:
virtual String^ GetPreferredMediaSourceHandler( 
   PreferredMediaSourceHandler MediaSourceHandlerType
) 

Parameters

MediaSourceHandlerType
A PreferredMediaSourceHandler enumeration value specifying the desired media source handler type

Return Value

A string containing a media source handler's GUID.
Remarks
This method can be used to determine whether a preferred media source handler has been set by SetPreferredMediaSourceHandler. It will return NULL (if no preferred media source handler has been set) or a GUID indicating the preferred media source handler.

This GUID uniquely identifies the media source handler. Every media format has one or registered media source handlers responsible of creating a media source for this media type.

For example, the GUID for the LEAD MPEG2 Transport Media Source Handler is: EFE626C3-0A2C-49FA-8A01-3768B559B6DA

A list of display names for common media source handlers can be found in Constants.PreferredMediaSourceHandlers.

Please see SetPreferredMediaSourceHandler for more information on media source handler display names.

Example
Copy Code  
Imports Leadtools
Imports Leadtools.MediaFoundation
Imports LeadtoolsMediaFoundationExamples.Fixtures

Public _result As Boolean = False
Public _form As PlayCtrlForm = New PlayCtrlForm()
Public Sub PlayerPreferredMediaSourceHandlersExample()
   Try
      ' reference the forms play control
      Dim playctrl As PlayCtrl = _form.PlayCtrl

      ' set the preferred ISO(MP4) media source handler to the LEAD default (which is the LEAD ISO Media Source handler)
      playctrl.SetPreferredMediaSourceHandler(PreferredMediaSourceHandler.ISO, _
                                  Leadtools.MediaFoundation.Constants.PreferredMediaSourceHandlers.LEADDefault)

      ' the default ISO(MP4) media source handler should be the LEAD ISO(MP4) media source handler now
      _result = (String.Compare(playctrl.GetPreferredMediaSourceHandler(PreferredMediaSourceHandler.ISO), _
                                Leadtools.MediaFoundation.Constants.PreferredMediaSourceHandlers.ISO, True) = 0)
   Catch e1 As Exception
      _result = False
   End Try
End Sub
using Leadtools;
using Leadtools.MediaFoundation;
using LeadtoolsMediaFoundationExamples.Fixtures;

public bool _result = false;
public PlayCtrlForm _form = new PlayCtrlForm();
public void PlayerPreferredMediaSourceHandlersExample()
{
    PlayCtrl playctrl = _form.PlayCtrl;

    try
    {
        // set the preferred ISO(MP4) media source handler to the LEAD default (which is the LEAD ISO Media Source handler)
        playctrl.SetPreferredMediaSourceHandler(PreferredMediaSourceHandler.ISO, Constants.PreferredMediaSourceHandlers.LEADDefault);

        // the default ISO(MP4) media source handler should be the LEAD ISO(MP4) media source handler now
        _result = (string.Compare(playctrl.GetPreferredMediaSourceHandler(PreferredMediaSourceHandler.ISO),
                   Constants.PreferredMediaSourceHandlers.ISO, true) == 0);
    }
    catch (Exception)
    {
        _result = false;
    }
}
Requirements

Target Platforms

See Also

Reference

PlayCtrl Class
PlayCtrl Members
SetPreferredMediaSourceHandler Method

Error processing SSI file
Leadtools.MediaFoundation requires a Multimedia or Multimedia Suite license and unlock key. For more information, refer to: LEADTOOLS Toolkit Features