ios - AVPlayer override video controls -


i need notified when control button (on video) pressed. example if tap on "pause" or on "full scren" button need implement logic. can override methods of avplayerviewcontroller? found avplayerviewcontrollerdelegate can't find methods override.

i tried add observer avplayer

player.addobserver(self, forkeypath: "status", options:nskeyvalueobservingoptions(), context: nil) 

and used:

override func observevalueforkeypath(keypath: string, ofobject object: anyobject, change: [string : anyobject], context: unsafemutablepointer<void>) { ... } 

but notification when video played: method isn't called if tap on control button.

thanks

keypaths different, swift, check play/pause after clicked:

  player .addobserver(self, forkeypath: "rate", options: nskeyvalueobservingoptions.new, context: nil) 

and in

observevalueforkeypath 

check this

if ((change!["new"] as! int) == 1) 

^ returns if video played or paused true/false cases


Comments

Popular posts from this blog

Capture and play voice with Asterisk ARI -

java - Why database contraints in HSQLDB are only checked during a commit when using transactions in Hibernate? -

visual studio - Installing Packages through Nuget - "Central Directory corrupt" -