Class SightMessage
-
- All Implemented Interfaces:
public class SightMessageShort Video Message Class
The short video message class. This message will be stored and counted in the unread message count.
-
-
Field Summary
Fields Modifier and Type Field Description public booleanisOriginalpublic final static Creator<SightMessage>CREATOR
-
Constructor Summary
Constructors Constructor Description SightMessage()SightMessage(Array<byte> data)SightMessage(Parcel in)Constructor.
-
Method Summary
Modifier and Type Method Description booleanisOriginal()static SightMessageobtain(Uri localUri, int duration)Creates an instance of the SightMessage object. static SightMessageobtain(Uri thumbUri, Uri localUri, int duration)static SightMessageobtain(Context context, Uri localUri, int duration)Creates an instance of the SightMessage object. static SightMessageobtain(Context context, Uri thumbUri, Uri localUri, int duration)Creates an instance of the SightMessage object. Array<byte>encode()voidwriteToParcel(Parcel dest, int flags)Writes the class data into the provided Parcel. intdescribeContents()Describes the type of special objects included in the arrangement information of the Parcelable object. UrigetThumbUri()Retrieves the thumbnail Uri. voidsetThumbUri(Uri thumbUri)Sets the thumbnail URI. voidsetBase64(String base64)Sets the Base64 data to be passed StringgetBase64()Retrieves the Base64 data that needs to be passed. intgetDuration()Retrieves the duration of the short video message in seconds. voidsetDuration(int duration)Sets the duration of the short video message in seconds. longgetSize()Get the size of the short video file voidsetSize(long size)Sets the size of the short video file -
-
Constructor Detail
-
SightMessage
SightMessage()
-
SightMessage
SightMessage(Array<byte> data)
-
SightMessage
SightMessage(Parcel in)
Constructor.- Parameters:
in- The Parcel object passed during initialization.
-
-
Method Detail
-
isOriginal
boolean isOriginal()
- Returns:
Indicates whether to upload the original video. If true, the compression logic will be skipped.
-
obtain
static SightMessage obtain(Uri localUri, int duration)
Creates an instance of the SightMessage object. Only supports files starting with 'file'. To support 'content', use obtain.
- Parameters:
localUri- The URI of the short video.duration- The duration of the video.- Returns:
An instance of the SightMessage object.
-
obtain
@Deprecated() static SightMessage obtain(Uri thumbUri, Uri localUri, int duration)
- Parameters:
thumbUri- The URI of the thumbnail.localUri- The URI of the short video.- Returns:
SightMessage object instance. @Deprecated Creates a SightMessage object instance. Only supports files starting with file. To support content, use obtain
-
obtain
static SightMessage obtain(Context context, Uri localUri, int duration)
Creates an instance of the SightMessage object.
- Parameters:
context- The context.localUri- The URI of the short video.duration- The duration of the video.- Returns:
An instance of the SightMessage object.
-
obtain
static SightMessage obtain(Context context, Uri thumbUri, Uri localUri, int duration)
Creates an instance of the SightMessage object.
- Parameters:
context- The context.thumbUri- The thumbnail URI.localUri- The local URI of the short video.duration- The duration of the video.- Returns:
An instance of the SightMessage object.
-
writeToParcel
void writeToParcel(Parcel dest, int flags)
Writes the class data into the provided Parcel.
- Parameters:
dest- The Parcel into which the object is written.flags- Additional flags about how the object should be written, possibly 0 or PARCELABLE_WRITE_RETURN_VALUE.
-
describeContents
int describeContents()
Describes the type of special objects included in the arrangement information of the Parcelable object.
- Returns:
A flag indicating the arrangement of the special object type collection of the Parcelable object.
-
getThumbUri
Uri getThumbUri()
Retrieves the thumbnail Uri.
- Returns:
The thumbnail Uri (in the case of receiving a message, this is an internal Uri. You need to use
ResourceManager.getInstance().getFile(new Resource(Uri))to obtain the actual address).
-
setThumbUri
void setThumbUri(Uri thumbUri)
Sets the thumbnail URI.
- Parameters:
thumbUri- The URI of the thumbnail
-
setBase64
void setBase64(String base64)
Sets the Base64 data to be passed
- Parameters:
base64- The Base64 data.
-
getBase64
String getBase64()
Retrieves the Base64 data that needs to be passed.
- Returns:
The Base64 data.
-
getDuration
int getDuration()
Retrieves the duration of the short video message in seconds.
-
setDuration
void setDuration(int duration)
Sets the duration of the short video message in seconds.
- Parameters:
duration- The duration of the short video message
-
getSize
long getSize()
Get the size of the short video file
-
setSize
void setSize(long size)
Sets the size of the short video file
-
-
-
-