Commit 2ade0e60 by pierce

fixed bugs

parent 897e0d67
...@@ -96,6 +96,7 @@ ...@@ -96,6 +96,7 @@
if (image == nil) { if (image == nil) {
image = [UIImage imageNamed:imageName inBundle:[NSBundle mainBundle] compatibleWithTraitCollection:nil]; image = [UIImage imageNamed:imageName inBundle:[NSBundle mainBundle] compatibleWithTraitCollection:nil];
} }
FUSLogInfo(@"pidan record imageNamed = %@, bundle = %@",imageName, bundle);
return image; return image;
} }
...@@ -115,6 +116,7 @@ ...@@ -115,6 +116,7 @@
if (image == nil) { if (image == nil) {
image = [self imageNamed:imageName inBundle:[NSBundle mainBundle]]; image = [self imageNamed:imageName inBundle:[NSBundle mainBundle]];
} }
FUSLogInfo(@"pidan record imageWithContentFile = %@, bundle = %@",imageName, bundle);
return image; return image;
} }
......
...@@ -150,11 +150,11 @@ ...@@ -150,11 +150,11 @@
} }
- (void)fus_stopPlayer { - (void)fus_stopPlayer {
[self fus_destroyPlayerAsync:YES]; [self fus_destroyPlayerAsync:NO];
} }
- (void)fus_destroyPlayer { - (void)fus_destroyPlayer {
[self fus_destroyPlayerAsync:YES]; [self fus_destroyPlayerAsync:NO];
} }
- (void)fus_destroyPlayerAsync:(BOOL)async { - (void)fus_destroyPlayerAsync:(BOOL)async {
...@@ -440,9 +440,11 @@ ...@@ -440,9 +440,11 @@
#pragma mark - VeLivePlayerObserver #pragma mark - VeLivePlayerObserver
- (void)onRenderVideoFrame:(TVLManager *)player videoFrame:(VeLivePlayerVideoFrame *)videoFrame { - (void)onRenderVideoFrame:(TVLManager *)player videoFrame:(VeLivePlayerVideoFrame *)videoFrame {
if (player.playbackState == TVLPlayerPlaybackStatePlaying) {
if (self.delegate && [self.delegate respondsToSelector:@selector(fus_player:onRenderVideoFrame:)]) { if (self.delegate && [self.delegate respondsToSelector:@selector(fus_player:onRenderVideoFrame:)]) {
[self.delegate fus_player:self onRenderVideoFrame:videoFrame.pixelBuffer]; [self.delegate fus_player:self onRenderVideoFrame:videoFrame.pixelBuffer];
} }
}
} }
- (void)onAudioRenderStall:(TVLManager *)player stallTime:(int64_t)stallTime { - (void)onAudioRenderStall:(TVLManager *)player stallTime:(int64_t)stallTime {
......
...@@ -786,7 +786,7 @@ typedef NS_ENUM(NSInteger, FUSStreamState) { ...@@ -786,7 +786,7 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
// 播放 // 播放
[FUSLiveHelper fus_quitLiveWithCompletion:^{ [FUSLiveHelper fus_quitLiveWithCompletion:^{
// [self.playView fus_stopPlay]; // [self.playView fus_stopPlay];
[_playView fus_stopWithUID:[FUSLiveHelper shareInstance].roomInfoModel.roomId]; [self.playView fus_stopWithUID:[FUSLiveHelper shareInstance].roomInfoModel.roomId];
self.playView = nil; self.playView = nil;
[self.liveFunctionView fus_cleanFunctionView]; [self.liveFunctionView fus_cleanFunctionView];
self.liveFunctionView = nil; self.liveFunctionView = nil;
...@@ -801,8 +801,9 @@ typedef NS_ENUM(NSInteger, FUSStreamState) { ...@@ -801,8 +801,9 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
[self.liveFunctionView fus_cleanFunctionView]; [self.liveFunctionView fus_cleanFunctionView];
if (self.pushView.streamType == FUSStreamTypeRTC) { if (self.pushView.streamType == FUSStreamTypeRTC) {
__weak typeof(self) weakSelf = self;
[self.pushView fus_stopRTCStreamingWithCompletion:^{ [self.pushView fus_stopRTCStreamingWithCompletion:^{
self.pushView = nil; weakSelf.pushView = nil;
}]; }];
}else{ }else{
self.pushView = nil; self.pushView = nil;
...@@ -1363,7 +1364,7 @@ typedef NS_ENUM(NSInteger, FUSStreamState) { ...@@ -1363,7 +1364,7 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
NSString *liveType = @"0"; NSString *liveType = @"0";
[FUSLiveHttpHelper fus_reconnectRoomWithRoomId:[[[FUSLiveHelper shareInstance] roomInfoModel] roomId] livingType:liveType vdoid:[[[FUSLiveHelper shareInstance] streamModel] vdoid] success:^(FUSRoomInfoModel *roomInfoModel) { [FUSLiveHttpHelper fus_reconnectRoomWithRoomId:[[[FUSLiveHelper shareInstance] roomInfoModel] roomId] livingType:liveType vdoid:[[[FUSLiveHelper shareInstance] streamModel] vdoid] success:^(FUSRoomInfoModel *roomInfoModel) {
_retryTime = 0; self.retryTime = 0;
self.resentJoinRoomTimer = [NSTimer scheduledTimerWithTimeInterval:2 target:[YYWeakProxy proxyWithTarget:self] selector:@selector(resendJoinRoomTimerAction:) userInfo:nil repeats:YES]; self.resentJoinRoomTimer = [NSTimer scheduledTimerWithTimeInterval:2 target:[YYWeakProxy proxyWithTarget:self] selector:@selector(resendJoinRoomTimerAction:) userInfo:nil repeats:YES];
} failure:^(NSString *msg, int code, NSDictionary *errorDict) { } failure:^(NSString *msg, int code, NSDictionary *errorDict) {
...@@ -2059,6 +2060,10 @@ typedef NS_ENUM(NSInteger, FUSStreamState) { ...@@ -2059,6 +2060,10 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
return [VELPictureInPictureController isPictureInPictureSupported]; return [VELPictureInPictureController isPictureInPictureSupported];
} }
- (void)delaySetupPictureInPicture {
[self performSelector:@selector(setupPictureInPicture) afterDelay:0.3];
}
- (void)setupPictureInPicture { - (void)setupPictureInPicture {
if (self.autoStartPictureInPicture == NO) { if (self.autoStartPictureInPicture == NO) {
return; return;
......
...@@ -2115,7 +2115,9 @@ ...@@ -2115,7 +2115,9 @@
[userMutArray addObject:roomPKInfoModel]; [userMutArray addObject:roomPKInfoModel];
} }
if (success) { if (success) {
dispatch_async(dispatch_get_main_queue(), ^{
success(status,remaintime,winner,content,isLikePk,userMutArray,matchId); success(status,remaintime,winner,content,isLikePk,userMutArray,matchId);
});
} }
} failure:^(NSDictionary *dataDict, int code) { } failure:^(NSDictionary *dataDict, int code) {
if (failure) { if (failure) {
......
...@@ -2694,7 +2694,7 @@ UIGestureRecognizerDelegate ...@@ -2694,7 +2694,7 @@ UIGestureRecognizerDelegate
} }
[[NSOperationQueue mainQueue] addOperationWithBlock:^{ [[NSOperationQueue mainQueue] addOperationWithBlock:^{
[self.userListViewModel fus_reloadUserDataWithUID:fromUserUid newLevel:fromUserLevel inPay:fromUserInPay]; [weakSelf.userListViewModel fus_reloadUserDataWithUID:fromUserUid newLevel:fromUserLevel inPay:fromUserInPay];
}]; }];
// 校验礼物数据 // 校验礼物数据
...@@ -2719,9 +2719,9 @@ UIGestureRecognizerDelegate ...@@ -2719,9 +2719,9 @@ UIGestureRecognizerDelegate
isMystic = NO; isMystic = NO;
} }
self.bubbleNum = 11; weakSelf.bubbleNum = 11;
[[NSOperationQueue mainQueue] addOperationWithBlock:^{ [[NSOperationQueue mainQueue] addOperationWithBlock:^{
[self.emitter fus_emitterLaunchCellForced:NO]; [weakSelf.emitter fus_emitterLaunchCellForced:NO];
}]; }];
FUSLiveGiftDataModel *giftModel; FUSLiveGiftDataModel *giftModel;
...@@ -2801,7 +2801,7 @@ UIGestureRecognizerDelegate ...@@ -2801,7 +2801,7 @@ UIGestureRecognizerDelegate
} }
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
[self.pkContentView fus_changeFirstKillAnimationViewLevel]; [weakSelf.pkContentView fus_changeFirstKillAnimationViewLevel];
}); });
}); });
}]; }];
...@@ -4629,6 +4629,7 @@ UIGestureRecognizerDelegate ...@@ -4629,6 +4629,7 @@ UIGestureRecognizerDelegate
[[FUSLiveGiftView shareGiftView] fus_resetGiftView]; [[FUSLiveGiftView shareGiftView] fus_resetGiftView];
if ([FUSLiveHelper shareInstance].liveType == FUSLiveTypeAudience) { if ([FUSLiveHelper shareInstance].liveType == FUSLiveTypeAudience) {
[_enterRoomTimer invalidate];
_enterRoomTimer = [NSTimer timerWithTimeInterval:1 target:self selector:@selector(countEnterRoomTimer) userInfo:nil repeats:YES]; _enterRoomTimer = [NSTimer timerWithTimeInterval:1 target:self selector:@selector(countEnterRoomTimer) userInfo:nil repeats:YES];
[[NSRunLoop mainRunLoop] addTimer:_enterRoomTimer forMode:NSDefaultRunLoopMode]; [[NSRunLoop mainRunLoop] addTimer:_enterRoomTimer forMode:NSDefaultRunLoopMode];
_enterRoomInterval = 1; _enterRoomInterval = 1;
......
...@@ -31,6 +31,16 @@ ...@@ -31,6 +31,16 @@
// 送礼动画的图片 // 送礼动画的图片
@property (nonatomic, strong) UIImageView *animImgView; @property (nonatomic, strong) UIImageView *animImgView;
@property (nonatomic, strong) UIImage *coverNormalImage;
@property (nonatomic, strong) UIImage *coverHighlightedImage;
@property (nonatomic, strong) UIImage *coverSelectedImage;
@end @end
@implementation FUSLinkMicroHeaderView @implementation FUSLinkMicroHeaderView
...@@ -126,9 +136,22 @@ ...@@ -126,9 +136,22 @@
if (model.uid.integerValue == 0) { if (model.uid.integerValue == 0) {
self.faceView.imageView.image = nil; self.faceView.imageView.image = nil;
[self.coverBtn setImage:[FUSShowRoomCenterBunble imageNamed:model.face] forState:UIControlStateNormal];
[self.coverBtn setImage:[FUSShowRoomCenterBunble imageNamed:model.hightlightImgUrl] forState:UIControlStateHighlighted]; if (self.coverNormalImage == nil) {
[self.coverBtn setImage:[FUSShowRoomCenterBunble animatedImageNamed:@"live_link_micro_request_" duration:1] forState:UIControlStateSelected]; self.coverNormalImage = [FUSShowRoomCenterBunble imageNamed:model.face];
}
if (self.coverHighlightedImage == nil) {
self.coverHighlightedImage = [FUSShowRoomCenterBunble imageNamed:model.hightlightImgUrl];
}
if (self.coverSelectedImage == nil) {
self.coverSelectedImage = [FUSShowRoomCenterBunble animatedImageNamed:@"live_link_micro_request_" duration:1];
}
[self.coverBtn setImage:self.coverNormalImage forState:UIControlStateNormal];
[self.coverBtn setImage:self.coverHighlightedImage forState:UIControlStateHighlighted];
[self.coverBtn setImage:self.coverSelectedImage forState:UIControlStateSelected];
[self.coverBtn setImageEdgeInsets:UIEdgeInsetsMake(5, 5, 5, 5)]; [self.coverBtn setImageEdgeInsets:UIEdgeInsetsMake(5, 5, 5, 5)];
_richImageView.image = nil; _richImageView.image = nil;
......
...@@ -134,6 +134,26 @@ ...@@ -134,6 +134,26 @@
[self.albumModel.result enumerateObjectsWithOptions:option usingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {//enumerateObjectsUsingBlock:^(PHAsset *obj, NSUInteger idx, BOOL * _Nonnull stop) { [self.albumModel.result enumerateObjectsWithOptions:option usingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {//enumerateObjectsUsingBlock:^(PHAsset *obj, NSUInteger idx, BOOL * _Nonnull stop) {
if (![obj isKindOfClass:[PHAsset class]]) return ; if (![obj isKindOfClass:[PHAsset class]]) return ;
if (![obj isKindOfClass:[PHAsset class]]) return ;
PHAsset *objAsset = (PHAsset *)obj;
switch ([FUSImagePickerManager sharedManager].phAssetType) {
case PHAssetMediaTypeImage:
if (objAsset.mediaType != PHAssetMediaTypeImage) {
return;
}
break;
case PHAssetMediaTypeVideo:
if (objAsset.mediaType != PHAssetMediaTypeVideo) {
return;
}
break;
default:
break;
}
FUSAssetModel *model = [[FUSAssetModel alloc]init]; FUSAssetModel *model = [[FUSAssetModel alloc]init];
model.asset = obj; model.asset = obj;
model.isSelected = [[FUSImagePickerManager sharedManager]fus_isModelSelected:model]; model.isSelected = [[FUSImagePickerManager sharedManager]fus_isModelSelected:model];
...@@ -1034,6 +1054,22 @@ ...@@ -1034,6 +1054,22 @@
if (![obj isKindOfClass:[PHAsset class]]) return ; if (![obj isKindOfClass:[PHAsset class]]) return ;
PHAsset *objAsset = (PHAsset *)obj;
switch ([FUSImagePickerManager sharedManager].phAssetType) {
case PHAssetMediaTypeImage:
if (objAsset.mediaType != PHAssetMediaTypeImage) {
return;
}
break;
case PHAssetMediaTypeVideo:
if (objAsset.mediaType != PHAssetMediaTypeVideo) {
return;
}
break;
default:
break;
}
FUSAssetModel *model = [[FUSAssetModel alloc]init]; FUSAssetModel *model = [[FUSAssetModel alloc]init];
model.asset = obj; model.asset = obj;
model.isSelected = [[FUSImagePickerManager sharedManager]fus_isModelSelected:model]; model.isSelected = [[FUSImagePickerManager sharedManager]fus_isModelSelected:model];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment