ssai-tracking
v0.0.1
Published
```markdown npm i ```
Downloads
2
Readme
WebOS
npm i
example
const video = document.getElementById('video')
const urlSession = 'http://123.31.18.25:2180/manifest/manipulation/session/628e8331-d3b2-4e89-a151-10003ed76286/origin04/scte35-av4s-clear/master.m3u8'
const data = await fetch(urlSession)
.then(response => response.json()) as { manifestUrl: string; trackingUrl: string }
const videoSrc = `http://123.31.18.25:2180${data.manifestUrl}`
const trackingUrl = `http://123.31.18.25:2180${data.trackingUrl}`
const player = new Hls()
player.attachMedia(video)
player.on(Hls.Events.MEDIA_ATTACHED, () => {
player.loadSource(
videoSrc
)
})
const ssaiPlugin = new SSAITracking(trackingUrl, video, { intervalTracking: 10000 })
ssaiPlugin.init()