|
@@ -22,17 +22,11 @@
|
|
|
SOFTWARE.
|
|
|
*/
|
|
|
|
|
|
-protocol AsyncContentLoadDelegate: class {
|
|
|
- func contentDidLoad()
|
|
|
-}
|
|
|
-
|
|
|
import UIKit
|
|
|
|
|
|
/// A subclass of `MessageContentCell` used to display video and audio messages.
|
|
|
open class MediaMessageCell: MessageContentCell {
|
|
|
|
|
|
- weak var asyncDelegate: AsyncContentLoadDelegate?
|
|
|
-
|
|
|
/// The play button view to display on video messages.
|
|
|
open lazy var playButtonView: PlayButtonView = {
|
|
|
let playButtonView = PlayButtonView()
|
|
@@ -66,7 +60,6 @@ open class MediaMessageCell: MessageContentCell {
|
|
|
open override func prepareForReuse() {
|
|
|
super.prepareForReuse()
|
|
|
self.imageView.image = nil
|
|
|
- self.asyncDelegate = nil
|
|
|
}
|
|
|
|
|
|
open override func configure(with message: MessageType, at indexPath: IndexPath, and messagesCollectionView: MessagesCollectionView) {
|
|
@@ -89,7 +82,6 @@ open class MediaMessageCell: MessageContentCell {
|
|
|
imageView.loadVideoThumbnail(from: url, placeholderImage: mediaItem.placeholderImage, completionHandler: { [weak self] thumbnail in
|
|
|
if let image = thumbnail {
|
|
|
self?.cache(thumbnail: image, key: url.absoluteString)
|
|
|
- self?.asyncDelegate?.contentDidLoad()
|
|
|
}
|
|
|
})
|
|
|
}
|