Overview
Media Libraries allow you to organize and display media content including: videos, PDFs and images within the mobile app. Users can access libraries through menu items or as attachments on loads. This makes it easy to distribute reference materials, training content, safety documents, and more.
WARNING: Media items are not subject to the standard Platform data retention rules, as they are often intended to be long-lived reference materials. The Platform generates randomized URLs for media items, which means anyone who obtains the URL may be able to access it. Do not store sensitive or restricted content in media libraries.
How It Works
Media Libraries can be managed through App Manager or the Media Items API. Each library contains one or more media items, which are uploaded and associated with the library via a unique library_id.
There is no specific file size limit for items.
NOTE: Successful uploads depend entirely on the file's bitrate and resolution. If a video fails to upload, reduce its bitrate or resolution so it processes faster.
Managing Media Content via API
Uploading a media item is a three-step process:
Submit a
POSTrequest to create the media item placeholder, including amedia_typeproperty (pdf,image, orvideo) to receive a uniquehandle, anupload_destination, and aurl.Upload the binary file to the
upload_destinationreturned in step 1, ensuring theContent-Typeheader matches the file being uploaded.IMPORTANT: If the
Content-Typeheader in step 2 does not correctly match the uploaded file, the media item may display or behave unexpectedly in the mobile app.Use the exact
upload_destinationvalue provided, including any query string parameters.NOTE: The
upload_destinationremains valid for up to two hours. If the upload is interrupted, repeat step 2 using the sameupload_destinationvalue.
Submit a
PUTrequest to theurlproperty returned in step 1 to confirm the upload is complete and move the item into the processing queue where it’sstatustransitions fromcreatedtotranscodingtoready.TIP: You can check the status of the item at any time by making a GET request to the Media Items API.
To include a media item in a specific library, provide the library_id (the “Permanent ID” from App Manager) in either the initial POST or the confirmation PUT request. Media items without a library_id are not accessible through App Manager, but they can still be displayed directly as a load attachment when explicitly referenced by their unique handle.
When content changes, you can maintain your media using the following actions:
Submit a
PUTrequest to update a media item'stitle,library_id, ormetadata.Submit a
DELETErequest to permanently remove a media item.WARNING: Deleting a media item removes it immediately. Any menu items, load attachments, or news items that reference the deleted item will no longer be displayed to users.
Displaying Content
Libraries and individual media items can be surfaced to users in two distinct ways:
Menu Item: Add a menu item of type
media-libraryand set thelibraryproperty to the relevant media library'scodeso users can tap the menu item to browse its contents. See our Menus Guide for more information.Load Attachment: Reference a media item directly on a load using its
handleor the item's ID from App Manager to display the item in the context of a specific load.TIP: Use the
sortproperty on media items to control the display order within a library. Items sharing the same sort value will automatically be ordered bycreated_atin descending order.
Tracking Engagement
For media items of type video, you can track user engagement via the view_metrics property on GET and PUT responses. This property returns playback data including the username of the user who watched the video, when they watched it, and whether they completed playback or only partially viewed it.
NOTE:
view_metricswill return up to 10,000 of the most recent view records.