Skip to content

Commit e63a969

Browse files
committed
專案名稱精簡為 **FlexPlyr**,更加簡潔易記。
1 parent 9671abc commit e63a969

25 files changed

+587
-159
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,7 @@ terser.cache.json
1111

1212
# 忽略其他
1313
reset.sh
14-
memo.md
14+
memo.md
15+
16+
# 保留編譯結果資料夾
17+
!dist/

.npmignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,15 @@ Icon?
1414
# 忽略源碼
1515
src/
1616

17+
# 忽略介紹用 html
18+
static/
19+
index.html
20+
1721
# 忽略其他
1822
reset.sh
1923
memo.md
24+
terser.cache.json
25+
terser.config.json
26+
27+
# 保留編譯後的 dist
28+
!dist/

DEPRECATION.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@
44
- `panel`:棄用,改用 `option: { panelItem: xxx }`
55
- `volume`:棄用,改用 `option: { volume: xxx }`
66
- `mute`:棄用,改用 `option: { mute: xxx }`
7-
- `event`:棄用,改用 `when`
7+
- `event`:棄用,改用 `when`
8+
- ESM 版本的 `player`
9+
- 非 ESM 版本的 `PDPlayer`

README.md

Lines changed: 84 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,130 +1,149 @@
1-
# PDPlayerKit (JavaScript Library)
1+
<img src="./static/image/logo.png" width=80>
22

3-
> 模組化 JavaScript 媒體播放器<br>
4-
> 支援 HTML5、YouTube、Vimeo,提供靈活主題與完整控制面板。
3+
# FlexPlyr
54

6-
![](https://img.shields.io/badge/tag-JavaScript%20Library-bb4444)
7-
![](https://img.shields.io/github/size/pardnchiu/PDPlayerKit/dist%2FPDPlayerKit.js)
8-
![](https://img.shields.io/github/license/pardnchiu/PDPlayerKit)<br>
9-
[![](https://img.shields.io/github/v/release/pardnchiu/PDPlayerKit)](https://github.com/pardnchiu/PDPlayerKit)
10-
[![](https://img.shields.io/npm/v/pdplayerkit)](https://www.npmjs.com/package/pdplayerkit)
11-
[![](https://img.shields.io/jsdelivr/npm/hw/pdplayerkit)](https://www.jsdelivr.com/package/npm/pdplayerkit)
5+
*(Previously known as PDPlayerKit, renamed to FlexPlyr starting from version `2.2.4`)*
126

13-
## 特點
7+
> Modular JavaScript Media Player<br>
8+
> Supports HTML5, YouTube, Vimeo with flexible themes and a complete control panel.
149
15-
### 多媒體播放
16-
- 支援多類型:可播放 **HTML5 影片 / 音訊****YouTube****Vimeo**
17-
- 兼容桌面與行動設備,支持 `playsinline`**全螢幕模式** 切換。
10+
![tag](https://img.shields.io/badge/tag-JavaScript%20Library-bb4444)
11+
![size](https://img.shields.io/github/size/pardnchiu/FlexPlyr/dist%2FFlexPlyr.js)
12+
![license](https://img.shields.io/github/license/pardnchiu/FlexPlyr)<br>
13+
[![npm](https://img.shields.io/npm/v/@pardnchiu/flexplyr)](https://www.npmjs.com/package/@pardnchiu/flexplyr)
14+
[![download](https://img.shields.io/npm/dm/@pardnchiu/flexplyr)](https://www.npmjs.com/package/@pardnchiu/flexplyr)
15+
[![jsdeliver](https://img.shields.io/jsdelivr/npm/hm/@pardnchiu/flexplyr)](https://www.jsdelivr.com/package/npm/@pardnchiu/flexplyr)<br>
16+
[![](https://img.shields.io/badge/查閱-中文版本-ffffff)](https://github.com/pardnchiu/FlexPlyr/blob/main/README.zh.md)
1817

19-
### 高度自定義控制面板
20-
- 自由定制按鈕:**播放速率調整****音量控制****進度條** 等功能按需配置。
21-
- 提供多種內建主題: (如 Minimal、Classic、Retro、Simple),方便自由選擇。
18+
## Features
2219

23-
### 輕量與無依賴
24-
- 基於 **原生 API****YouTube / Vimeo API**,無需額外庫,開箱即用。
25-
- 完全移除 **PDRenderKit** 的依賴,減少耦合,提升使用便捷性。
26-
- 文件體積小於 數 KB,即使在行動設備上也能高效運行。
20+
### Multimedia Playback
21+
- Supports multiple formats: Play **HTML5 video/audio**, **YouTube**, and **Vimeo**.
22+
- Compatible with desktop and mobile devices, with `playsinline` and **fullscreen mode** toggle support.
2723

28-
### 全面的事件監聽
29-
- 支持多種事件監聽: (如 ready、playing、pause、end),方便深度擴展。
24+
### Highly Customizable Control Panel
25+
- Customizable buttons: **Playback speed adjustment**, **volume control**, **progress bar**, etc.
26+
- Multiple built-in themes (e.g., Minimal, Classic, Retro, Simple) for flexible selection.
3027

31-
### 多版本支持
32-
- 提供 **ESM (ECMAScript Module)****一般版本**,適用於多種開發環境,靈活集成。
28+
### Lightweight and Dependency-Free
29+
- Built on **native APIs** and **YouTube/Vimeo APIs**, no extra libraries required.
30+
- Completely removes dependency on **PDRenderKit**, reducing coupling and enhancing usability.
31+
- Lightweight with a file size of only a few KB, ensuring smooth performance even on mobile devices.
3332

34-
### 更直觀的控制按鈕
35-
- 按鈕圖示使用 [Google Icons](https://fonts.google.com/icons),清晰、現代,適配各類主題風格。
33+
### Comprehensive Event Listening
34+
- Supports a wide range of events (e.g., ready, playing, pause, end) for seamless extension.
3635

37-
### 友善授權
38-
- 授權從 **GPL 3.0** 調整為 **MIT**,方便自由使用與修改,適應更多商業或個人項目。
36+
### Multi-Version Support
37+
- Provides **ESM (ECMAScript Module)** and **regular versions**, suitable for various development environments.
3938

40-
## 安裝方式
39+
### Intuitive Control Buttons
40+
- Uses [Google Icons](https://fonts.google.com/icons) for button visuals, modern and adaptable to different themes.
4141

42-
### 從 npm 安裝
42+
### Friendly Licensing
43+
- License changed from **GPL 3.0** to **MIT**, offering greater flexibility for commercial and personal projects.
44+
45+
## Installation
46+
47+
### Via npm
4348
```bash
44-
npm i pdplayerkit
49+
npm i @pardnchiu/flexplyr
4550
```
4651

47-
### CDN 引入
48-
- **引入 `PDPlayerKit` 套件**
52+
### Via CDN
53+
- **Import the `FlexPlyr` library**
4954
```html
50-
<script src="https://cdn.jsdelivr.net/npm/pdplayerkit@latest/dist/PDPlayerKit.js"></script>
55+
<!-- Version 2.2.4 and above -->
56+
<script src="https://cdn.jsdelivr.net/npm/@pardnchiu/flexplyr@[VERSION]/dist/FlexPlyr.js"></script>
57+
58+
<!-- Version 2.2.3 and below -->
59+
<script src="https://cdn.jsdelivr.net/npm/pdplayerkit@[VERSION]/dist/PDPlayerKit.js"></script>
5160
```
52-
- **Module 版本**
61+
- **Module Version**
5362
```javascript
54-
import { player as PDPlayer } from "https://cdn.jsdelivr.net/npm/pdplayerkit@latest/dist/PDPlayerKit.module.js";
63+
// Version 2.2.4 and above
64+
import { FPlyr } from "https://cdn.jsdelivr.net/npm/@pardnchiu/flexplyr@[VERSION]/dist/FlexPlyr.esm.js";
65+
66+
// Version 2.2.3 and below
67+
import { player } from "https://cdn.jsdelivr.net/npm/pdplayerkit@[VERSION]/dist/PDPlayerKit.module.js";
5568
```
56-
- **初始化 `editor` 和 `viewer`**
69+
- **Initialize `FPlyr`**
5770
```Javascript
58-
const dom = new PDPlayer({
59-
// 選填:指定元件替換為播放器(元件的 ID)
60-
// 若未指定,需手動將 dom.body 加入至視圖中
61-
// id: "元件 ID",
62-
63-
64-
// 必填:媒體來源設定,以下選項中僅能選擇一項
65-
video: "[影片位置]",
66-
// audio: "[音訊位置]",
71+
// Version 2.2.4 and above
72+
// Unified: FPlyr
73+
74+
// Version 2.2.3 and below
75+
// IIFE: PDPlayer
76+
// ESM: player
77+
78+
const dom = new FPlyr({
79+
// Optional: Specify the element to replace with the player (element ID)
80+
// If not specified, manually append dom.body to the view
81+
// id: "element ID",
82+
83+
// Required: Media source configuration, choose one of the options below
84+
video: "[video source]",
85+
// audio: "[audio source]",
6786
// vimeo: "[Vimeo ID]",
6887
// youtube: "[YouTube ID]"
6988

70-
// 選填:播放設置
89+
// Optional: Playback settings
7190
option: {
72-
// 是否顯示滑桿,預設 true
91+
// Whether to show the slider, default is true
7392
showThumb: true,
7493

75-
// 控制面板外觀風格,例如 "minimal" "classic"
76-
panelType: "[風格選擇]",
94+
// Control panel style, e.g., "minimal" or "classic"
95+
panelType: "[style choice]",
7796

78-
// 控制面板按鈕,依需求選擇顯示的功能
97+
// Control panel buttons, choose functions to display
7998
panel: [
8099
"play", "progress", "time", "timeMini",
81100
"volume", "volumeMini", "rate", "full"
82101
],
83-
// 播放器預設音量
102+
// Default volume level
84103
volume: 100,
85-
// 播放器預設靜音
104+
// Default mute setting
86105
mute: false
87106
},
88107

89-
// 選填:事件監聽器,可監聽播放過程中的特定事件
108+
// Optional: Event listeners to monitor specific events during playback
90109
when: {
91110
ready: function () {
92-
console.log("播放器準備完成");
111+
console.log("Player is ready");
93112
},
94113
playing: function () {
95-
console.log("播放中");
114+
console.log("Playing");
96115
},
97116
pause: function () {
98-
console.log("暫停");
117+
console.log("Paused");
99118
},
100119
end: function () {
101-
console.log("播放結束");
120+
console.log("Playback ended");
102121
},
103122
destroyed: function () {
104-
console.log("已移除");
123+
console.log("Player removed");
105124
}
106125
}
107126
});
108127

109-
// 若無指定元件,需手動將播放器加入至 DOM 中
128+
// If no element is specified, manually append the player to the DOM
110129
(...).appendChild(dom.body);
111130

112-
// 移除元件
113-
// dom.destory();
131+
// Remove the component
132+
// dom.destroy();
114133
```
115134

116135

117-
## 開發者
136+
## Creator
118137

119138
<img src="https://avatars.githubusercontent.com/u/25631760" align="left" width="96" height="96" style="margin-right: 0.5rem;" />
120139

121140
<h4 style="padding-top: 0">邱敬幃 Pardn Chiu</h4>
122141

123142
[![](https://pardn.io/image/mail.svg)](mailto:dev@pardn.io) [![](https://skillicons.dev/icons?i=linkedin)](https://linkedin.com/in/pardnchiu)
124143

125-
## 授權條款
144+
## License
126145

127-
本專案依據 [MIT](https://github.com/pardnchiu/PDPlayerKit/blob/main/LICENSE) 授權使用。
146+
This project is licensed under the [MIT License](https://github.com/pardnchiu/FlexPlyr/blob/main/LICENSE).
128147

129148
***
130149

0 commit comments

Comments
 (0)