Compare commits

..

2 commits

Author SHA1 Message Date
Korbs cf9abaa2c3 Bump 2024-12-07 21:26:50 -05:00
Korbs 112fda8612 Fix Fullscreen function and the ShowFullscreen option 2024-12-07 21:26:40 -05:00
4 changed files with 13 additions and 12 deletions

View file

@ -1,6 +1,6 @@
{
"name": "@minpluto/zorn",
"version": "0.4.81",
"version": "0.4.82",
"author": "SudoVanilla",
"displayName": "Zorn",
"description": "In-House Player built by MinPluto",

View file

@ -5,6 +5,8 @@ const {
ShowBackAndForward,
ShowFullscreen
} = Astro.props
console.log('Controller: ' + ShowFullscreen)
---
<script define:vars={{PlayerName, BigPlayButton, ShowBackAndForward, ShowFullscreen}}>
@ -61,10 +63,9 @@ function Buffering() {
// Fullscreen
function Fullscreen() {
console.log('Hey')
// Get Button
if (ShowFullscreen === true) {
var Button_Fullscreen = document.querySelector("#zorn-player-" + PlayerName + " #vc-fullscreen");
}
// Create and Call Functions
function Toggle_Fullscreen() {
@ -84,19 +85,19 @@ function Fullscreen() {
EnterFullscreen();
VideoContainer.requestFullscreen()
}
if (ShowFullscreen === true) {Update_FullscreenButton()}
Update_FullscreenButton()
}
function EnterFullscreen() {
VideoContainer.classList.add('zorn-fullscreen');
if (ShowFullscreen === true) {Update_FullscreenButton()}
Update_FullscreenButton()
}
function ExitFullscreen() {
VideoContainer.classList.remove('zorn-fullscreen');
if (ShowFullscreen === true) {Update_FullscreenButton()}
Update_FullscreenButton()
}
// Event Listener
if (ShowFullscreen === true) {Button_Fullscreen.onclick = Toggle_Fullscreen;}
Button_Fullscreen.onclick = Toggle_Fullscreen;
function Update_FullscreenButton() {
if (document.fullscreenElement) {
Button_Fullscreen.setAttribute("data-title", "Exit full screen (f)");
@ -110,7 +111,7 @@ function Fullscreen() {
// Gesture
Player.addEventListener("dblclick", () => {
Toggle_Fullscreen()
if (ShowFullscreen === true) {Update_FullscreenButton()}
Update_FullscreenButton()
});
// Keyboard Shortcut
@ -352,7 +353,7 @@ function PlayAgain() {
// Init Functions
AutoToggleControls()
Buffering()
Fullscreen()
if (ShowFullscreen === true) {Fullscreen()}
Gestures()
KeyboardShortcuts()
PlayPause()

View file

@ -17,7 +17,7 @@ const {
ShowBackAndForward,
ShowPlaybackRate,
ShowPiP,
ShowFullscreen,
ShowFullscreen = true,
BigPlayButton = false,
YouTube = false,
@ -106,7 +106,7 @@ import './Styles/Iconoir.css'
:
null
}
<Controller PlayerName={PlayerName} BigPlayButton={BigPlayButton} ShowBackAndForward={ShowBackAndForward}/>
<Controller PlayerName={PlayerName} BigPlayButton={BigPlayButton} ShowBackAndForward={ShowBackAndForward} ShowFullscreen={ShowFullscreen}/>
<Seek PlayerName={PlayerName}/>
</div>