Class MediaMessageContent
-
- All Implemented Interfaces:
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.
-
-
Constructor Summary
Constructors Constructor Description MediaMessageContent()
-
Method Summary
Modifier and Type Method Description Uri
getLocalPath()
Gets the local path of the media content (this property must have a value) 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). 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) void
setLocalPath(Uri mLocalPath)
Sets the local path for retrieving media content (this property must have a value) String
getName()
Retrieves the filename of the media content (if not provided, the SDK will generate a default name when using the downloadMediaMessage method). 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). -
-
Method Detail
-
getLocalPath
Uri getLocalPath()
Gets the local path of the media content (this property must have a value)
- Returns:
The local path of the media content (this property must have a value)
-
getMediaUrl
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).
- Returns:
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).
-
setMediaUrl
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)
- Parameters:
mMediaUrl
- 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)
-
setLocalPath
void setLocalPath(Uri mLocalPath)
Sets the local path for retrieving media content (this property must have a value)
- Parameters:
mLocalPath
- The local path for retrieving media content (this property must have a value)
-
getName
String getName()
Retrieves the filename of the media content (if not provided, the SDK will generate a default name when using the downloadMediaMessage method).
- Returns:
The filename of the media content (if not provided, the SDK will generate a default name when using the downloadMediaMessage method).
-
setName
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).
- Parameters:
name
- The filename for the media content (if not provided, a default name will be generated when downloaded using the SDK's `downloadMediaMessage` method).
-
-
-
-