Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dataSourceErrorOccured #398

Open
KenmuHuang opened this issue Apr 18, 2018 · 9 comments
Open

dataSourceErrorOccured #398

KenmuHuang opened this issue Apr 18, 2018 · 9 comments

Comments

@KenmuHuang
Copy link

I can not do anything when I play an empty audio from server.
It never execute public delegate method in the iOS 11.

The console show related information as following:
attemptReconnect 0/0
dataSourceErrorOccured
attemptReconnect 0/0
dataSourceErrorOccured
...

For example I access this audio:
http://www.tingban.cn/record/file_play/Mg/NDUxOV8xNDMwXzY1Njg0XzI/L3dpenphcmRhdWRpbzEvMjAxNDA0LzJlMzJmNzEyLWZjMGYtNDk3NC1iYTlkLTNiYTNlNmRhZjdmMS5tcDM.mp3

@patrickjquinn
Copy link

I'm getting a 404 when I hit that link. Are you testing against dead links?

@KenmuHuang
Copy link
Author

@patrickjquinn
Yes, I want to get a notice when I play invalid audio link. If I getting a notice(e.g. delegate), I can do somethig(e.g. play next audio) for it.

@xiaogehenjimo
Copy link

@KenmuHuang 大佬 传了无效的地址 控制台一直打印这个 请问在哪里能获得这个事件?

@KenmuHuang
Copy link
Author

@KenmuHuang 大佬 传了无效的地址 控制台一直打印这个 请问在哪里能获得这个事件?

尴尬,之前就是因为同样情况获取不到,所以提问;现在不知道有没新增功能支持这处理

@diegostamigni
Copy link
Collaborator

diegostamigni commented Mar 20, 2019

Hi @KenmuHuang

It never execute public delegate method in the iOS 11

I'm not sure I understand this. Do you mean that no method in protocol STKAudioPlayerDelegate gets called?

@youyou5920
Copy link

let audioDataSource = STKAudioPlayer.dataSource(from: sourceURL)

self.audioPlayer = STKAudioPlayer(options: STKAudioPlayerOptions())
self.audioPlayer?.delegate = self

self.audioPlayer?.play(audioDataSource)

// If sourceURL is invalid 404, it will trigger dataSourceErrorOccured in a loop,
// Do not execute : -(void) audioPlayer:(STKAudioPlayer*)audioPlayer unexpectedError:(STKAudioPlayerErrorCode)errorCode

@iDevelopper
Copy link

Hi there,

Any news about this? No public delegate method is called after dataSourceErrorOccured...

Thank you.

@MQL9011
Copy link

MQL9011 commented Jun 12, 2019

I have the same bug.

Play url error , but delegate is not called.

Is anyone solve this?

@iDevelopper
Copy link

iDevelopper commented Jun 13, 2019

I had to absolutely have a response in my audio palyer delegate for this error. So I wrote this category which I hope will help some of you. It calls the method audioPlayer:unexpectedError with STKAudioPlayerErrorDataSource error.

STKAutoRecover.zip

In your player view controller:

#import "STKAutoRecoveringHTTPDataSource+PBPrivate.h"

Setting your dataSource:

    STKDataSource *dataSource = [STKAudioPlayer dataSourceFromURL:url];
    ((STKAutoRecoveringHTTPDataSource *)dataSource).audioPlayer = _audioPlayer;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants