Package com.ooyala.pulse
Class Pulse
- java.lang.Object
-
- com.ooyala.pulse.Pulse
-
public class Pulse extends java.lang.ObjectThe INVIDI Pulse SDK. This class is used to request ad sessions from Pulse. An ad session contains all the ads that will be played along with a specific piece of content.When your application has content which it wants to display alongside advertisements, it requests a new ad session using this class. (See
PulseSession.) A "live session" (PulseLiveSession) is better suited for live/streaming content since the integration has control over when to access and trigger ads.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidclearTranscodingCache()Clear all cached transcoded assets.static PulseLiveSessioncreateLiveSession(ContentMetadata contentMetadata, RequestSettings requestSettings, PulseLiveSessionListener liveSessionListener)Create a new Pulse live ad session with the passed metadata and request settings.static PulseSessioncreateSession(ContentMetadata contentMetadata, RequestSettings requestSettings)Create a new Pulse ad session with the passed metadata and request settings.static java.util.List<TranscodingAssetResponse>fetchTranscodedAssets(java.lang.String pulseHost, java.util.List<AdIdentifiers> identifiersList, java.lang.String playbackUrlFormat)Batch lookup of transcoded assets for playback.static voidinitializeDataDog(TranscodingEventListener listener)static booleanisDebuggingEnabled()Method that requests the status of the debug messages logging inside the Pulse SDK.static voidlogDebugMessages(boolean enableDebugMessages)Set whether or not debug information from the SDK should be logged to the consolestatic voidprefetchTranscodedAssets(java.lang.String pulseHost, java.lang.String subdomain, java.lang.String channelId)Invoked by the Fuse SDK to prefetch and cache the transcoded asset mapping for a subdomain/channel scope.static voidsetLogListener(LogListener listener)Set a listener to receive low-level log messages about errors, warnings and the like, which may be dispatched during ad or tracking requests.static voidsetPulseHost(java.lang.String host, java.lang.String deviceContainer, java.lang.String persistentId)Initialize the Pulse SDK
-
-
-
Method Detail
-
setPulseHost
public static void setPulseHost(java.lang.String host, java.lang.String deviceContainer, java.lang.String persistentId)Initialize the Pulse SDKThis method must be called before requesting any ad sessions from Pulse.
- Parameters:
host- The Ooyala Pulse hostname for the client account being used.deviceContainer- The Ooyala Pulse device container, if any; can be null.persistentId- The Ooyala Pulse persistent user id, if any; can be null.
-
setLogListener
public static void setLogListener(LogListener listener)
Set a listener to receive low-level log messages about errors, warnings and the like, which may be dispatched during ad or tracking requests.- Parameters:
listener- ALogListenerwhich is called with the log messages.
-
createSession
public static PulseSession createSession(ContentMetadata contentMetadata, RequestSettings requestSettings)
Create a new Pulse ad session with the passed metadata and request settings. With a PulseSession the Pulse SDK will notify the integration when to play each ad.- Parameters:
contentMetadata- Information about the content along with which the requested ads are to be displayed.requestSettings- Information about the environment in which the ad will play.- Returns:
- An object conforming to the
PulseSessioninterface.
-
createLiveSession
public static PulseLiveSession createLiveSession(ContentMetadata contentMetadata, RequestSettings requestSettings, PulseLiveSessionListener liveSessionListener)
Create a new Pulse live ad session with the passed metadata and request settings. A PulseLiveSession is better suited for live/streaming setups, since the integration has control over when to access and play ads.- Parameters:
contentMetadata- Information about the content along with which the requested ads are to be displayed.requestSettings- Information about the environment in which the ad will play.liveSessionListener- The session will notify you through this listener.- Returns:
- An object conforming to the
PulseLiveSessioninterface.
-
logDebugMessages
public static void logDebugMessages(boolean enableDebugMessages)
Set whether or not debug information from the SDK should be logged to the console- Parameters:
enableDebugMessages- true if debug messages should be logged; false otherwise.
-
initializeDataDog
public static void initializeDataDog(TranscodingEventListener listener)
-
fetchTranscodedAssets
public static java.util.List<TranscodingAssetResponse> fetchTranscodedAssets(java.lang.String pulseHost, java.util.List<AdIdentifiers> identifiersList, java.lang.String playbackUrlFormat)
Batch lookup of transcoded assets for playback. Returns the playable transcoded assets for the ads found in the cache. Ads not in the cache are sent for transcoding internally (a single batched, fire-and-forget request) so they are available next time; they are not part of the returned list. Returns immediately.- Parameters:
pulseHost- the Pulse host base URLidentifiersList- the ads to look up- Returns:
- the list of playable
TranscodingAssetResponsefor the matched ads.
-
prefetchTranscodedAssets
public static void prefetchTranscodedAssets(java.lang.String pulseHost, java.lang.String subdomain, java.lang.String channelId)Invoked by the Fuse SDK to prefetch and cache the transcoded asset mapping for a subdomain/channel scope. Runs asynchronously and returns immediately. Fetched assets are cached deduped so repeated calls refresh entries rather than duplicating them.- Parameters:
pulseHost- the Pulse host base URLsubdomain- the subdomain identifierchannelId- the channel identifier
-
clearTranscodingCache
public static void clearTranscodingCache()
Clear all cached transcoded assets. The transcoding cache has no automatic time-based expiry; the Fuse SDK is expected to call this when cached assets should be discarded (e.g. on session teardown or channel change).
-
isDebuggingEnabled
public static boolean isDebuggingEnabled()
Method that requests the status of the debug messages logging inside the Pulse SDK.- Returns:
- true if debug messages are enabled; false otherwise.
-
-