This class provides general (static) methods and constants.
The Media class has these static methods:
Method | Return type | Description |
---|---|---|
Link ( FirstControl As MediaControl, SecondControl As MediaControl, … ) | - | Links two or more controls together one after the other. The output of FirstControl is linked to the input of SecondControl. If there is a third control element, the output of SecondControl is linked to the input of this third control element and so on … . |
Time ( Seconds As Float ) | Float | Converts a time in seconds into a GStreamer timestamp. |
URL ( Path As String ) | String | Converts a local file path into a URL. |
Table 23.9.1.1.1 : Methods of the Media class
Here you will find an overview of constants that are defined in the Media class:
Constant | Integer value | Description |
---|---|---|
Null | 1 | This constant represents the zero state or the initial state of a MediaControl. |
Ready | 2 | This constant represents the state of a MediaControl that is ready for use. It means that the MediaControl is ready to switch to the Paused state. |
Paused | 3 | This constant represents the state of a paused MediaControl. A pausing MediaControl is ready to accept and process data. Sink controls, on the other hand, only accept a buffer and then block. |
Playing | 4 | This constant represents an active MediaControl. It means that the internal clock is running and data is flowing. |
Info | 0 | This constant represents the type of an information message. |
Warning | 1 | This constant represents the type of warning message. |
Error | 2 | This constant represents the type of error message. |
Unknown | -1 | This constant represents an unknown (indifferent) state of the MediaControl. |
Table 23.9.1.2.1 : Constants of the Media class
Example 1 - Conversion of a local file path to a URL:
aFilter = ["avi", "mp4", "mpeg", "mpg", "webm", "ogv", "mkv"] If aFilter.Exist(File.Ext(Dialog.Path)) Then MediaView1.URL = Media.URL(Dialog.Path) Endif
Example 2
Public Sub btnStop_Click() If mpPipeline.State = Media.Playing Then mpPipeline.Stop() mpPipeline.Close() End