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.
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:
Then, let’s add the related variables in our
var ampPlayer: AmpPlayer!
var ampOctoshapeManager: AmpOctoshapeManager!
And it’s time to instantiate them now, in your
// Instantiate player
self.ampPlayer = AmpPlayer(parentView: self.view)
self.ampPlayer.autoplay = true
// Register yourself as an observer if required
// Instantiate the Octoshape Manager before we handle the URL
self.ampOctoshapeManager = AmpOctoshapeManager(ampPlayer: self.ampPlayer, enableLogs: true, container: self.view)
And that’s basically it, with just those few steps, you have a working integration between AMP and Octoshape.