Outils pour utilisateurs

Outils du site


en:yaml:medias

Ceci est une ancienne révision du document !


Language / Langue : FR | EN

Sounds, Images and Videos (YAML)

Media can be used in narrative text, object descriptions and HUD panels.

Sounds

text: |
  The dragon roars! <<https://example.com/sounds/roar.mp3>>
  You take 10 damage.

Supported formats for linting and exports: .mp3, .ogg, .wav, .flac, .m4a.

<<3:https://example.com/sounds/alarm.mp3>>
<<0:https://example.com/sounds/music.mp3>>
<<stop>>

Images

text: |
  [[https://example.com/images/castle.png]]

Supported formats include .png, .jpg, .jpeg, .gif, .webp and .svg depending on the adapter/browser.

Videos (v4.10)

text: |
  ((https://example.com/videos/intro.mp4))

Recognized formats: .mp4, .webm, .mov, .ogv.

If the content does not look like a valid video, it remains normal text with its parentheses.

Video Options

Options go before the URL, separated with ; then :.

Option Effect
loop Loop playback.
autoplay Autoplay; the engine also forces muted.
muted Muted audio.
controls or controls=true Show controls. Default.
controls=false Hide controls. For a file, click play/pause still works on web and standalone. For a hosted video, playback starts on its own, muted: an iframe cannot be controlled by a click.
poster=url Poster image before playback. URL variables are accepted.
((loop:https://example.com/videos/ambience.mp4))
((autoplay;muted:https://example.com/videos/intro.mp4))
((poster=https://example.com/poster.jpg;loop:https://example.com/videos/scene.mp4))

Hosted videos

The same (( )) syntax also accepts a link to YouTube, Vimeo, Dailymotion or PeerTube. The service player replaces the built-in one, in the same place and with the same appearance as an ordinary video.

((https://www.youtube.com/watch?v=aqz-KE-bpKQ))
((https://vimeo.com/76979871))
((https://framatube.org/w/mnRs2Wm5cGqXcHbF))

Short and alternate forms are recognised: youtu.be, /shorts/, m.youtube.com, dai.ly, player.vimeo.com, and both PeerTube forms (/videos/watch/ and /w/) on any instance.

A link to a channel or a playlist is refused: the address must point to one precise video. The linter reports it.

Privacy. YouTube is called through its cookie-free domain and Vimeo receives dnt=1, with nothing to write on the author side.

Options. loop, autoplay, muted and controls=false are translated into the parameters of each service. Two exceptions:

  • Dailymotion ignores them all: since its player migrated, an embed without a Player ID plays with its default settings. The linter warns you instead of letting you believe the setting applies.
  • poster= has no effect on a hosted video: the service shows its own thumbnail. It still works for a file.

Other platforms. Discord and the Terminal display the link, the Terminal also naming the platform. In an HTML5 export the video stays online: it is not embedded in the archive, and the report does not list it as missing. The export must therefore be served over HTTP or HTTPS, since hosted players do not work from a local file: page. ===== Variables in URLs ===== Use {variable_name} inside sound, image and video URLs. <code yaml> text: | https://site.test/images/{zone}.png «https://site.test/sounds/{ambience}.mp3» 1) </code> ===== Media inside object descriptions ===== <code yaml> objets: - nom: map endroit: table description: “A map of the kingdom. https://example.com/images/map.png” msg_ramassage: “You take the map.” - nom: musical_key endroit: chest description: “A key that rings. «https://example.com/sounds/key.mp3»” msg_ramassage: “You take the key.” </code> When the description is only an image URL [[url]], inspect <object>'' shows the picture directly. Find us on the Make&Play Discord

en/yaml/medias.1788117655.txt.gz · Dernière modification : de cyrilfiesta