andreipitis / ASPVideoPlayer

A simple video player that allow animations to be performed on the view during playback.
MIT License
89 stars 43 forks source link

Button State #18

Closed NemanjaLugi closed 6 years ago

NemanjaLugi commented 6 years ago

How can I change the button state on PlayPauseButton?

andreipitis commented 6 years ago

Hi @NemanjaLugi , you can use the isSelected property, or the buttonState property to set the button in one of it's two available states. The button also changes state based on touch events using the private changeState() method.

NemanjaLugi commented 6 years ago

Can you give me example of code, I have some issues with that. I need to change button state from play to pause on ASPVideoPlayer. Thanks

andreipitis commented 6 years ago

You can't change the button state on ASPVideoPlayer with the default controls. You can implement your own controls (take a look at ASPVideoPlayerControls) and add additional methods to update the UI however you want. You can set the player's videoPlayerControls property to use your own implementation. Then you could call your methods like this :

let controls = videoPlayer.videoPlayerControls as! CustomControls
controls.updateButtonState()