Zorn/docs/setting-menus.mdx

109 lines
2.9 KiB
Text
Raw Normal View History

2024-12-01 01:44:43 -05:00
---
Title: Setting Menus
Type: Document
---
import {Code} from "astro:components"
2024-12-01 01:44:43 -05:00
import {Zorn} from "@minpluto/zorn"
2025-02-05 22:47:26 -05:00
<Zorn
PlayerName="ennie_and_yoyki"
Poster="https://ocean.sudovanilla.org/media/videos/Ennie%20and%20Yoyki/Poster.png"
Video="https://ocean.sudovanilla.org/media/videos/Ennie%20and%20Yoyki/Ennie%20and%20Yoyki:%20Non-Girly%20Games.mp4"
ShowPlaybackRate
Settings={
[
{
"Type": "Button",
"Name": "Stats for Geeks",
"Action": "null",
},
{
"Type": "Separator"
},
{
"Type": "Link",
"Name": "Open Video URL",
"Action": "#",
},
{
"Type": "Link",
"Name": "Download",
"Action": "#",
},
{
"Type": "Link",
"Name": "Embed",
"Action": "#",
},
{
"Type": "Separator"
},
]
}
/>
2025-02-05 17:47:18 -05:00
## Automated items
2024-12-01 01:44:43 -05:00
2025-02-05 17:47:18 -05:00
When enabling certain functions and features of Zorn, certain items will automatically be added to the main settings menu. As an example, if you enable `Milieu`, an item named "Milieu" will be added and it's setup to open the Milieu menu.
2024-12-01 01:44:43 -05:00
2025-02-05 17:47:18 -05:00
However, if you don't have your items added at all with no `Settings` variable setup, the Settings icon is setup to not be shown. So if you decide to enable these other functions and features without creating a custom settings menu, at least create a blank one:
2024-12-01 01:44:43 -05:00
<Code lang="jsx" code={`
2025-02-05 17:47:18 -05:00
<Zorn
Settings={[{"Type": "Button","Name": "","Action": "null"}}
/>
2024-12-01 01:44:43 -05:00
`}/>
2025-02-05 17:47:18 -05:00
## Custom Menu
2024-12-01 01:44:43 -05:00
2025-02-05 17:47:18 -05:00
To setup the settings menu with your own custom items, you'll need to setup an array within the Zorn player, here's a quick example:
2024-12-01 01:44:43 -05:00
<Code lang="jsx" code={`
2025-02-05 17:47:18 -05:00
<Zorn
Settings={
[
{
"Type": "Button",
"Name": "Menu Item Button",
"Action": "null",
},
2025-02-05 22:47:26 -05:00
{
"Type": "Separator"
},
2025-02-05 17:47:18 -05:00
{
"Type": "Link",
"Name": "Menu Item Link",
"Action": "#",
},
]
}
/>
`}/>
| Variable | Option |
|--------------------|---------------------------------------------------------------|
2025-02-05 22:47:26 -05:00
| Type | `Button`, `Link`, or `Separator` |
2025-02-05 17:47:18 -05:00
| Name | string |
| Action (Button) | `onclick` - Use JavaScript |
| Action (Link) | `href` - Use a link |
## Quality Menu
2024-12-01 01:44:43 -05:00
2025-02-05 17:47:18 -05:00
You can also enable the "Quality" menu, doing so will automatically add this to the main menu. If you enable just the quality menu only, please add a blank `Settings` variable like this.
You can set what resolutions are available and set the `onclick` action for it:
<Code lang="jsx" code={`
2025-02-05 17:47:18 -05:00
<Zorn
Quality={
[
{"Resolution": "1080p","Action": "null"},
{"Resolution": "720p","Action": "null"},
{"Resolution": "480p","Action": "null"}
]
}
/>
2024-12-01 01:44:43 -05:00
`}/>
2025-02-05 17:47:18 -05:00
It should be up the developer on how they'll implement the change of quality within the video player. Each "Action" is an `onclick` variable, so use JavaScript.