Live-URL mapping
On Pro and Business, a JSON source can be a link instead of a file. Paste the link and Smart Code checks it straight away, then fetches it on its own from then on and serves the result to Mega Player. Update your feed and codes follow within about two minutes.
Feeds in the Smart Code format
If the link returns a Smart Code document ("format": "smartcode"), it is used as it is. Feeds still using the old name "megaplayer" are converted automatically. The document is checked like a pasted one, and every fetch is checked again. A fetch that fails the check is not served; viewers keep getting the last good copy.
Other JSON feeds
Many panels and CMSs already publish a JSON list of channels. Smart Code reads such a list automatically and turns it into live channels: it finds the first list of items in the feed (at the top level, or up to two levels down) and recognises these keys in each item.
Categories are created from the values found and numbered 1, 2, 3… in the order they first appear.
If your feed uses other key names, or you need movies, series, stream types or "player": "webview", publish it in the Smart Code format instead (see Mega JSON format). Then nothing needs recognising.
As soon as you enter the link, Smart Code checks it and shows the first channels it found, so you can see the result before you save.
Skipped items
An item is left out when its name is missing, or when its stream link is missing or isn't a link (scheme://…). The check shows how many items were skipped.
How fetching works
- Smart Code keeps a copy of the feed. A copy younger than 2 minutes is served as it is.
- When a player asks and the copy is older, the player gets the copy right away and Smart Code fetches a fresh one in the background.
- If your feed is down, viewers keep getting the last good copy for up to 24 hours. After that, Mega Player shows that the provider's service is unavailable until the feed is back.
- Fetches time out after 10 seconds and must return less than 10 MB. They come from Smart Code's servers, so the feed must be reachable from the public internet.
The code's Source tab shows when the feed was last fetched, and whether the last attempt failed.