Kit media
16 ferramentas. Gerado a partir do código-fonte do plugin; não edite manualmente.
As descrições das ferramentas e dos argumentos são exibidas em inglês porque espelham o schema das ferramentas (o mesmo texto que o agente recebe em
tools/list).
Guia
Use this kit for persistent UMediaPlayer, UMediaPlaylist and UMediaSource assets plus
synchronous controls on a player that already has media open.
Recipe
media.create_player {"folder":"/Game/Media","name":"MP_Screen"}
media.create_source {"folder":"/Game/Media","name":"MS_Intro","kind":"file","url":"Movies/Intro.mp4"}
media.create_source {"folder":"/Game/Media","name":"MS_Live","kind":"stream","url":"rtsp://camera.local/stream"}
media.create_playlist {"folder":"/Game/Media","name":"MPL_Loop"}
media.add_playlist_source {"asset":"/Game/Media/MPL_Loop","source":"/Game/Media/MS_Intro"}
media.list_playlist {"asset":"/Game/Media/MPL_Loop"}
media.get_state {"asset":"/Game/Media/MP_Screen"}
create_sourcekinds:file(path absolute or relative to the projectContentfolder; the file is not checked or opened) andstream(any URL). Creation never opens media.add_playlist_sourceappends withindex-1 (default) or inserts atindex;remove_playlist_sourceremoves by zero-based index.get_sourcereturns the source URL;audit_assetsreports the state of a player, the entries of a playlist or the URL of a source.
Playback
play, seek and set_rate act on media the player has already opened; with nothing open they
fail with an explicit error (E_EDITOR_STATE / E_INVALID_ARG). pause, rewind, set_loop and
close are safe on a closed player. Opening a source is asynchronous and is not exposed yet.
Gotchas
- Names are bare; an existing asset at the path is
E_CONFLICT. - Seek ranges and rates depend on the media backend of the opened file.
Ferramentas
Legenda. risco 0 = somente leitura, 1 = operação inofensiva do editor, 2 = altera asset, 3 = apaga/substitui asset, 4 = projeto/config/build, 5 = potencialmente destrutivo (chamadas acima de
MaxAutoRiskexigem"_confirm": true). altera = roda numa transação (edit.undo reverte). requer PIE / requer mundo = recusado sem sessão PIE / sem nível aberto. requer plugin = indisponível quando o plugin está desativado. dryRun = aceita o argumentodryRun. smoke = coberto poredit.self_test.
media.add_playlist_source (risco 2, altera, smoke)
Appends (index -1) or inserts a MediaSource asset into a MediaPlaylist.
| Argumento | Tipo | Descrição |
|---|---|---|
source | string | MediaSource asset path (required to add). |
index | integer | Playlist index; -1 appends when adding. Padrão -1. |
Retorna: media, sources.
media.audit_assets (risco 0, smoke)
Resolves a media asset and reports its class and, for players, playlists and sources, their state or entries.
| Argumento | Tipo | Descrição |
|---|---|---|
asset | string | obrigatório. |
Retorna: media, sources.
media.close (risco 2, altera, smoke)
Closes the media opened by the player.
| Argumento | Tipo | Descrição |
|---|---|---|
asset | string | obrigatório. |
Retorna: media, sources.
media.create_player (risco 2, altera, smoke)
Creates a MediaPlayer asset. Returns the player state.
| Argumento | Tipo | Descrição |
|---|---|---|
folder | string | obrigatório. |
name | string | obrigatório. |
Retorna: media, sources.
media.create_playlist (risco 2, altera, smoke)
Creates an empty MediaPlaylist asset.
| Argumento | Tipo | Descrição |
|---|---|---|
folder | string | obrigatório. |
name | string | obrigatório. |
Retorna: media, sources.
media.create_source (risco 2, altera, smoke)
Creates a MediaSource asset: kind 'file' (url = file path, absolute or relative to the project Content folder) or 'stream' (url = stream URL). The media is not opened.
| Argumento | Tipo | Descrição |
|---|---|---|
folder | string | obrigatório. Content folder under /Game. |
name | string | obrigatório. Bare asset name. |
kind | string | file or stream. Padrão TEXT("file"). |
url | string | obrigatório. File path (file) or stream URL (stream). |
Retorna: media, sources.
media.get_source (risco 0, smoke)
Returns the URL of a MediaSource asset.
| Argumento | Tipo | Descrição |
|---|---|---|
asset | string | obrigatório. |
Retorna: media, sources.
media.get_state (risco 0, smoke)
Returns ready/playing/paused/looping state, time, duration and rate of a MediaPlayer.
| Argumento | Tipo | Descrição |
|---|---|---|
asset | string | obrigatório. |
Retorna: media, sources.
media.list_playlist (risco 0, smoke)
Lists the media sources of a MediaPlaylist in order.
| Argumento | Tipo | Descrição |
|---|---|---|
asset | string | obrigatório. |
Retorna: media, sources.
media.pause (risco 2, altera, smoke)
Pauses the player (rate 0). Harmless on a closed player.
| Argumento | Tipo | Descrição |
|---|---|---|
asset | string | obrigatório. |
Retorna: media, sources.
media.play (risco 2, altera)
Starts playback of the media currently opened by the player; fails when nothing is open.
| Argumento | Tipo | Descrição |
|---|---|---|
asset | string | obrigatório. |
Retorna: media, sources.
media.remove_playlist_source (risco 2, altera, smoke)
Removes the playlist entry at index.
| Argumento | Tipo | Descrição |
|---|---|---|
source | string | MediaSource asset path (required to add). |
index | integer | Playlist index; -1 appends when adding. Padrão -1. |
Retorna: media, sources.
media.rewind (risco 2, altera, smoke)
Rewinds the player to the start of the opened media.
| Argumento | Tipo | Descrição |
|---|---|---|
asset | string | obrigatório. |
Retorna: media, sources.
media.seek (risco 2, altera)
Seeks the opened media to a time in seconds.
| Argumento | Tipo | Descrição |
|---|---|---|
seconds | number | obrigatório. |
Retorna: media, sources.
media.set_loop (risco 2, altera, smoke)
Enables or disables looping on the player.
| Argumento | Tipo | Descrição |
|---|---|---|
value | boolean | obrigatório. |
Retorna: media, sources.
media.set_rate (risco 2, altera)
Sets the playback rate of the opened media (1 = normal, 0 = paused).
| Argumento | Tipo | Descrição |
|---|---|---|
rate | number | obrigatório. |
Retorna: media, sources.