MediaMessageContent

public abstract class MediaMessageContent

The parent class for all media type messages in the SDK.

All media type messages (e.g., images, files, etc.) in the SDK inherit from this class. Developers must inherit from this class if they need to upload custom media type messages to RongCloud's default server (the SDK handles the upload of media messages and their sending after successful upload, while developers are responsible for displaying the received messages). The following attributes need to be processed by subclasses in the `encode` and `decode` methods along with extended attributes.

Constructors

Link copied to clipboard
public void MediaMessageContent()

Functions

Link copied to clipboard
public Uri getLocalPath()
Gets the local path of the media content (this property must have a value)
Link copied to clipboard
public Uri getMediaUrl()
Retrieves the network address of the media content after it has been uploaded to the server (the SDK will assign a value to this property upon successful upload).
Link copied to clipboard
public String getName()
Retrieves the filename of the media content (if not provided, the SDK will generate a default name when using the downloadMediaMessage method).
Link copied to clipboard
public void setLocalPath(Uri mLocalPath)
Sets the local path for retrieving media content (this property must have a value)
Link copied to clipboard
public void setMediaUrl(Uri mMediaUrl)
Sets the network address of the media content after it is uploaded to the server (the SDK will assign a value to this property after a successful upload)
Link copied to clipboard
public void setName(String name)
Sets the filename for the media content (if not provided, a default name will be generated when downloaded using the SDK's `downloadMediaMessage` method).