# aliyunvideo/aliyunplayer_web architecture

> Architecture diagram of the GitHub repository aliyunvideo/aliyunplayer_web, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/aliyunvideo/aliyunplayer_web
- Repository: https://github.com/aliyunvideo/aliyunplayer_web

## Overview

##### Project type and purpose
- This is a monorepo of front-end demo apps for the ApsaraVideo Player SDK (“AliyunPlayer_Web”). It contains multiple standalone demos (Vue, React, jQuery, custom components, live/VOD, multi-platform, WeChat mini-program) that showcase how to integrate and extend the ApsaraVideo Player with features like playlists, ads, danmu (comments), adaptive bitrate, MQTT‐based comments, etc.

##### File structure
- Top level:
- customComponents/         – demo of custom HTML5 player components
- H5VodVueDemo/             – Vue + Vite demo for VOD
- h5VodDemo/                – jQuery/Webpack + Gulp VOD demo
- h5LiveDemo/               – jQuery/Webpack + Gulp live‐streaming demo
- h5VodReactDemo/           – React + UmiJS demo for VOD
- multiPlatformLiveDemo/    – jQuery/Webpack multi-platform (PC & mobile) live+VOD demo
- vod-mini-program/         – WeChat Mini Program demo
- Root build configs & README
- Each demo has:
- src/ or disk/ – source or built static assets
- build scripts (webpack.config*, gulpfile.js, build_customize.sh)
- package.json, .babelrc, tsconfig* or .umirc.ts

##### README insights
- Each demo is standalone. They all load the ApsaraVideo Player JS/CSS, fetch video streams from the Aliyun CDN, and optionally connect to an MQTT broker (mqttws31.js) for comments/likes. Some use Babel+Webpack4, one uses Vite, one uses UmiJS, one uses the WeChat Mini Program SDK.

##### Capturing essential architectural elements
- On the right, list external services: Player SDK, Aliyun CDN, MQTT Broker, WeChat Runtime

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Build Pipeline
    subgraph "Build Pipeline"
        direction TB
        Babel["Babel"]:::build
        Webpack["Webpack"]:::build
        Vite["Vite"]:::build
        Gulp["Gulp"]:::build
        Umi["UmiJS"]:::build
    end

    %% Demo Applications
    subgraph "Demo Applications"
        direction TB
        customComponents["customComponents<br/>(Custom HTML5 Components)"]:::jquery
        H5VodVueDemo["H5VodVueDemo<br/>(Vue3 + Vite)"]:::vue
        h5VodDemo["h5VodDemo<br/>(jQuery + Webpack + Gulp)"]:::jquery
        h5LiveDemo["h5LiveDemo<br/>(jQuery + Webpack + Gulp)"]:::jquery
        h5VodReactDemo["h5VodReactDemo<br/>(React + UmiJS)"]:::react
        multiPlatformLiveDemo["multiPlatformLiveDemo<br/>(jQuery Multi-platform)"]:::jquery
        vodMiniProgram["vod-mini-program<br/>(WeChat Mini Program)"]:::mini
    end

    %% External Services
    subgraph "External Services"
        direction TB
        PlayerSDK["ApsaraVideo Player SDK"]:::service
        AliyunCDN["Aliyun Video CDN"]:::external
        MQTTBroker["MQTT Broker"]:::external
        WeChatHost["WeChat Host"]:::external
    end

    %% Connections
    Babel --> customComponents
    Webpack --> customComponents
    Gulp --> customComponents

    Babel --> H5VodVueDemo
    Vite --> H5VodVueDemo

    Babel --> h5VodDemo
    Webpack --> h5VodDemo
    Gulp --> h5VodDemo

    Babel --> h5LiveDemo
    Webpack --> h5LiveDemo
    Gulp --> h5LiveDemo

    Babel --> h5VodReactDemo
    Umi --> h5VodReactDemo

    Babel --> multiPlatformLiveDemo
    Webpack --> multiPlatformLiveDemo
    Gulp --> multiPlatformLiveDemo

    Babel --> vodMiniProgram

    %% Demo to services
    customComponents --> PlayerSDK
    H5VodVueDemo --> PlayerSDK
    h5VodDemo --> PlayerSDK
    h5LiveDemo --> PlayerSDK
    h5VodReactDemo --> PlayerSDK
    multiPlatformLiveDemo --> PlayerSDK
    vodMiniProgram --> WeChatHost
    WeChatHost --> PlayerSDK

    customComponents --> AliyunCDN
    H5VodVueDemo --> AliyunCDN
    h5VodDemo --> AliyunCDN
    h5LiveDemo --> AliyunCDN
    h5VodReactDemo --> AliyunCDN
    multiPlatformLiveDemo --> AliyunCDN
    vodMiniProgram --> AliyunCDN

    h5VodDemo --> MQTTBroker
    h5LiveDemo --> MQTTBroker
    multiPlatformLiveDemo --> MQTTBroker

    %% Click Events
    click customComponents "https://github.com/aliyunvideo/aliyunplayer_web/tree/master/customComponents/"
    click H5VodVueDemo "https://github.com/aliyunvideo/aliyunplayer_web/tree/master/H5VodVueDemo/"
    click vite.config.ts "https://github.com/aliyunvideo/aliyunplayer_web/blob/master/H5VodVueDemo/vite.config.ts"
    click App.vue "https://github.com/aliyunvideo/aliyunplayer_web/blob/master/H5VodVueDemo/src/App.vue"
    click h5VodDemo "https://github.com/aliyunvideo/aliyunplayer_web/tree/master/h5VodDemo/"
    click gulpfile.js "https://github.com/aliyunvideo/aliyunplayer_web/blob/master/h5VodDemo/gulpfile.js"
    click webpack.config.js "https://github.com/aliyunvideo/aliyunplayer_web/blob/master/h5VodDemo/webpack.config.js"
    click webpack.production.config.js "https://github.com/aliyunvideo/aliyunplayer_web/blob/master/h5VodDemo/webpack.production.config.js"
    click mqttws31.js "https://github.com/aliyunvideo/aliyunplayer_web/blob/master/h5VodDemo/src/lib/mqttws31.js"
    click h5LiveDemo "https://github.com/aliyunvideo/aliyunplayer_web/tree/master/h5LiveDemo/"
    click gulpfile.js_1 "https://github.com/aliyunvideo/aliyunplayer_web/blob/master/h5LiveDemo/gulpfile.js"
    click webpack.config.js_1 "https://github.com/aliyunvideo/aliyunplayer_web/blob/master/h5LiveDemo/webpack.config.js"
    click webpack.production.config.js_1 "https://github.com/aliyunvideo/aliyunplayer_web/blob/master/h5LiveDemo/webpack.production.config.js"
    click mqttws31.js_1 "https://github.com/aliyunvideo/aliyunplayer_web/blob/master/h5LiveDemo/src/lib/mqttws31.js"
    click h5VodReactDemo "https://github.com/aliyunvideo/aliyunplayer_web/tree/master/h5VodReactDemo/"
    click .umirc.ts "https://github.com/aliyunvideo/aliyunplayer_web/blob/master/h5VodReactDemo/.umirc.ts"
    click index.tsx "https://github.com/aliyunvideo/aliyunplayer_web/blob/master/h5VodReactDemo/src/pages/index.tsx"
    click ThePlayer.tsx "https://github.com/aliyunvideo/aliyunplayer_web/blob/master/h5VodReactDemo/src/pages/components/thePlayer/ThePlayer.tsx"
    click multiPlatformLiveDemo "https://github.com/aliyunvideo/aliyunplayer_web/tree/master/multiPlatformLiveDemo/"
    click gulpfile.js_2 "https://github.com/aliyunvideo/aliyunplayer_web/blob/master/multiPlatformLiveDemo/gulpfile.js"
    click webpack.base.config.js "https://github.com/aliyunvideo/aliyunplayer_web/blob/master/multiPlatformLiveDemo/webpack.base.config.js"
    click webpack.mobile.config.js "https://github.com/aliyunvideo/aliyunplayer_web/blob/master/multiPlatformLiveDemo/webpack.mobile.config.js"
    click webpack.pc.config.js "https://github.com/aliyunvideo/aliyunplayer_web/blob/master/multiPlatformLiveDemo/webpack.pc.config.js"
    click webpack.production.config.js_2 "https://github.com/aliyunvideo/aliyunplayer_web/blob/master/multiPlatformLiveDemo/webpack.production.config.js"
    click vodMiniProgram "https://github.com/aliyunvideo/aliyunplayer_web/tree/master/vod-mini-program/"
    click app.js "https://github.com/aliyunvideo/aliyunplayer_web/blob/master/vod-mini-program/app.js"
    click app.json "https://github.com/aliyunvideo/aliyunplayer_web/blob/master/vod-mini-program/app.json"
    click pages_index "https://github.com/aliyunvideo/aliyunplayer_web/blob/master/vod-mini-program/pages/index/index.js"
    click service_index "https://github.com/aliyunvideo/aliyunplayer_web/blob/master/vod-mini-program/service/index.js"

    %% Styles
    classDef build fill:#f9f,stroke:#333,stroke-width:1px;
    classDef vue fill:#8fd3f4,stroke:#333,stroke-width:1px;
    classDef react fill:#a2d5ab,stroke:#333,stroke-width:1px;
    classDef jquery fill:#f3c969,stroke:#333,stroke-width:1px;
    classDef mini fill:#cccccc,stroke:#333,stroke-width:1px;
    classDef service fill:#ffcc00,stroke:#333,stroke-width:1px;
    classDef external fill:#d3d3d3,stroke:#333,stroke-width:1px;
```
