# Zorn
![Zorn using Milieu Mode](https://md.sudovanilla.org/images/Screenshot%20from%202024-08-16%2016-16-48.png)
A custom video player tailored for MinPluto.
## Installation
To install Zorn for your Astro project, run the following:
```bash
npm install @minpluto/zorn --registry https://npm.sudovanilla.org
```
Zorn uses icons from Iconoir using their Vue package, you'll need to integrate Astro's Vue package if you want to use the custom controls.
Learn how: https://docs.astro.build/en/guides/integrations-guide/vue/#manual-install
## Examples
**Basic Usage**
Import `Zorn` from the package and add it to your page.
```jsx
---
import {Zorn} from '@minpluto/zorn'
---
```
**With Separated Audio Source**
Since Zorn is built for the MinPluto project, there are scenarios where the video source has no audio to get higher quality options, so Zorn has an opion to add a seprated audio source to include.
```jsx
---
import {Zorn} from '@minpluto/zorn'
---
```
Make sure to add `muted` to the `VideoAttributes` option, just in case.
## References
**Title** - `Title`
When the video enters fullscreen, the title of the video will appear in the upper left corner of the screen.
```jsx
```
**Poster** - `Poster`
Setting a thumbnail for the video player is done using the [`poster`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/video#poster) attribute. Just use a valid URL.
```jsx
```
**Video Source** - `Video`
The main part of the video player, is of course the video. You can set any video source you want, local or remote.
Local:
```jsx
```
> Use the `/public/` folder in your Astro project.
Remote:
```jsx
```
**Audio Source** - `Audio`
If you're in a scenario where the video source is missing audio, but you do have the audio itself, you can add that audio source to the video player. A separated `` element is used, this will use a sync function in JavaScript to make sure the video and audio are synced. As before with the video source, it can be local or remote.
Local:
```jsx
```
> Use the `/public/` folder in your Astro project.
Remote:
```jsx
```
**Settings Menu** - `SettingsMenu`
If you want to add additional settings to the player, you can enable the Settings button and add your own menu and sub-menus.
To enable the menu, add the `SettingsMenu` option:
```jsx
```
Then, as a slot, add your menu like so:
```jsx
```
> Use `OpenZornMenu()` as the open menu function. You can use the scripts provided in `/test/` of this package.
You can also add sub-menus with additional scripts you'll need to add:
```jsx
```
**Attributes** - `VideoAttributes` / `AudioAttributes`
If you need to add an addition attribute to either the video and/or audio source, then you can with `VideoAttributes` and `AudioAttributes`.
```jsx
```
**Milieu** - `Milieu`
The Milieu option is an attempt to copy YouTube's ambient player feature. Where it adds a blurry glow around the player. This uses two ``s behind the player to make a smooth transition when it changes.
```jsx
```
**Live** - `Live`
Zorn can stream `.m3u8` content with HLS support added. The HLS support is only added if you add the `Live` option.
Just add the `Live` option with an `.m3u8` source.
```jsx
```
## Compatibility
### Web Browsers
| Browser | Live Streams |Player | CSS | JavaScript |
|--------------------|--------------|-------|-----|------------|
| **Other Browsers**|
| FOSS Browser | ✅ | ✅ | ❌ | ✅ |
| Ladybird | 🔘 | 🔘 | 🔘 | 🔘 |
| **WebKit Browsers**|
| Safari | 🔘 | 🔘 | 🔘 | 🔘 |
| GNOME Web | ✅ | ✅ | ✅*N| ✅ |
| DuckDuckGo | 🔘 | 🔘 | 🔘 | 🔘 |
| **Electron Browsers**|
| Min | 🔘 | ✅ | ✅ | ✅ |
| **Chromium Browsers**|
| Brave | ✅ | ✅ | ✅ | ✅ |
| Chromium | ✅ | ✅ | ✅ | ✅ |
| Google Chrome | ✅ | ✅ | ✅ | ✅ |
| Microsoft Edge | ✅ | ✅ | ✅ | ✅ |
| Opera | ✅ | ✅ | ✅ | ✅ |
| Vivaldi | ✅ | ✅ | ✅ | ✅ |
| Yandex | ✅ | ❌ | ✅ | ❌ |
| **Firefox Browsers**|
| Falkon | ✅ | ✅ | ✅ | ✅ |
| Firefox | ✅ | ✅ | ✅ | ✅ |
| Floorp | ✅ | ✅ | ✅ | ✅ |
| GNU/IceCat | ✅ | ✅ | ✅ | ✅*IC |
| Librewolf | ✅ | ✅ | ✅ | ✅ |
| Mull | ✅ | ✅ | ✅ | ✅ |
| Mullvad | ✅ | ✅ | ✅ | ✅ |
| Tor | 🔘 | 🔘 | 🔘 | 🔘 |
| Waterfox | ✅ | ✅ | ✅ | ✅ |
| **Outdated Browsers**|
| Internet Explorer | 🔘 | 🔘 | 🔘 | 🔘 |
> All browsers are tested as-is out of box. Some functions with ❌ can probably work if you tweak the settings or interact with a built-in extension.
> IC: By default, GNU/IceCat has the LibreJS extension installed, it will block all JS by default if it does not provide a valid license. Examples for settings menu do not provide one nor one is shown in the test version.
> N: The backdrop blur does not work. This should not affect the function of the video player.
## To Do
- [x] Support HLS (HTTP Live Streaming)
- [ ] Touch gestures for mobile