View Media Files

Header Component#

The headerComponent includes a default title as view media file, a back button that takes the user to the previous view. Each property corresponds to the elements in the navigation bar of the view controller.

The following table shows the parameters of the configure method of the headerComponent.

Parameter nameType
delegateMFUIViewMediaModuleHeaderDelegate
themeMFViewMediaTheme

List Component#

The listComponent shows a list of all media and docs. The following table shows the parameters of the configure method of the listComponent.

Parameter nameType
delegateMFUIViewMediaModuleListDelegate
themeMFViewMediaTheme

View Model#

The MFUIViewMediaController class uses a view model that is a type of the ViewAllMediaViewModel class.

Use the following function to get Video Audio and Image Messages to show

viewModel.getVideoAudioImageMessage(jid: jid) { isSuccess, error, data in
if !isSuccess {
let message = AppUtils.shared.getErrorMessage(description: error?.description ?? "")
AppAlert.shared.showAlert(view: self, title: "" , message: message, buttonTitle: "OK")
return
}
var result = data
if let chatMessages = result.getData() as? [[ChatMessage]] {
executeOnMainThread {
self.listViewcomponent?.configure(delegate: self, theme: self.theme, mediaChatMessages: chatMessages)
}
}
}
ArgumentTypeDescription
jidStringjid of the user/group
CALLBACKFlyCompletionHandlerFlyCompletionHandler used as completion Handler

Use the following function to get Doc Messages to show

viewModel.getDocumentMessage(jid: jid) { isSuccess,error,data in
if !isSuccess {
let message = AppUtils.shared.getErrorMessage(description: error?.description ?? "")
AppAlert.shared.showAlert(view: self, title: "" , message: message, buttonTitle: "OK")
return
}
var result = data
if let chatMessages = result.getData() as? [[ChatMessage]] {
executeOnMainThread {
self.listViewcomponent?.configureDocment(delegate: self, theme: self.theme, documentMessages: chatMessages)
}
}
}
ArgumentTypeDescription
jidStringjid of the user/group
CALLBACKFlyCompletionHandlerFlyCompletionHandler used as completion Handler

View Media option in User and group information screen

ViewMediaFile

ViewMediaFile