فهرست منبع

Merge branch 'master' of 60.205.190.38:iOS/MKRRadioManager

yyqxiaoyin 5 سال پیش
والد
کامیت
2369a04ffa

+ 2 - 2
MKRRadioManager/Classes/MKRRadioManager/MKRAVPlayer/MKRAVPlayer.h

@@ -130,12 +130,12 @@ typedef enum : NSUInteger {
 /**
  当前播放进度
  */
-@property (nonatomic, assign) NSInteger currentTime;
+@property (nonatomic, assign) NSTimeInterval currentTime;
 
 /**
  总时长
  */
-@property (nonatomic, assign) NSInteger totalTime;
+@property (nonatomic, assign) NSTimeInterval totalTime;
 
 /**
  播放

+ 2 - 0
MKRRadioManager/Classes/MKRRadioManager/MKRAVPlayer/MKRAVPlayer.m

@@ -412,6 +412,8 @@ NSURL * MKRUrlWithString(NSString *string){
     }
     _currentStatus.totalTime = self.totalTime;
     _currentStatus.currentTime = self.currentTime;
+    _currentStatus.totalDuration = self.totalTime;
+    _currentStatus.currentDuration = self.currentTime;
     _currentStatus.isPlaying = [self isPlaying];
     _currentStatus.playState = (MKRResourcePlayState)self.state;
     return _currentStatus;

+ 4 - 0
MKRRadioManager/Classes/MKRRadioManager/MKRAVPlayer/MKRPlayResourceStatus.h

@@ -38,6 +38,10 @@ typedef NS_ENUM(NSUInteger, MKRResourcePlayState) {
  * */
 @property(nonatomic, assign) NSInteger totalTime;
 
+@property (nonatomic, assign) NSTimeInterval currentDuration;
+
+@property (nonatomic, assign) NSTimeInterval totalDuration;
+
 /*
  * 当前播放时间字符串 格式:xx:xx:xx
  **/

+ 4 - 4
MKRRadioManager/Classes/MKRRadioManager/MKRAVPlayer/MKRPlayResourceStatus.m

@@ -13,8 +13,8 @@
     if (self.currentTime == 0){
         return @"00:00";
     }
-    int seconds = self.currentTime % 60;
-    int minutes = (self.currentTime / 60) % 60;
+    int seconds = (int) self.currentTime % 60;
+    int minutes = ((int)self.currentTime / 60) % 60;
     int hours = (int)self.currentTime / 3600;
     if (!hours){
         return [NSString stringWithFormat:@"%02d:%02d",minutes,seconds];
@@ -27,8 +27,8 @@
     if (self.totalTime == 0){
         return @"00:00";
     }
-    int seconds = self.totalTime % 60;
-    int minutes = (self.totalTime / 60) % 60;
+    int seconds = (int)self.totalTime % 60;
+    int minutes = ((int)self.totalTime / 60) % 60;
     int hours = (int)self.totalTime / 3600;
     if (!hours){
         return [NSString stringWithFormat:@"%02d:%02d",minutes,seconds];