[handler seekToFileOffset:(unsigned long long)_range.location]
NSData* body = [handler readDataOfLength:_range.length]
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:url]]
[request setHTTPMethod:@"POST"]
[request setValue:@"video/mp4" forHTTPHeaderField:@"Content-Type"]
[request setValue:[NSString stringWithFormat:@"%d",body.length] forHTTPHeaderField:@"Content-Length"]
[request setValue:@"no-cache" forHTTPHeaderField:@"Cache-Control"]
[request setHTTPBody:body]
然后服务器接收body 二进制流
错误提示是什么呢????//播放文件
AVAudioPlayer *audioPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL: [NSURL fileURLWithPath:filePath] error: &playerError]
最后一个参数写的不对唉
欢迎分享,转载请注明来源:夏雨云
评论列表(0条)