Commit 8920fece by ludi

修复一些bug

parent 946ce572
Showing with 358 additions and 50 deletions
......@@ -9,13 +9,13 @@
#import <UIKit/UIKit.h>
#import "FUSMediaPreviewModel.h"
@class FUSStreamVideoPlayView;
@class FUSByteStreamVideoPlayView;
NS_ASSUME_NONNULL_BEGIN
@interface FUSSingleVideoPreview : UIView
@property (nonatomic, copy) void(^hideCurrentViewHandler)(FUSStreamVideoPlayView *player);
@property (nonatomic, copy) void(^hideCurrentViewHandler)(FUSByteStreamVideoPlayView *player);
@property (nonatomic, copy) void(^__nullable showCurrentViewHandler)(void);
......@@ -25,7 +25,7 @@ NS_ASSUME_NONNULL_BEGIN
/// 创建view
/// @param previewModel 视频
+ (FUSSingleVideoPreview *)fus_baseMediaPreviewWithPlayer:(FUSStreamVideoPlayView *)player;
+ (FUSSingleVideoPreview *)fus_baseMediaPreviewWithPlayer:(FUSByteStreamVideoPlayView *)player;
- (void)fus_playCurrentVideo;
......
......@@ -17,7 +17,7 @@
@property (nonatomic, strong) FUSMediaPreviewModel *previewModel;
// 从外部传进来的播放器
@property (nonatomic, strong) FUSStreamVideoPlayView *playView;
@property (nonatomic, strong) FUSByteStreamVideoPlayView *playView;
// 播放/暂停按钮
@property (nonatomic, strong) UIButton *playControlBtn;
......@@ -39,7 +39,7 @@
}
/// 创建view
+ (FUSSingleVideoPreview *)fus_baseMediaPreviewWithPlayer:(FUSStreamVideoPlayView *)player {
+ (FUSSingleVideoPreview *)fus_baseMediaPreviewWithPlayer:(FUSByteStreamVideoPlayView *)player {
FUSSingleVideoPreview *preview = [self fus_baseMediaPreview];
[preview.playView fus_playWithPlayer:player];
......@@ -64,7 +64,7 @@
self = [super initWithFrame:frame];
if (self) {
self.playView = [[FUSStreamVideoPlayView alloc] initWithFrame:self.bounds];
self.playView = [[FUSByteStreamVideoPlayView alloc] initWithFrame:self.bounds];
self.playView.contentMode = UIViewContentModeScaleAspectFit;
__weak typeof(self) weakSelf = self;
self.playView.playingStatusDidChangedHandler = ^(FUSVideoPlayerPlayState playStatus) {
......
......@@ -429,7 +429,7 @@ typedef void(^ConnectBlock)(BOOL isSuccess); // 连接回调
}
}
// 打印收到的消息
if ([FUSConfig sharedInstanced].devConfigs.enableSocketDebug /*&& messageModel.cid*/) FUSLogInfo(@"--->收到消息:\n%@", [messageModel fus_getDictionary]);
if ([FUSConfig sharedInstanced].devConfigs.enableSocketDebug /*&& messageModel.cid*/) FUSLogInfo(@"--->收到消息111:\n%@", [messageModel fus_getDictionary]);
// 判断消息是否为空
if ([NSObject isNullWithObject:messageModel]) {
......
......@@ -115,6 +115,9 @@
#define ROOM_CID_LIVE_ALERT 10090 // 接收到直播弹窗通知
#define ROOM_CID_WEBVIEW_PUSH 10092 // 推送webview弹窗
// PK分数变化
#define PK_CID_SCORE_CHANGED 40060
// 主播打开关闭麦克风socket
#define ROOM_CID_anchorDidCloseBeauty 20200
// 主播打开关闭麦克风socket
......
//
// FUSNativeVideoPlayer.h
// FusiLive
//
// Created by Gemini on 2024/03/12.
// Copyright © 2024年 FusiYa. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "FUSVideoPlayerProtocal.h"
NS_ASSUME_NONNULL_BEGIN
@interface FUSNativeVideoPlayer : NSObject <FUSVideoPlayerProtocal>
@end
NS_ASSUME_NONNULL_END
......@@ -32,6 +32,9 @@
// 用户id
@property (nonatomic, copy) NSString *uid;
/// 其他人静音的uid
@property (nullable, strong) NSMutableArray<NSString *> *remoteMuteUidList;
// 推流地址
@property (nonatomic, copy) NSString *streamUrl;
......@@ -57,6 +60,7 @@
return;
}
self.remoteMuteUidList = [[NSMutableArray alloc] init];
self.beforeAgoraVideoSize = self.config.videoSize;
self.beforeAgoraVideoPreset = self.config.capturePreset;
[self fus_setVideoOutputSize:CGSizeMake(360, 640)];
......@@ -132,6 +136,10 @@
if (_agoraEngine) {
[_agoraEngine enableLocalAudio:YES];
[_agoraEngine muteAllRemoteAudioStreams:NO];
for (NSString *muteUid in self.remoteMuteUidList) {
[self fus_setPKUser:muteUid mute:YES];
}
}
}
......@@ -229,6 +237,14 @@
- (void)fus_setPKUser:(NSString *)uid mute:(BOOL)mute {
[self.agoraEngine muteRemoteAudioStream:uid.intValue mute:mute];
BOOL containUid = [self.remoteMuteUidList containsObject:uid.description];
if (mute && containUid == NO) {
[self.remoteMuteUidList addObject:uid.description];
}
else if (mute == NO && containUid == YES) {
[self.remoteMuteUidList removeObject:uid.description];
}
}
- (void)updateToSpeakerPlay {
......
......@@ -69,7 +69,7 @@
[super layoutSubviews];
if (self.streamPlayer.view == self.contentView) {
self.contentView.frame = self.bounds;
[_streamPlayer fus_setPlayerViewFrame:self.bounds];
[self.streamPlayer fus_setPlayerViewFrame:self.bounds];
}
}
#pragma mark - Notification
......@@ -121,10 +121,10 @@
player.streamPlayer.delegate = nil;
// 重新绑定播放回调和计时器
[_streamPlayer fus_resetPlayView:self.contentView];
[_streamPlayer fus_setPlayerViewFrame:self.bounds];
_streamPlayer.delegate = self;
_streamPlayer.view.center = CGPointMake(CGRectGetWidth(self.contentView.bounds) / 2.0f, CGRectGetHeight(self.contentView.bounds) / 2.0f);
[self.streamPlayer fus_resetPlayView:self.contentView];
[self.streamPlayer fus_setPlayerViewFrame:self.bounds];
self.streamPlayer.delegate = self;
self.streamPlayer.view.center = CGPointMake(CGRectGetWidth(self.contentView.bounds) / 2.0f, CGRectGetHeight(self.contentView.bounds) / 2.0f);
[self registerNotification];
// 同步播放器状态
......@@ -207,7 +207,7 @@
[self removeAllRegisterNotification];
[self.streamPlayer.view removeFromSuperview];
[self.streamPlayer fus_destroyPlayer];
_streamPlayer = nil;
self.streamPlayer = nil;
}
/**
......
......@@ -102,7 +102,7 @@
/* End PBXFileReference section */
/* Begin PBXFileSystemSynchronizedBuildFileExceptionSet section */
00E501FF2E0543A800579DB0 /* PBXFileSystemSynchronizedBuildFileExceptionSet */ = {
00E501FF2E0543A800579DB0 /* Exceptions for "NotificationService" folder in "NotificationService" target */ = {
isa = PBXFileSystemSynchronizedBuildFileExceptionSet;
membershipExceptions = (
"NotificationService-Info.plist",
......@@ -112,7 +112,18 @@
/* End PBXFileSystemSynchronizedBuildFileExceptionSet section */
/* Begin PBXFileSystemSynchronizedRootGroup section */
00E501F42E0543A800579DB0 /* NotificationService */ = {isa = PBXFileSystemSynchronizedRootGroup; exceptions = (00E501FF2E0543A800579DB0 /* PBXFileSystemSynchronizedBuildFileExceptionSet */, ); explicitFileTypes = {}; explicitFolders = (); path = NotificationService; sourceTree = "<group>"; };
00E501F42E0543A800579DB0 /* NotificationService */ = {
isa = PBXFileSystemSynchronizedRootGroup;
exceptions = (
00E501FF2E0543A800579DB0 /* Exceptions for "NotificationService" folder in "NotificationService" target */,
);
explicitFileTypes = {
};
explicitFolders = (
);
path = NotificationService;
sourceTree = "<group>";
};
/* End PBXFileSystemSynchronizedRootGroup section */
/* Begin PBXFrameworksBuildPhase section */
......@@ -415,14 +426,10 @@
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-FuSiLive/Pods-FuSiLive-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
inputPaths = (
);
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-FuSiLive/Pods-FuSiLive-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-FuSiLive/Pods-FuSiLive-frameworks.sh\"\n";
......@@ -436,14 +443,10 @@
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-FuSiLive/Pods-FuSiLive-resources-${CONFIGURATION}-input-files.xcfilelist",
);
inputPaths = (
);
name = "[CP] Copy Pods Resources";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-FuSiLive/Pods-FuSiLive-resources-${CONFIGURATION}-output-files.xcfilelist",
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-FuSiLive/Pods-FuSiLive-resources.sh\"\n";
......
......@@ -2779,14 +2779,10 @@
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-FUSChatCenterModule/Pods-FUSChatCenterModule-resources-${CONFIGURATION}-input-files.xcfilelist",
);
inputPaths = (
);
name = "[CP] Copy Pods Resources";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-FUSChatCenterModule/Pods-FUSChatCenterModule-resources-${CONFIGURATION}-output-files.xcfilelist",
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-FUSChatCenterModule/Pods-FUSChatCenterModule-resources.sh\"\n";
......
......@@ -133,6 +133,8 @@
00A51A5B2CAA4B9F00B26212 /* FUSLiveChatEasySendView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00A51A5A2CAA4B9F00B26212 /* FUSLiveChatEasySendView.swift */; };
00A51A5E2CAA5AA700B26212 /* FUSRoomQuickChatListModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 00A51A5D2CAA5AA700B26212 /* FUSRoomQuickChatListModel.m */; };
00A51A5F2CAA5AA700B26212 /* FUSRoomQuickChatListModel.h in Headers */ = {isa = PBXBuildFile; fileRef = 00A51A5C2CAA5AA700B26212 /* FUSRoomQuickChatListModel.h */; };
00A56FE32F62A5D4009BCC75 /* live_pk_progress_light_anim_gift_bomb.webp in Resources */ = {isa = PBXBuildFile; fileRef = 00A56FE22F62A5D4009BCC75 /* live_pk_progress_light_anim_gift_bomb.webp */; };
00A56FE52F62D37F009BCC75 /* live_header_like_btn_guide_animate.webp in Resources */ = {isa = PBXBuildFile; fileRef = 00A56FE42F62D37F009BCC75 /* live_header_like_btn_guide_animate.webp */; };
00A66C482CCA229400F366E9 /* FUSPKLiveAnimateImageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 00A66C472CCA229400F366E9 /* FUSPKLiveAnimateImageView.m */; };
00A66C492CCA229400F366E9 /* FUSPKLiveAnimateImageView.h in Headers */ = {isa = PBXBuildFile; fileRef = 00A66C462CCA229400F366E9 /* FUSPKLiveAnimateImageView.h */; };
00A84DC32CA41D0C000A3BED /* FUSPatAudiencePromptAlertView.h in Headers */ = {isa = PBXBuildFile; fileRef = 00A84DC12CA41D0C000A3BED /* FUSPatAudiencePromptAlertView.h */; };
......@@ -178,7 +180,6 @@
00BD441F2D1EAA740099A96F /* FUSCarEnterView.m in Sources */ = {isa = PBXBuildFile; fileRef = 00BD441E2D1EAA740099A96F /* FUSCarEnterView.m */; };
00BD44202D1EAA740099A96F /* FUSCarEnterView.h in Headers */ = {isa = PBXBuildFile; fileRef = 00BD441D2D1EAA740099A96F /* FUSCarEnterView.h */; };
00CD22092F57DC6800A07432 /* FUSPKGiftBombInfoPanelView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00CD22082F57DC6800A07432 /* FUSPKGiftBombInfoPanelView.swift */; };
00CD220D2F580A9000A07432 /* live_pk_progress_light_anim_gift_bomb.webp in Resources */ = {isa = PBXBuildFile; fileRef = 00CD220C2F580A9000A07432 /* live_pk_progress_light_anim_gift_bomb.webp */; };
00CD22D72F58245D00A07432 /* live_pk_win_anim_94@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 00CD226C2F58245D00A07432 /* live_pk_win_anim_94@2x.png */; };
00CD22D82F58245D00A07432 /* live_pk_win_anim_197@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 00CD22D32F58245D00A07432 /* live_pk_win_anim_197@2x.png */; };
00CD22D92F58245D00A07432 /* live_pk_win_anim_135@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 00CD22952F58245D00A07432 /* live_pk_win_anim_135@2x.png */; };
......@@ -2481,6 +2482,8 @@
00A51A5A2CAA4B9F00B26212 /* FUSLiveChatEasySendView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FUSLiveChatEasySendView.swift; sourceTree = "<group>"; };
00A51A5C2CAA5AA700B26212 /* FUSRoomQuickChatListModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FUSRoomQuickChatListModel.h; sourceTree = "<group>"; };
00A51A5D2CAA5AA700B26212 /* FUSRoomQuickChatListModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FUSRoomQuickChatListModel.m; sourceTree = "<group>"; };
00A56FE22F62A5D4009BCC75 /* live_pk_progress_light_anim_gift_bomb.webp */ = {isa = PBXFileReference; lastKnownFileType = file; path = live_pk_progress_light_anim_gift_bomb.webp; sourceTree = "<group>"; };
00A56FE42F62D37F009BCC75 /* live_header_like_btn_guide_animate.webp */ = {isa = PBXFileReference; lastKnownFileType = file; path = live_header_like_btn_guide_animate.webp; sourceTree = "<group>"; };
00A66C462CCA229400F366E9 /* FUSPKLiveAnimateImageView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FUSPKLiveAnimateImageView.h; sourceTree = "<group>"; };
00A66C472CCA229400F366E9 /* FUSPKLiveAnimateImageView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FUSPKLiveAnimateImageView.m; sourceTree = "<group>"; };
00A84DC12CA41D0C000A3BED /* FUSPatAudiencePromptAlertView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FUSPatAudiencePromptAlertView.h; sourceTree = "<group>"; };
......@@ -2526,7 +2529,6 @@
00BD441D2D1EAA740099A96F /* FUSCarEnterView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FUSCarEnterView.h; sourceTree = "<group>"; };
00BD441E2D1EAA740099A96F /* FUSCarEnterView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FUSCarEnterView.m; sourceTree = "<group>"; };
00CD22082F57DC6800A07432 /* FUSPKGiftBombInfoPanelView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FUSPKGiftBombInfoPanelView.swift; sourceTree = "<group>"; };
00CD220C2F580A9000A07432 /* live_pk_progress_light_anim_gift_bomb.webp */ = {isa = PBXFileReference; lastKnownFileType = file; path = live_pk_progress_light_anim_gift_bomb.webp; sourceTree = "<group>"; };
00CD220E2F58245D00A07432 /* live_pk_win_anim_0@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "live_pk_win_anim_0@2x.png"; sourceTree = "<group>"; };
00CD220F2F58245D00A07432 /* live_pk_win_anim_1@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "live_pk_win_anim_1@2x.png"; sourceTree = "<group>"; };
00CD22102F58245D00A07432 /* live_pk_win_anim_2@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "live_pk_win_anim_2@2x.png"; sourceTree = "<group>"; };
......@@ -8487,8 +8489,9 @@
00E6CE272F56F89F00B63797 /* img_liveroom_input_linkmic_waiting_animation.webp */,
00E6CE1A2F56E36500B63797 /* live_pk_host_win_draw_reward_type1_anim.webp */,
00E6CE1B2F56E36500B63797 /* live_pk_host_win_draw_reward_type2_anim.webp */,
00A56FE42F62D37F009BCC75 /* live_header_like_btn_guide_animate.webp */,
00D919602F5AC59F00EEAF97 /* live_pk_progress_light_anim.webp */,
00CD220C2F580A9000A07432 /* live_pk_progress_light_anim_gift_bomb.webp */,
00A56FE22F62A5D4009BCC75 /* live_pk_progress_light_anim_gift_bomb.webp */,
3E4DC8982F580A46003070EC /* live_link_mic_boy_speak_anim.webp */,
3E4DC8992F580A46003070EC /* live_link_mic_girl_speak_anim.webp */,
BEF675EC2C6B156500A670FB /* live_linkmic_bgImg.png */,
......@@ -9115,6 +9118,7 @@
00CD26512F593D9C00A07432 /* pk_user_contribute_burst_dew_type_two_left_18@2x.png in Resources */,
00CD26522F593D9C00A07432 /* pk_user_contribute_burst_dew_type_two_right_3@2x.png in Resources */,
00CD26532F593D9C00A07432 /* pk_user_contribute_burst_dew_type_two_left_23@2x.png in Resources */,
00A56FE32F62A5D4009BCC75 /* live_pk_progress_light_anim_gift_bomb.webp in Resources */,
00CD26542F593D9C00A07432 /* pk_user_contribute_burst_dew_type_two_right_11@2x.png in Resources */,
00CD26552F593D9C00A07432 /* pk_user_contribute_burst_dew_type_two_right_54@2x.png in Resources */,
00CD26562F593D9C00A07432 /* pk_user_contribute_burst_dew_type_two_left_35@2x.png in Resources */,
......@@ -9235,6 +9239,7 @@
BED65B7D2C5CE6AD00668116 /* FUSPKHotAnchorListTableViewCell.xib in Resources */,
BEF676E52C6B156600A670FB /* PK_Lose_Animation_14@2x.png in Resources */,
BEF677A52C6B156600A670FB /* pk_win_streak_6@3x.png in Resources */,
00A56FE52F62D37F009BCC75 /* live_header_like_btn_guide_animate.webp in Resources */,
BEF676832C6B156600A670FB /* live_gift_item_selected_anim_19@2x.png in Resources */,
BEF676B62C6B156600A670FB /* new_live_userlist_guardian_4@2x.png in Resources */,
BEF677602C6B156600A670FB /* PK_Win_Animation_19@2x.png in Resources */,
......@@ -9274,7 +9279,6 @@
00E2A7332F208CE4003B779E /* live_pk_draw_anim_49@2x.png in Resources */,
00E2A7342F208CE4003B779E /* live_pk_lose_anim_45@2x.png in Resources */,
00E2A7352F208CE4003B779E /* live_pk_draw_anim_30@2x.png in Resources */,
00CD220D2F580A9000A07432 /* live_pk_progress_light_anim_gift_bomb.webp in Resources */,
00E2A7362F208CE4003B779E /* live_pk_draw_anim_31@2x.png in Resources */,
00E2A7392F208CE4003B779E /* live_pk_lose_anim_59@2x.png in Resources */,
00E2A73D2F208CE4003B779E /* live_pk_draw_anim_52@2x.png in Resources */,
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "like_pop_blue@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "like_pop_pink@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
......@@ -10,6 +10,7 @@
"scale" : "2x"
},
{
"filename" : "live_pk_resault_anim_icon_draw@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
......
......@@ -10,6 +10,7 @@
"scale" : "2x"
},
{
"filename" : "live_pk_resault_anim_icon_lose@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
......
......@@ -10,6 +10,7 @@
"scale" : "2x"
},
{
"filename" : "live_pk_resault_anim_icon_win@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
......
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "pop_blueqi@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "pop_pinkqi@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
......@@ -1611,6 +1611,15 @@
messageModel.face = jsonDict[@"user"][@"face"];
messageModel.realUid = [jsonDict[@"user"][@"realUid"] description];
messageModel.realLevel = [jsonDict[@"user"][@"realLevel"] description];
NSDictionary *toFormDict = jsonDict[@"toForm"];
if (toFormDict != nil) {
messageModel.toUid = [toFormDict[@"toUid"] description];
messageModel.toNickName = [toFormDict[@"toNickName"] description];
messageModel.toFace = [toFormDict[@"toFace"] description];
}
FUSLogVerbose(@"收到消息:%@", [messageModel fus_getDictionary]);
......
......@@ -158,6 +158,9 @@ typedef NS_ENUM(NSUInteger, FUSLiveChatToolBeautyType) { //美颜工具按钮
/// 获取对应按钮的frame
- (CGRect)fus_getBtnFrameWithToolType:(FUSLiveBottomToolType)type;
/// 获取对应的btn
- (UIButton *)fus_getBtnWithToolType:(FUSLiveBottomToolType)type;
/// 根据一个按钮类型删除一个按钮
/// @param type 按钮类型
......@@ -198,6 +201,9 @@ typedef NS_ENUM(NSUInteger, FUSLiveChatToolBeautyType) { //美颜工具按钮
- (void)fus_updateLinkMicBtnState;
/// 能够改变布局的通知已经全部到达了
- (BOOL)fus_changeFrameNotificationsHaveArrived;
@end
NS_ASSUME_NONNULL_END
......@@ -1361,6 +1361,16 @@
return CGRectZero;
}
- (UIButton *)fus_getBtnWithToolType:(FUSLiveBottomToolType)type{
for (UIButton *btn in _allBtns) {
if (btn.tag == type) {
return btn;
}
}
return nil;
}
- (void)fus_cleanBottomToolView {
[self fus_removeBtnWithType:FUSLiveBottomToolTypeGameEntrance];
......
......@@ -27,6 +27,7 @@
#import <FUSFoundation/FUSFoundation-Swift.h>
#import <FUSCommon/FUSCommon-Swift.h>
#import <FUSShowRoomModule/FUSShowRoomModule-Swift.h>
@interface FUSLiveChatInputHelper ()
......@@ -410,6 +411,8 @@
case FUSLiveBottomToolTypeGift:
{
[self fus_chatInputViewDidClickGift:nil];
[[FUSUserGuideTipsHelper share] fus_dismissWithType:FUSUserGuideTipsTypeLiveGiftButton];
[[FUSUserGuideTipsHelper share] fus_completeGuideWithType:FUSUserGuideTipsTypeLiveGiftButton];
}
break;
default:
......
......@@ -143,6 +143,7 @@
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(fus_keyboardDidShow) name:UIKeyboardDidShowNotification object:nil];
[[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(fus_keyboardWillHide:) name:UIKeyboardWillHideNotification object:nil];
}
// 搭建背景
......@@ -413,6 +414,10 @@
_textView.textMaxLength = MAX_TEXT_LENGTH;
}
if (_chatFastInputView.isHidden == YES) {
[[FUSUserGuideTipsHelper share] fus_dismissWithType:FUSUserGuideTipsTypeQuickChat];
}
}
// textView 滚动到底部的定时器方法
......@@ -500,6 +505,13 @@
_textView.text = _preStringAfterKeyboardShow;
_preStringAfterKeyboardShow = nil;
}
if (self.chatFastInputView.isHidden == NO) {
[self.chatFastInputView fus_showGuideTipsIfInneed];
}
}
- (void)fus_keyboardWillHide:(NSNotification *)notification{
[[FUSUserGuideTipsHelper share] fus_dismissWithType:FUSUserGuideTipsTypeQuickChat];
}
// 停止编辑
......
......@@ -137,6 +137,13 @@ extension FUSGiftSegmentControl {
}
@objc public func fus_getSegmentButton(index: Int) -> UIButton? {
if index < self.segments.count {
return self.segments[index]
}
return nil
}
func setupUI() {
segmentBackView = UIView.init(frame: self.bounds)
segmentBackView?.backgroundColor = backColor
......
......@@ -377,6 +377,8 @@ static FUSLiveGiftView *giftView = nil;
[self fus_showGiftViewWithAnimate:animate onView:view];
self.liveType = livetype;
[[FUSUserGuideTipsHelper share] fus_dismissWithType:FUSUserGuideTipsTypePkLightUp];
if (self.needForcibleReloadLiveGiftView) {
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[self.collectionView reloadData];
......@@ -984,6 +986,7 @@ static FUSLiveGiftView *giftView = nil;
self.sendToUserView.onlySendToAnchor = YES;
// test
[[FUSUserGuideTipsHelper share] fus_dismissWithType:FUSUserGuideTipsTypeGiftViewBackpackButton];
}
- (void)showParcelGiftViewWithTip:(BOOL)tip{
......@@ -1027,14 +1030,22 @@ static FUSLiveGiftView *giftView = nil;
- (void)moveToBackPack:(BOOL)isMove {
if (isMove) {
[[FUSUserGuideTipsHelper share] fus_dismissWithType:FUSUserGuideTipsTypeGiftViewSendButton];
self.liveParcelView.alpha = 0;
self.bgView.alpha = 1;
MJWeakSelf
[UIView animateWithDuration:0.3 animations:^{
self.liveParcelView.left = 0;
// self.bgView.alpha = 0;
self.bgView.left = -UIView.fus_screenW;
} completion:^(BOOL finished) {
[self bringSubviewToFront:self.parcelGiftSegmentBgView];
UIView *backpackSendView = weakSelf.liveParcelView.useBtn;
if (weakSelf.parcelViewModel.oc_giftList.count > 0 && backpackSendView != nil) {
[[FUSUserGuideTipsHelper share] fus_showTipsWithType:FUSUserGuideTipsTypeGiftViewBackpackSendButton showOn:self targetView:backpackSendView];
[[FUSUserGuideTipsHelper share] fus_completeGuideWithType:FUSUserGuideTipsTypeGiftViewBackpackSendButton];
}
}];
[UIView animateWithDuration:0.2 delay:0.1 options:UIViewAnimationOptionCurveLinear animations:^{
......@@ -1043,6 +1054,9 @@ static FUSLiveGiftView *giftView = nil;
}];
} else {
[[FUSUserGuideTipsHelper share] fus_dismissWithType:FUSUserGuideTipsTypeGiftViewBackpackSendButton];
[UIView animateWithDuration:0.3 animations:^{
self.liveParcelView.left = UIView.fus_screenW;
// self.bgView.alpha = 1;
......@@ -1191,6 +1205,20 @@ static FUSLiveGiftView *giftView = nil;
[weakSelf fus_setupSelectIndexpath:self.selectedIndexPath];
[weakSelf fus_updataGiftJumpData];
// 引导,如果一打开不是在第一个页面就不引导第一个页面
if (weakSelf.parcelGiftSegment.defaultSegment == 0) {
UIButton *backpackBtn = [weakSelf.parcelGiftSegment fus_getSegmentButtonWithIndex:1];
if (weakSelf.parcelViewModel.oc_giftList.count > 0 && backpackBtn != nil) {
[[FUSUserGuideTipsHelper share] fus_showTipsWithType:FUSUserGuideTipsTypeGiftViewBackpackButton showOn:self targetView:backpackBtn];
[[FUSUserGuideTipsHelper share] fus_completeGuideWithType:FUSUserGuideTipsTypeGiftViewBackpackButton];
}
if (weakSelf.sendBtn != nil && weakSelf.sendBtn.isHidden == NO) {
[[FUSUserGuideTipsHelper share] fus_showTipsWithType:FUSUserGuideTipsTypeGiftViewSendButton showOn:self targetView:weakSelf.sendBtn];
[[FUSUserGuideTipsHelper share] fus_completeGuideWithType:FUSUserGuideTipsTypeGiftViewSendButton];
}
}
}];
} else {
// 静态展示
......@@ -1332,6 +1360,10 @@ static FUSLiveGiftView *giftView = nil;
[[NSNotificationCenter defaultCenter] postNotificationName:kLiveGiftViewWillDismissNotification object:@{@"needUpload":@(upload)} userInfo:nil];
}
[[FUSUserGuideTipsHelper share] fus_dismissWithType:FUSUserGuideTipsTypeGiftViewBackpackButton];
[[FUSUserGuideTipsHelper share] fus_dismissWithType:FUSUserGuideTipsTypeGiftViewBackpackSendButton];
[[FUSUserGuideTipsHelper share] fus_dismissWithType:FUSUserGuideTipsTypeGiftViewSendButton];
// ludy: fusi没有真爱团,直接注释了
// if (self.isClickSendBtn
// && self.sendGiftModel.currency.integerValue == 3
......
......@@ -45,6 +45,9 @@ NS_ASSUME_NONNULL_BEGIN
// 回调的delegate
@property (nonatomic, weak) id<FUSLiveParcelViewDelegate> delegate;
// 使用按钮
@property (nonatomic, strong) FUSStyleButton *useBtn;
- (void)fus_resetParcelGiftSendingState:(BOOL)isSending;
- (void)fus_resetGiftAndPropsState;
......
......@@ -27,6 +27,7 @@
#import <FUSCommon/FUSBackpackMotorModel.h>
#import <FUSFoundation/FUSFoundation.h>
#import <FUSCommon/FUSBackpackUnreadGetTimeModel.h>
#import <FUSShowRoomModule/FUSShowRoomModule-Swift.h>
//#import "FUSLiveParcelGiftModel+FFDownload.h"
......@@ -65,9 +66,6 @@
// 记录内容的Label
//@property (nonatomic, strong) UILabel *recordDetailLabel;
// 使用按钮
@property (nonatomic, strong) FUSStyleButton *useBtn;
#pragma mark - scrollView
// 包含道具和礼物列表的scrollView
@property (nonatomic, strong) UIScrollView *scrollView;
......@@ -823,6 +821,9 @@
switch (type.index) {
case 90001: {
// 使用背包礼物
[[FUSUserGuideTipsHelper share] fus_dismissWithType:FUSUserGuideTipsTypeGiftViewBackpackSendButton];
FUSLiveParcelGiftModel *giftModel = self.parcelGiftsList[self.giftListView.selectedParcelGiftsIndexPath.row];
if (![NSString isNullWithString:giftModel.mp4Res]) {
// 有资源文件,检查资源文件是否已经下载完成
......
......@@ -175,6 +175,9 @@ typedef NS_ENUM(NSInteger, FUSLiveHeadViewType) {
*/
- (CGRect)getLikeBtnRect;
/// 取得关注按钮
- (UIButton *)fus_getLikeBtn;
- (CGRect)getPortraitViewRect;
/**
......@@ -207,5 +210,8 @@ typedef NS_ENUM(NSInteger, FUSLiveHeadViewType) {
- (void)fus_updateUserListModel:(id)userListModel;
/// 更新主播闭麦
- (void)fus_updateAnchorAudioClose:(BOOL)closed;
@end
......@@ -76,6 +76,9 @@ NSString * const kDidHotScoreChangeNotification = @"kDidHotScoreChangeNotificati
// 水印
@property (nonatomic, strong) UIImageView *waterMark;
/// 主播是否闭麦
@property (nonatomic, assign) BOOL isAnchorAudioClose;
@end
@implementation FUSLiveHeadView
......@@ -99,6 +102,7 @@ NSString * const kDidHotScoreChangeNotification = @"kDidHotScoreChangeNotificati
if (self) {
self.type = type;
self.isAnchorAudioClose = NO;
[self initUI];
......@@ -496,7 +500,10 @@ NSString * const kDidHotScoreChangeNotification = @"kDidHotScoreChangeNotificati
_userInfoLabel.text = [NSString stringWithFormat:@"%@ %@",FUSLiveHelper.shareInstance.roomInfoModel.roomId,[[NSDate date] stringWithFormat:@"dd/MM/yyyy"]];
[_userInfoLabel sizeToFit];
_userInfoLabel.height = 20;
_userInfoLabel.x = self.width - self.userInfoLabel.width - 86;
// _userInfoLabel.x = self.width - self.userInfoLabel.width - 86;
CGFloat audioW = _isAnchorAudioClose == YES ? 30 : 0;
CGFloat liveTimeW = [FUSLiveHelper shareInstance].liveType == FUSLiveTypeAnchor ? 86 : 10;
_userInfoLabel.x = self.width - self.userInfoLabel.width - liveTimeW - audioW;
_userInfoLabel.centerY = self.coinTicketView.centerY;
_waterMark.centerY = _userInfoLabel.centerY;
_waterMark.right = _userInfoLabel.left - 4;
......@@ -598,6 +605,14 @@ NSString * const kDidHotScoreChangeNotification = @"kDidHotScoreChangeNotificati
[self.userListView fus_updateUserListModel:userListModel];
}
- (void)fus_updateAnchorAudioClose:(BOOL)closed{
_isAnchorAudioClose = closed;
CGFloat audioW = _isAnchorAudioClose == YES ? 30 : 0;
CGFloat liveTimeW = [FUSLiveHelper shareInstance].liveType == FUSLiveTypeAnchor ? 86 : 10;
_userInfoLabel.x = self.width - self.userInfoLabel.width - liveTimeW - audioW;
}
/**
设置是否追踪
......@@ -624,6 +639,10 @@ NSString * const kDidHotScoreChangeNotification = @"kDidHotScoreChangeNotificati
return frame;
}
- (UIButton *)fus_getLikeBtn{
return self.portraitView.likeBtn;
}
/**
获取frame作为镂空区域的坐标
......
......@@ -15,6 +15,8 @@
#import "CBAutoScrollLabel.h"
#import "FUSRadarAnimImageViewView.h"
#import <SJAttributesFactory/SJAttributesFactory.h>
#import <Masonry/Masonry.h>
#import <FUSShowRoomModule/FUSShowRoomModule-Swift.h>
#define LIKE_BTN_MARGIN 0
#define MAX_NICKNAME_WIDTH 70
......@@ -60,6 +62,9 @@
/// 头像new的图片
@property (nonatomic, strong) UIImageView *headNewImageView;
@property (nonatomic, strong) YYAnimatedImageView *likeGuideAnimateImageView;
@end
@implementation FUSLivePortraitView
......@@ -226,6 +231,23 @@
CGRect frame = CGRectMake(CGRectGetMaxX(_autoScrollNicknameLabel.frame) > CGRectGetMaxX(_wordLabel.frame) ? CGRectGetMaxX(_autoScrollNicknameLabel.frame) + LIKE_BTN_MARGIN : CGRectGetMaxX(_wordLabel.frame) + LIKE_BTN_MARGIN, 5, self.height - 10, self.height - 10);
_likeBtn.frame = frame;
_likeBtn.centerY = self.bgView.centerY;
self.likeGuideAnimateImageView.hidden = ![FUSUserGuideTipsHelper share].oc_isNewUserGuide;
}
-(void)fus_createLikeGuideImageViewIfInneed{
if (self.likeGuideAnimateImageView == nil) {
self.likeGuideAnimateImageView = [[YYAnimatedImageView alloc] init];
self.likeGuideAnimateImageView.image = [FUSShowRoomCenterBunble webpImageName:@"live_header_like_btn_guide_animate"];
[self addSubview:self.likeGuideAnimateImageView];
[self bringSubviewToFront:self.likeBtn];
[self.likeGuideAnimateImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.center.equalTo(self.likeBtn);
make.width.equalTo(self.likeBtn.mas_width).offset(6);
make.height.equalTo(self.likeBtn.mas_height).offset(6);
}];
self.likeGuideAnimateImageView.hidden = YES;
}
}
#pragma mark - Setter
......@@ -293,6 +315,13 @@
}
_likeBtn.hidden = NO;
_likeBtn.selected = isLike;
if (isLike) {
self.likeGuideAnimateImageView.hidden = YES;
}
else {
self.likeGuideAnimateImageView.hidden = ![FUSUserGuideTipsHelper share].oc_isNewUserGuide;
}
}
/**
......@@ -706,6 +735,9 @@
{
FUSLogInfo(@"点击追踪按钮");
[[FUSUserGuideTipsHelper share] fus_dismissWithType:FUSUserGuideTipsTypeLiveFollow];
[[FUSUserGuideTipsHelper share] fus_completeGuideWithType:FUSUserGuideTipsTypeLiveFollow];
sender.enabled = NO;
// 添加菊花
......
......@@ -9,11 +9,16 @@
#import <UIKit/UIKit.h>
#import "FUSEmitterViewCell.h"
typedef NS_ENUM(NSInteger, FUSEmitterViewImageType) {
FUSEmitterViewImageTypeNormal,
FUSEmitterViewImageTypePupular
};
@class FUSEmitterView;
@protocol FUSEmitterViewDelegate <NSObject>
@required
- (nullable FUSEmitterViewCell *)cellForEmitterView:(nonnull FUSEmitterView *)emitterView;
- (nullable FUSEmitterViewCell *)cellForEmitterView:(nonnull FUSEmitterView *)emitterView imageType:(FUSEmitterViewImageType)imageType;
@end
......@@ -57,7 +62,7 @@
*
* @param forced 是否强制发射,不管 shouldLaunch
*/
- (void)fus_emitterLaunchCellForced:(BOOL)forced;
- (void)fus_emitterLaunchCellForced:(BOOL)forced imageType:(FUSEmitterViewImageType)imageType;
/**
......
......@@ -26,6 +26,10 @@
@implementation FUSEmitterView
- (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event {
return NO;
}
#pragma mark - 初始化方法
- (instancetype)init
{
......@@ -200,12 +204,12 @@
*
* @param forced 是否强制发射,不管 shouldLaunch
*/
- (void)fus_emitterLaunchCellForced:(BOOL)forced
- (void)fus_emitterLaunchCellForced:(BOOL)forced imageType:(FUSEmitterViewImageType)imageType
{
FUSEmitterViewCell *cell;
if (self.delegate && [self.delegate respondsToSelector:@selector(cellForEmitterView:)]) {
cell = [self.delegate cellForEmitterView:self];
if (self.delegate && [self.delegate respondsToSelector:@selector(cellForEmitterView:imageType:)]) {
cell = [self.delegate cellForEmitterView:self imageType:imageType];
}
if (!cell) {
......
......@@ -78,6 +78,8 @@ import YYKit
/// item view的列表
private var itemViewList: [FUSLiveChatEasySendItemView] = []
private var guideTipsDidShow: Bool = false
public func makeUI(){
self.layer.masksToBounds = true
......@@ -147,6 +149,7 @@ import YYKit
itemView.clickHandle = {[weak self] in
self?.sendFastInputMsgHandler?(itemModel)
self?.closingRemainingTime = 10
FUSUserGuideTipsHelper.share.fus_dismiss(type: .quickChat)
}
}
contentScrollGradientView.superview?.layoutIfNeeded()
......@@ -177,6 +180,16 @@ import YYKit
}
}
@objc public func fus_showGuideTipsIfInneed(){
if self.easySendWordList.count > 0 {
if let targetView = self.itemViewList.first {
FUSUserGuideTipsHelper.share.fus_showTips(type: .quickChat, showOn: self.superview, targetView: targetView)
FUSUserGuideTipsHelper.share.fus_completeGuide(type: .quickChat)
self.guideTipsDidShow = true
}
}
}
/// 当前用户是否需要展示文字链/
static public func fus_needShowFastInputView() -> Bool{
return FUSCacheDataShare.shareStore().quickChatShowState
......@@ -204,6 +217,9 @@ import YYKit
extension FUSLiveChatEasySendView: UIScrollViewDelegate {
public func scrollViewDidScroll(_ scrollView: UIScrollView) {
if self.guideTipsDidShow == true{
FUSUserGuideTipsHelper.share.fus_dismiss(type: .quickChat)
}
if scrollView == self.contentScrollView {
self.closingRemainingTime = self.closingRemainingTime < 10 ? 10 : self.closingRemainingTime
}
......
......@@ -86,7 +86,7 @@ import RxSwift
self.onceMoreBtn.snp.makeConstraints { make in
make.centerX.equalToSuperview()
make.top.equalToSuperview().offset(65)
make.top.equalToSuperview().offset(75)
make.width.equalTo(65)
make.height.equalTo(22)
}
......
......@@ -661,7 +661,17 @@ class FUSPKScoreProgressPointIncrvalueView: FUSBaseView {
public func fus_setup(incrvalue: Int, color: UIColor, icon: UIImage?) {
if let icon = icon {
imageView.frame = .init(x: 0, y: 0, width: icon.size.width / 2.0, height: icon.size.height / 2.0)
// 规范大小
var iconW = icon.size.width
var iconH = icon.size.height
if iconW < 14 {
iconW = 14
iconH = iconW / icon.size.width * icon.size.height
}else if iconH < 14 {
iconH = 14
iconW = iconH / icon.size.height * icon.size.width
}
imageView.frame = .init(x: 0, y: 0, width: iconW, height: iconH)
imageView.image = icon
}
......
......@@ -48,9 +48,9 @@ import RxCocoa
// MARK: 储存相关
/// 引导是否能显示的字典的udkey
private let guideShouldShowUDKey = "FFUserGuideTipsHelper_guideShouldShowUDKey"
private let guideShouldShowUDKey = "FUSUserGuideTipsHelper_guideShouldShowUDKey"
/// 引导显示次数的字典的udkey
private let guideShowTimesUDKey = "FFUserGuideTipsHelper_guideShowTimesUDKey"
private let guideShowTimesUDKey = "FUSUserGuideTipsHelper_guideShowTimesUDKey"
/// 是否能显示的字典
private var guideShouldShowDict: [String: Any] = .init()
......
......@@ -9,7 +9,7 @@
NS_ASSUME_NONNULL_BEGIN
@interface FUSShowRoomRouter : UIView <FUSLiveRouterProtocol>
@interface FUSShowRoomRouter : NSObject <FUSLiveRouterProtocol>
@end
......
......@@ -478,9 +478,12 @@
UIImageView *flyImageView = [[UIImageView alloc] initWithFrame:frame];
flyImageView.image = giftImage;
flyImageView.contentMode = UIViewContentModeScaleAspectFit;
[self addSubview:flyImageView];
[[UIViewController fus_topMostWindow] addSubview:flyImageView];
CGRect convertRect = [self convertRect:flyImageView.frame toView:[FUSLiveHelper shareInstance].currentFunctionView];
if ([flyImageView superview] != nil) {
UIView *flyImageViewSuperView = flyImageView.superview;
CGRect convertRect = [flyImageViewSuperView convertRect:flyImageView.frame toView:[FUSLiveHelper shareInstance].currentFunctionView];
CGFloat toY = [FUSLiveHelper shareInstance].currentFunctionView.linkMicroView.y - flyImageView.height;
CGFloat yOffset = convertRect.origin.y - toY;
......@@ -501,6 +504,7 @@
[[FUSLiveHelper shareInstance].currentFunctionView.linkMicroView fus_startGiftAnimWithGiftUrl:giftResource userIDs:userIds];
}];
}];
}
}
- (void)fus_showLiveBoxSettingView {
......
......@@ -8,14 +8,15 @@
#import "FUSNewsFeedDetailHeaderView.h"
#import "FUSStreamVideoPlayView.h"
//#import "FUSStreamVideoPlayView.h"
#import "FUSByteStreamVideoPlayView.h"
NS_ASSUME_NONNULL_BEGIN
@interface FUSNewsFeedDetailVideoHeaderView : FUSNewsFeedDetailHeaderView
/// 视频的view
@property (nonatomic, strong) FUSStreamVideoPlayView *videoView;
@property (nonatomic, strong) FUSByteStreamVideoPlayView *videoView;
- (void)fus_playIfInWIFINetwork;
......
......@@ -68,7 +68,7 @@
self = [super initWithFrame:frame];
if (self) {
self.videoView = [[FUSStreamVideoPlayView alloc] initWithFrame:CGRectMake(0, 0, UIView.fus_screenW, UIView.fus_screenW)];
self.videoView = [[FUSByteStreamVideoPlayView alloc] initWithFrame:CGRectMake(0, 0, UIView.fus_screenW, UIView.fus_screenW)];
[self.contentView addSubview:self.contentLabel];
[self.contentView addSubview:self.videoView];
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -186,6 +186,7 @@
#import "FUSBeautySteakerHelper.h"
#import "FUSBeautySteakerShownOperation.h"
#import "FUSLiveVideoProgressBar.h"
#import "FUSNativeVideoPlayer.h"
#import "FUSTTStreamPlayer.h"
#import "FUSTTVideoPlayer.h"
#import "FUSVideoPlayerProtocal.h"
......
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