2016-05-12 10 views
-1

私はビデオサムネイル画像を表示するUITableViewを使用してタイムラインを持っています。ユーザは、ビデオサムネイル画像をタップすることができ、ビデオフルスクリーンを開き、再生する。ユーザーが完了ボタンをタップすると、ユーザーはタイムラインに戻ります。これで、ビデオのサムネイルが消え、視聴していたビデオと途中で止めた場所が表示されます。ユーザーが完了したボタンをタップしてタイムラインに戻し、ビデオフルスクリーンを再生する前と同じようにビデオサムネイルイメージを表示します。以下にいくつかのコードです:ユーザーがタップした後のサムネイル全画面表示を終了 - 目的C

 cell.imageView.image = [UIImage imageNamed:@"PlaceholderPhoto"]; 

     if (object) { 

      //The below line displays the users video thumbnail on the timeline. 
      //The following 2 lines is what fills the display cell that shows the photo. 
      cell.imageView.clipsToBounds = YES; 
      cell.imageView.contentMode = UIViewContentModeScaleAspectFill; 

      //The below line is what displays the video thumbnail on the home timeline. 
      cell.imageView.file = [object objectForKey:@"videoThumbnail"]; 
      [cell.imageView loadInBackground]; 

      PFFile *video =[object objectForKey:@"file"]; 
      [video getDataInBackgroundWithBlock:^(NSData *data, NSError *error) { 
       if (!error) { 
        NSString *string = [NSString stringWithFormat:@"cell%li.m4v", (long)cell.mediaItemButton.tag]; 
        NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); 
        NSString *documentsDirectory = [paths objectAtIndex:0]; 
        NSString *appFile = [documentsDirectory stringByAppendingPathComponent:string]; 
        [data writeToFile:appFile atomically:YES]; 
        NSURL *movieUrl = [NSURL fileURLWithPath:appFile]; 
        //The below line is what displays the full size movie and plays it on the home timeline. 
        [cell.movie setContentURL:movieUrl]; 
       } 
      }]; 

     } 
     return cell; 

答えて

0

私が行っボタンmpmovieplayerするために、この行を追加することでそれを行うことができました:

[self.tableView reloadData]; 
関連する問題