MXKRoomDataSource: Handle video thumbnail generation with MXKVideoThumbnailGenerator.

This commit is contained in:
SBiOSoftWhare
2019-07-11 19:07:45 +02:00
parent 9b0c0ba96b
commit 8a1bb8d718
2 changed files with 24 additions and 0 deletions
@@ -46,4 +46,20 @@
*/
- (Widget *)jitsiWidget;
/**
Send an video to the room.
Note: Move this method to MatrixKit when MatrixKit project will handle Swift module.
While sending, a fake event will be echoed in the messages list.
Once complete, this local echo will be replaced by the event saved by the homeserver.
@param videoLocalURL the local filesystem path of the video to send.
@param success A block object called when the operation succeeds. It returns
the event id of the event generated on the homeserver
@param failure A block object called when the operation fails.
*/
- (void)sendVideo:(NSURL*)videoLocalURL
success:(void (^)(NSString *eventId))success
failure:(void (^)(NSError *error))failure;
@end
@@ -555,6 +555,14 @@
return jitsiWidget;
}
- (void)sendVideo:(NSURL*)videoLocalURL
success:(void (^)(NSString *eventId))success
failure:(void (^)(NSError *error))failure
{
UIImage *videoThumbnail = [MXKVideoThumbnailGenerator.shared generateThumbnailFrom:videoLocalURL];
[self sendVideo:videoLocalURL withThumbnail:videoThumbnail success:success failure:failure];
}
#pragma mark - BubbleReactionsViewModelDelegate
- (void)bubbleReactionsViewModel:(BubbleReactionsViewModel *)viewModel didAddReaction:(MXReactionCount *)reactionCount forEventId:(NSString *)eventId