                         switch message.mediaType {
                         case MessageMediaType.Image.rawValue:
                             if let fileURL = NSFileManager.saveMessageImageData(data, withName: fileName) {
-                                updateMessage(message, withAttachmentFileName: fileName)
+                                updateAttachmentOfMessage(message, withAttachmentFileName: fileName)
                             }
 
                         case MessageMediaType.Video.rawValue:
-                            break // TODO: download video
+                            if let fileURL = NSFileManager.saveMessageVideoData(data, withName: fileName) {
+                                updateAttachmentOfMessage(message, withAttachmentFileName: fileName)
+                            }
 
                         case MessageMediaType.Audio.rawValue:
                             if let fileURL = NSFileManager.saveMessageAudioData(data, withName: fileName) {
-                                updateMessage(message, withAttachmentFileName: fileName)
+                                updateAttachmentOfMessage(message, withAttachmentFileName: fileName)
                             }
                             
                         default:


func downloadAttachmentOfMessage(message: Message) {

    func updateMessage(message: Message, withAttachmentFileName attachmentFileName: String) {
        let realm = message.realm
        realm.beginWriteTransaction()
        message.localAttachmentName = attachmentFileName

        realm.commitWriteTransaction()
    }

    func updateThumbnailOfMessage(message: Message, withThumbnailFileName thumbnailFileName: String) {
        let realm = message.realm
        realm.beginWriteTransaction()
        message.localThumbnailName = thumbnailFileName
        realm.commitWriteTransaction()
    }

    let attachmentURLString = message.attachmentURLString

    if !attachmentURLString.isEmpty && message.downloadState != MessageDownloadState.Downloaded.rawValue {
        if let url = NSURL(string: attachmentURLString) {
