口吃和曲目开始多次播放

时间:2017-05-09 19:39:05

标签: ios swift spotify

每次使用Spotify播放器时,我们会遇到持续大约十秒钟的口吃。虽然有一些方面对我来说似乎不正常,但最常见的标志是我们不止一次点击didStartPlayingTrack委托方法,即使我们只告诉玩家玩一次。有没有人有什么想法会导致这种情况发生?

重要提示:这是spotify-ios-sdk version 0.21

日志样本:

audioStreaming(_:didReceive:withName:)[L:412]: didReceiveEvent: Optional("SPPlaybackNotifyTrackDelivered") // Last track ended
audioStreaming(_:didReceive:withName:)[L:412]: didReceiveEvent: Optional("SPPlaybackNotifyAudioDeliveryDone")
audioStreaming(_:didReceive:withName:)[L:412]: didReceiveEvent: Optional("SPPlaybackNotifyPause")
audioStreaming(_:didReceive:withName:)[L:412]: didReceiveEvent: Optional("SPPlaybackNotifyMetadataChanged")
movePlayerPosition(_:completion:)[L:180]: seek successful to 0.842
audioStreaming(_:didReceive:withName:)[L:412]: didReceiveEvent: Optional("SPPlaybackNotifyMetadataChanged")
13:13:50 audioStreaming(_:didStartPlayingTrack:)[L:377]: didStartPlayingTrack: Optional("So Far Away (Live) - Live")
audioStreaming(_:didReceive:withName:)[L:412]: didReceiveEvent: Optional("SPPlaybackNotifyTrackChanged")
audioStreaming(_:didReceive:withName:)[L:412]: didReceiveEvent: Optional("SPPlaybackEventAudioFlush")
audioStreaming(_:didReceive:withName:)[L:412]: didReceiveEvent: Optional("SPPlaybackNotifyPlay")
audioStreaming(_:didReceive:withName:)[L:412]: didReceiveEvent: Optional("SPPlaybackNotifyMetadataChanged")
audioStreaming(_:didReceive:withName:)[L:412]: didReceiveEvent: Optional("SPPlaybackNotifyMetadataChanged")
audioStreaming(_:didReceive:withName:)[L:412]: didReceiveEvent: Optional("SPPlaybackNotifyContextChanged")
13:14:01 audioStreaming(_:didStartPlayingTrack:)[L:377]: didStartPlayingTrack: Optional("So Far Away (Live) - Live")
audioStreaming(_:didReceive:withName:)[L:412]: didReceiveEvent: Optional("SPPlaybackNotifyTrackChanged")
audioStreaming(_:didSeekToPosition:)[L:474]: did seek to position: 0.001
audioStreaming(_:didReceive:withName:)[L:412]: didReceiveEvent: Optional("SPPlaybackEventAudioFlush")

无论如何都要防止这种口吃?

更新

我已切换到第25版,但我仍遇到此问题。我发现口吃日志中的一个显着特征是,除非特别要求,否则在大多数歌曲的开头我都没有didSeekToPosition代表;但是当遇到口吃时,口吃开始时会看到以下情况:

audioStreaming(_:didStartPlayingTrack:)[L:377]: didStartPlayingTrack
audioStreaming(_:didSeekToPosition:)[L:474]: did seek to position: 0.001

为了清楚起见,只有一种方法可以调用playSpotifyUri;但是,此didStartPlaying代理会被多次命中。

1 个答案:

答案 0 :(得分:3)

iOS SDK现在处于Beta 25版本,您是否考虑过升级?我建议你这样做,看看它能否解决你的问题。

我需要查看您的具体实现才能进行调试。