Introducing a new way to review your PRs.

Read the announcement

4gray / iptvnator

:tv: Cross-platform IPTV player application with multiple features, such as support of m3u and m3u8 playlists, favorites, TV guide, TV archive/catchup and more.

View on GitHub

26 documents · Updated Nov 23, 2026

docs / provider-portals

Provider portal integrations

Provider portals connect saved IPTV sources to shared channel, catalog, playback, collection, and download experiences. The system keeps each source's identity and access rules with its content while common views let users work across providers without losing the path back to the owning source. See Xtream and Stalker portals for provider differences and Portal catalog and downloads for catalog and offline flows.

Portal integration model

Source identity

A portal source is a saved provider account that defines where content comes from and how the system reaches it. Xtream uses a server address with user credentials. Stalker uses a portal address and device identity, then records the connection details found during discovery.

Each source stays tied to one playlist identity. This boundary keeps content, progress, favorites, recent items, downloads, and navigation separate when providers reuse a title or media ID.

Portal typeAccount identityMain content
XtreamServer address, user name, and passwordLive channels, VOD, and series
StalkerPortal address and MAC address, with discovered portal detailsLive TV, radio, VOD, and series

References: libs/…/portal-account-playlist.utils.ts• L3-39 libs/…/playlist-meta.type.ts• L3-45 libs/…/xtream-code-import.component.ts• L89-180 libs/…/stalker-portal-import.component.ts• L93-117 libs/…/stalker-portal-discovery.service.ts• L129-155

Provider route context

The workspace selects a provider route session from the saved source. That session supplies the active provider and playlist to shared services. Route helpers keep this source context when a user moves between sections, search, favorites, recent items, and detail views.

This context links each visible item to its source. A collection row can reopen in the correct provider route, and a detail view can return to the catalog that produced it. History state also preserves the selected collection scope and return target across browser navigation.

References: libs/…/portal-route.utils.ts• L78-127 libs/…/workspace-portal-navigation.ts• L61-277 libs/…/collection-detail-portal-navigation.ts• L36-223 libs/…/stalker-similar-navigation.ts• L1-27

Portal journey

The portal journey starts with a saved source and ends with a provider-backed action. Shared views manage the user task. The selected provider supplies account data and resolves the source needed for playback, guide data, or download.

This diagram shows how a saved source reaches shared viewing and offline experiences.

flowchart LR
    A[Saved portal source] --> B{Provider type}
    B -->|Xtream| C[Xtream route session]
    B -->|Stalker| D[Stalker route session]
    C --> E[Channels and catalog]
    D --> E
    E --> F[Provider guide and details]
    E --> G[Resolved playback]
    E --> H[Download request]
    E --> I[Second-source browse]
    F --> G
    G --> J[Player]
    H --> K[Offline library]

Playback history records the playlist captured when playback starts. This prevents delayed playback work from writing to a later source. Live and second-source rows resolve current provider data instead of trusting stale source details.

References: libs/…/xtream-feature.routes.ts• L67-166 libs/…/stalker-feature.routes.ts• L49-154 libs/…/stream-resolver.service.ts• L185-243 libs/…/unified-recent-data.service.ts• L270-396 libs/…/second-stream-catalog.service.ts• L69-159

Source health and session continuity

Source health gives shared portal views one answer about whether a saved source can be reached. Desktop can check M3U, Xtream, and Stalker sources. The browser uses the account status that is available to it.

Health checks reuse recent results and share work that is already in progress. Stalker viewing has a separate session need: a full portal requires an active session and keepalive, while a simple request can use direct access.

References: libs/…/source-health.service.ts• L36-175 libs/…/source-health-probes.service.ts• L20-109 libs/…/source-status.service.ts• L32-213 libs/…/stalker-session.service.ts• L59-70 libs/…/stalker-session.service.ts• L175-200

Provider service boundary

Catalog contract

The catalog contract gives shared views one way to show provider content. It covers categories, item lists, search, progress, paging, retry, return position, provider capabilities, source resolution, and optional watch-state data. Each provider maps its own data into this contract without forcing the providers to use the same catalog rules.

Catalog views separate loading, no results, more results, and provider error states. Refinements start a new result set. Provider capabilities control which filters and refinements appear.

References: libs/…/portal-catalog-facade.ts• L28-179 libs/…/category-content-view.component.ts• L103-205 libs/…/xtream-catalog-facade.service.ts• L37-185 libs/…/stalker-catalog-facade.service.ts• L41-229

Categories lead from a provider section to a list and then to a detail view. Search uses the same source context as the catalog, so a result can return to the list that produced it.

Changing search or a refinement starts a new result set and return position. Appending results keeps the current position. Provider errors remain distinct from empty results so the user keeps a retry path.

References: libs/…/category-view.component.ts• L15-100 libs/…/search-layout.component.ts• L32-163 libs/…/stalker-search.component.ts• L1-160 libs/…/search-results.component.ts• L39-52 libs/…/category-content-view.component.ts• L240-355

Category controls

Category controls let users decide which provider groups appear in shared catalog views. The common editor supports search, bulk selection, and source-specific category counts while the provider owns how visibility changes are stored.

The same editor can expose parental locks. Locked and hidden state are separate: visibility changes shape the catalog, while locks protect category access. Stalker can mark censored groups and lock them in bulk. Editors close when the parental lock becomes active again.

References: libs/…/category-editor.component.ts• L23-143 libs/…/category-editor.component.html• L141-245 libs/…/category-management-dialog.component.ts• L96-117 libs/…/stalker-category-lock-dialog.component.ts• L62-155

Local viewing state

Portal views keep viewing state beside provider data. The same source-bound records support resume, watched actions, and series continuation in cards and detail views.

Playback position writes are shared by Xtream and Stalker. They save the newest position at key playback events and keep the original playlist and media identity. This prevents a source switch or late player event from changing progress for another item.

Series continuation follows season and episode order. It can resume an unfinished episode, start the next episode, or report that the series is complete.

References: libs/…/playback-progress.ts• L16-140 libs/…/inline-playback-position-writer.ts• L11-169 libs/…/portal-playback-positions.ts• L54-117 libs/…/series-next-up.ts• L25-125 libs/…/series-quick-start.ts• L35-114

Favorites and recent items

Favorites and recent items form collections across saved sources. Each row keeps its source type, playlist identity, content type, and provider identity. This lets one list mix M3U, Xtream, and Stalker items without losing the route back to the source.

The collection can use one playlist or all playlists. Shared actions route each change to the source that owns the row. Rows that are no longer available can still be removed from history without being shown as playable.

References: libs/…/unified-collection-item.interface.ts• L14-125 libs/…/unified-collection-data.service.ts• L78-174 libs/…/unified-favorites-data.service.ts• L69-169 libs/…/unified-recent-data.service.ts• L61-117 libs/…/unified-recent-data.service.ts• L270-396

Collection actions

The collection workspace provides one shell for favorites and recent items. It can show live channels or shared movie and series grids. The user can scope the view to one playlist or all saved playlists.

Destructive actions require confirmation. Clearing the visible tab removes only the rows currently shown. Collection mutations use the request that loaded those rows, so a scope change during reload cannot clear or reorder another playlist's items. The view drops the cleared type after confirmation and reloads from storage if a favorites write fails. The command palette offers the same action only while the current tab has rows.

References: libs/…/unified-collection-clear-action.ts• L15-145 libs/…/unified-collection-page.component.ts• L163-249 libs/…/unified-collection-page.component.ts• L390-440 libs/…/unified-collection-clear-action.spec.ts• L22-92

Live channel experience

The unified live collection gives saved channels one browsing and playback experience. It combines source-aware search, favorites, recent history, guide data, catch-up, radio playback, and return to the owning portal. The live view also supports opening a channel in its owning playlist instead of only opening the playlist root.

Guide data stays scoped to the source and channel identity. M3U rows use XMLTV data. Xtream and Stalker rows use provider guides and can use source-specific mappings. Catch-up changes a selected programme into a non-live source and can return to the live edge.

When a live row returns to its playlist, each provider uses its own stable locator: an M3U stream URL, an Xtream stream ID, or a Stalker channel ID and genre. Stalker radio uses a separate section and has no equivalent auto-open target.

References: libs/…/stream-resolver.service.ts• L224-331 libs/…/stream-resolver.service.ts• L786-900 libs/…/unified-collection-page.component.ts• L345-365 libs/…/unified-live-selection-view.ts• L150-168 libs/…/live-collection-playlist-navigation.ts• L47-151 libs/…/unified-live-tab.component.ts• L440-450 libs/…/xtream-full-epg.service.ts• L21-54 libs/…/with-stalker-epg.feature.ts• L238-480

Playback resolution

Playback starts with a provider item and ends with a provider-neutral playback description. The description gives the player the source and access data that it needs, including headers, resume data, live state, and content identity.

Xtream builds a source from account data and media identity. Stalker uses a current playlist identity when available, can reuse a safe static link, and otherwise asks the portal for a fresh link. Same-host Stalker streams can need session credentials, while foreign-host streams must not receive portal credentials. Fresh-link playback remains marked so later actions do not treat a temporary URL as permanent. VOD alternatives resolve only when the user asks to play or pin one, so normal catalog browsing does not query every saved provider.

Guide loading follows the source type. M3U uses local programme data. Xtream and Stalker use portal data with mapping and fallback paths. A batch guide load evaluates its time window against one clock snapshot, so all rows in one view use the same provider time.

References: libs/…/portal-playback.interface.ts• L4-23 libs/…/stream-resolver.service.ts• L185-243 libs/…/stream-resolver.service.ts• L426-753 libs/…/stream-resolver.service.ts• L786-900 libs/…/vod-source-resolver.service.ts• L82-183 libs/…/stalker-player-request.utils.ts• L60-152 libs/…/vod-primary-action-position.ts• L12-166

Portal collections

Second-source browsing

Second-source browsing lets the user inspect another saved source or a global collection without replacing the active provider route or player selection. It uses the same source-neutral rows as the main collections.

The view loads source-specific groups and categories, then applies hidden-category and access rules before display and again before playback. It uses XMLTV for M3U guide data and provider resolvers for Xtream and Stalker.

References: libs/…/second-stream-catalog.service.ts• L53-189 libs/…/second-stream-catalog.service.ts• L192-371 libs/…/second-stream-collection.service.ts• L21-89 libs/…/second-stream-epg.service.ts• L19-67

Downloads and offline media

A download is a provider-backed copy of playable media for offline use. The detail view resolves the provider source first, then sends a common request with source identity, display data, and fetch data.

The download workspace separates active transfers, items that need attention, and completed media. Offline detail uses a safe metadata snapshot when the provider is unavailable. If the original source no longer exists, the local file stays available without a false provider link. See Portal catalog and downloads for the detailed flow.

References: libs/…/downloads.service.ts• L16-163 libs/…/download-metadata-snapshot.ts• L170-328 libs/…/downloads.component.ts• L103-205 libs/…/download-offline-detail.component.ts• L104-205

Provider variants

Xtream and Stalker portals

Xtream and Stalker are the supported portal families. They share the source-to-content-to-playback model, but their account keys, discovery rules, catalog behavior, session needs, guide sources, and link creation differ.

Both providers map their data into shared catalog, collection, playback, series, guide, and download contracts. Read Xtream and Stalker portals for the provider comparison. The key boundary is that shared experiences own user tasks while provider services own access and source-specific data rules. Playlist management covers saved source setup, while Viewing experience covers the player-facing side of the flow.

References: libs/…/stalker-portal-discovery.service.ts• L129-255 libs/…/stalker-auth.api.ts• L43-48 libs/…/stalker-auth.api.ts• L260-397 libs/…/xtream-data-source.interface.ts• L178-225 libs/…/pwa-xtream-data-source.ts• L67-175

Change checklist

When these files or sections are changed, remember to consider these:

  • A provider must connect its saved identity to route context, catalog rows, guide data, playback, collections, and downloads.
  • A playlist identity change must stay aligned with progress, favorites, recent items, navigation, second-source browsing, and offline handoff.
  • A shared catalog or playback contract change must preserve optional provider capabilities.
  • Category visibility and parental locks must remain separate and must use the provider's own category identity.
  • A live collection return target must preserve the provider-specific locator and reject rows that cannot be opened safely.
  • A Stalker identity change must keep content kind with reused provider IDs.
  • A guide change must keep source, playlist, channel identity, mappings, provider time, and display offset aligned.
  • A source resolver change must bind the candidate playlist, provider identity, content facts, and playback position to one source.
  • A collection change must keep the loaded request, confirmation scope, storage result, and restored view aligned.
  • A download snapshot change must keep stream and credential URLs out of offline metadata.

Important failure modes

TriggerConsequenceGuard
A source loses its playlist or provider identityAn item can open the wrong provider or update another account.Carry source type, playlist identity, content type, and provider identity through each contract.
A provider route loses its source contextSearch or detail return can open the wrong source.Resolve and validate source context for each handoff.
A provider error becomes an empty catalogThe user loses the retry path and sees a false no-match state.Keep error and no-result states separate.
A category editor writes visibility and lock state as one settingA category can be visible but still unprotected, or protected but hidden for the wrong reason.Keep provider visibility writes and parental-lock writes as separate operations.
A live collection row lacks its provider locatorOpen in playlist falls back to a route that cannot select the channel.Require the M3U URL, Xtream ID, or valid Stalker channel ID before exposing the action.
A Stalker same-host stream skips session credentialsPlayback can fail with an authorization error.Warm or validate the matching session before using a portal-owned static link.
A foreign-host Stalker stream receives portal credentialsCredentials can be sent to an unrelated host.Classify the stream host before building headers or warming the portal session.
A Stalker provider reuses one ID across content kindsAn action can affect the wrong item.Include content kind in the saved identity.
A late playback event uses the current sourceProgress can move to another source or title.Save the identity captured when playback starts.
A collection clear uses a changed scopeRows from another playlist can be removed.Clear the rows captured from the visible tab and confirm before the write.
A favorites write fails after the view changesThe screen can disagree with storage.Reload the collection after a failed clear.
An offline snapshot stores a stream or credential URLOffline metadata can expose access data or point to live media.Keep only safe display data and validated artwork URLs.
A second-source row becomes locked after displayProtected content can reach playback.Check access before display and before source resolution.

Key files

FileWhy to read it
libs/…/playlist-meta.type.tsDefines saved source metadata and provider identity.
libs/…/portal-account-playlist.utils.tsShows account identity for Xtream and Stalker sources.
libs/…/unified-collection-item.interface.tsDefines the source-neutral row used by catalogs and collections.
libs/…/workspace-portal-navigation.tsMaps provider activity and collection rows to source-bound routes.
libs/…/live-collection-playlist-navigation.tsDefines provider-specific targets for opening a live row in its playlist.
libs/…/stream-resolver.service.tsConnects shared rows to provider playback and guide data.
libs/…/unified-collection-data.service.tsOwns collection loading and source-scoped actions.
libs/…/category-editor.component.tsDefines the shared category visibility and lock editing model.
libs/…/unified-collection-page.component.tsCoordinates collection scope, content type, detail state, and safe mutations.
libs/…/second-stream-catalog.service.tsLoads independent cross-source catalogs and checks access.
libs/…/inline-playback-position-writer.tsDefines source-bound resume persistence.
libs/…/download-metadata-snapshot.tsDefines the safe offline metadata boundary.
libs/…/playlist-error-view.component.tsShows the shared source removal flow after a provider error.
libs/…/unified-collection-clear-action.tsShows confirmed collection clearing and command-palette exposure.
libs/…/stalker-portal-discovery.service.tsExplains Stalker endpoint and mode discovery.
libs/…/stalker-player-request.utils.tsDefines Stalker source choices for playback.
libs/…/xtream-data-source.interface.tsDefines the Xtream data-source boundary.
libs/…/xtream-full-epg.service.tsDefines Xtream guide source selection.