I implemented a video player function with AVPlayer
in Swift 3.
Currently, I can play the video well.
I would like to add the feature of "Trick Play" with the speed of 2x,3x,4x.
However, I didn't find anything googling. Can anyone help me please?
Asked
Active
Viewed 840 times
1

Rhythmic Fistman
- 34,352
- 5
- 87
- 159

May Phyu
- 895
- 3
- 23
- 47
1 Answers
0
Try
playerViewController.player!.rate = 2 // 3, 4 etc

Rhythmic Fistman
- 34,352
- 5
- 87
- 159
-
I added your code but not work. I also added this code, still the same (not work) vlcMediaPlayer.fastForward(atRate: 2.00) – San San May 12 '17 at 04:15
-
Can you add some code to your answer to show what you've tried? – Rhythmic Fistman May 12 '17 at 04:16
-
func btnTrickPlay(_ atRate: Float!){ if(atRate == 2.0){ vlcMediaPlayer.rate = 2 } } – San San May 12 '17 at 04:18