Playback of clear content
Creating the SDK
When the client application starts up, it must create and initialise the SDK (and the PAK for encrypted content). The client application controls the lifecycle of the OpenTV Player SDK.
Example code
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
_playerController = [[NMPAVPlayer alloc] initWithURL:nil];
(…)
return self;
}
Playback of clear content
To enable users to watch clear content, you must create and configure an NMPAVPlayer, as with a standard AVPlayer. If the content is in the clear, the playback will proceed on start.
Example code
The following code example shows how to enable users to watch clear content.
- (void)playWithUrl:(NSURL* )url
{
NMPAVPlayerItem playerItem = [NMPAVPlayerItem playerItemWithURL:url];
[_playerController replaceCurrentItemWithPlayerItem:_playerItem];
[_playerController play];
(…)
}
See the NMPAVPlayer class reference for details of the API calls used above.