Commit 4a519fe3bc683fd0111f543e971d59beb4465340
1 parent
0782c6e7
结束界面
Showing
4 changed files
with
114 additions
and
7 deletions
LiveVideoCloud/LiveVideoCloud.xcodeproj/project.pbxproj
| @@ -163,6 +163,7 @@ | @@ -163,6 +163,7 @@ | ||
| 163 | D25BF89D1E7FE049007FB138 /* CNLiveMsgTools.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = D25BF8961E7FE01B007FB138 /* CNLiveMsgTools.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; | 163 | D25BF89D1E7FE049007FB138 /* CNLiveMsgTools.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = D25BF8961E7FE01B007FB138 /* CNLiveMsgTools.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; |
| 164 | D25BF8A01E80C4BD007FB138 /* UIImage+LVCVagueImage.m in Sources */ = {isa = PBXBuildFile; fileRef = D25BF89F1E80C4BD007FB138 /* UIImage+LVCVagueImage.m */; }; | 164 | D25BF8A01E80C4BD007FB138 /* UIImage+LVCVagueImage.m in Sources */ = {isa = PBXBuildFile; fileRef = D25BF89F1E80C4BD007FB138 /* UIImage+LVCVagueImage.m */; }; |
| 165 | D25BF8A31E80C4FC007FB138 /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D25BF8A21E80C4FC007FB138 /* Accelerate.framework */; }; | 165 | D25BF8A31E80C4FC007FB138 /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D25BF8A21E80C4FC007FB138 /* Accelerate.framework */; }; |
| 166 | + D25BF8A51E80EC76007FB138 /* 头像.jpg in Resources */ = {isa = PBXBuildFile; fileRef = D25BF8A41E80EC76007FB138 /* 头像.jpg */; }; | ||
| 166 | D2888D941E6EB8B4003A77C8 /* LVCTabBar.m in Sources */ = {isa = PBXBuildFile; fileRef = D2888D931E6EB8B4003A77C8 /* LVCTabBar.m */; }; | 167 | D2888D941E6EB8B4003A77C8 /* LVCTabBar.m in Sources */ = {isa = PBXBuildFile; fileRef = D2888D931E6EB8B4003A77C8 /* LVCTabBar.m */; }; |
| 167 | D2888D9E1E6EBF1B003A77C8 /* LVCLiveViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D2888D9B1E6EBF1B003A77C8 /* LVCLiveViewController.m */; }; | 168 | D2888D9E1E6EBF1B003A77C8 /* LVCLiveViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D2888D9B1E6EBF1B003A77C8 /* LVCLiveViewController.m */; }; |
| 168 | D2888DB11E6EC05F003A77C8 /* TempViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D2888DB01E6EC05F003A77C8 /* TempViewController.m */; }; | 169 | D2888DB11E6EC05F003A77C8 /* TempViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D2888DB01E6EC05F003A77C8 /* TempViewController.m */; }; |
| @@ -520,6 +521,7 @@ | @@ -520,6 +521,7 @@ | ||
| 520 | D25BF89E1E80C4BD007FB138 /* UIImage+LVCVagueImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIImage+LVCVagueImage.h"; sourceTree = "<group>"; }; | 521 | D25BF89E1E80C4BD007FB138 /* UIImage+LVCVagueImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIImage+LVCVagueImage.h"; sourceTree = "<group>"; }; |
| 521 | D25BF89F1E80C4BD007FB138 /* UIImage+LVCVagueImage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIImage+LVCVagueImage.m"; sourceTree = "<group>"; }; | 522 | D25BF89F1E80C4BD007FB138 /* UIImage+LVCVagueImage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIImage+LVCVagueImage.m"; sourceTree = "<group>"; }; |
| 522 | D25BF8A21E80C4FC007FB138 /* Accelerate.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accelerate.framework; path = System/Library/Frameworks/Accelerate.framework; sourceTree = SDKROOT; }; | 523 | D25BF8A21E80C4FC007FB138 /* Accelerate.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accelerate.framework; path = System/Library/Frameworks/Accelerate.framework; sourceTree = SDKROOT; }; |
| 524 | + D25BF8A41E80EC76007FB138 /* 头像.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "头像.jpg"; sourceTree = "<group>"; }; | ||
| 523 | D2888D921E6EB8B4003A77C8 /* LVCTabBar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCTabBar.h; sourceTree = "<group>"; }; | 525 | D2888D921E6EB8B4003A77C8 /* LVCTabBar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCTabBar.h; sourceTree = "<group>"; }; |
| 524 | D2888D931E6EB8B4003A77C8 /* LVCTabBar.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LVCTabBar.m; sourceTree = "<group>"; }; | 526 | D2888D931E6EB8B4003A77C8 /* LVCTabBar.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LVCTabBar.m; sourceTree = "<group>"; }; |
| 525 | D2888D9A1E6EBF1B003A77C8 /* LVCLiveViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCLiveViewController.h; sourceTree = "<group>"; }; | 527 | D2888D9A1E6EBF1B003A77C8 /* LVCLiveViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCLiveViewController.h; sourceTree = "<group>"; }; |
| @@ -1397,6 +1399,7 @@ | @@ -1397,6 +1399,7 @@ | ||
| 1397 | isa = PBXGroup; | 1399 | isa = PBXGroup; |
| 1398 | children = ( | 1400 | children = ( |
| 1399 | D25BF88F1E7F7F8F007FB138 /* UGCLoading.jpeg */, | 1401 | D25BF88F1E7F7F8F007FB138 /* UGCLoading.jpeg */, |
| 1402 | + D25BF8A41E80EC76007FB138 /* 头像.jpg */, | ||
| 1400 | ); | 1403 | ); |
| 1401 | path = Images; | 1404 | path = Images; |
| 1402 | sourceTree = "<group>"; | 1405 | sourceTree = "<group>"; |
| @@ -1644,6 +1647,7 @@ | @@ -1644,6 +1647,7 @@ | ||
| 1644 | D2575C7F1E76A4F300E3A8FC /* NHPlaneViews.xib in Resources */, | 1647 | D2575C7F1E76A4F300E3A8FC /* NHPlaneViews.xib in Resources */, |
| 1645 | D2575C7B1E76A4F300E3A8FC /* NHCarViews.xib in Resources */, | 1648 | D2575C7B1E76A4F300E3A8FC /* NHCarViews.xib in Resources */, |
| 1646 | D25BF8901E7F7F8F007FB138 /* UGCLoading.jpeg in Resources */, | 1649 | D25BF8901E7F7F8F007FB138 /* UGCLoading.jpeg in Resources */, |
| 1650 | + D25BF8A51E80EC76007FB138 /* 头像.jpg in Resources */, | ||
| 1647 | D2029CC91E6EADE10027CD92 /* SVProgressHUD.bundle in Resources */, | 1651 | D2029CC91E6EADE10027CD92 /* SVProgressHUD.bundle in Resources */, |
| 1648 | D2575C801E76A4F300E3A8FC /* resource.bundle in Resources */, | 1652 | D2575C801E76A4F300E3A8FC /* resource.bundle in Resources */, |
| 1649 | D2029B941E6EAAA50027CD92 /* LaunchScreen.storyboard in Resources */, | 1653 | D2029B941E6EAAA50027CD92 /* LaunchScreen.storyboard in Resources */, |
LiveVideoCloud/LiveVideoCloud/Classes/Sections/homeSections/Controller/LVCUGCLivePlayerController.m
| @@ -46,6 +46,7 @@ | @@ -46,6 +46,7 @@ | ||
| 46 | self.view.backgroundColor = [UIColor whiteColor]; | 46 | self.view.backgroundColor = [UIColor whiteColor]; |
| 47 | 47 | ||
| 48 | [self.view addSubview:self.loadingView]; | 48 | [self.view addSubview:self.loadingView]; |
| 49 | + [self.view addSubview:self.bgView]; | ||
| 49 | 50 | ||
| 50 | //添加播放器通知 | 51 | //添加播放器通知 |
| 51 | [self installMovieNotificationObservers]; | 52 | [self installMovieNotificationObservers]; |
| @@ -187,6 +188,9 @@ | @@ -187,6 +188,9 @@ | ||
| 187 | { | 188 | { |
| 188 | if (_player) { | 189 | if (_player) { |
| 189 | NSLog(@"isPreparedToPlay"); | 190 | NSLog(@"isPreparedToPlay"); |
| 191 | + if (_loadingView) { | ||
| 192 | + [_loadingView removeFromSuperview]; | ||
| 193 | + } | ||
| 190 | } | 194 | } |
| 191 | } | 195 | } |
| 192 | 196 | ||
| @@ -235,7 +239,7 @@ | @@ -235,7 +239,7 @@ | ||
| 235 | // 获取主播状态通知 | 239 | // 获取主播状态通知 |
| 236 | - (void)anchorStatusChanged:(NSNotification *)notification | 240 | - (void)anchorStatusChanged:(NSNotification *)notification |
| 237 | { | 241 | { |
| 238 | - if (_player.anchorStatus == 2) { | 242 | + if (_player.anchorStatus == 2) { // 已结束 |
| 239 | 243 | ||
| 240 | } | 244 | } |
| 241 | _bgView.anchorStatus = _player.anchorStatus; | 245 | _bgView.anchorStatus = _player.anchorStatus; |
| @@ -249,12 +253,23 @@ | @@ -249,12 +253,23 @@ | ||
| 249 | 253 | ||
| 250 | #pragma mark - getter | 254 | #pragma mark - getter |
| 251 | - (LVCUGCPlayerLoadingView *)loadingView { | 255 | - (LVCUGCPlayerLoadingView *)loadingView { |
| 256 | + | ||
| 252 | if (!_loadingView) { | 257 | if (!_loadingView) { |
| 253 | _loadingView = [[LVCUGCPlayerLoadingView alloc] initWithFrame:self.view.bounds bgImageURLStr:@""]; | 258 | _loadingView = [[LVCUGCPlayerLoadingView alloc] initWithFrame:self.view.bounds bgImageURLStr:@""]; |
| 254 | } | 259 | } |
| 255 | return _loadingView; | 260 | return _loadingView; |
| 256 | } | 261 | } |
| 257 | 262 | ||
| 263 | +- (LVCUGCBackgroundView *)bgView { | ||
| 264 | + | ||
| 265 | + if (!_bgView) { | ||
| 266 | + _bgView = [[LVCUGCBackgroundView alloc] init]; | ||
| 267 | + _bgView.backgroundColor = [UIColor whiteColor]; | ||
| 268 | + _bgView.hidden = YES; | ||
| 269 | + } | ||
| 270 | + return _bgView; | ||
| 271 | +} | ||
| 272 | + | ||
| 258 | #pragma mark - 内存警告 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | 273 | #pragma mark - 内存警告 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
| 259 | - (void)didReceiveMemoryWarning { | 274 | - (void)didReceiveMemoryWarning { |
| 260 | [super didReceiveMemoryWarning]; | 275 | [super didReceiveMemoryWarning]; |
LiveVideoCloud/LiveVideoCloud/Classes/Sections/homeSections/View/LVCUGCBackgroundView.m
| @@ -8,14 +8,102 @@ | @@ -8,14 +8,102 @@ | ||
| 8 | 8 | ||
| 9 | #import "LVCUGCBackgroundView.h" | 9 | #import "LVCUGCBackgroundView.h" |
| 10 | 10 | ||
| 11 | +@interface LVCUGCBackgroundView() | ||
| 12 | + | ||
| 13 | +@property (nonatomic, strong) UIImageView *iconView; | ||
| 14 | + | ||
| 15 | +@property (nonatomic, strong) UILabel *nicknameLabel; | ||
| 16 | + | ||
| 17 | +@property (nonatomic, strong) UILabel *playInfoLabel; | ||
| 18 | + | ||
| 19 | +@property (nonatomic, strong) UIButton *backButton; | ||
| 20 | + | ||
| 21 | +@end | ||
| 22 | + | ||
| 11 | @implementation LVCUGCBackgroundView | 23 | @implementation LVCUGCBackgroundView |
| 12 | 24 | ||
| 13 | -/* | ||
| 14 | -// Only override drawRect: if you perform custom drawing. | ||
| 15 | -// An empty implementation adversely affects performance during animation. | ||
| 16 | -- (void)drawRect:(CGRect)rect { | ||
| 17 | - // Drawing code | 25 | + |
| 26 | +- (instancetype)initWithFrame:(CGRect)frame | ||
| 27 | +{ | ||
| 28 | + self = [super initWithFrame:frame]; | ||
| 29 | + if (self) { | ||
| 30 | + [self addSubview:self.iconView]; | ||
| 31 | + [self addSubview:self.nicknameLabel]; | ||
| 32 | + [self addSubview:self.playInfoLabel]; | ||
| 33 | + [self addSubview:self.backButton]; | ||
| 34 | + } | ||
| 35 | + return self; | ||
| 36 | +} | ||
| 37 | + | ||
| 38 | +#pragma mark - setter !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
| 39 | +- (void)setAnchorStatus:(int)anchorStatus | ||
| 40 | +{ | ||
| 41 | + switch (anchorStatus) { | ||
| 42 | + case 0: | ||
| 43 | + self.hidden = YES; | ||
| 44 | + break; | ||
| 45 | + | ||
| 46 | + case 1: | ||
| 47 | + _playInfoLabel.text = @"主播已离开,马上回来~"; | ||
| 48 | + self.hidden = NO; | ||
| 49 | + break; | ||
| 50 | + | ||
| 51 | + case 2: | ||
| 52 | + _playInfoLabel.text = @"直播已结束"; | ||
| 53 | + self.hidden = NO; | ||
| 54 | + break; | ||
| 55 | + | ||
| 56 | + default: | ||
| 57 | + break; | ||
| 58 | + } | ||
| 18 | } | 59 | } |
| 19 | -*/ | ||
| 20 | 60 | ||
| 61 | +#pragma mark - getter !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
| 62 | + | ||
| 63 | +- (UIImageView *)iconView { | ||
| 64 | + | ||
| 65 | + if (!_iconView) { | ||
| 66 | + NSString *path = [[NSBundle mainBundle] pathForResource:@"头像" ofType:@"jpg"]; | ||
| 67 | + UIImage *image = [UIImage imageWithContentsOfFile:path]; | ||
| 68 | + _iconView = [[UIImageView alloc] initWithImage:image]; | ||
| 69 | + _iconView.frame = CGRectMake((SCREEN_WIDTH - 100) * 0.5, 200, 100, 100); | ||
| 70 | + _iconView.layer.cornerRadius = 50; | ||
| 71 | + _iconView.layer.masksToBounds = YES; | ||
| 72 | + } | ||
| 73 | + return _iconView; | ||
| 74 | +} | ||
| 75 | + | ||
| 76 | +- (UILabel *)nicknameLabel { | ||
| 77 | + | ||
| 78 | + if (!_nicknameLabel) { | ||
| 79 | + _nicknameLabel = [[UILabel alloc] initWithFrame:CGRectMake((SCREEN_WIDTH - 100) * 0.5, 310, 100, 30)]; | ||
| 80 | + _nicknameLabel.textAlignment = NSTextAlignmentCenter; | ||
| 81 | + _nicknameLabel.text = @"奥斯卡大家发你看"; | ||
| 82 | + } | ||
| 83 | + return _nicknameLabel; | ||
| 84 | +} | ||
| 85 | + | ||
| 86 | +- (UILabel *)playInfoLabel { | ||
| 87 | + | ||
| 88 | + if (!_playInfoLabel) { | ||
| 89 | + _playInfoLabel = [[UILabel alloc] initWithFrame:CGRectMake((SCREEN_WIDTH - 100) * 0.5, 350, 100, 50)]; | ||
| 90 | + _playInfoLabel.textAlignment = NSTextAlignmentCenter; | ||
| 91 | + _playInfoLabel.font = [UIFont systemFontOfSize:18]; | ||
| 92 | + } | ||
| 93 | + return _playInfoLabel; | ||
| 94 | +} | ||
| 95 | + | ||
| 96 | +- (UIButton *)backButton { | ||
| 97 | + | ||
| 98 | + if (!_backButton) { | ||
| 99 | + _backButton = [UIButton buttonWithType:UIButtonTypeCustom]; | ||
| 100 | + _backButton.frame = CGRectMake((SCREEN_WIDTH - 200) * 0.5, 410, 200, 40); | ||
| 101 | + _backButton.layer.cornerRadius = 20; | ||
| 102 | + _backButton.layer.masksToBounds = YES; | ||
| 103 | + _backButton.titleLabel.text = @"返回列表"; | ||
| 104 | + _backButton.titleLabel.textAlignment = NSTextAlignmentCenter; | ||
| 105 | + _backButton.titleLabel.font = [UIFont systemFontOfSize:18]; | ||
| 106 | + } | ||
| 107 | + return _backButton; | ||
| 108 | +} | ||
| 21 | @end | 109 | @end |
LiveVideoCloud/LiveVideoCloud/Resource/Images/头像.jpg
0 → 100644
4.88 KB