Set up the Web SDK for streaming media
The streamingMedia component of the Adobe Experience Platform Web SDK (alloy.js, version 2.20.0 or later) collects media session data on your website and sends it to the Edge Network. This page covers the in-code (alloy.js) configuration. To configure the Web SDK through Tags instead, see Set up the Web SDK tag extension for streaming media.
-
Prerequisites:
- Complete the Edge implementation overview (schema, dataset, datastream with Media Analytics enabled).
- Install Web SDK 2.20.0 or later. See Install the Web SDK.
Configure the streamingMedia component
Add the streamingMedia component to your alloy configuration:
alloy("configure", {
edgeConfigId: "<datastreamID>",
streamingMedia: {
channel: "sample_channel",
playerName: "player_name",
appVersion: "app_version",
mainPingInterval: 10,
adPingInterval: 10
}
});
For complete configuration details, see the streamingMedia command.
Migrating from the Media JS SDK
If you are moving from the Media JS (3.x) SDK, the Web SDK getMediaAnalyticsTracker command returns a tracker instance that exposes the same APIs as the 3.x Media SDK, so your existing tracking calls continue to work.
Track media events
With the SDK configured, send each media event by calling sendEvent. See the Web SDK tab on each event and variable page for the exact payloads.
Next step
Once your implementation is complete, you can Set up reporting for Edge implementations.