Broadpeak ********* Broadpeak SmartLib integrates with PRESTOplay for Web Apps via NPM and script tag. See the Broadpeak project setup documentation (https://delivery-platform.broadpeak.tv/smartlib/public/project-setup#web) for Broadpeak-specific setup details. Code samples: * Broadpeak analytics and SSAI (https://raw.githubusercontent.com/castlabs/prestoplay-web-code-samples/refs/heads/main/examples/analytics/broadpeak.js): analytics and server-side ad insertion (SSAI) ad tracking for streams delivered by a Broadpeak CDN. Install with NPM ================ The minimum SmartLib version supported by this integration is "5.4.4-808048b". Add the Broadpeak NPM registry: npm config set @broadpeak:registry https://delivery-platform.broadpeak.tv/js/ Install SmartLib: npm install @broadpeak/smartlib@5.4.4-808048b npm install @broadpeak/smartlib-analytics@5.4.4-808048b For other installation methods, see the Broadpeak project setup documentation (https://delivery-platform.broadpeak.tv/smartlib/public/project-setup#web). If your project needs a pre-transpiled bundle, use "@broadpeak/smartlib-all-compatibility" instead. Import the SmartLib files and the PRESTOplay Broadpeak plugin: import { SmartLib } from '@broadpeak/smartlib'; import '@broadpeak/smartlib-analytics'; import { clpp } from '@castlabs/prestoplay'; import '@castlabs/prestoplay/cl.broadpeak'; window.SmartLib = SmartLib; // Required by the PRESTOplay Broadpeak plugin. Configuration ============= Add the Broadpeak configuration to your player. Set "broadpeakDomainNames" to a comma-separated list of the CDN domains that serve content through Broadpeak: const playerConfig = { ... broadpeak: { broadpeakDomainNames: 'cdn.broadpeak.example,cdn2.broadpeak.example', }, }; Two special values are also accepted: "'*'" if every URL the player loads is served through Broadpeak, or "''" if none are. See "BroadpeakConfiguration" (https://players.castlabs.com/web/latest/docs/api/clpp.BroadpeakConfiguration.md) for all available configuration options. Session options --------------- Pass session options via "broadpeak.sessionOptions", using "StreamingSessionOptions" constants as keys: const playerConfig = { ... broadpeak: { broadpeakDomainNames: '', sessionOptions: { [StreamingSessionOptions.GDPR_PREFERENCE]: StreamingSessionOptions.GDPR_CLEAR, [StreamingSessionOptions.SESSION_KEEPALIVE_FREQUENCY]: 5000, [StreamingSessionOptions.SESSION_PRECACHE]: false, // Defaults to false when omitted. }, }, }; See the Broadpeak documentation on session options (https://delivery-platform.broadpeak.tv/smartlib/public/advanced-features/session-options) for more information. Broadpeak SSAI ads ================== The Broadpeak plugin integrates server-side ad insertion (SSAI) tracking into PRESTOplay for Web Apps, automatically handling ad tracking and emitting client-side events. To enable this feature, extend your Broadpeak analytics installation with the Broadpeak ads module: npm install @broadpeak/smartlib-ad@5.4.4-808048b Then enable ad tracking in the Broadpeak config with "adTracking: true" and, optionally, pass "adParameters" to enable ad personalization. See the Broadpeak documentation for details about supported ad parameters. player.open({ source: { url: 'https://stream.broadpeak.io/...', type: clpp.Type.DASH, }, broadpeak: { broadpeakDomainNames: '...', analyticsAddress: '...', adTracking: true, adParameters: { deviceType: 'desktop', userId: 'user123', contentGenre: 'sports', // ... any additional targeting parameters }, }, }); For ad click-through to work properly, the default HTML5 video controls ("