Polyv Help Center

Help Center

6-FAQ

Updated: 2025-12-29 16:03:22

1. How to Modify Speed Options

To modify the speed options, you need to edit the following two files, which handle the speed selection UI in portrait and landscape modes respectively:

  • PLVMediaPlayerSpeedSelectLayoutPortrait.kt (Speed selection layout in portrait mode)
  • PLVMediaPlayerSpeedSelectLayoutLandscape.kt (Speed selection layout in landscape mode)

To ensure the speed options are visible in both screen orientations, both files must be modified accordingly. The following example demonstrates how to add a 2.5x speed option:

In both files, the speed options are defined by a constant named SUPPORT_SPEED_LIST of type listOf<String>. You simply need to add "2.5" to this list.

Steps:

  1. Open the PLVMediaPlayerSpeedSelectLayoutPortrait.kt file.

  2. Locate the SUPPORT_SPEED_LIST definition. It is typically at the top of the file, as shown below:

    // PLVMediaPlayerSpeedSelectLayoutPortrait.kt
    // ...
    private val SUPPORT_SPEED_LIST = listOf("0.5", "0.75", "1", "1.25", "1.5", "2", "3")
    // ...
    
  3. Modify SUPPORT_SPEED_LIST by adding "2.5" to the list. It is recommended to place it between "2" and "3" to maintain the order of speeds.

    --- a/PLVMediaPlayerSpeedSelectLayoutPortrait.kt
    +++ b/PLVMediaPlayerSpeedSelectLayoutPortrait.kt
    
    -private val SUPPORT_SPEED_LIST = listOf("0.5", "0.75", "1", "1.25", "1.5", "2", "3")
    +private val SUPPORT_SPEED_LIST = listOf("0.5", "0.75", "1", "1.25", "1.5", "2", "2.5", "3")
     private val TEXT_COLOR_SELECTED = parseColor("#3F76FC")
     private val TEXT_COLOR_NORMAL = parseColor("#333333")
    // ...
    
  4. Repeat the above steps for the PLVMediaPlayerSpeedSelectLayoutLandscape.kt file. Similarly, locate the SUPPORT_SPEED_LIST in that file and modify it:

    --- a/PLVMediaPlayerSpeedSelectLayoutLandscape.kt
    +++ b/PLVMediaPlayerSpeedSelectLayoutLandscape.kt
    
    -private val SUPPORT_SPEED_LIST = listOf("0.5", "0.75", "1", "1.25", "1.5", "2", "3")
    +private val SUPPORT_SPEED_LIST = listOf("0.5", "0.75", "1", "1.25", "1.5", "2", "2.5", "3")
     private val TEXT_COLOR_SELECTED = parseColor("#3F76FC")
     private val TEXT_COLOR_NORMAL = Color.WHITE
    // ...
    

After completing the modifications in both files, recompile and run your application. You will see the 2.5x speed option in the player's speed selection interface.

联系客服,在线咨询