OOOoyalaPlayerFacade.h
1 //
2 // OOOyalaPlayerInternal.h
3 // OoyalaSDK
4 //
5 // Copyright © 2018 Brightcove, Inc. All rights reserved.
6 //
7 
8 #ifndef OOOyalaPlayerFacade_h
9 #define OOOyalaPlayerFacade_h
10 
11 #import <AVFoundation/AVFoundation.h>
12 #import <UIKit/UIKit.h>
13 #import "OOCallbacks.h"
14 #import "OOPlayerState.h"
15 #import "OOEnums.h"
16 #import "OOExternNotifications.h"
17 
18 @class OOContentItem;
19 @class OOVideo;
20 @class OOOoyalaError;
21 @class OOOoyalaAPIClient;
23 @class OOStreamPlayer;
24 @class OOManagedAdSpot;
25 @class OOPlayerDomain;
26 @class OOCastManager;
27 @class OOStreamPlayerMapping;
29 @class OOFCCTVRating;
30 @class OOOptions;
31 @class OOManagedAdsPlugin;
32 @class OOPlayer;
33 @class OOSsaiAdsMetadata;
34 @class OOAudioSession;
35 @class OOOoyalaPlayerContextSwitcher;
36 @class OOOoyalaPlayerSessionIDManager;
38 @class OOUnbundledVideo;
39 @class OOStream;
40 @protocol OOEmbedTokenGenerator;
41 
51 #define OOOOYALAPLAYER_DURATION_MISSING (-1)
52 
58 @interface OOOoyalaPlayer : NSObject
59 
60 #pragma mark Statics
61 
64 + (void)setEnvironment:(OOOoyalaPlayerEnvironment)e;
65 
69 + (void)setSSLEnvironmentEnabled:(BOOL)sslEnabled;
70 
75 + (NSString *)version;
76 
81 + (BOOL)useDebugDRMPlayback;
82 
83 
88 + (void)setEncryptedLoopback:(BOOL)enabled;
89 
94 + (BOOL)encryptedLoopback;
95 
100 + (void)setUseDebugDRMPlayback:(BOOL)enable;
101 
106 + (OOIQAnalyticsTrackingState)iqAnalyticsTrackingState;
107 
113 + (void)setIqAnalyticsTrackingState:(OOIQAnalyticsTrackingState)state;
114 
115 #pragma mark Properties
116 
117 @property (readonly, nonatomic) OOVideo *currentItem;
118 @property (readonly, nonatomic) OOContentItem *rootItem;
119 @property (readonly, nonatomic) NSDictionary *metadata;
120 @property (readonly, nonatomic) OOOoyalaError *error;
121 @property (readonly, nonatomic) OOOoyalaPlayerSessionIDManager *sessionIDManager;
122 @property (readonly, nonatomic) UIView *view;
123 @property (nonatomic) OOOoyalaPlayerVideoGravity videoGravity;
124 @property (readonly, nonatomic) BOOL supportsVideoGravityButton;
125 @property (nonatomic) BOOL seekable;
126 @property (nonatomic) BOOL adsSeekable;
127 @property (readonly, nonatomic) OOSeekStyle seekStyle;
128 @property (nonatomic) NSString *closedCaptionsLanguage;
132 @property (readonly, nonatomic) BOOL isAudioOnlyStreamPlaying;
133 @property (readonly, nonatomic, getter = isClosedCaptionsTrackAvailable) BOOL closedCaptionsTrackAvailable;
134 @property (nonatomic) OOCurrentItemChangedCallback currentItemChangedCallback;
136 @property (nonatomic) OOOoyalaPlayerActionAtEnd actionAtEnd;
137 @property (readonly, nonatomic, getter = isExternalPlaybackActive) BOOL externalPlaybackActive;
138 
139 @property (nonatomic) BOOL allowsExternalPlayback;
140 
143 @property (nonatomic) float playbackRate;
144 @property (readonly, nonatomic) NSString *authToken;
146 @property (readonly, nonatomic) NSString *playerSessionId;
147 @property (readonly, nonatomic) NSString *contentSessionId;
155 @property (nonatomic) float volume;
156 
164 @property (nonatomic) NSString *userAgent;
165 
173 @property (nonatomic) NSString *customDrmData;
174 @property (nonatomic, readonly) OOStreamPlayerMapping *streamPlayerMapping;
175 @property (nonatomic, readonly) NSString *pcode;
176 
177 
182 @property (nonatomic, readonly)OOOoyalaPlayerDesiredState desiredState;
183 
187 @property (readonly, nonatomic) OOManagedAdsPlugin *managedAdsPlugin;
188 
192 @property (readonly, nonatomic) OOOptions *options;
193 
197 @property (nonatomic) OOUIProgressSliderMode normalSliderMode;
198 
199 
203 @property (nonatomic) OOAudioSession *audioSession;
204 
205 #pragma mark Initializers
206 
212 - (instancetype)initWithOoyalaAPIClient:(OOOoyalaAPIClient *)apiClient;
213 
220 - (instancetype)initWithPcode:(NSString *)pcode
221  domain:(OOPlayerDomain *)domain;
222 
230 - (instancetype)initWithPcode:(NSString *)pcode
231  domain:(OOPlayerDomain *)domain
232  options:(OOOptions *)options;
233 
241 - (instancetype)initWithPcode:(NSString *)pcode
242  domain:(OOPlayerDomain *)domain
243  embedTokenGenerator:(id<OOEmbedTokenGenerator>)embedTokenGenerator;
244 
253 - (instancetype)initWithPcode:(NSString *)pcode
254  domain:(OOPlayerDomain *)domain
255  embedTokenGenerator:(id<OOEmbedTokenGenerator>)embedTokenGenerator
256  options:(OOOptions*)options;
257 
258 
259 #pragma mark Content Setters
260 
261 - (void)setDesiredState:(OOOoyalaPlayerDesiredState)desiredState;
262 
266 - (BOOL)setStream:(OOStream*)stream;
267 
271 - (BOOL)setStreams:(NSArray*)streams;
272 
277 - (BOOL)setUnbundledVideo:(OOUnbundledVideo*)unbundledVideo;
278 
284 - (BOOL)setEmbedCode:(NSString *)embedCode;
285 
291 - (BOOL)setEmbedCodes:(NSArray *)embedCodes;
292 
299 - (BOOL)setEmbedCode:(NSString *)embedCode adSetCode:(NSString *)adSetCode;
300 
307 - (BOOL)setEmbedCodes:(NSArray *)embedCodes adSetCode:(NSString *)adSetCode;
308 
314 - (BOOL)setExternalId:(NSString *)externalId;
315 
321 - (BOOL)setExternalIds:(NSArray *)externalIds;
322 
327 - (void)setRootItem:(OOContentItem *)theRootItem;
328 
333 - (void)setAsset:(NSDictionary *)asset;
334 
340 - (BOOL)changeCurrentItemToEmbedCode:(NSString *)embedCode;
341 
346 - (BOOL)changeCurrentItemToVideo:(OOVideo *)video;
347 
352 - (BOOL) changeUnbundledVideo:(OOVideo *)video;
353 
359 - (void)reauthorizeCurrentItemWithCallback:(OOAuthorizeCallback)callback;
360 
361 #pragma mark During-playback status
362 
367 - (OOOoyalaPlayerState)state;
368 
369 #pragma mark Playback Actions
370 
375 - (void)setCustomAnalyticsTags:(NSArray *)tags;
376 
377 - (void)destroy;
378 
379 #pragma mark Plugin registration and interaction
380 
385 
391 - (NSString *)dataFromFile:(NSString *)embedCode;
392 
393 @end
394 
395 #endif /* OOOyalaPlayerFacade_h */
BOOL isAudioOnlyStreamPlaying
Get whether the player is playing the audio only stream in an m3u8.
Definition: OOOoyalaPlayerFacade.h:132
BOOL useDebugDRMPlayback()
OOOoyalaAPIClient * api()
Return an OoyalaAPIClient.
NSString * contentSessionId
A Session ID that is created on the set of a new piece of content (i.e setEmbedCode).
Definition: OOOoyalaPlayerFacade.h:147
float volume
The volume of the OoyalaPlayer, relative to the device&#39;s volume setting.
Definition: OOOoyalaPlayerFacade.h:155
OOUIProgressSliderMode normalSliderMode
Definition: OOOoyalaPlayerFacade.h:197
OOStream.
Definition: OOStream.h:22
OOOoyalaPlayerVideoGravity videoGravity
Definition: OOOoyalaPlayerFacade.h:123
BOOL externalPlaybackActive
Definition: OOOoyalaPlayerFacade.h:137
BOOL closedCaptionsTrackAvailable
Definition: OOOoyalaPlayerFacade.h:133
NSString * playerSessionId
A Session ID that is created at the initialization of OoyalaPlayer.
Definition: OOOoyalaPlayerFacade.h:146
Represents the domain under which Ooyala analytics will be recorded.
Definition: OOPlayerDomain.h:7
Use this when first setting up the OoyalaPlayer to control the layout and behavior of the TV Ratings ...
Definition: OOFCCTVRatingConfiguration.h:26
OOAudioSession * audioSession
Definition: OOOoyalaPlayerFacade.h:203
OOAssetLoaderDelegate * assetLoaderDelegate
This property can be used to pass Custom Implementation of AVAssetResourceLoaderDelegate from AVFound...
Definition: OOOoyalaPlayerFacade.h:172
BOOL allowsExternalPlayback
Definition: OOOoyalaPlayerFacade.h:139
Base class for concrete ad spot implementations.
Definition: OOManagedAdSpot.h:19
OOCurrentItemChangedCallback currentItemChangedCallback
A callback that will be called every time the current item is changed.
Definition: OOOoyalaPlayerFacade.h:134
OOOoyalaPlayerActionAtEnd actionAtEnd
the OOOoyalaPlayerActionAtEnd to perform when the current item finishes playing.
Definition: OOOoyalaPlayerFacade.h:136
NSString * authToken
The Auth Token provided by Ooyala Authorization, when using Ooyala Player Token.
Definition: OOOoyalaPlayerFacade.h:144
NSDictionary * metadata
The OOOoyalaPlayer&#39;s content metadata for currently loaded content.
Definition: OOOoyalaPlayerFacade.h:119
Definition: OOAssetLoaderDelegate.h:15
BOOL encryptedLoopback()
get encryptedloopback.
OOOoyalaError * error
The OOOoyalaPlayer&#39;s current error if it exists.
Definition: OOOoyalaPlayerFacade.h:120
OOStreamPlayerMapping * streamPlayerMapping
Definition: OOOoyalaPlayerFacade.h:174
OOOoyalaPlayerState state()
Gets the player&#39;s current state.
OOContentItem * rootItem
The OOOoyalaPlayer&#39;s embedded content (OOVideo, OOChannel, or OOChannelSet)
Definition: OOOoyalaPlayerFacade.h:118
Definition: OOUnbundledVideo.h:16
BOOL seekable
Whether or not the Videos that OOOoyalaPlayer plays are seekable.
Definition: OOOoyalaPlayerFacade.h:125
OOIQAnalyticsTrackingState iqAnalyticsTrackingState()
Use to get state for Ooyala Analytics (IQ) tracking.
Represents an error in the Ooyala SDK.
Definition: OOOoyalaError.h:56
BOOL adsSeekable
Whether or not the Ads that OOOoyalaPlayer plays are seekable.
Definition: OOOoyalaPlayerFacade.h:126
Definition: OOManagedAdsPlugin.h:13
The OoyalaPlayer is the heart of the playback system.
Definition: OOOoyalaPlayerFacade.h:58
Encapsulates the UI-relevant rating data of an asset.
Definition: OOFCCTVRating.h:10
A single playable content item, such as video.
Definition: OOContentItem.h:20
BOOL supportsVideoGravityButton
Definition: OOOoyalaPlayerFacade.h:124
NSString * customDrmData
Definition: OOOoyalaPlayerFacade.h:173
OOOptions * options
Get the options.
Definition: OOOoyalaPlayerFacade.h:192
OOOoyalaPlayerDesiredState desiredState
Gets the user&#39;s current desired state.
Definition: OOOoyalaPlayerFacade.h:182
OOPlayer.
Definition: OOPlayer.h:21
OOOoyalaPlayerSessionIDManager * sessionIDManager
Definition: OOOoyalaPlayerFacade.h:121
OOSeekStyle seekStyle
Definition: OOOoyalaPlayerFacade.h:127
Defines text style to be used when displaying closed captions.
Definition: OOClosedCaptionsStyle.h:11
UIView * view
the view associated with the player
Definition: OOOoyalaPlayerFacade.h:122
NSString * pcode
Definition: OOOoyalaPlayerFacade.h:175
NSString * version()
Get the version and RC of the Ooyala SDK.
BOOL usesExternalPlaybackWhileExternalScreenIsActive
Definition: OOOoyalaPlayerFacade.h:141
NSString * closedCaptionsLanguage
the current closed captions language, or nil to hide closed captions.
Definition: OOOoyalaPlayerFacade.h:128
float playbackRate
When external playback is enabled, this will share the video view to the external screen only...
Definition: OOOoyalaPlayerFacade.h:143
OOManagedAdsPlugin * managedAdsPlugin
Get the managedAdsPlugin that manages OOOoyalaAdSpots and OOVASTAdSpots.
Definition: OOOoyalaPlayerFacade.h:187
Ooyala API client implementation.
Definition: OOOoyalaAPIClient.h:26
Definition: OOStreamPlayer.h:19
NSString * userAgent
This property can be used to set the User-Agent for manifest requests served by AVPlayer.
Definition: OOOoyalaPlayerFacade.h:164
OOVideo * currentItem
The OOOoyalaPlayer&#39;s currently playing OOVideo.
Definition: OOOoyalaPlayerFacade.h:117
Configurations to change the behavior of the OoyalaPlayer.
Definition: OOOptions.h:13
this class implements video stream object
Definition: OOVideo.h:22