0

My code:

AVQueuePlayer *player = ...;
AVPlayerViewController *controller = [[AVPlayerViewController alloc] init];
    [vc presentViewController:controller animated:YES completion:nil];
    controller.player = player;
    controller.allowsPictureInPicturePlayback = NO;
    [player play];

AVQueuePlayer is like AVPlayer but supports multiple items.

The problem is AVPlayerViewController has "go next/prev" buttons and they don't work.

Jonas
  • 121,568
  • 97
  • 310
  • 388
Vyachaslav Gerchicov
  • 2,317
  • 3
  • 23
  • 49

1 Answers1

0

Not all media is capable of fast forwarding / skipping or rewinding. The AVPlayer does not allow you to override that functionality.

In order to check if the media is capable of fast forward or rewind, see the values of canPlayFastForward and canPlayFastReverse in AVPlayerItem.

If you really want to override the Next/Prev buttons, I think your only shot is to make a custom AVPlayerViewController.

Ramon
  • 1,415
  • 9
  • 18
  • I don't need `canPlayFastForward` and `canPlayFastReverse` - I need `canStepFastForward` and `canStepFastReverse`. Anyways item supports slow and fast forward and `canStepFastForward == YES` but the buttons still don't work – Vyachaslav Gerchicov Jan 11 '17 at 09:59
  • Right, isn't "stepping" done by holding the buttons? Or maybe dragging and dropping the video timeline is ment by stepping. I'm not sure. – Ramon Jan 11 '17 at 10:02
  • Holding buttons means scroll forward/backward. I mean it should go to next/prev video with a single button click – Vyachaslav Gerchicov Jan 11 '17 at 10:17