StreamingKit icon indicating copy to clipboard operation
StreamingKit copied to clipboard

Is there any workaround for playing m4a file from remote?

Open JunsW opened this issue 5 years ago • 2 comments

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 😭😭😭

JunsW avatar Feb 29 '20 05:02 JunsW

Can you provide a sample URL?

From: JunsW [email protected] [email protected] Reply: tumtumtum/StreamingKit [email protected] [email protected] Date: 28 February 2020 at 21:05:03 To: tumtumtum/StreamingKit [email protected] [email protected] CC: Subscribed [email protected] [email protected] Subject: [tumtumtum/StreamingKit] Is there any workaround for playing m4a file from remote? (#448)

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 😭😭😭

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/tumtumtum/StreamingKit/issues/448?email_source=notifications&email_token=AALMQAWOMFDBZVIAIH4LX2TRFCLP7A5CNFSM4K6NCDIKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IRJ7YLQ, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALMQATOGJWYSPWRLGYIWBDRFCLP7ANCNFSM4K6NCDIA .

tumtumtum avatar Feb 29 '20 06:02 tumtumtum

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

JunsW avatar Feb 29 '20 06:02 JunsW