SwiftAudio icon indicating copy to clipboard operation
SwiftAudio copied to clipboard

player always return error code -11819 after add AVURLAssetPreferPreciseDurationAndTimingKey on load(from:playWhenReady:initialTime) in AVPlayerWrapper class

Open cendolinside123 opened this issue 5 years ago • 1 comments
trafficstars

Describe the bug So, I try add AVURLAssetPreferPreciseDurationAndTimingKey on load(from:playWhenReady:initialTime) in AVPlayerWrapper class

func load(from url: URL, playWhenReady: Bool, initialTime: TimeInterval? = nil, options: [String : Any]? = nil) {
        _initialTime = initialTime
        self.pause()
        var opt = options
        if options == nil{
            opt = [
                AVURLAssetPreferPreciseDurationAndTimingKey : true
            ]
        } else {
            opt?[AVURLAssetPreferPreciseDurationAndTimingKey] = true
        }
        
        
        print("player option : \(opt)")
        
        self.load(from: url, playWhenReady: playWhenReady, options: opt)
    }

when try to test it on example project playing streaming .mp3 and .m4a format is working, but when playing .flac it always return error code -11819

this is the log if I force to play everytime it reproduce error

player option : Optional(["AVURLAssetPreferPreciseDurationAndTimingKey": true])
paused
loading
ready
buffering
error code: -11819
player option : Optional(["AVURLAssetPreferPreciseDurationAndTimingKey": true])
paused
loading
ready
buffering
error code: -11819
player option : Optional(["AVURLAssetPreferPreciseDurationAndTimingKey": true])
paused
2020-04-27 10:47:58.460146+0700 SwiftAudio_Example[278:6729] [avas] AVAudioSessionUtilities.h:112:GetProperty: AudioSessionGetProperty ('mode') failed with error: '!ini'
2020-04-27 10:47:58.461047+0700 SwiftAudio_Example[278:6729] [avas] AVAudioSessionUtilities.h:127:GetProperty_DefaultToZero: AudioSessionGetProperty ('mode') failed with error: '!ini'
2020-04-27 10:47:58.461737+0700 SwiftAudio_Example[278:6729] [avas] AVAudioSession.mm:1660:-[AVAudioSession mode]: No valid string for mode: 0
2020-04-27 10:47:58.462460+0700 SwiftAudio_Example[278:6729] [avas] AVAudioSessionUtilities.h:112:GetProperty: AudioSessionGetProperty ('cmix') failed with error: '!ini'
2020-04-27 10:47:58.463090+0700 SwiftAudio_Example[278:6729] [avas] AVAudioSessionUtilities.h:127:GetProperty_DefaultToZero: AudioSessionGetProperty ('cmix') failed with error: '!ini'
2020-04-27 10:47:58.463851+0700 SwiftAudio_Example[278:6729] [avas] AVAudioSessionUtilities.h:112:GetProperty: AudioSessionGetProperty ('duck') failed with error: '!ini'
2020-04-27 10:47:58.464441+0700 SwiftAudio_Example[278:6729] [avas] AVAudioSessionUtilities.h:127:GetProperty_DefaultToZero: AudioSessionGetProperty ('duck') failed with error: '!ini'
2020-04-27 10:47:58.465081+0700 SwiftAudio_Example[278:6729] [avas] AVAudioSessionUtilities.h:112:GetProperty: AudioSessionGetProperty ('cblu') failed with error: '!ini'
2020-04-27 10:47:58.465752+0700 SwiftAudio_Example[278:6729] [avas] AVAudioSessionUtilities.h:127:GetProperty_DefaultToZero: AudioSessionGetProperty ('cblu') failed with error: '!ini'
2020-04-27 10:47:58.466482+0700 SwiftAudio_Example[278:6729] [avas] AVAudioSessionUtilities.h:112:GetProperty: AudioSessionGetProperty ('cspk') failed with error: '!ini'
2020-04-27 10:47:58.467056+0700 SwiftAudio_Example[278:6729] [avas] AVAudioSessionUtilities.h:127:GetProperty_DefaultToZero: AudioSessionGetProperty ('cspk') failed with error: '!ini'
2020-04-27 10:47:58.467854+0700 SwiftAudio_Example[278:6729] [avas] AVAudioSessionUtilities.h:112:GetProperty: AudioSessionGetProperty ('sint') failed with error: '!ini'
2020-04-27 10:47:58.468479+0700 SwiftAudio_Example[278:6729] [avas] AVAudioSessionUtilities.h:127:GetProperty_DefaultToZero: AudioSessionGetProperty ('sint') failed with error: '!ini'
2020-04-27 10:47:58.469218+0700 SwiftAudio_Example[278:6729] [avas] AVAudioSessionUtilities.h:112:GetProperty: AudioSessionGetProperty ('nwrs') failed with error: '!ini'
2020-04-27 10:47:58.469819+0700 SwiftAudio_Example[278:6729] [avas] AVAudioSessionUtilities.h:127:GetProperty_DefaultToZero: AudioSessionGetProperty ('nwrs') failed with error: '!ini'
loading
2020-04-27 10:47:58.610833+0700 SwiftAudio_Example[278:6729] [avas] AVAudioSessionUtilities.mm:106:getUInt32: -- Mode Value Converter failed to find a match for string ""
ready
buffering
error code: -11819
player option : Optional(["AVURLAssetPreferPreciseDurationAndTimingKey": true])
paused
2020-04-27 10:48:18.258580+0700 SwiftAudio_Example[278:7017] [avas] AVAudioSessionUtilities.h:112:GetProperty: AudioSessionGetProperty ('mode') failed with error: '!ini'
2020-04-27 10:48:18.259398+0700 SwiftAudio_Example[278:7017] [avas] AVAudioSessionUtilities.h:127:GetProperty_DefaultToZero: AudioSessionGetProperty ('mode') failed with error: '!ini'
2020-04-27 10:48:18.260025+0700 SwiftAudio_Example[278:7017] [avas] AVAudioSession.mm:1660:-[AVAudioSession mode]: No valid string for mode: 0
2020-04-27 10:48:18.260726+0700 SwiftAudio_Example[278:7017] [avas] AVAudioSessionUtilities.h:112:GetProperty: AudioSessionGetProperty ('cmix') failed with error: '!ini'
2020-04-27 10:48:18.261338+0700 SwiftAudio_Example[278:7017] [avas] AVAudioSessionUtilities.h:127:GetProperty_DefaultToZero: AudioSessionGetProperty ('cmix') failed with error: '!ini'
2020-04-27 10:48:18.262152+0700 SwiftAudio_Example[278:7017] [avas] AVAudioSessionUtilities.h:112:GetProperty: AudioSessionGetProperty ('duck') failed with error: '!ini'
2020-04-27 10:48:18.262714+0700 SwiftAudio_Example[278:7017] [avas] AVAudioSessionUtilities.h:127:GetProperty_DefaultToZero: AudioSessionGetProperty ('duck') failed with error: '!ini'
2020-04-27 10:48:18.263378+0700 SwiftAudio_Example[278:7017] [avas] AVAudioSessionUtilities.h:112:GetProperty: AudioSessionGetProperty ('cblu') failed with error: '!ini'
2020-04-27 10:48:18.264017+0700 SwiftAudio_Example[278:7017] [avas] AVAudioSessionUtilities.h:127:GetProperty_DefaultToZero: AudioSessionGetProperty ('cblu') failed with error: '!ini'
2020-04-27 10:48:18.264772+0700 SwiftAudio_Example[278:7017] [avas] AVAudioSessionUtilities.h:112:GetProperty: AudioSessionGetProperty ('cspk') failed with error: '!ini'
2020-04-27 10:48:18.265397+0700 SwiftAudio_Example[278:7017] [avas] AVAudioSessionUtilities.h:127:GetProperty_DefaultToZero: AudioSessionGetProperty ('cspk') failed with error: '!ini'
2020-04-27 10:48:18.266129+0700 SwiftAudio_Example[278:7017] [avas] AVAudioSessionUtilities.h:112:GetProperty: AudioSessionGetProperty ('sint') failed with error: '!ini'
2020-04-27 10:48:18.266783+0700 SwiftAudio_Example[278:7017] [avas] AVAudioSessionUtilities.h:127:GetProperty_DefaultToZero: AudioSessionGetProperty ('sint') failed with error: '!ini'
2020-04-27 10:48:18.267492+0700 SwiftAudio_Example[278:7017] [avas] AVAudioSessionUtilities.h:112:GetProperty: AudioSessionGetProperty ('nwrs') failed with error: '!ini'
2020-04-27 10:48:18.268221+0700 SwiftAudio_Example[278:7017] [avas] AVAudioSessionUtilities.h:127:GetProperty_DefaultToZero: AudioSessionGetProperty ('nwrs') failed with error: '!ini'
loading
2020-04-27 10:48:18.366435+0700 SwiftAudio_Example[278:7017] [avas] AVAudioSessionUtilities.mm:106:getUInt32: -- Mode Value Converter failed to find a match for string ""
ready
buffering
error code: -11819
player option : Optional(["AVURLAssetPreferPreciseDurationAndTimingKey": true])
paused
loading
ready
buffering
error code: -11819
player option : Optional(["AVURLAssetPreferPreciseDurationAndTimingKey": true])
paused
2020-04-27 10:49:01.120968+0700 SwiftAudio_Example[278:7444] [avas] AVAudioSessionUtilities.h:112:GetProperty: AudioSessionGetProperty ('mode') failed with error: '!ini'
2020-04-27 10:49:01.121885+0700 SwiftAudio_Example[278:7444] [avas] AVAudioSessionUtilities.h:127:GetProperty_DefaultToZero: AudioSessionGetProperty ('mode') failed with error: '!ini'
2020-04-27 10:49:01.122637+0700 SwiftAudio_Example[278:7444] [avas] AVAudioSession.mm:1660:-[AVAudioSession mode]: No valid string for mode: 0
2020-04-27 10:49:01.123509+0700 SwiftAudio_Example[278:7444] [avas] AVAudioSessionUtilities.h:112:GetProperty: AudioSessionGetProperty ('cmix') failed with error: '!ini'
2020-04-27 10:49:01.124222+0700 SwiftAudio_Example[278:7444] [avas] AVAudioSessionUtilities.h:127:GetProperty_DefaultToZero: AudioSessionGetProperty ('cmix') failed with error: '!ini'
2020-04-27 10:49:01.125016+0700 SwiftAudio_Example[278:7444] [avas] AVAudioSessionUtilities.h:112:GetProperty: AudioSessionGetProperty ('duck') failed with error: '!ini'
2020-04-27 10:49:01.125777+0700 SwiftAudio_Example[278:7444] [avas] AVAudioSessionUtilities.h:127:GetProperty_DefaultToZero: AudioSessionGetProperty ('duck') failed with error: '!ini'
2020-04-27 10:49:01.126393+0700 SwiftAudio_Example[278:7444] [avas] AVAudioSessionUtilities.h:112:GetProperty: AudioSessionGetProperty ('cblu') failed with error: '!ini'
2020-04-27 10:49:01.126975+0700 SwiftAudio_Example[278:7444] [avas] AVAudioSessionUtilities.h:127:GetProperty_DefaultToZero: AudioSessionGetProperty ('cblu') failed with error: '!ini'
2020-04-27 10:49:01.127819+0700 SwiftAudio_Example[278:7444] [avas] AVAudioSessionUtilities.h:112:GetProperty: AudioSessionGetProperty ('cspk') failed with error: '!ini'
2020-04-27 10:49:01.128413+0700 SwiftAudio_Example[278:7444] [avas] AVAudioSessionUtilities.h:127:GetProperty_DefaultToZero: AudioSessionGetProperty ('cspk') failed with error: '!ini'
2020-04-27 10:49:01.129129+0700 SwiftAudio_Example[278:7444] [avas] AVAudioSessionUtilities.h:112:GetProperty: AudioSessionGetProperty ('sint') failed with error: '!ini'
2020-04-27 10:49:01.129714+0700 SwiftAudio_Example[278:7444] [avas] AVAudioSessionUtilities.h:127:GetProperty_DefaultToZero: AudioSessionGetProperty ('sint') failed with error: '!ini'
2020-04-27 10:49:01.130428+0700 SwiftAudio_Example[278:7444] [avas] AVAudioSessionUtilities.h:112:GetProperty: AudioSessionGetProperty ('nwrs') failed with error: '!ini'
2020-04-27 10:49:01.130990+0700 SwiftAudio_Example[278:7444] [avas] AVAudioSessionUtilities.h:127:GetProperty_DefaultToZero: AudioSessionGetProperty ('nwrs') failed with error: '!ini'
loading
2020-04-27 10:49:01.311506+0700 SwiftAudio_Example[278:7444] [avas] AVAudioSessionUtilities.mm:106:getUInt32: -- Mode Value Converter failed to find a match for string ""
ready
buffering
error code: -11819
player option : Optional(["AVURLAssetPreferPreciseDurationAndTimingKey": true])
paused
loading
ready
buffering
error code: -11819
player option : Optional(["AVURLAssetPreferPreciseDurationAndTimingKey": true])
paused
2020-04-27 10:49:42.752574+0700 SwiftAudio_Example[278:7825] [avas] AVAudioSessionUtilities.h:112:GetProperty: AudioSessionGetProperty ('mode') failed with error: '!ini'
2020-04-27 10:49:42.753153+0700 SwiftAudio_Example[278:7825] [avas] AVAudioSessionUtilities.h:127:GetProperty_DefaultToZero: AudioSessionGetProperty ('mode') failed with error: '!ini'
2020-04-27 10:49:42.753961+0700 SwiftAudio_Example[278:7825] [avas] AVAudioSession.mm:1660:-[AVAudioSession mode]: No valid string for mode: 0
2020-04-27 10:49:42.754778+0700 SwiftAudio_Example[278:7825] [avas] AVAudioSessionUtilities.h:112:GetProperty: AudioSessionGetProperty ('cmix') failed with error: '!ini'
2020-04-27 10:49:42.755382+0700 SwiftAudio_Example[278:7825] [avas] AVAudioSessionUtilities.h:127:GetProperty_DefaultToZero: AudioSessionGetProperty ('cmix') failed with error: '!ini'
2020-04-27 10:49:42.756068+0700 SwiftAudio_Example[278:7825] [avas] AVAudioSessionUtilities.h:112:GetProperty: AudioSessionGetProperty ('duck') failed with error: '!ini'
2020-04-27 10:49:42.756726+0700 SwiftAudio_Example[278:7825] [avas] AVAudioSessionUtilities.h:127:GetProperty_DefaultToZero: AudioSessionGetProperty ('duck') failed with error: '!ini'
2020-04-27 10:49:42.757433+0700 SwiftAudio_Example[278:7825] [avas] AVAudioSessionUtilities.h:112:GetProperty: AudioSessionGetProperty ('cblu') failed with error: '!ini'
2020-04-27 10:49:42.758015+0700 SwiftAudio_Example[278:7825] [avas] AVAudioSessionUtilities.h:127:GetProperty_DefaultToZero: AudioSessionGetProperty ('cblu') failed with error: '!ini'
2020-04-27 10:49:42.758786+0700 SwiftAudio_Example[278:7825] [avas] AVAudioSessionUtilities.h:112:GetProperty: AudioSessionGetProperty ('cspk') failed with error: '!ini'
2020-04-27 10:49:42.759355+0700 SwiftAudio_Example[278:7825] [avas] AVAudioSessionUtilities.h:127:GetProperty_DefaultToZero: AudioSessionGetProperty ('cspk') failed with error: '!ini'
2020-04-27 10:49:42.760071+0700 SwiftAudio_Example[278:7825] [avas] AVAudioSessionUtilities.h:112:GetProperty: AudioSessionGetProperty ('sint') failed with error: '!ini'
2020-04-27 10:49:42.760646+0700 SwiftAudio_Example[278:7825] [avas] AVAudioSessionUtilities.h:127:GetProperty_DefaultToZero: AudioSessionGetProperty ('sint') failed with error: '!ini'
2020-04-27 10:49:42.761342+0700 SwiftAudio_Example[278:7825] [avas] AVAudioSessionUtilities.h:112:GetProperty: AudioSessionGetProperty ('nwrs') failed with error: '!ini'
2020-04-27 10:49:42.761925+0700 SwiftAudio_Example[278:7825] [avas] AVAudioSessionUtilities.h:127:GetProperty_DefaultToZero: AudioSessionGetProperty ('nwrs') failed with error: '!ini'
loading
2020-04-27 10:49:42.772586+0700 SwiftAudio_Example[278:7825] [avas] AVAudioSessionUtilities.mm:106:getUInt32: -- Mode Value Converter failed to find a match for string ""
ready
buffering
error code: -11819
player option : Optional(["AVURLAssetPreferPreciseDurationAndTimingKey": true])
paused
2020-04-27 10:50:04.917634+0700 SwiftAudio_Example[278:8077] [avas] AVAudioSessionUtilities.h:112:GetProperty: AudioSessionGetProperty ('mode') failed with error: '!ini'
2020-04-27 10:50:04.923549+0700 SwiftAudio_Example[278:8077] [avas] AVAudioSessionUtilities.h:127:GetProperty_DefaultToZero: AudioSessionGetProperty ('mode') failed with error: '!ini'
2020-04-27 10:50:04.924474+0700 SwiftAudio_Example[278:8077] [avas] AVAudioSession.mm:1660:-[AVAudioSession mode]: No valid string for mode: 0
2020-04-27 10:50:04.941774+0700 SwiftAudio_Example[278:8077] [avas] AVAudioSessionUtilities.h:112:GetProperty: AudioSessionGetProperty ('cmix') failed with error: '!ini'
2020-04-27 10:50:04.942505+0700 SwiftAudio_Example[278:8077] [avas] AVAudioSessionUtilities.h:127:GetProperty_DefaultToZero: AudioSessionGetProperty ('cmix') failed with error: '!ini'
2020-04-27 10:50:04.943199+0700 SwiftAudio_Example[278:8077] [avas] AVAudioSessionUtilities.h:112:GetProperty: AudioSessionGetProperty ('duck') failed with error: '!ini'
2020-04-27 10:50:04.943817+0700 SwiftAudio_Example[278:8077] [avas] AVAudioSessionUtilities.h:127:GetProperty_DefaultToZero: AudioSessionGetProperty ('duck') failed with error: '!ini'
2020-04-27 10:50:04.944401+0700 SwiftAudio_Example[278:8077] [avas] AVAudioSessionUtilities.h:112:GetProperty: AudioSessionGetProperty ('cblu') failed with error: '!ini'
2020-04-27 10:50:04.945042+0700 SwiftAudio_Example[278:8077] [avas] AVAudioSessionUtilities.h:127:GetProperty_DefaultToZero: AudioSessionGetProperty ('cblu') failed with error: '!ini'
2020-04-27 10:50:04.945840+0700 SwiftAudio_Example[278:8077] [avas] AVAudioSessionUtilities.h:112:GetProperty: AudioSessionGetProperty ('cspk') failed with error: '!ini'
2020-04-27 10:50:04.946431+0700 SwiftAudio_Example[278:8077] [avas] AVAudioSessionUtilities.h:127:GetProperty_DefaultToZero: AudioSessionGetProperty ('cspk') failed with error: '!ini'
2020-04-27 10:50:04.947083+0700 SwiftAudio_Example[278:8077] [avas] AVAudioSessionUtilities.h:112:GetProperty: AudioSessionGetProperty ('sint') failed with error: '!ini'
2020-04-27 10:50:04.947699+0700 SwiftAudio_Example[278:8077] [avas] AVAudioSessionUtilities.h:127:GetProperty_DefaultToZero: AudioSessionGetProperty ('sint') failed with error: '!ini'
2020-04-27 10:50:04.948403+0700 SwiftAudio_Example[278:8077] [avas] AVAudioSessionUtilities.h:112:GetProperty: AudioSessionGetProperty ('nwrs') failed with error: '!ini'
2020-04-27 10:50:04.949007+0700 SwiftAudio_Example[278:8077] [avas] AVAudioSessionUtilities.h:127:GetProperty_DefaultToZero: AudioSessionGetProperty ('nwrs') failed with error: '!ini'
loading
2020-04-27 10:50:05.090718+0700 SwiftAudio_Example[278:8077] [avas] AVAudioSessionUtilities.mm:106:getUInt32: -- Mode Value Converter failed to find a match for string ""
ready
buffering
error code: -11819
player option : Optional(["AVURLAssetPreferPreciseDurationAndTimingKey": true])
paused
2020-04-27 10:50:26.925441+0700 SwiftAudio_Example[278:8087] [avas] AVAudioSessionUtilities.h:112:GetProperty: AudioSessionGetProperty ('mode') failed with error: '!ini'
2020-04-27 10:50:26.926294+0700 SwiftAudio_Example[278:8087] [avas] AVAudioSessionUtilities.h:127:GetProperty_DefaultToZero: AudioSessionGetProperty ('mode') failed with error: '!ini'
2020-04-27 10:50:26.926989+0700 SwiftAudio_Example[278:8087] [avas] AVAudioSession.mm:1660:-[AVAudioSession mode]: No valid string for mode: 0
2020-04-27 10:50:26.927658+0700 SwiftAudio_Example[278:8087] [avas] AVAudioSessionUtilities.h:112:GetProperty: AudioSessionGetProperty ('cmix') failed with error: '!ini'
2020-04-27 10:50:26.928096+0700 SwiftAudio_Example[278:8087] [avas] AVAudioSessionUtilities.h:127:GetProperty_DefaultToZero: AudioSessionGetProperty ('cmix') failed with error: '!ini'
2020-04-27 10:50:26.928939+0700 SwiftAudio_Example[278:8087] [avas] AVAudioSessionUtilities.h:112:GetProperty: AudioSessionGetProperty ('duck') failed with error: '!ini'
2020-04-27 10:50:26.929539+0700 SwiftAudio_Example[278:8087] [avas] AVAudioSessionUtilities.h:127:GetProperty_DefaultToZero: AudioSessionGetProperty ('duck') failed with error: '!ini'
2020-04-27 10:50:26.930250+0700 SwiftAudio_Example[278:8087] [avas] AVAudioSessionUtilities.h:112:GetProperty: AudioSessionGetProperty ('cblu') failed with error: '!ini'
2020-04-27 10:50:26.930832+0700 SwiftAudio_Example[278:8087] [avas] AVAudioSessionUtilities.h:127:GetProperty_DefaultToZero: AudioSessionGetProperty ('cblu') failed with error: '!ini'
2020-04-27 10:50:26.931718+0700 SwiftAudio_Example[278:8087] [avas] AVAudioSessionUtilities.h:112:GetProperty: AudioSessionGetProperty ('cspk') failed with error: '!ini'
2020-04-27 10:50:26.932736+0700 SwiftAudio_Example[278:8087] [avas] AVAudioSessionUtilities.h:127:GetProperty_DefaultToZero: AudioSessionGetProperty ('cspk') failed with error: '!ini'
2020-04-27 10:50:26.933521+0700 SwiftAudio_Example[278:8087] [avas] AVAudioSessionUtilities.h:112:GetProperty: AudioSessionGetProperty ('sint') failed with error: '!ini'
2020-04-27 10:50:26.934137+0700 SwiftAudio_Example[278:8087] [avas] AVAudioSessionUtilities.h:127:GetProperty_DefaultToZero: AudioSessionGetProperty ('sint') failed with error: '!ini'
2020-04-27 10:50:26.934850+0700 SwiftAudio_Example[278:8087] [avas] AVAudioSessionUtilities.h:112:GetProperty: AudioSessionGetProperty ('nwrs') failed with error: '!ini'
2020-04-27 10:50:26.935425+0700 SwiftAudio_Example[278:8087] [avas] AVAudioSessionUtilities.h:127:GetProperty_DefaultToZero: AudioSessionGetProperty ('nwrs') failed with error: '!ini'
loading
2020-04-27 10:50:27.100773+0700 SwiftAudio_Example[278:8087] [avas] AVAudioSessionUtilities.mm:106:getUInt32: -- Mode Value Converter failed to find a match for string ""

To Reproduce add AVURLAssetPreferPreciseDurationAndTimingKey : true on load(from:playWhenReady:initialTime) in AVPlayerWrapper class

.flac song : https://www.eclassical.com/custom/eclassical/files/BIS1447-002-flac_24.flac

Expected behavior player can play streaming .flac after adding AVURLAssetPreferPreciseDurationAndTimingKey : true

Smartphone (please complete the following information):

  • Device: iPhone6
  • OS: iOs 13.1.2
  • Version 0.11.2

cendolinside123 avatar Apr 26 '20 06:04 cendolinside123

@jorgenhenrichsen

cendolinside123 avatar Mar 18 '21 09:03 cendolinside123