Skip to main content

Predefined ActiveX element

The component can be used in a visualization by using an ActiveX visualization element.

To do this, the component name NativeControls.Mediaplayer must be referenced in an ActiveX element. Then the media player will be available embedded in a visualization.

Functionality

Method

Data type of the return value

1

NativeControls.Mediaplayer.setSource

STRING

Relative path or stream, such as rtsp://

When using Qt5, a custom GStreamer pipeline is possible. This can be used for cameras with Video4Linux which are directly connected.

2

NativeControls.Mediaplayer.setVolume

INT

Sets the volume

3

NativeControls.Mediaplayer.setRepeat

INT

Sets repeat

4

NativeControls.Mediaplayer.setPlaybackRate

REAL

Sets the playback speed

5

NativeControls.Mediaplayer.setPosition

ULINT

Sets the playback position

Jumps to the position

Position (in milliseconds)

6

NativeControls.Mediaplayer.setMirror

BOOL

Parameter

Activates the mirroring on the y-axis

7

NativeControls.Mediaplayer.play

Starts the playback

8

NativeControls.Mediaplayer.pause

Pauses the playback

9

NativeControls.Mediaplayer.stop

Stops the playback

10

NativeControls.Mediaplayer.getPosition

ULINT

Returns the playback position

11

NativeControls.Mediaplayer.getDuration

ULINT

Returns the duration of the medium (in milliseconds)

12

NativeControls.Mediaplayer.getMediaStatus

INT

Returns the status of the media player.

Statuses of the media player

Statuses of the NativeControls.Mediaplayer.getMediaStatus method

Value (INT)

NativeControls.Mediaplayer.getMediaStatus

1

There is currently no media file available. The player is in StoppedState.

2

The current media file is being loaded. The player can be in any state.

3

The current media file has been loaded. The player is in StoppedState.

4

Playback of the current media has been paused due to insufficient buffering or another temporary interruption. The player is in PlayingState or PausedState.

5

The player is buffering data, but has buffered enough data to continue playback for now. The player is in PlayingState or PausedState.

6

The playback has reached the limits of the current medium. The player is in StoppedState.

7

The current media file cannot be played. The player is in StoppedState.

State of the media player using the NativeControls.Mediaplayer.getState method

Value (INT)

NativeControls.Mediaplayer.getState

1

The media player is currently not playing any content. Playback begins at the start of the current track.

2

The media player is currently playing content. This corresponds to the "playing" property.

3

The media player has paused playback. Playback of the current track will resume from where the player was paused.

Dependencies in Linux SL runtime systems

  • libqt6multimedia6

  • libqt6multimediaquick6

  • libqt6multimediawidgets6

  • qml6-module-qtmultimedia

  • gstreamer-1.0-qt6

  • Additionally, you can install the RTSP plug-in.

Dependencies in Windows

Note

Possible only when the overlay function is enabled.

For more information, see the following: Settings

Important

Qt Media Backend interface

In some cases, the Qt Media Backend is not automatically detected by the platforms. In that case, it must be manually configured via the environment variable QT_MEDIA_BACKEND.

Hardware platform

A multicore CPU and hardware acceleration is recommended for efficient video decoding.

CODESYS Remote TargetVisu

Note the following if you intend to use the media player with files. The remote target visualization is not intended for the automatic upload of video files. If necessary, these must therefore be stored manually set to the CODESYS Remote TargetVisu.

CODESYS Control Win SL

Note that all videos should be played from files with a relative path. For the process to run smoothly, it is essential that the files are available before the application is started.