Commit 28d4262c cgx

修复白色描边、未登录试听重复出现、进度条滑块不能在最左或者最右、呼吸法音频静音bug

1 个父辈 02e4528c
...@@ -146,6 +146,7 @@ ...@@ -146,6 +146,7 @@
D0AEFE822817DD1500230DC6 /* MyFeedListController.m in Sources */ = {isa = PBXBuildFile; fileRef = D0AEFE802817DD1500230DC6 /* MyFeedListController.m */; }; D0AEFE822817DD1500230DC6 /* MyFeedListController.m in Sources */ = {isa = PBXBuildFile; fileRef = D0AEFE802817DD1500230DC6 /* MyFeedListController.m */; };
D0B1124528629C0F00A496FB /* UnityFramework.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0FFCD402853421900A01707 /* UnityFramework.framework */; }; D0B1124528629C0F00A496FB /* UnityFramework.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0FFCD402853421900A01707 /* UnityFramework.framework */; };
D0B1124628629C0F00A496FB /* UnityFramework.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = D0FFCD402853421900A01707 /* UnityFramework.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; D0B1124628629C0F00A496FB /* UnityFramework.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = D0FFCD402853421900A01707 /* UnityFramework.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
D0B1124A28631D8C00A496FB /* DSSlider.m in Sources */ = {isa = PBXBuildFile; fileRef = D0B1124928631D8C00A496FB /* DSSlider.m */; };
D0B5ECA627F2D9DE003EDFE3 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = D0B5ECA527F2D9DE003EDFE3 /* AppDelegate.m */; }; D0B5ECA627F2D9DE003EDFE3 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = D0B5ECA527F2D9DE003EDFE3 /* AppDelegate.m */; };
D0B5ECAF27F2D9DE003EDFE3 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D0B5ECAD27F2D9DE003EDFE3 /* Main.storyboard */; }; D0B5ECAF27F2D9DE003EDFE3 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D0B5ECAD27F2D9DE003EDFE3 /* Main.storyboard */; };
D0B5ECB127F2D9E0003EDFE3 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D0B5ECB027F2D9E0003EDFE3 /* Assets.xcassets */; }; D0B5ECB127F2D9E0003EDFE3 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D0B5ECB027F2D9E0003EDFE3 /* Assets.xcassets */; };
...@@ -510,6 +511,8 @@ ...@@ -510,6 +511,8 @@
D0AEFE7E2817DD1500230DC6 /* MyFeedCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MyFeedCell.m; sourceTree = "<group>"; }; D0AEFE7E2817DD1500230DC6 /* MyFeedCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MyFeedCell.m; sourceTree = "<group>"; };
D0AEFE7F2817DD1500230DC6 /* MyFeedListController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MyFeedListController.h; sourceTree = "<group>"; }; D0AEFE7F2817DD1500230DC6 /* MyFeedListController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MyFeedListController.h; sourceTree = "<group>"; };
D0AEFE802817DD1500230DC6 /* MyFeedListController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MyFeedListController.m; sourceTree = "<group>"; }; D0AEFE802817DD1500230DC6 /* MyFeedListController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MyFeedListController.m; sourceTree = "<group>"; };
D0B1124828631D8C00A496FB /* DSSlider.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DSSlider.h; sourceTree = "<group>"; };
D0B1124928631D8C00A496FB /* DSSlider.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DSSlider.m; sourceTree = "<group>"; };
D0B5ECA127F2D9DE003EDFE3 /* 小梦睡眠-Dev.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "小梦睡眠-Dev.app"; sourceTree = BUILT_PRODUCTS_DIR; }; D0B5ECA127F2D9DE003EDFE3 /* 小梦睡眠-Dev.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "小梦睡眠-Dev.app"; sourceTree = BUILT_PRODUCTS_DIR; };
D0B5ECA427F2D9DE003EDFE3 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; }; D0B5ECA427F2D9DE003EDFE3 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
D0B5ECA527F2D9DE003EDFE3 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; }; D0B5ECA527F2D9DE003EDFE3 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
...@@ -1196,6 +1199,8 @@ ...@@ -1196,6 +1199,8 @@
D0A72E32282B504C00EED7BE /* View */ = { D0A72E32282B504C00EED7BE /* View */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
D0B1124828631D8C00A496FB /* DSSlider.h */,
D0B1124928631D8C00A496FB /* DSSlider.m */,
D055BEC628252D8200BC11A4 /* AudioCourseCell.h */, D055BEC628252D8200BC11A4 /* AudioCourseCell.h */,
D055BEC728252D8200BC11A4 /* AudioCourseCell.m */, D055BEC728252D8200BC11A4 /* AudioCourseCell.m */,
D0F9AC5C282660CC00FD7A3B /* MusicPlayerView.h */, D0F9AC5C282660CC00FD7A3B /* MusicPlayerView.h */,
...@@ -2071,6 +2076,7 @@ ...@@ -2071,6 +2076,7 @@
D027EE2927FB51D0004BBA61 /* DSGifHeader.m in Sources */, D027EE2927FB51D0004BBA61 /* DSGifHeader.m in Sources */,
D030C1B8284775930014946F /* RelaxTrainController.m in Sources */, D030C1B8284775930014946F /* RelaxTrainController.m in Sources */,
D049679D2834E1AB00FB81E5 /* ProfileHeaderView.m in Sources */, D049679D2834E1AB00FB81E5 /* ProfileHeaderView.m in Sources */,
D0B1124A28631D8C00A496FB /* DSSlider.m in Sources */,
D0336163285035AB005573CF /* DailyBgView.m in Sources */, D0336163285035AB005573CF /* DailyBgView.m in Sources */,
D0FAC421281B817D00D4B859 /* GKPhotoView.m in Sources */, D0FAC421281B817D00D4B859 /* GKPhotoView.m in Sources */,
D091E66E283F29D100D3279E /* ScoreDetailController.m in Sources */, D091E66E283F29D100D3279E /* ScoreDetailController.m in Sources */,
......
...@@ -10,11 +10,12 @@ ...@@ -10,11 +10,12 @@
#import <FSAudioController.h> #import <FSAudioController.h>
#import "RelaxTrainCell.h" #import "RelaxTrainCell.h"
#import "RelaxTrainRequestModel.h" #import "RelaxTrainRequestModel.h"
#import "DSSlider.h"
@interface RelaxBodyView () <UIGestureRecognizerDelegate, UICollectionViewDelegate, UICollectionViewDataSource> @interface RelaxBodyView () <UIGestureRecognizerDelegate, UICollectionViewDelegate, UICollectionViewDataSource>
@property (nonatomic, strong) UIButton *playerBtn; @property (nonatomic, strong) UIButton *playerBtn;
@property (nonatomic, strong) UILabel *titleLab; @property (nonatomic, strong) UILabel *titleLab;
@property (nonatomic, strong) UISlider *sliderView; @property (nonatomic, strong) DSSlider *sliderView;
@property (nonatomic, strong) UILabel *proLeftLb; @property (nonatomic, strong) UILabel *proLeftLb;
@property (nonatomic, strong) UILabel *proRightLb; @property (nonatomic, strong) UILabel *proRightLb;
@property (nonatomic, strong) UILabel *tipsLab; @property (nonatomic, strong) UILabel *tipsLab;
...@@ -251,9 +252,9 @@ ...@@ -251,9 +252,9 @@
return _titleLab; return _titleLab;
} }
- (UISlider *)sliderView { - (DSSlider *)sliderView {
if (!_sliderView) { if (!_sliderView) {
_sliderView = [UISlider new]; _sliderView = [DSSlider new];
[_sliderView cornerRadius:2.0]; [_sliderView cornerRadius:2.0];
_sliderView.minimumTrackTintColor = BrandColor; _sliderView.minimumTrackTintColor = BrandColor;
_sliderView.maximumTrackTintColor = ColorFromHex(0xE3E1E1); _sliderView.maximumTrackTintColor = ColorFromHex(0xE3E1E1);
......
...@@ -207,6 +207,7 @@ ...@@ -207,6 +207,7 @@
self.playDuration = [[self.minuteDatas objectAtIndex:self.currentIndex] integerValue] * 60; self.playDuration = [[self.minuteDatas objectAtIndex:self.currentIndex] integerValue] * 60;
self.controlTimer = [NSTimer scheduledTimerWithTimeInterval:interval target:self selector:@selector(timerAction:) userInfo:nil repeats:YES]; self.controlTimer = [NSTimer scheduledTimerWithTimeInterval:interval target:self selector:@selector(timerAction:) userInfo:nil repeats:YES];
[self.controlTimer fire]; [self.controlTimer fire];
self.audioStreamer.volume = self.volumeBtn.selected ? 0 : 1;
[self.audioStreamer play]; [self.audioStreamer play];
} }
...@@ -384,7 +385,7 @@ ...@@ -384,7 +385,7 @@
_startRelaxBtn.layer.cornerRadius = 20; _startRelaxBtn.layer.cornerRadius = 20;
_startRelaxBtn.layer.masksToBounds = YES; _startRelaxBtn.layer.masksToBounds = YES;
[_startRelaxBtn addTarget:self action:@selector(startRelaxAction:) forControlEvents:UIControlEventTouchUpInside]; [_startRelaxBtn addTarget:self action:@selector(startRelaxAction:) forControlEvents:UIControlEventTouchUpInside];
_startRelaxBtn.titleLabel.font = [UIFont systemFontOfSize:16]; _startRelaxBtn.titleLabel.font = SysFont(16.0);
_startRelaxBtn.backgroundColor = BrandColor; _startRelaxBtn.backgroundColor = BrandColor;
[_startRelaxBtn setTitle:@"开始放松" forState:UIControlStateNormal]; [_startRelaxBtn setTitle:@"开始放松" forState:UIControlStateNormal];
} }
......
...@@ -30,6 +30,8 @@ ...@@ -30,6 +30,8 @@
NSMutableDictionary *_remoteInfoDictionary; NSMutableDictionary *_remoteInfoDictionary;
// 是否进入后台 // 是否进入后台
BOOL _isBackground; BOOL _isBackground;
// 其他应用是否正在播放
BOOL _isOtherPlaying;
} }
- (void)loadView { - (void)loadView {
...@@ -39,7 +41,6 @@ ...@@ -39,7 +41,6 @@
- (void)viewDidLoad { - (void)viewDidLoad {
[super viewDidLoad]; [super viewDidLoad];
if (self.currentIndex >= self.playAudios.count) { return; }
[self launchPlayer]; [self launchPlayer];
WS(weakSelf); WS(weakSelf);
...@@ -252,6 +253,8 @@ ...@@ -252,6 +253,8 @@
// 更新音频播放进度、音频当前播放时间、音频总时间 // 更新音频播放进度、音频当前播放时间、音频总时间
[self.playerView updateProgress:cur.position currentTime:[NSString stringWithFormat:@"%02i:%02i", cur.minute, cur.second] totalTime:[NSString stringWithFormat:@"%02i:%02i", end.minute, end.second]]; [self.playerView updateProgress:cur.position currentTime:[NSString stringWithFormat:@"%02i:%02i", cur.minute, cur.second] totalTime:[NSString stringWithFormat:@"%02i:%02i", end.minute, end.second]];
// DSLog(@"缓存进度:%f, 总进度:%f", self.audioStream.prebufferedByteCount, self.audioStream.contentLength);
[self updatePlayingCenterInfo]; [self updatePlayingCenterInfo];
} }
...@@ -411,6 +414,8 @@ ...@@ -411,6 +414,8 @@
_audioStream = [[FSAudioStream alloc] init]; _audioStream = [[FSAudioStream alloc] init];
_audioStream.strictContentTypeChecking = NO; _audioStream.strictContentTypeChecking = NO;
_audioStream.defaultContentType = @"audio/mpeg"; _audioStream.defaultContentType = @"audio/mpeg";
_audioStream.volume = .5;
[_audioStream setPlayRate:1.0];
} }
return _audioStream; return _audioStream;
} }
......
...@@ -143,8 +143,10 @@ ...@@ -143,8 +143,10 @@
// 音频未🔒 // 音频未🔒
if (model.is_lock == 0) { if (model.is_lock == 0) {
self.tryLab.hidden = [LoginUtils getUserLoginData]; self.tryLab.hidden = [LoginUtils getUserLoginData];
self.pleyerBtn.hidden = !self.tryLab.hidden; } else {
self.tryLab.hidden = YES;
} }
self.pleyerBtn.hidden = !self.tryLab.hidden;
} }
- (void)updatePlayingAudio { - (void)updatePlayingAudio {
......
...@@ -32,6 +32,9 @@ ...@@ -32,6 +32,9 @@
self.audioDescLab.text = model.audio_desc; self.audioDescLab.text = model.audio_desc;
self.audioNameLab.textColor = DSWhite; self.audioNameLab.textColor = DSWhite;
self.audioIV.layer.borderColor = DSWhite.CGColor;
self.audioIV.layer.borderWidth = 1.0;
} }
[self.bgIV yy_setImageWithURL:[NSURL URLWithString:model.bg_url] placeholder:[UIImage imageNamed:@"bannerPlaceholder"]]; [self.bgIV yy_setImageWithURL:[NSURL URLWithString:model.bg_url] placeholder:[UIImage imageNamed:@"bannerPlaceholder"]];
......
//
// DSSlider.h
// DreamSleep
//
// Created by peter on 2022/6/22.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
/// 重写系统UISlider
@interface DSSlider : UISlider
@end
NS_ASSUME_NONNULL_END
//
// DSSlider.m
// DreamSleep
//
// Created by peter on 2022/6/22.
//
#import "DSSlider.h"
@implementation DSSlider
// UISlider设置图片 滑块不能滑到最左最右边
- (CGRect)thumbRectForBounds:(CGRect)bounds trackRect:(CGRect)rect value:(float)value {
rect.origin.x = rect.origin.x - 5;
rect.size.width = rect.size.width + 10;
return CGRectInset([super thumbRectForBounds:bounds trackRect:rect value:value], 5, 5);
}
@end
...@@ -8,12 +8,13 @@ ...@@ -8,12 +8,13 @@
#import "MusicPlayerView.h" #import "MusicPlayerView.h"
#import "SPButton.h" #import "SPButton.h"
#import "TimingView.h" #import "TimingView.h"
#import "DSSlider.h"
@interface MusicPlayerView () <UIGestureRecognizerDelegate> @interface MusicPlayerView () <UIGestureRecognizerDelegate>
@property (nonatomic, strong) UIButton *dismissBtn; @property (nonatomic, strong) UIButton *dismissBtn;
@property (nonatomic, strong) UIImageView *audioPicIV; @property (nonatomic, strong) UIImageView *audioPicIV;
@property (nonatomic, strong) UILabel *audioNameLab; @property (nonatomic, strong) UILabel *audioNameLab;
@property (nonatomic, strong) UISlider *progressV; @property (nonatomic, strong) DSSlider *progressV;
@property (nonatomic, strong) UILabel *proLeftLb; @property (nonatomic, strong) UILabel *proLeftLb;
@property (nonatomic, strong) UILabel *proRightLb; @property (nonatomic, strong) UILabel *proRightLb;
@property (nonatomic, strong) UIButton *playerBtn; @property (nonatomic, strong) UIButton *playerBtn;
...@@ -283,9 +284,9 @@ ...@@ -283,9 +284,9 @@
return _audioNameLab; return _audioNameLab;
} }
- (UISlider *)progressV { - (DSSlider *)progressV {
if (!_progressV) { if (!_progressV) {
_progressV = [UISlider new]; _progressV = [DSSlider new];
[_progressV cornerRadius:2.0]; [_progressV cornerRadius:2.0];
_progressV.minimumTrackTintColor = BrandColor; _progressV.minimumTrackTintColor = BrandColor;
_progressV.dk_maximumTrackTintColorPicker = DKColorPickerWithColors(ColorFromHex(0xE3E1E1), AlertDarkColor, DSWhite); _progressV.dk_maximumTrackTintColorPicker = DKColorPickerWithColors(ColorFromHex(0xE3E1E1), AlertDarkColor, DSWhite);
......
...@@ -6,13 +6,14 @@ ...@@ -6,13 +6,14 @@
// //
#import "NoisePlayCell.h" #import "NoisePlayCell.h"
#import "DSSlider.h"
@interface NoisePlayCell () @interface NoisePlayCell ()
@property (nonatomic, strong) UIView *bgView; @property (nonatomic, strong) UIView *bgView;
@property (nonatomic, strong) UIImageView *audioIcon; @property (nonatomic, strong) UIImageView *audioIcon;
@property (nonatomic, strong) UILabel *nameLab; @property (nonatomic, strong) UILabel *nameLab;
@property (nonatomic, strong) UIImageView *volumeIcon; @property (nonatomic, strong) UIImageView *volumeIcon;
@property (nonatomic, strong) UISlider *volumeSlider; @property (nonatomic, strong) DSSlider *volumeSlider;
@property (nonatomic, strong) UIButton *deleteBtn; @property (nonatomic, strong) UIButton *deleteBtn;
@end @end
...@@ -148,9 +149,9 @@ ...@@ -148,9 +149,9 @@
return _volumeIcon; return _volumeIcon;
} }
- (UISlider *)volumeSlider { - (DSSlider *)volumeSlider {
if (!_volumeSlider) { if (!_volumeSlider) {
_volumeSlider = [UISlider new]; _volumeSlider = [DSSlider new];
[_volumeSlider cornerRadius:2.0]; [_volumeSlider cornerRadius:2.0];
_volumeSlider.minimumTrackTintColor = BrandColor; _volumeSlider.minimumTrackTintColor = BrandColor;
_volumeSlider.dk_maximumTrackTintColorPicker = DKColorPickerWithColors(ColorFromHex(0xE3E1E1), AlertDarkColor, DSWhite); _volumeSlider.dk_maximumTrackTintColorPicker = DKColorPickerWithColors(ColorFromHex(0xE3E1E1), AlertDarkColor, DSWhite);
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!