Making clips
Origin and links
Write where a clip came from into its metadata, with a deep link back to the moment.
origin says where a clip came from. Splice writes it into the MP4's metadata, with a link back to the clipped moment.
await createSplice({
source,
start: 42,
end: 52,
origin: {
url: location.href,
title: 'The interview',
publisher: 'Example News',
player: 'interview',
},
})
| Field | Description |
|---|---|
url | The page the viewer was watching |
title | Written as the title |
publisher | Written as the artist |
player | The player's deep-link id, so the link names it on a page with several |
The metadata carries the title, the publisher as artist, the link as the comment, a one-line description and the date. Without an origin the clip has no tags, and the source's own are never carried over, since they can hold things (a location, a device) that don't describe the clip.
The link
createClipLink(origin, start, end) builds the link: the origin's URL with #ml-t=<start>,<end> in its hash, plus &ml-player=<id> when player is given. That's the form video-player's deep links read: a player with deep-link on seeks to the range and highlights it.
createClipLink({ url: 'https://example.com/interview', player: 'interview' }, 42, 52)
// 'https://example.com/interview#ml-t=42,52&ml-player=interview'
The link replaces any hash the URL had.