6-FAQ
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:
Open the
PLVMediaPlayerSpeedSelectLayoutPortrait.ktfile.Locate the
SUPPORT_SPEED_LISTdefinition. 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") // ...Modify
SUPPORT_SPEED_LISTby 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") // ...Repeat the above steps for the
PLVMediaPlayerSpeedSelectLayoutLandscape.ktfile. Similarly, locate theSUPPORT_SPEED_LISTin 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.
