Media Actions

The following actions can be used to control the media playback. Note that all actions take a “channel_name” argument. This is used to target a specific playback channel. For example if a video is started with “gra.media.new.video” with “channel_name=video1” then any subsequent action which wants to act on this video, such as play/pause, must set the channel “video1”.

gra.media.new.audio

Tells the plugin to play a new audio file.

The action arguments are:

channel_name

The channel name the new video is to be played on

media_name

The name of the media to play, full path to an audio file

volume

The initial volume value to play the media at. The value should be between 0 and 100.

update_interval

The number of milliseconds to wait in between update messages

emit_time_events

A value that is set to 1 to emit time update events, 0 otherwise

extra_data

Any extra data that should be passed to the back-end, can be NULL

gra.media.new.video

Tells the plugin to play a new video file.

The action arguments are:

channel_name

The channel name the new video is to be played on

media_name

The name of the media to play, full path to a video file

volume

The initial volume that the media should be played at

object_name

The name of the external object to display content on. This is necessary when using an external render extension to display the content, please refer to the external render extension documentation

external_name

The name of the render extension to display content on. This is necessary when using an external render extension to display the content, please refer to the external render extension documentation

update_interval

The number of milliseconds to wait in between update messages

emit_time_events

A value that is set to 1 to emit time update events, 0 otherwise

output_width

The width of the video

output_height

The height of the video

output_depth

The output depth of the video in bytes per pixel. 16bit = 2, 24bit = 3, 32bit = 4

extra_data

Any extra data that should be passed to the back-end, can be NULL. See each backend for a description of this data

gra.media.volume

Triggers a change in the playback volume.

The action arguments are:

channel_name

The channel name to change the volume on

volume

The value to change the volume to, a number between 0 and 100

emit_volume_event

A value that is set to 1 if an event should be emitted or 0 otherwise

gra.media.seek

Triggers a change to the current playback position of the media that is playing.

The action arguments are:

channel_name

The channel name to change the seek position on

seek_num

The new seek position for the media file

emit_state_event

A value that is set to 1 if an event should be emitted or 0 otherwise

gra.media.stop

Changes the media playback state to stopped.

The action arguments are:

channel_name

The channel name to change the state on

emit_state_event

A value that is set to 1 if an event should be emitted or 0 otherwise

gra.media.playpause

Changes the media playback state from paused to playing or from playing to paused

The action arguments are:

channel_name

The channel name to change the state on

emit_state_event

A value that is set to 1 if an event should be emitted or 0 otherwise