Merge branch 'charlesmchen/fixAudioPlayback' into hotfix/2.10.1

pull/1/head
Matthew Chen 8 years ago
commit 622a757ec8

@ -132,7 +132,7 @@ CHECKOUT OPTIONS:
:commit: 139bde37738ccb6ebcc68bf1b02c8a28400b6760
:git: https://github.com/WhisperSystems/SignalProtocolKit.git
SignalServiceKit:
:commit: d4e0c49ff98f88ea053b3c4875b81270a8ab8ea0
:commit: 7f2ce6142471b6f9814c558838e23fc9365c78af
:git: https://github.com/WhisperSystems/SignalServiceKit.git
SocketRocket:
:commit: 877ac7438be3ad0b45ef5ca3969574e4b97112bf

@ -162,7 +162,7 @@ NS_ASSUME_NONNULL_BEGIN
[[TSPhotoAdapter alloc] initWithAttachment:stream incoming:isIncomingAttachment];
adapter.mediaItem.appliesMediaViewMaskAsOutgoing = !isIncomingAttachment;
break;
} else if ([stream isVideo]) {
} else if ([stream isVideo] || [stream isAudio]) {
adapter.mediaItem = [[TSVideoAttachmentAdapter alloc]
initWithAttachment:stream
incoming:[interaction isKindOfClass:[TSIncomingMessage class]]];

@ -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…
Cancel
Save