如何在iOS中向YouTube之类的avplayer添加快退和快进跳过动画?

时间:2019-06-10 11:37:13

标签: ios objective-c avplayer forward rewind

我想像youtube一样双击屏幕左侧或右侧向avplayer添加快进和快退动画。下面是我的代码

[UIView animateWithDuration:0.3 delay:0.0 options:UIViewAnimationOptionCurveEaseOut animations:^{
    self.viewInner.alpha = 1.0;
    [self.view layoutIfNeeded];
    [self.view layoutSubviews];

} completion:^(BOOL finished) {
    self.leading.constant = 50;

    self.imgView.alpha = 1.0;
    self.leading.constant =  self.leading.constant + 50;
    self.lblTime.hidden = false;

    [UIView animateWithDuration:0.5 delay:0.0 options:UIViewAnimationOptionCurveEaseOut animations:^{
        [self.view layoutIfNeeded];
        [self.view layoutSubviews];

    } completion:^(BOOL finished) {
        self.imgView.alpha = 0.0;
        self.lblTime.hidden = true;

        self.leading.constant = 50;

        [UIView animateWithDuration:0.3 animations:^{
            self.viewInner.alpha = 0.0;

        } completion:^(BOOL finished) {
            self.trailing.constant = -(self.viewInner.frame.size.width);

        }];

    }];
}];

0 个答案:

没有答案