title: How to play a video embedded in a UIView?
body: <p>I tried to play video in a seperate UIView, so that I can leave some room for control utils such as start/stop buttons etc, so I write code like this:<br>
  First, I create an iOS project of Single View Application, then I add a View to the storyboard, at last, I append a new UIView based class named VideoView, then I associated the View to the class VideoView, and I wrote some code below:  </p>
  
  <pre><code>#import "ViewController.h"
  
  @interface ViewController ()
  
  @end
  
  @implementation ViewController
  
  @synthesize moviePlayer;
  
  - (IBAction)playMovie:(id)sender
  {
      VideoView *videoView = [[VideoView alloc] initWithFrame:CGRectMake(0, 0, 320, 100)];
  
      NSString *videoPath = [[NSBundle mainBundle] pathForResource:@"Sanda" ofType:@"mp4"];
      NSURL *videoURL = [NSURL fileURLWithPath:videoPath];
      moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:videoURL];
      //[moviePlayer.view setFrame:CGRectMake(0, 0, 320, 476)];
      [moviePlayer.view setFrame:videoView.bounds];
      [videoView addSubview:moviePlayer.view];
  
      [moviePlayer prepareToPlay];
      [moviePlayer play];
  
  }
  </code></pre>
  
  <p>Well, I build and run it, the result is that I can just hear the sound but without seeing the video, I'm really a new comer to iOS,so any tips?</p>