Skip to content

Commit

Permalink
feat: add react vod demo (#341)
Browse files Browse the repository at this point in the history
  • Loading branch information
youcheng-yc authored Nov 20, 2024
1 parent d36757d commit 46986ed
Show file tree
Hide file tree
Showing 27 changed files with 13,659 additions and 0 deletions.
9 changes: 9 additions & 0 deletions h5VodReactDemo/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/node_modules
/.env.local
/.umirc.local.ts
/config/config.local.ts
/src/.umi
/src/.umi-production
/src/.umi-test
/dist
.swc
2 changes: 2 additions & 0 deletions h5VodReactDemo/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
registry=https://registry.npmmirror.com/

11 changes: 11 additions & 0 deletions h5VodReactDemo/.umirc.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { defineConfig } from "umi";
export default defineConfig({
routes: [
{ path: "/", component: "index" },
// { path: "/docs", component: "docs" },
],
headScripts: [
'https://player.alicdn.com/lib/aliplayercomponents-1.1.1.min.js',
],
npmClient: 'npm',
});
27 changes: 27 additions & 0 deletions h5VodReactDemo/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
## Demo of React-based ApsaraVideo Player

Other Languages: [简体中文](https://github.com/aliyunvideo/AliyunPlayer_Web/blob/master/H5VodReactDemo/README.zh_CN.md)

This demo is a React-based single-page application that uses ApsaraVideo Player SDK for web to play on-demand videos. This demo provides features such as playlist, memory playback, and advertisement. For more information, see [ApsaraVideo Player for web.](https://help.aliyun.com/document_detail/125570.html)

## Usage

### Install dependencies

This demo depends on [React](https://react.dev/), [UmiJS](https://umijs.org/)

```bash
$ npm install
```

### Development environment

```bash
$ npm run start
```

### Publish the application

```bash
$ npm run build
```
27 changes: 27 additions & 0 deletions h5VodReactDemo/README.zh_CN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
## 阿里云 React 播放器 demo

其他语言: [English](https://github.com/aliyunvideo/AliyunPlayer_Web/blob/master/H5VodReactDemo/README.md)

基于 React/UmiJS 的播放器单页应用, 利用 web 播放器 sdk 进行视频点播,包含播放列表、记忆播放、广告等功能 [Web播放器文档](https://help.aliyun.com/document_detail/125570.html)

## 如何使用

### 安装依赖

主要依赖有 [React](https://react.dev/), [UmiJS](https://umijs.org/)

```bash
$ npm install
```

### 开发

```bash
$ npm run start
```

### 发布

```bash
$ npm run build
```
1 change: 1 addition & 0 deletions h5VodReactDemo/env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
declare module "aliyun-aliplayer";
11 changes: 11 additions & 0 deletions h5VodReactDemo/global.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export {};
class StartADComponent {}
class MemoryPlayComponent {}
declare global {
interface Window {
AliPlayerComponent: {
StartADComponent: StartADComponent;
MemoryPlayComponent: MemoryPlayComponent;
};
}
}
Loading

0 comments on commit 46986ed

Please sign in to comment.