zorn/README.md

79 lines
2.4 KiB
Markdown
Raw Normal View History

2023-10-16 15:52:17 -04:00
# Plyx-Player
2023-10-16 17:35:27 -04:00
> Currently in beta stages.
2023-10-17 06:25:22 -04:00
### To Do List
- Add colors as root colors (Make changable by developer)
2023-10-17 13:33:55 -04:00
- Add mobile support
- Create options
2023-10-17 06:25:22 -04:00
- Create layouts
- Create custom context-menu
- Create demo
- Create documentations
2023-11-06 02:09:42 -05:00
- Ignore keyboard shortcuts if an input is active
2023-10-17 06:25:22 -04:00
2023-10-16 17:35:27 -04:00
## Installing
2023-11-06 02:09:42 -05:00
Install from NPM:
2023-10-16 17:35:27 -04:00
```bash
2023-11-06 02:09:42 -05:00
npm install plyx-player
2023-10-16 17:35:27 -04:00
```
## Usage
2023-10-17 06:25:22 -04:00
### HTML5
2023-10-16 17:35:27 -04:00
Add the stylesheet and script:
```html
2023-11-06 02:13:15 -05:00
<link rel="stylesheet" href="/node_modules/plyx-player/src/styles/app.css">
<script src="/node_modules/plyx-player/src/index.js" type="module"></script>
2023-10-16 17:35:27 -04:00
```
2023-10-16 17:56:26 -04:00
Also add the Font Awesome that the Pylx uses:
```html
<script src="https://kit.fontawesome.com/ecedfeb6bc.js" crossorigin="anonymous"></script>
```
<details>
<summary>About this Font Awesome Pro Kit</summary>
This kit is a Pro kit provided by SudoVanilla, it has only a limited amount icons that can be used since subsetting is used.
</details>
2023-10-16 17:35:27 -04:00
Then, add the class name `plyx-player` to the `<video>` element and make sure it's wrapped around a div contained with the class name `video-container`:
```html
<div class="video-container">
<video class="plyx-player" src="video.mp4"></video>
</div>
```
2023-10-17 06:25:22 -04:00
___
### Express
Route the files required for Pylx Player to work in Express (Tested with PokeTube):
```
2023-11-06 02:13:15 -05:00
const PylxDirectory = "./node_modules/plyx-player"
2023-10-17 06:25:22 -04:00
module.exports = function (app, config, renderTemplate) {
app.get("/player/index.js", function (req, res) {res.sendFile("/src/index.js", { root: PylxDirectory })})
app.get("/player/index.css", function (req, res) {res.sendFile("/src/styles/app.css", { root: PylxDirectory })})
app.get("/player/functions/buttons.js", function (req, res) {res.sendFile("/src/functions/buttons.js", { root: PylxDirectory })})
app.get("/player/functions/length.js", function (req, res) {res.sendFile("/src/functions/length.js", { root: PylxDirectory })})
}
```
Add the stylesheet and script:
```html
<link rel="stylesheet" href="/player/index.css">
<script src="/player/index.js" type="module"></script>
```
2023-11-06 18:07:48 -05:00
Also add the Font Awesome Kit that is included with Plyx:
2023-10-17 06:25:22 -04:00
```html
2023-11-06 18:07:48 -05:00
<script src="/node_modules/plyx-player/src/icons/fa-kit/js/all.js" crossorigin="anonymous"></script>
2023-10-17 06:25:22 -04:00
```
Then, add the class name `plyx-player` to the `<video>` element and make sure it's wrapped around a div contained with the class name `video-container`:
```html
<div class="video-container">
<video class="plyx-player" src="video.mp4"></video>
</div>