Octoshape
By starting and managing the Octoshape’s services, this module simplifies the integration with our player, by just instantiating our Octoshape module, our player will be able to handle Octoshape streams with no additional work.
Installation
Just import the AmpOctoshape.framework in your project. For more information check out the AmpCore’s documentation.
Note: Make sure to add the frameworks as Embedded Binaries or you’ll get an error about a missing image.
How to Use
Let’s first import the required frameworks:
import AmpCore
import AmpOctoshape
Then, let’s add the related variables in our UIViewController:
var ampPlayer: AmpPlayer!
var ampOctoshapeManager: AmpOctoshapeManager!
And it’s time to instantiate them now, in your viewDidLoad function:
// Instantiate player
self.ampPlayer = AmpPlayer(parentView: self.view)
self.ampPlayer.autoplay = true
self.ampPlayer.setLicense(license)
// Register yourself as an observer if required
self.ampPlayer.registerObserver(self)
// Instantiate the Octoshape Manager before we handle the URL
self.ampOctoshapeManager = AmpOctoshapeManager(ampPlayer: self.ampPlayer, enableLogs: true, container: self.view)
self.ampPlayer.play(octoshapeUrl)
And that’s basically it, with just those few steps, you have a working integration between AMP and Octoshape.