# zabique/reolink2samsung architecture

> Architecture diagram of the GitHub repository zabique/reolink2samsung, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/zabique/reolink2samsung
- Repository: https://github.com/zabique/reolink2samsung

## Overview

Reolink2Samsung is a Samsung Tizen TV viewer for Reolink cameras and NVRs. The viewer settings configure the connection and display; the live view cycles through camera snapshots, while full-screen playback provides stream controls, quality selection, and camera navigation. PTZ commands and patrol are additional viewing capabilities. Streams can come directly from the NVR over HTTP-FLV or pass through the bundled RTSP relay for playback. The graph separates interface and control responsibilities within the main app file. Source excerpts are partial, so links between unsampled subsystems are limited to README-documented relationships.

Main entry points: [`src/js/app.js`](https://github.com/zabique/reolink2samsung/blob/main/src/js/app.js) (Full-Screen Player), [`src/service/relay.js`](https://github.com/zabique/reolink2samsung/blob/main/src/service/relay.js) (RTSP Relay), [`src/js/i18n.js`](https://github.com/zabique/reolink2samsung/blob/main/src/js/i18n.js) (Translations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_viewing["Camera Viewing"]
  node_live_view["Live View<br/>[app.js]"]
  node_snapshots["Camera Snapshots<br/>[app.js]"]
  node_full_screen["Full-Screen Player<br/>[app.js]"]
end

subgraph group_controls["Playback Controls"]
  node_playback_controls["Playback Controls<br/>[app.js]"]
  node_ptz["PTZ Controls<br/>[app.js]"]
  node_patrol["Camera Patrol<br/>[app.js]"]
end

subgraph group_connectivity["Stream Connectivity"]
  node_rtsp_relay["RTSP Relay<br/>[relay.js]"]
  node_tv_player["TV Playback Runtime<br/>[app.js]"]
end

subgraph group_configuration["Settings And Language"]
  node_settings["Settings<br/>[app.js]"]
  node_translations["Translations<br/>[i18n.js]"]
end

node_viewer(("TV Viewer"))
node_nvr["Reolink NVR"]

node_viewer -->|"uses"| node_live_view
node_live_view -->|"loads previews"| node_snapshots
node_live_view -->|"opens camera"| node_full_screen
node_full_screen -->|"offers controls"| node_playback_controls
node_full_screen -->|"cycles cameras"| node_patrol
node_playback_controls -->|"opens controls"| node_ptz
node_settings -->|"uses language strings"| node_translations
node_settings -->|"configures connection"| node_nvr
node_snapshots -->|"requests snapshots"| node_nvr
node_ptz -->|"sends PTZ commands"| node_nvr
node_full_screen -->|"plays HTTP-FLV"| node_nvr
node_full_screen -->|"requests RTSP stream"| node_rtsp_relay
node_rtsp_relay -->|"opens RTSP session"| node_nvr
node_rtsp_relay -->|"serves playable stream"| node_tv_player
node_tv_player -->|"plays stream"| node_full_screen

click node_live_view "https://github.com/zabique/reolink2samsung/blob/main/src/js/app.js"
click node_snapshots "https://github.com/zabique/reolink2samsung/blob/main/src/js/app.js"
click node_full_screen "https://github.com/zabique/reolink2samsung/blob/main/src/js/app.js"
click node_playback_controls "https://github.com/zabique/reolink2samsung/blob/main/src/js/app.js"
click node_ptz "https://github.com/zabique/reolink2samsung/blob/main/src/js/app.js"
click node_patrol "https://github.com/zabique/reolink2samsung/blob/main/src/js/app.js"
click node_settings "https://github.com/zabique/reolink2samsung/blob/main/src/js/app.js"
click node_translations "https://github.com/zabique/reolink2samsung/blob/main/src/js/i18n.js"
click node_rtsp_relay "https://github.com/zabique/reolink2samsung/blob/main/src/service/relay.js"
click node_tv_player "https://github.com/zabique/reolink2samsung/blob/main/src/js/app.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_live_view,node_snapshots,node_full_screen,node_viewer toneBlue
class node_playback_controls,node_ptz,node_patrol toneAmber
class node_rtsp_relay,node_tv_player toneMint
class node_settings,node_translations toneRose
class node_nvr toneIndigo
```

## Components

### Camera Viewing

- [Live View](https://github.com/zabique/reolink2samsung/blob/main/src/js/app.js): `src/js/app.js`
- [Camera Snapshots](https://github.com/zabique/reolink2samsung/blob/main/src/js/app.js): `src/js/app.js`
- [Full-Screen Player](https://github.com/zabique/reolink2samsung/blob/main/src/js/app.js): `src/js/app.js`

### Playback Controls

- [Playback Controls](https://github.com/zabique/reolink2samsung/blob/main/src/js/app.js): `src/js/app.js`
- [PTZ Controls](https://github.com/zabique/reolink2samsung/blob/main/src/js/app.js): `src/js/app.js`
- [Camera Patrol](https://github.com/zabique/reolink2samsung/blob/main/src/js/app.js): `src/js/app.js`

### Stream Connectivity

- [RTSP Relay](https://github.com/zabique/reolink2samsung/blob/main/src/service/relay.js): `src/service/relay.js`
- [TV Playback Runtime](https://github.com/zabique/reolink2samsung/blob/main/src/js/app.js): `src/js/app.js`

### Settings And Language

- [Settings](https://github.com/zabique/reolink2samsung/blob/main/src/js/app.js): `src/js/app.js`
- [Translations](https://github.com/zabique/reolink2samsung/blob/main/src/js/i18n.js): `src/js/i18n.js`

### Other components

- **TV Viewer**
- **Reolink NVR**

## Connections

- TV Viewer → Live View: uses (evidence: `README.md`)
- Live View → Camera Snapshots: loads previews (evidence: `README.md`)
- Live View → Full-Screen Player: opens camera (evidence: `README.md`)
- Full-Screen Player → Playback Controls: offers controls (evidence: `README.md`)
- Full-Screen Player → Camera Patrol: cycles cameras (evidence: `README.md`)
- Playback Controls → PTZ Controls: opens controls (evidence: `README.md`)
- Settings → Translations: uses language strings (evidence: `src/js/app.js`)
- Settings → Reolink NVR: configures connection (evidence: `README.md`)
- Camera Snapshots → Reolink NVR: requests snapshots (evidence: `README.md`)
- PTZ Controls → Reolink NVR: sends PTZ commands (evidence: `src/js/app.js`)
- Full-Screen Player → Reolink NVR: plays HTTP-FLV (evidence: `README.md`)
- Full-Screen Player → RTSP Relay: requests RTSP stream (evidence: `README.md`)
- RTSP Relay → Reolink NVR: opens RTSP session (evidence: `src/service/relay.js`)
- RTSP Relay → TV Playback Runtime: serves playable stream (evidence: `README.md`)
- TV Playback Runtime → Full-Screen Player: plays stream (evidence: `src/js/app.js`)
