Streams (playable content)
Fantastic! Your add-on now provides catalogs and detailed metadata. But users still can't actually watch anything. Let's add streams - the actual video sources that users can play.
Streams are like links to the real media files. They don't contain the videos themselves, but they tell EMET Surf where to find and play the content.
Understanding streams
Think of streams as a playlist of different ways to watch the same content. A movie might be available as:
- A direct web link
- A torrent file
- A local file
Users can choose which stream to use based on their preferences and internet connection.
Updating your manifest
Adding stream support is simple - just add "stream" to your resources:
{
"id": "my.first.emet.addon",
"version": "1.0.0",
"name": "Hello, World",
"description": "My first EMET Surf add-on",
"logo": "https://example.com/logo-256.png",
"resources": [
"catalog",
{
"name": "meta",
"types": ["movie"],
"idPrefixes": ["hiwrld_"]
},
"stream"
],
"types": ["movie"],
"catalogs": [
{"id": "movieCatalog", "type": "movie", "name": "Hello, Movies"}
]
}
What changed:
- Added
"stream"to theresourcesarray
Creating the stream structure
EMET Surf expects stream files in a specific folder structure. Create the directories:
On Windows:
mkdir stream
mkdir stream\movie
On Mac/Linux:
mkdir -p stream/movie
Your file structure should now look like:
my-emet-addon/
├── manifest.json
├── catalog/
│ └── movie/
│ └── movieCatalog.json
├── meta/
│ └── movie/
│ └── hiwrld_jellyfish.json
└── stream/
└── movie/
├── tt0032138.json
├── tt0017136.json
└── hiwrld_jellyfish.json
Adding streams for your movies
Now let's create stream files for each movie. The filename must match the content ID.
The Wizard of Oz (torrent stream)
Create stream/movie/tt0032138.json:
{
"streams": [
{
"title": "Torrent - HD Quality",
"infoHash": "1588987DB4C7D98F74FB436AD8FEDE1CBE9F1F63"
}
]
}
This provides a torrent-based stream using an info hash.
Metropolis (direct URL stream)
Create stream/movie/tt0017136.json:
{
"streams": [
{
"title": "Direct Stream - HD Quality",
"url": "https://example.com/metropolis-hd.mp4"
}
]
}
This provides a direct URL stream for the movie.
Jellyfish (multiple quality options)
Create stream/movie/hiwrld_jellyfish.json:
{
"streams": [
{
"title": "Web Stream - 3 Mbps HD",
"url": "http://jell.yfish.us/media/jellyfish-3-mbps-hd-h264.mkv"
},
{
"title": "Web Stream - 15 Mbps HD",
"url": "http://jell.yfish.us/media/jellyfish-15-mbps-hd-h264.mkv"
},
{
"title": "Web Stream - 120 Mbps 4K",
"url": "http://jell.yfish.us/media/jellyfish-120-mbps-4k-uhd-h264.mkv"
}
]
}
This provides multiple quality options for the same content.
Understanding stream types
EMET Surf supports various stream types:
Direct URLs:
{
"title": "Direct Download",
"url": "https://example.com/movie.mp4"
}
Torrent files:
{
"title": "Torrent",
"infoHash": "1588987DB4C7D98F74FB436AD8FEDE1CBE9F1F63"
}
External streams:
{
"title": "External Player",
"externalUrl": "https://example.com/stream"
}
Important stream rules
Always provide valid responses: If you can't provide streams for a particular item, return an empty array:
{
"streams": []
}
Multiple streams per item: You can provide multiple streams for the same content, giving users choice:
{
"streams": [
{"title": "HD Quality", "url": "https://example.com/hd.mp4"},
{"title": "4K Quality", "url": "https://example.com/4k.mp4"},
{"title": "Torrent", "infoHash": "1234567890ABCDEF"}
]
}
Stream titles matter: Use descriptive titles that help users choose the right stream:
- "HD Quality - 1080p"
- "Mobile Optimized - 480p"
- "Torrent - Full Quality"
Testing your streams
- Update your manifest with the stream resource
- Create the stream files for each movie
- Reinstall your add-on in EMET Surf
- Click on any movie - you should see stream options on the right side!
Watch your server logs for stream requests:
GET /stream/movie/tt0032138.json 200 1.5ms - 89
GET /stream/movie/hiwrld_jellyfish.json 200 2.3ms - 234
What you've accomplished
- Added stream support to your add-on
- Created multiple stream types (URL, torrent)
- Provided quality options for users
- Learned about stream file structure
- Understood different stream formats
What's next?
Congratulations! Your add-on is now fully functional - users can browse catalogs, read detailed information, and actually watch content!
In the next step, we'll explore series content (TV shows with multiple episodes) to make your add-on even more powerful.
Summary
- Streams provide the actual playable content
- Add
"stream"to your manifest resources - Create stream files at
stream/type/id.json - Support multiple stream types: URLs, torrents, etc.
- Always return valid responses (empty array if no streams available)
- Your add-on now provides fully playable content!