> ## Documentation Index
> Fetch the complete documentation index at: https://docs.interactivelayers.com/llms.txt
> Use this file to discover all available pages before exploring further.

# HTML5 video

> Attach session graphics to a video element and its container.

Put the existing `<video>` inside a positioned `stage`. Keep controls, captions and the graphics surface in that presentation area. This integration attaches to the element already set up to play HLS in your application.

```js theme={null}
import { attachHtmlVideo } from '@interactivelayers/player-sdk';
import '@interactivelayers/player-sdk/player.css';

const sdk = attachHtmlVideo({
  video,
  stage,
  eventsUrl: playback.overlayEventsUrl,
  sessionId: playback.sessionId,
  programTime: readVideoProgramTime,
});
```

`readVideoProgramTime()` is supplied by your host. Return the program instant at the actual playhead in Unix milliseconds or `null` if it is unavailable. On engines exposing a valid `video.getStartDate()`, the adapter can infer the program clock. For HLS cues, configure `playlistUrl` with the media variant or pass the text from your existing loader to `sdk.updateManifest(text)`.

The feed and assets need the correct HTTPS and cross-origin permissions for the player. Use `sdk.setLinearAd(true)` at the start of a confirmed spot and `false` at return to content. Call `sdk.destroy()` when leaving the video. Verify CSS positioning and focus in the actual browser or TV. Play both formats, seek past a cue to confirm no impression, and compare fullscreen behavior with the stage itself fullscreen. [Fixture and cue contract](https://docs.interactivelayers.com/player-sdk.md) · [HTML5 adapter source](https://github.com/InteractiveLayerscom/IL-VideoPlayers-SDK/blob/main/web/README.md#html5)

If you link `player.css` from HTML instead of importing it, publish `fonts.css` and the `fonts/` folder with it. See Typeface of the product panels in the [Player SDK](https://docs.interactivelayers.com/player-sdk.md) guide.

If you use hls.js without the SDK's content clock, or another Media Source player, call `sdk.closeProduct()` when you open other content, so that an open product panel does not stay over it. See How long the product panel stays in the [Player SDK](https://docs.interactivelayers.com/player-sdk.md) guide.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.