 
                     cell.configureWithMessage(message, messageImagePreferredWidth: messageImagePreferredWidth, messageImagePreferredHeight: messageImagePreferredHeight, messageImagePreferredAspectRatio: messageImagePreferredAspectRatio, mediaTapAction: {
 
-                        self.performSegueWithIdentifier("showMessageMedia", sender: message)
+                        if message.sendState == MessageSendState.Failed.rawValue {
+
+                            YepAlert.confirmOrCancel(title: NSLocalizedString("Action", comment: ""), message: NSLocalizedString("Resend video?", comment: ""), confirmTitle: NSLocalizedString("Resend", comment: ""), cancelTitle: NSLocalizedString("Cancel", comment: ""), inViewController: self, withConfirmAction: {
+
+                                resendMessage(message, failureHandler: { (reason, errorMessage) in
+                                    defaultFailureHandler(reason, errorMessage)
+                                    // TODO: resendVideo 错误提醒
+
+                                }, completion: { success in
+                                    println("resendVideo: \(success)")
+                                })
+
+                            }, cancelAction: {
+                            })
+
+                        } else {
+                            self.performSegueWithIdentifier("showMessageMedia", sender: message)
+                        }
                     })
 
                     return cell

                    let cell = collectionView.dequeueReusableCellWithReuseIdentifier(chatRightLocationCellIdentifier, forIndexPath: indexPath) as! ChatRightLocationCell

                    cell.configureWithMessage(message, mediaTapAction: {
                        if let coordinate = message.coordinate {
                            let locationCoordinate = CLLocationCoordinate2D(latitude: coordinate.latitude, longitude: coordinate.longitude)
                            let mapItem = MKMapItem(placemark: MKPlacemark(coordinate: locationCoordinate, addressDictionary: nil))
                            /*
                            let launchOptions = [MKLaunchOptionsDirectionsModeKey: MKLaunchOptionsDirectionsModeDriving]
                            mapItem.openInMapsWithLaunchOptions(launchOptions)
                            */
                            mapItem.openInMapsWithLaunchOptions(nil)
                        }
                    })



                    cell.configureWithMessage(message, audioPlayedDuration: audioPlayedDuration, audioBubbleTapAction: { message in

                        if let message = message {
                            if message.sendState == MessageSendState.Failed.rawValue {

                                YepAlert.confirmOrCancel(title: NSLocalizedString("Action", comment: ""), message: NSLocalizedString("Resend audio?", comment: ""), confirmTitle: NSLocalizedString("Resend", comment: ""), cancelTitle: NSLocalizedString("Cancel", comment: ""), inViewController: self, withConfirmAction: {

                                    resendMessage(message, failureHandler: { (reason, errorMessage) in
                                        defaultFailureHandler(reason, errorMessage)
                                        // TODO: resendAudio 错误提醒

                                    }, completion: { success in
                                        println("resendAudio: \(success)")
                                    })

                                }, cancelAction: {
                                })

                                return
                            }
                        }

                        self.playMessageAudioWithMessage(message)
                    })

