LLM
Yospace¶
To get started with Yospace, download the Yospace ad management SDK from the Yospace developer site. The currently supported version is 3.9.0. Other similar versions may also work, but compatibility is not guaranteed.
Import the Yospace SDK:
<script src="./lib/yospace/admanagement-sdk-3.9.0.min.js"></script>
Import the Yospace plugin:
import { clpp } from "@castlabs/prestoplay";
import "@castlabs/prestoplay/cl.yospace";
Enable the Yospace plugin when calling open() with a Yospace Central
Session Manager (CSM) uniform resource identifier (URI). This automatically
starts a Yospace session. source.type must be specified:
await player.open({
source: {
// Yospace CSM URI
url: 'https://csm...',
type: clpp.Type.HLS,
},
yospace: {
enabled: true,
streamType: clpp.yospace.StreamType.VOD
}
});
Set up listeners for Yospace-related events:
player.on(clpp.events.YOSPACE_SESSION_STARTED, (e) => {
// e.detail contains the YospaceAdManagement.Session object
});
player.on(clpp.events.YOSPACE_SESSION_ENDED, (e) => {
// e.detail contains the YospaceAdManagement.Session object
});
await player.open({
source: '<manifest_url>',
});
Once the video starts playing, call getSession() on the plugin instance to
get the YospaceAdManagement.Session:
const plugin = player.getPlugin(clpp.yospace.YospacePlugin.Id);
const session = plugin.getSession();
Next topic: FreeWheel (beta)
Previous topic: Google IMA