Table of Contents

23.9.8 MediaTagList (gb.media)

The class represents a list of media tags. A media tag is a piece of information (key-value pair) that consists of a string key and a value and is linked to a multimedia stream.

The class cannot be created and behaves like an array that can only be read.

To read the value assigned to a tag name (key), proceed as follows

Dim hMediaTagList As MediaTagList
Dim vValue As Variant

vValue = hMediaTagList [ TagName As String ]

23.9.8.1 Properties

The MediaTagList class only has this relevant property:

PropertyData typeDescription
TagsString[ ]Reads the list of all tag names and returns them in a string array.

Table 23.9.8.1.1 : Properties of the MediaTagList class

Note the connection to the Tag event (TagList As MediaTagList) in the MediaPipeline class, which is triggered when metadata is found in the multimedia stream! The TagList argument is the list of tag names found - stored in the string array 'Tags'.

23.9.8.2 Example

With the following source code, you can read the metadata from an audio stream in the tag event and display it in a TextArea:

[1] Public Public Sub hPipeline_Tag(TagList As MediaTagList)
[2]
[3] Dim sTag, sTagOrigin As String
[4]
[5] For Each sTag In Taglist.Tags
[6] '-- If Upper(sTag) = "TITLE" Then
[7]   sTagOrigin = sTag
[8]   If sTag.Len < 8 Then stag &= "         "
[9]   txaMetadata.Insert("KEY = " & Upper(sTag) & gb.Tab & "| VALUE = " & TagList[sTagOrigin] & gb.NewLine)
[10]   txaMetadata.Pos = txaMetadata.Length
[11] '-- Endif
[12]   Next
[13]
[14] End

BILD

Figure 23.9.8.2.1: Display of all metadata in an audio stream

Comment