Polyv Help Center

Help Center

4.FAQ

Updated: 2026-01-21 18:08:45

1. How to Modify Playback Speed Options

The speed "option list" in the new VOD player iOS SDK belongs to the UI layer configuration. If you directly use the Demo skin (with the "More" panel + full-screen speed popup), you need to modify the following two files separately, as they are responsible for the speed selection UI at different entry points:

  • PolyvIOSMediaPlayerDemo/PolyvVodScenes/Secenes/Modules/Media/SkinView/WidgetView/OutsideMoreView/PLVMediaPlayerSkinOutMoreView.m (speed options in the portrait/"More" panel)
  • PolyvIOSMediaPlayerDemo/PolyvVodScenes/Secenes/Modules/Media/SkinView/WidgetView/RatePopupView/PLVMediaPlayerSkinPlaybackRateView.m (speed selection popup in landscape full-screen mode)

Both locations independently maintain the playbackRates array, so they must be modified separately to ensure that newly added or adjusted speeds are visible and selectable at both entry points. Below, adding a 2.5x speed is used as an example.

Steps

  • Step 1: Modify PLVMediaPlayerSkinOutMoreView.m (More panel)

Before modification:

// 配置可用倍速
if (@available(iOS 15.0, *)) {
    self.playbackRates = @[@0.5, @0.75, @1.0, @1.25, @1.5, @2.0, @3.0];
} else {
    self.playbackRates = @[@0.5, @0.75, @1.0, @1.25, @1.5, @2.0];
}

After modification: Insert 2.5 between 2.0 and 3.0 (it is recommended to keep ascending order for user understanding and selection).

// 配置可用倍速
if (@available(iOS 15.0, *)) {
    self.playbackRates = @[@0.5, @0.75, @1.0, @1.25, @1.5, @2.0, @2.5, @3.0];
} else {
    self.playbackRates = @[@0.5, @0.75, @1.0, @1.25, @1.5, @2.0];
}
  • Step 2: Modify PLVMediaPlayerSkinPlaybackRateView.m (Full-screen speed popup)

Before modification:

if (@available(iOS 15.0, *)) {
    self.playbackRates = @[@0.5, @0.75, @1.0, @1.25, @1.5, @2.0, @3.0];
} else {
    self.playbackRates = @[@0.5, @0.75, @1.0, @1.25, @1.5, @2.0];
}

After modification: Similarly, insert 2.5 between 2.0 and 3.0.

if (@available(iOS 15.0, *)) {
    self.playbackRates = @[@0.5, @0.75, @1.0, @1.25, @1.5, @2.0, @2.5, @3.0];
} else {
    self.playbackRates = @[@0.5, @0.75, @1.0, @1.25, @1.5, @2.0];
}

After completing the modifications to the two files above, recompile and run the application. You will then see the newly added 2.5x option in the speed selection interface.

  • Speed switching API: In the Demo, when a user clicks a speed option, the player core switchSpeedRate: is called to apply the change (see examples in PLVMediaPlayerCore.h / PLVMediaPlayerCore.m).
  • Speed range: The actual supported range may depend on the system version or player core capabilities. After adding higher speeds, please verify according to your business scenario.
联系客服,在线咨询
在线咨询