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

play in ios9 #91

Closed
Phil0529 opened this issue Oct 9, 2015 · 12 comments
Closed

play in ios9 #91

Phil0529 opened this issue Oct 9, 2015 · 12 comments

Comments

@Phil0529
Copy link

Phil0529 commented Oct 9, 2015

my code in iphone and simulator can play. but in the ipod ,the KVO observe keyPath only is currentItem and rate . the "loadedTimeRanges" not appear; the version of the ipod is 8.4.1 and iphone 9.1.2

@saiday
Copy link
Member

saiday commented Oct 9, 2015

You mean the version of iPod is iOS 8.4.1 and iOS 9.1.2 right? Is there any iOS version can work that you've tested?

I'm not sure what not appear you mentioned exactly happened. Never went into loadedTimeRanges statement?

If possible, you should give us more informations. It can be HysteriaPlayer logs inside your console.

@Phil0529
Copy link
Author

Phil0529 commented Oct 9, 2015

ok, a m3u8 format stream music in ipod 8.4.1 did not work. but in iphone 9.1.2 can play normally. I don't know is the question is ipod or the version . the stream is normally play in the system player

@saiday
Copy link
Member

saiday commented Oct 9, 2015

So what we know now is something went wrong on iPod with iOS 8.4.1, do you observer any code level doubtful logs or exceptions?

I don't have iPod touch btw.

@saiday
Copy link
Member

saiday commented Oct 9, 2015

It could be better that you paste HysteriaPlayer logs on this issue.

@Phil0529
Copy link
Author

Phil0529 commented Oct 9, 2015

the logs is only repeat
2015-10-09 18:10:14.653 HyseteriaSamples[801:172616] The operation could not be completed
2015-10-09 18:10:14.688 HyseteriaSamples[801:172616] current item changed
2015-10-09 18:10:14.851 HyseteriaSamples[801:172616] index: 1 is about to play

@Phil0529
Copy link
Author

Phil0529 commented Oct 9, 2015

and i have the breakpoint to check find that -->the kvo observer keyPath id not find "loadedTimeRanges" ---> only "rate" and "currentItem"

@Phil0529
Copy link
Author

Phil0529 commented Oct 9, 2015

and where are you from

@Phil0529
Copy link
Author

Phil0529 commented Oct 9, 2015

and I find maybe the reason is the version means that the stream url is not available below the 9.0 the stream url
http://hls.qd.qingting.fm/live/85651.m3u8?deviceid=b25036dd51334233ab2bebc5f41c09c8&bitrate=24
-> m3u8 format where the question; can you vertify it to solve it.

@saiday
Copy link
Member

saiday commented Oct 9, 2015

@Phil0529 Oh ok, It seems like under iOS 9 there's some bug with file-based media (HysteriaPlayer use it to play empty sound before your first item been initiated) and HTTP Live Streaming (which you are using), so there's a quick fix for you.

Find - (void)playEmptySound in HysteriaPlayer.m, modify source code like this

- (void)playEmptySound
{
    //play .1 sec empty sound
    self.audioPlayer = [[AVQueuePlayer alloc] init];
//    NSBundle *bundle = [NSBundle bundleForClass:[self class]];
//    NSString *filepath = [bundle pathForResource:@"point1sec" ofType:@"mp3"];
//    if ([[NSFileManager defaultManager]fileExistsAtPath:filepath]) {
//        self.isInEmptySound = YES;
//        AVPlayerItem *playerItem = [AVPlayerItem playerItemWithURL:[NSURL fileURLWithPath:filepath]];
//        self.audioPlayer = [AVQueuePlayer queuePlayerWithItems:[NSArray arrayWithObject:playerItem]];
//    }
}

I'm patching a commit to let user had a opportunity to disable empty sound playing.
I'm from Taiwan, btw.

Ref: iOS 9 release note

AVQueuePlayer now supports a mixture of file-based media and HTTP Live Streaming media in its queue. Prior to this, you had to ensure that all items in the queue were of the same type.

@Phil0529
Copy link
Author

Phil0529 commented Oct 9, 2015

thx it's ok

@Phil0529
Copy link
Author

Phil0529 commented Oct 9, 2015

我是大陸的.開發ios時間不是很長,所以遇到這個問題,順便問一句你為什麼要預置播放這個空聲音了?

@saiday saiday closed this as completed in 23a7106 Oct 9, 2015
@Phil0529 Phil0529 changed the title play in iPod play in ios9 Oct 9, 2015
@jiayuzhang
Copy link

Same question here, why pre-play an empty sound file here? A sort of way to boost initialization of the underlying AVPlayer??

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

3 participants