title: AVPlayer Item get a nan duration
body: <p>I'm playing a file. mp3 from url by stream. 
  I'm using AVPlayer and when I am trying to get the total time to build a progress bar, I get whenever time is nan.</p>
  
  <pre><code> NSError *setCategoryError = nil;
      if ([ [AVAudioSession sharedInstance] isOtherAudioPlaying]) { // mix sound effects with music already playing
          [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategorySoloAmbient error:&amp;setCategoryError];
      } else {
          [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryAmbient error:&amp;setCategoryError];
      }
      if (setCategoryError) {
          NSLog(@"Error setting category! %ld", (long)[setCategoryError code]);
      }
      NSURL *url = [NSURL URLWithString:@"http://..//46698"];
  
      AVPlayer *player = [AVPlayer playerWithURL:url];
      songPlayer=player;
      [songPlayer addObserver:self forKeyPath:@"status" options:0 context:nil];
  
  
  
  - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context {
  
      if (object == songPlayer &amp;&amp; [keyPath isEqualToString:@"status"]) {
          if (songPlayer.status == AVPlayerStatusFailed) {
              NSLog(@"AVPlayer Failed");
  
          } else if (songPlayer.status == AVPlayerStatusReadyToPlay) {
              NSLog(@"AVPlayerStatusReadyToPlay");
              [songPlayer play];
              [songPlayer addPeriodicTimeObserverForInterval:CMTimeMake(1, 1) queue:dispatch_get_main_queue() usingBlock:^(CMTime time){
                  CMTime aux = [songPlayer currentTime];
                  AVPlayerItem *item=[songPlayer currentItem];
                  CMTime dur=[item duration];
                  NSLog(@"%f/%f", CMTimeGetSeconds(aux),  CMTimeGetSeconds(dur));
              }];
          } else if (songPlayer.status == AVPlayerItemStatusUnknown) {
              NSLog(@"AVPlayer Unknown");
  
          }
      }
  }
  </code></pre>
  
  <p>I've tried everything.</p>
  
  <pre><code>[item duration]; /// Fail
  
  [[item asset] duration]; /// Fail
  </code></pre>
  
  <p>and nothing work</p>
  
  <p>Anyone know why?</p>