User Tools

Site Tools


Sidebar

Multimedia

k23:k23.9:k23.9.1:start

23.9.1 Class Media (gb.media)

This class provides general (static) methods and constants.

23.9.1.1 Methods

The Media class has these static methods:

MethodReturn typeDescription
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 )FloatConverts a time in seconds into a GStreamer timestamp.
URL ( Path As String )StringConverts a local file path into a URL.

Table 23.9.1.1.1 : Methods of the Media class

23.9.1.2 Constants

Here you will find an overview of constants that are defined in the Media class:

ConstantInteger valueDescription
Null1This constant represents the zero state or the initial state of a MediaControl.
Ready2This 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.
Paused3This 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.
Playing4This constant represents an active MediaControl. It means that the internal clock is running and data is flowing.
Info0This constant represents the type of an information message.
Warning1This constant represents the type of warning message.
Error2This constant represents the type of error message.
Unknown-1This 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
The website uses a temporary session cookie. This technically necessary cookie is deleted when the browser is closed. You can find information on cookies in our privacy policy.
k23/k23.9/k23.9.1/start.txt · Last modified: 13.01.2024 by emma

Page Tools