title: Caching in VLC Media Player
body: <p>I'm using VLC Media Player (MobileVLCKit.framwork) for playing .mpd format file. In the case of AVCaching Player, we have option for caching but in this case I'm not able to add caching feature. I tried but not getting any info about solving this problem. It would be great if any body can give few ideas to solve this problem. I'm working on iOS development.</p>
  
  <p>This is the code for AVcaching player catch and want the same for VLC Media Player caching.</p>
  
  <pre><code>-(void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response{
  
      Log(@"response received");
  
      if(self.videoCacheObject.response == nil){
          self.videoCacheObject.response = (NSHTTPURLResponse *)response;
      }
  
      if([self.delegate respondsToSelector:@selector(requestDidReceiveResponse)]){
          [self.delegate requestDidReceiveResponse];
      }
  }
  
  - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data{
      [self.videoCacheObject.videoData appendData:data];
  
      Log(@"video data length = %lu", (unsigned long)self.videoCacheObject.videoData.length);
  
      if(self.videoCacheObject.videoData.length &gt; PARTIAL_LOAD_LENGTH * self.videoCacheObject.response.expectedContentLength &amp;&amp; shouldLoadPartial){
          [[TMCache sharedCache] setObject:self.videoCacheObject forKey:self.videoName];
          [self.connection cancel];
  
          if([self.delegate respondsToSelector:@selector(requestPrefetchingCompleted)]){
              Log(@"prefetching completed");
              [self.delegate requestPrefetchingCompleted];
          }
      }
      else if(self.videoCacheObject.videoData.length &gt; 0.15*self.videoCacheObject.response.expectedContentLength){
          [[TMCache sharedCache] setObject:self.videoCacheObject forKey:self.videoName];
      }
  
      if([self.delegate respondsToSelector:@selector(requestDidReceiveData)]){
          [self.delegate requestDidReceiveData];
      }
  }
  </code></pre>