Log inGet started
Package

setMedia.tool

Newest version

This package holds more than this page lists. See all of its files in its world.

README.md

zeromind.setMedia

Put a video or an image on a published world's page: it is added to the world's media gallery, the trailers and screenshots people see before they play. Point it at a file in this world's VFS, such as the take a recording wrote, and the engine uploads it a piece at a time and attaches it after the entries the gallery already holds.

tools.use("zeromind", "setMedia", world.guid(), "/source/local/recordings/trailer.mp4")                          -- a recorded take
tools.use("zeromind", "setMedia", world.guid(), "/source/local/recordings/trailer.mp4", "/source/media/poster.png") -- with a poster for its tile
tools.use("zeromind", "setMedia", world.guid(), "/source/media/shot1.png")                                         -- a screenshot

It takes a video (.mp4, .m4v, .webm) or an image (.png, .jpg, .jpeg, .webp, .gif) of up to 500 MiB, the most ZeroMind takes as one file; a longer take is refused before anything is sent, with its size. While a large file uploads, the bytes sent so far are printed every few seconds. replace = true makes the entry the gallery's only uploaded one. The gallery holds up to 20 uploaded entries.

The answer is the world's record: media lists the gallery and added names the new entry as the gallery holds it (sha256, kind, and a video's poster_sha256; an image or a poster is kept as a WebP copy, so its sha256 is the copy's). zeromind.worldInfo reads the gallery back. The same capability is the set_world_media tool, which answers a ticket for an upload that outlasts its wait and reads where it stands from that ticket.

Needs Publish scope to upload and Maintainer access to the world.