Search code examples
iosobjective-cavplayeravplayerlayer

the position of the avplayer in a containerView is not what it should be T_T


I'm working on the Avplayer . I've got a containerView for the Avplayer and i set the frame of the Avplayer like this:

CGRect frame = CGRectMake(0, 0, 200, 400);
playerLayer.frame=frame;
[containerView.layer addSublayer:playerLayer];

But the Avplayer is not at the posiotion it should be T_T


Solution

  • i solve it by myself,instead of using the frame i use the playerview

    with the playerview ,u can use the storyboard to make the position of the avplayer,and also the size of it.