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

Is there any workaround for playing m4a file from remote? #448

Open
JunsW opened this issue Feb 29, 2020 · 2 comments
Open

Is there any workaround for playing m4a file from remote? #448

JunsW opened this issue Feb 29, 2020 · 2 comments

Comments

@JunsW
Copy link

JunsW commented Feb 29, 2020

I just found StreamingKit can't play an m4a file using URL.

Is there any method I can try to solve this issue?

My whole project integrating complicated audio playing and I just make it bugless for all user interactions. But now I find it is impossible for StreamingKit to play m4a file from serve 😭😭😭

@tumtumtum
Copy link
Owner

tumtumtum commented Feb 29, 2020 via email

@JunsW
Copy link
Author

JunsW commented Feb 29, 2020

Thanks man,
http://47.99.148.129:8087/group2/M00/00/05/rBDJSF4707SAQOcGAA0Cqv-6wgE489.m4a
👆

I replaced the url in play from http function in the example app as the following.

-(void) audioPlayerViewPlayFromHTTPSelected:(AudioPlayerView*)audioPlayerView
{
    NSURL* url = [NSURL URLWithString:@"http://47.99.148.129:8087/group2/M00/00/05/rBDJSF4707SAQOcGAA0Cqv-6wgE489.m4a"];
    STKDataSource* dataSource = [STKAudioPlayer dataSourceFromURL:url];
    [audioPlayer setDataSource:dataSource withQueueItemId:[[SampleQueueId alloc] initWithUrl:url andCount:0]];
}

here is the log when tap the "Play from HTTP" button once:

2020-02-29 14:27:51.826081+0800 ExampleApp[50919:2664294] setDataSource:withQueueItemId: Playing: http://47.99.148.129:8087/group2/M00/00/05/rBDJSF4707SAQOcGAA0Cqv-6wgE489.m4a
2020-02-29 14:27:51.826574+0800 ExampleApp[50919:2664669] setCurrentlyReadingEntry:andStartPlaying:clearQueue: http://47.99.148.129:8087/group2/M00/00/05/rBDJSF4707SAQOcGAA0Cqv-6wgE489.m4a
2020-02-29 14:27:51.827928+0800 ExampleApp[50919:2664669] processFinishPlayingIfAnyAndPlayingNext:withNext: Finished: nothing, Next: http://47.99.148.129:8087/group2/M00/00/05/rBDJSF4707SAQOcGAA0Cqv-6wgE489.m4a, buffering.count=0,upcoming.count=0
2020-02-29 14:27:51.830034+0800 ExampleApp[50919:2664294] Started: http://47.99.148.129:8087/group2/M00/00/05/rBDJSF4707SAQOcGAA0Cqv-6wgE489.m4a
2020-02-29 14:27:52.125067+0800 ExampleApp[50919:2664669] dataSourceEof
2020-02-29 14:27:52.131830+0800 ExampleApp[50919:2673525] processFinishPlayingIfAnyAndPlayingNext:withNext: Finished: http://47.99.148.129:8087/group2/M00/00/05/rBDJSF4707SAQOcGAA0Cqv-6wgE489.m4a, Next: (null), buffering.count=0,upcoming.count=0
2020-02-29 14:27:52.132031+0800 ExampleApp[50919:2673525] STKAutoRecoveringHTTPDataSource dealloc
2020-02-29 14:27:52.132040+0800 ExampleApp[50919:2664294] Finished: http://47.99.148.129:8087/group2/M00/00/05/rBDJSF4707SAQOcGAA0Cqv-6wgE489.m4a
2020-02-29 14:27:52.132165+0800 ExampleApp[50919:2673525] STKHTTPDataSource dealloc

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

No branches or pull requests

2 participants