The FrameTrail player can be initialized directly on your own page in several ways. See the examples folder on GitHub for working implementations of all options below.
<video> elementPoint FrameTrail at a <video> tag already on your page. FrameTrail wraps it and takes control of playback.
Provide an empty <div> container and pass the video URL directly as an init option.
Decorate one or more <video> elements with data-frametrail attributes and call FrameTrail.autoInit() once. Useful when rendering multiple players on a single page.
Supported data attributes:
data-frametrail — marks the element for auto-initializationdata-frametrail-annotations — URL of a W3C annotations JSON filedata-frametrail-language — language code, e.g. en-USdata-frametrail-config — inline JSON configuration object| Option | Purpose |
|---|---|
target | Container selector or DOM element to render the player into |
videoElement | Selector of an existing <video> element to adopt |
videoSource | Direct video URL (MP4, HLS, YouTube, Vimeo, …) |
annotations | URL string, array of URLs, or inline W3C annotation objects |
language | Language code for the UI (e.g. en-US, de-DE) |
config | Configuration object — theme, autohideControls, layout defaults, etc. |
dataPath | Base URL for the _data/ directory (e.g. '../_data/' or a CDN URL); auto-detected when omitted |
server | Base URL for the _server/ PHP backend; auto-detected when omitted (set dataPath without this to force static/CDN mode) |
startID | ID of the hypervideo to open on load |
contents | Array of inline hypervideo and annotation data (bypasses _data/ entirely) |
resources | Array of inline resource definitions |
dataPath and serverWhen the embedding page is in a subdirectory or on a different host than the FrameTrail installation, set dataPath and server explicitly so requests resolve correctly. If both are omitted, FrameTrail auto-detects by probing the default _server/ path. Providing dataPath without server enables static/CDN mode — read-only access to data without a PHP backend.
Pass the complete hypervideo and resource data directly as init options. FrameTrail never touches the _data/ directory, making this approach work in all four storage modes — including in-memory, local folder, and static/CDN mode. Useful for publishing a single self-contained hypervideo.