LEADTOOLS Multimedia (Leadtools.Multimedia assembly) Send comments on this topic. | Back to Introduction | Help Version 17.0.3.22
StreamType Property
See Also 
Leadtools.Multimedia Namespace > MediaInfo Class : StreamType Property



Gets a string representing the GUID of the type of the current stream.

Syntax

Visual Basic (Declaration) 
Public ReadOnly Property StreamType As String
Visual Basic (Usage)Copy Code
Dim instance As MediaInfo
Dim value As String
 
value = instance.StreamType
C# 
public string StreamType {get;}
C++/CLI 
public:
property String^ StreamType {
   String^ get();
}

Property Value

A value representing the GUID of the current stream type.

Example

Visual BasicCopy Code
Public _form As PlayCtrlForm = New PlayCtrlForm()
    Public _result As Boolean = False
    Public Sub ResetSourceExample()
      ' reference the play control
      Dim playctrl As PlayCtrl = _form.PlayCtrl

      ' input file
                Dim inFile As String = Path.Combine(LEAD_VARS.MediaDir, "MediaInfo_Source.avi")
      Dim info As String = String.Empty

      Try
         ' create a new media info object
         Dim mi As MediaInfo = New MediaInfo()

         ' set the input and output files
         mi.SourceFile = inFile

         ' set the info string
            info = String.Format("Source File={0}" & Microsoft.VisualBasic.Constants.vbLf & "Source File Size={1}" & Microsoft.VisualBasic.Constants.vbLf & "Duration={2}" & Microsoft.VisualBasic.Constants.vbLf & "VideoBitRate={3}" & Microsoft.VisualBasic.Constants.vbLf & "VideoBitCount={4}" & Microsoft.VisualBasic.Constants.vbLf + Microsoft.VisualBasic.Constants.vbLf & "Are these values correct?", mi.SourceFile, mi.SourceFileSize, mi.SourceDuration, mi.VideoBitRate, mi.VideoBitCount) ', mi.AudioBitsPerSample, mi.AudioChannels);

         ' verify the values
         _result = (MessageBox.Show(_form, info, "Media Info", MessageBoxButtons.YesNo) = DialogResult.Yes)

         ' reset the source
         mi.ResetSource()

         ' set the result to what we expect
         _result = _result And (mi.SourceFile Is Nothing)
      Catch e1 As Exception
         _result = False
      End Try
    End Sub

Public NotInheritable Class LEAD_VARS
   Public Const MediaDir As String = "C:\Program Files (x86)\LEAD Technologies\LEADTOOLS 17\Media"
End Class
C#Copy Code
public PlayCtrlForm _form = new PlayCtrlForm();
      public bool _result = false;
      public void ResetSourceExample()
      {
         // reference the play control
         PlayCtrl playctrl = _form.PlayCtrl;

         // input file
         string inFile =Path.Combine(LEAD_VARS.MediaDir,"MediaInfo_Source.avi");
         string info = string.Empty;

         try
         {
            // create a new media info object
            MediaInfo mi = new MediaInfo();

            // set the input and output files
            mi.SourceFile = inFile;

            // set the info string
            info = string.Format("Source File={0}\nSource File Size={1}\nDuration={2}\nVideoBitRate={3}\nVideoBitCount={4}\n\nAre these values correct?", // AudioBitsPerSample={5}\nAudioChannels={6}\n 
               mi.SourceFile, mi.SourceFileSize, mi.SourceDuration, mi.VideoBitRate, mi.VideoBitCount); //, mi.AudioBitsPerSample, mi.AudioChannels);

            // verify the values
            _result = (MessageBox.Show(_form, info, "Media Info", MessageBoxButtons.YesNo) == DialogResult.Yes);

            // reset the source
            mi.ResetSource();

            // set the result to what we expect
            _result &= (mi.SourceFile == null);
         }
         catch (Exception)
         {
            _result = false;
         }
      }

static class LEAD_VARS
{
   public const string MediaDir = @"C:\Program Files (x86)\LEAD Technologies\LEADTOOLS 17\Media";
}

Remarks

This property is updated automatically when the CurrentStream property is set. To change the current stream, set the CurrentStream property to a new value. Once the current stream has been set, other MediaInfo properties are updated with information about the current stream.

Requirements

Target Platforms: Microsoft .NET Framework 2.0, Windows 2000, Windows XP, Windows Server 2003 family, Windows Server 2008 family, Windows Vista, Windows 7

See Also