Embedding YouTube videos on

Just tested your code, it works fine on an iPhone, Youtube videos are not supported on the iOS simulator though, so you’ll need a real device for testing.

How can I position this box?

You are already passing the X (20), Y(20), width(100) and height(100) of the box at this line:

[self embedYouTube:@"http://..." frame:CGRectMake(20, 20, 100, 100)];

To change the position of the view afterwards, you modify its center property:

videoView.center = CGPointMake(200, 100 );

Leave a Comment