Bläddra i källkod

版本升级维护

yyqxiaoyin 5 år sedan
förälder
incheckning
03680eabec

+ 8 - 4
MKRRadioManager/Classes/MKRRadioManager/MKRWIFIDeviceManager/MKRWIFIDeviceManager.h

@@ -87,21 +87,25 @@
  * 播放channelNO频道从第index开始
  * 在播放之前 如果是临时频道(频道号>= 13) 需要先生成M3U列表
  * 如是正式频道(频道号 1~12) 可选生成M3U
- * @param channelNO      频道号
- * @param index          需要播放的下标
- * @param device         播放的设备
- * @param timeStamp      频道时间戳
+ * @param channelNO         频道号
+ * @param firstPlayingSong  给当前播放下标需要播放资源给设备 设备会更快出声
+ * @param index             需要播放的下标
+ * @param device            播放的设备
+ * @param timeStamp         频道时间戳
  */
 - (void)playSongWithChannelNO:(NSInteger)channelNO
+             firstPlayingSong:(id<MKRRadioResorce>)firstPlayingSong
                         index:(NSInteger)index
                        device:(id <MKRUPnPDevice>)device
                     timeStamp:(NSTimeInterval)timeStamp;
 /**
  * 播放channelNO频道 从第0首开始
  * @param channelNO 频道号
+ * @param firstPlayingSong  给当前播放下标需要播放资源给设备 设备会更快出声
  * @param device    需要播放的设备
  */
 - (void)playSongWithChannelNO:(NSInteger)channelNO
+             firstPlayingSong:(id<MKRRadioResorce>)firstPlayingSong
                        device:(id <MKRUPnPDevice>)device
                     timeStamp:(NSTimeInterval)timeStamp;
 

+ 9 - 5
MKRRadioManager/Classes/MKRRadioManager/MKRWIFIDeviceManager/MKRWIFIDeviceManager.m

@@ -430,20 +430,24 @@ static inline void wd_playControl_queue(void (^block)(void)){
 }
 
 - (void)playSongWithChannelNO:(NSInteger)channelNO
-                        index:(NSInteger)index
-                       device:(id <MKRUPnPDevice>)device
+             firstPlayingSong:(id<MKRRadioResorce>)firstPlayingSong
+                       device:(id<MKRUPnPDevice>)device
                     timeStamp:(NSTimeInterval)timeStamp{
     wd_playControl_queue(^{
-        NSString *playFlag = [NSString stringWithFormat:@"%zd-%zd",channelNO,index];
+        [self setAVTransportURIWithSong:firstPlayingSong device:device];
+        NSString *playFlag = [NSString stringWithFormat:@"%zd",channelNO];
         [self _playPlayFlag:playFlag device:device timeStamp:timeStamp];
     });
 }
 
 - (void)playSongWithChannelNO:(NSInteger)channelNO
-                       device:(id <MKRUPnPDevice>)device
+             firstPlayingSong:(id<MKRRadioResorce>)firstPlayingSong
+                        index:(NSInteger)index
+                       device:(id<MKRUPnPDevice>)device
                     timeStamp:(NSTimeInterval)timeStamp{
     wd_playControl_queue(^{
-        NSString *playFlag = [NSString stringWithFormat:@"%zd",channelNO];
+        [self setAVTransportURIWithSong:firstPlayingSong device:device];
+        NSString *playFlag = [NSString stringWithFormat:@"%zd-%zd",channelNO,index];
         [self _playPlayFlag:playFlag device:device timeStamp:timeStamp];
     });
 }