Fix audio playback.
// FREEBIE
This commit is contained in:
parent
8458fb69a4
commit
79a2612dbe
@ -151,6 +151,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
_audioPlayPauseButton = [[UIButton alloc] initWithFrame:CGRectMake(3, 3, 30, 30)];
|
||||
[_audioPlayPauseButton setBackgroundImage:[UIImage imageNamed:@"audio_play_button"]
|
||||
forState:UIControlStateNormal];
|
||||
_audioPlayPauseButton.enabled = NO;
|
||||
|
||||
AVAudioPlayer *player = [[AVAudioPlayer alloc] initWithContentsOfURL:url error:&err];
|
||||
_durationLabel = [[UILabel alloc] init];
|
||||
@ -180,13 +181,9 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
[audioBubble addSubview:_durationLabel];
|
||||
|
||||
if (!_incoming) {
|
||||
__weak TSVideoAttachmentAdapter *weakSelf = self;
|
||||
self.attachmentUploadView = [[AttachmentUploadView alloc] initWithAttachment:self.attachment
|
||||
superview:audioBubble
|
||||
attachmentStateCallback:^(BOOL isAttachmentReady) {
|
||||
weakSelf.audioPlayPauseButton.enabled
|
||||
= isAttachmentReady;
|
||||
}];
|
||||
attachmentStateCallback:nil];
|
||||
}
|
||||
|
||||
return audioBubble;
|
||||
|
||||
@ -1699,7 +1699,8 @@ typedef enum : NSUInteger {
|
||||
NSIndexPath *indexPathI = [NSIndexPath indexPathForRow:i inSection:0];
|
||||
id<OWSMessageData> message = [self messageAtIndexPath:indexPathI];
|
||||
|
||||
if (message.messageType == TSIncomingMessageAdapter && message.isMediaMessage) {
|
||||
if (message.messageType == TSIncomingMessageAdapter && message.isMediaMessage &&
|
||||
[[message media] isKindOfClass:[TSVideoAttachmentAdapter class]]) {
|
||||
TSVideoAttachmentAdapter *msgMedia
|
||||
= (TSVideoAttachmentAdapter *)[message media];
|
||||
if ([msgMedia isAudio]) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user