| mx_send_media | R Documentation |
Uploads path to the media repository and posts an
m.room.message referencing it. The default info carries
mimetype and size; pass richer metadata (width, height,
duration) yourself – mx.api deliberately does not inspect media files.
mx_send_media(
session,
room_id,
path,
body = basename(path),
msgtype = NULL,
content_type = NULL,
info = list()
)
mx_send_file(
session,
room_id,
path,
body = basename(path),
content_type = NULL,
info = list()
)
mx_send_image(
session,
room_id,
path,
body = basename(path),
content_type = NULL,
info = list()
)
mx_send_audio(
session,
room_id,
path,
body = basename(path),
content_type = NULL,
info = list()
)
mx_send_video(
session,
room_id,
path,
body = basename(path),
content_type = NULL,
info = list()
)
session |
An "mx_session" object. |
room_id |
Character. The room ID. |
path |
Character. Path to the file to upload. |
body |
Character. Message body / filename shown by clients. |
msgtype |
Character or NULL. One of |
content_type |
Character or NULL. MIME type (guessed from the extension when NULL). |
info |
List. Extra fields merged into the |
The event ID of the sent message.
## Not run:
mx_send_media(s, "!abc:example", "clip.mp4", msgtype = "m.video")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.