Skip to content

Sk8er22/Test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AVPlayerController plugin: detects Pause/Play/End Video

This is an example of AVPlayerController plugin to get notifications when people pause/resum/end Video without a custom layer.

Install

You will need to copy

Plugin/Plugin/ControlPlugin.swift

into your project

Use it

First of all you will have to instance it in your Controller

var controlPlugin = ControlPlugin()

after that, once you have your AVPlayer, you need to use

self.controlPlugin.addObserver(player: self.player)

To set the ''rate'' and ''playerDidFinishPlaying'' observers.
And thats all... this plugin will show you on console a message when:

  • Video ends
  • User Play
  • User Pause
  • △ Paused Time

Also you can recibe a String with all this information using the following function:

var finalmessage = controlPlugin.end()

IMPORTANT TO WORK CORRECTLY, THE VIDEO MUST START PLAYING

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages