Has anyone else noticed that playableDuration property of MPMoviePlayerController class always returns 0 in iOS 5. This used to work fine in previous versions of iOS. I use it to set the value of a progress bar.
Here is piece of code that used to work under 4.x SDK just fine (i.e., the playableDuration attribute returned the correct non-zero value while buffering the stream), but under SDK 5.x it always returns zero.
- (void) updateMeter {
NSLog(@"playableDuration = %f", streamPlayer.playableDuration);
}
- (void)viewDidLoad
{
[super viewDidLoad];
streamPlayer = [[MPMoviePlayerController alloc]
initWithContentURL:[NSURL URLWithString:@"http://99.198.118.250:8158/"]];
NSTimer *updateBarTimer = [NSTimer scheduledTimerWithTimeInterval:0.5
target:self selector:@selector(updateMeter)
userInfo:nil repeats:YES];
streamPlayer.controlStyle = MPMovieControlStyleEmbedded;
[streamPlayer play];
}