【问题标题】:AVPlayerViewController next/prev buttons don't work?AVPlayerViewController 下一个/上一个按钮不起作用?
【发布时间】:2017-05-26 00:42:27
【问题描述】:

我的代码:

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

AVQueuePlayer 类似于AVPlayer,但支持多个项目。

问题是AVPlayerViewController 有“下一个/上一个”按钮,但它们不起作用。

【问题讨论】:

    标签: ios button avplayer next avqueueplayer


    【解决方案1】:

    并非所有媒体都能够快进/跳过或倒带。 AVPlayer 不允许您覆盖该功能。

    为了检查媒体是否能够快进或快退,请查看AVPlayerItemcanPlayFastForwardcanPlayFastReverse 的值。

    如果你真的想覆盖 Next/Prev 按钮,我认为你唯一的办法就是制作一个自定义 AVPlayerViewController

    【讨论】:

    • 我不需要canPlayFastForwardcanPlayFastReverse - 我需要canStepFastForwardcanStepFastReverse。无论如何项目支持慢进和快进和canStepFastForward == YES,但按钮仍然不起作用
    • 对了,“踩”不是长按按钮吗?或者,可能通过步进来拖放视频时间线。我不确定。
    • 按住按钮意味着向前/向后滚动。我的意思是它应该通过单击按钮转到下一个/上一个视频
    猜你喜欢
    • 2013-01-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-09-28
    • 1970-01-01
    • 1970-01-01
    • 2020-12-13
    • 1970-01-01
    相关资源
    最近更新 更多