# piwigo/piwigo-videojs architecture

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

- Interactive diagram: https://gitdiagram.com/piwigo/piwigo-videojs
- Repository: https://github.com/piwigo/piwigo-videojs

## Overview

Piwigo VideoJS adds video metadata synchronization, poster and thumbnail generation, and browser playback to a Piwigo gallery. The documented workflow is to upload video media, then synchronize metadata and generate posters/thumbnails from plugin administration or photo/batch editing. Playback builds video sources and player options for the gallery view. The README supports the processing capabilities, but the implementation of the sync and tool adapters was not excerpted; those links are shown as unverified. The bundled Video.js versions are represented as player assets.

Main entry points: [`main.inc.php`](https://github.com/piwigo/piwigo-videojs/blob/master/main.inc.php) (Video playback), [`include/function_sync.php`](https://github.com/piwigo/piwigo-videojs/blob/master/include/function_sync.php) (Metadata sync), [`include/function_metadata.php`](https://github.com/piwigo/piwigo-videojs/blob/master/include/function_metadata.php) (Metadata extraction), [`admin/admin.php`](https://github.com/piwigo/piwigo-videojs/blob/master/admin/admin.php) (Plugin administration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_admin["Administration"]
  node_admin_ui["Plugin administration<br/>[admin.php]"]
  node_configuration["Plugin settings<br/>[admin_config.php]"]
  node_batch_edit["Batch manager"]
  node_photo_edit["Photo editing<br/>[admin_photo.php]"]
end

subgraph group_processing["Media processing"]
  node_sync["Metadata sync<br/>[function_sync.php]"]
  node_metadata["Metadata extraction"]
  node_exiftool["ExifTool adapter<br/>[exiftool.php]"]
  node_ffprobe["FFprobe adapter<br/>[ffprobe.php]"]
  node_mediainfo["MediaInfo adapter<br/>[mediainfo.php]"]
  node_posters["Poster generation<br/>[function_sync.php]"]
  node_thumbnails["Video thumbnails<br/>[function_sync.php]"]
end

subgraph group_playback["Gallery playback"]
  node_gallery_integration["Piwigo integration<br/>[main.inc.php]"]
  node_video_player["Video playback<br/>[main.inc.php]"]
  node_templates["Player templates"]
end

subgraph group_assets["Player assets"]
  node_videojs4["Video.js v4<br/>[video.dev.js]"]
  node_videojs5["Video.js v5<br/>[video.js]"]
  node_videojs6["Video.js v6<br/>[video.js]"]
  node_videojs7["Video.js v7<br/>[video.js]"]
  node_ie8shim5["IE8 compatibility<br/>[videojs-ie8.js]"]
  node_ie8shim6["IE8 compatibility<br/>[videojs-ie8.js]"]
end

node_gallery_user(("Gallery user"))
node_piwigo["Piwigo gallery"]
node_ffmpeg["FFmpeg"]

node_gallery_user -->|"uploads videos"| node_piwigo
node_piwigo -.->|"opens plugin tools"| node_admin_ui
node_piwigo -->|"offers batch action"| node_batch_edit
node_piwigo -->|"offers photo action"| node_photo_edit
node_admin_ui -.->|"starts synchronization"| node_sync
node_batch_edit -.->|"starts synchronization"| node_sync
node_photo_edit -.->|"starts synchronization"| node_sync
node_configuration -.->|"sets sync options"| node_sync
node_sync -.->|"requests extraction"| node_metadata
node_metadata -.->|"uses when available"| node_exiftool
node_metadata -.->|"uses when available"| node_ffprobe
node_metadata -.->|"uses when available"| node_mediainfo
node_sync -->|"generates posters"| node_posters
node_sync -->|"generates thumbnails"| node_thumbnails
node_posters -.->|"uses when available"| node_ffmpeg
node_piwigo -.->|"loads plugin"| node_gallery_integration
node_gallery_integration -->|"assembles playback"| node_video_player
node_video_player -->|"selects template"| node_templates
node_gallery_user -.->|"views video"| node_video_player
node_video_player -.->|"uses player assets"| node_videojs4
node_video_player -.->|"uses player assets"| node_videojs5
node_video_player -.->|"uses player assets"| node_videojs6
node_video_player -.->|"uses player assets"| node_videojs7
node_videojs5 -.->|"supports legacy browsers"| node_ie8shim5
node_videojs6 -.->|"supports legacy browsers"| node_ie8shim6

click node_admin_ui "https://github.com/piwigo/piwigo-videojs/blob/master/admin/admin.php"
click node_configuration "https://github.com/piwigo/piwigo-videojs/blob/master/admin/admin_config.php"
click node_batch_edit "https://github.com/piwigo/piwigo-videojs/blob/master/admin/admin_batchmanager.php"
click node_photo_edit "https://github.com/piwigo/piwigo-videojs/blob/master/admin/admin_photo.php"
click node_sync "https://github.com/piwigo/piwigo-videojs/blob/master/include/function_sync.php"
click node_metadata "https://github.com/piwigo/piwigo-videojs/blob/master/include/function_metadata.php"
click node_exiftool "https://github.com/piwigo/piwigo-videojs/blob/master/include/exiftool.php"
click node_ffprobe "https://github.com/piwigo/piwigo-videojs/blob/master/include/ffprobe.php"
click node_mediainfo "https://github.com/piwigo/piwigo-videojs/blob/master/include/mediainfo.php"
click node_posters "https://github.com/piwigo/piwigo-videojs/blob/master/include/function_sync.php"
click node_thumbnails "https://github.com/piwigo/piwigo-videojs/blob/master/include/function_sync.php"
click node_gallery_integration "https://github.com/piwigo/piwigo-videojs/blob/master/main.inc.php"
click node_video_player "https://github.com/piwigo/piwigo-videojs/blob/master/main.inc.php"
click node_templates "https://github.com/piwigo/piwigo-videojs/tree/master/template"
click node_videojs4 "https://github.com/piwigo/piwigo-videojs/blob/master/video-js-4/video.dev.js"
click node_videojs5 "https://github.com/piwigo/piwigo-videojs/blob/master/video-js-5/video.js"
click node_videojs6 "https://github.com/piwigo/piwigo-videojs/blob/master/video-js-6/video.js"
click node_videojs7 "https://github.com/piwigo/piwigo-videojs/blob/master/video-js-7/video.js"
click node_ie8shim5 "https://github.com/piwigo/piwigo-videojs/blob/master/video-js-5/ie8/videojs-ie8.js"
click node_ie8shim6 "https://github.com/piwigo/piwigo-videojs/blob/master/video-js-6/ie8/videojs-ie8.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_admin_ui,node_configuration,node_batch_edit,node_photo_edit,node_gallery_user toneBlue
class node_sync,node_metadata,node_exiftool,node_ffprobe,node_mediainfo,node_posters,node_thumbnails toneAmber
class node_gallery_integration,node_video_player,node_templates toneMint
class node_videojs4,node_videojs5,node_videojs6,node_videojs7,node_ie8shim5,node_ie8shim6 toneRose
class node_piwigo,node_ffmpeg toneIndigo
```

## Components

### Administration

- [Plugin administration](https://github.com/piwigo/piwigo-videojs/blob/master/admin/admin.php): `admin/admin.php`
- [Plugin settings](https://github.com/piwigo/piwigo-videojs/blob/master/admin/admin_config.php): `admin/admin_config.php`
- [Batch manager](https://github.com/piwigo/piwigo-videojs/blob/master/admin/admin_batchmanager.php): `admin/admin_batchmanager.php`
- [Photo editing](https://github.com/piwigo/piwigo-videojs/blob/master/admin/admin_photo.php): `admin/admin_photo.php`

### Media processing

- [Metadata sync](https://github.com/piwigo/piwigo-videojs/blob/master/include/function_sync.php): `include/function_sync.php`
- [Metadata extraction](https://github.com/piwigo/piwigo-videojs/blob/master/include/function_metadata.php): `include/function_metadata.php`
- [ExifTool adapter](https://github.com/piwigo/piwigo-videojs/blob/master/include/exiftool.php): `include/exiftool.php`
- [FFprobe adapter](https://github.com/piwigo/piwigo-videojs/blob/master/include/ffprobe.php): `include/ffprobe.php`
- [MediaInfo adapter](https://github.com/piwigo/piwigo-videojs/blob/master/include/mediainfo.php): `include/mediainfo.php`
- [Poster generation](https://github.com/piwigo/piwigo-videojs/blob/master/include/function_sync.php): `include/function_sync.php`
- [Video thumbnails](https://github.com/piwigo/piwigo-videojs/blob/master/include/function_sync.php): `include/function_sync.php`

### Gallery playback

- [Piwigo integration](https://github.com/piwigo/piwigo-videojs/blob/master/main.inc.php): `main.inc.php`
- [Video playback](https://github.com/piwigo/piwigo-videojs/blob/master/main.inc.php): `main.inc.php`
- [Player templates](https://github.com/piwigo/piwigo-videojs/tree/master/template): `template`

### Player assets

- [Video.js v4](https://github.com/piwigo/piwigo-videojs/blob/master/video-js-4/video.dev.js): `video-js-4/video.dev.js`
- [Video.js v5](https://github.com/piwigo/piwigo-videojs/blob/master/video-js-5/video.js): `video-js-5/video.js`
- [Video.js v6](https://github.com/piwigo/piwigo-videojs/blob/master/video-js-6/video.js): `video-js-6/video.js`
- [Video.js v7](https://github.com/piwigo/piwigo-videojs/blob/master/video-js-7/video.js): `video-js-7/video.js`
- [IE8 compatibility](https://github.com/piwigo/piwigo-videojs/blob/master/video-js-5/ie8/videojs-ie8.js): `video-js-5/ie8/videojs-ie8.js`
- [IE8 compatibility](https://github.com/piwigo/piwigo-videojs/blob/master/video-js-6/ie8/videojs-ie8.js): `video-js-6/ie8/videojs-ie8.js`

### Other components

- **Gallery user**
- **Piwigo gallery**
- **FFmpeg**

## Connections

- Gallery user → Piwigo gallery: uploads videos (evidence: `README.md`)
- Piwigo gallery → Plugin administration: opens plugin tools
- Piwigo gallery → Batch manager: offers batch action (evidence: `README.md`)
- Piwigo gallery → Photo editing: offers photo action (evidence: `README.md`)
- Plugin administration → Metadata sync: starts synchronization
- Batch manager → Metadata sync: starts synchronization
- Photo editing → Metadata sync: starts synchronization
- Plugin settings → Metadata sync: sets sync options
- Metadata sync → Metadata extraction: requests extraction
- Metadata extraction → ExifTool adapter: uses when available
- Metadata extraction → FFprobe adapter: uses when available
- Metadata extraction → MediaInfo adapter: uses when available
- Metadata sync → Poster generation: generates posters (evidence: `README.md`)
- Metadata sync → Video thumbnails: generates thumbnails (evidence: `README.md`)
- Poster generation → FFmpeg: uses when available (evidence: `README.md`)
- Piwigo gallery → Piwigo integration: loads plugin
- Piwigo integration → Video playback: assembles playback (evidence: `main.inc.php`)
- Video playback → Player templates: selects template (evidence: `main.inc.php`)
- Gallery user → Video playback: views video
- Video playback → Video.js v4: uses player assets
- Video playback → Video.js v5: uses player assets
- Video playback → Video.js v6: uses player assets
- Video playback → Video.js v7: uses player assets
- Video.js v5 → IE8 compatibility: supports legacy browsers
- Video.js v6 → IE8 compatibility: supports legacy browsers
