Compare commits

...

3 commits

Author SHA1 Message Date
Korbs
2a63c7530d Bump version 2024-11-02 05:15:41 -04:00
Korbs
7ff06e549a Add volume controller 2024-11-02 05:15:32 -04:00
Korbs
6d44cba179 Swap out Milieu in original test page 2024-11-02 05:15:18 -04:00
5 changed files with 48 additions and 8 deletions

View file

@ -14,7 +14,7 @@
"live-streaming"
],
"type": "module",
"version": "0.4.52",
"version": "0.4.53",
"exports": {
".": "./index.ts"
},

View file

@ -12,8 +12,9 @@ import {
Enlarge,
ForwardSolid,
PlaySolid,
Refresh
} from "@iconoir/vue";
Refresh,
SoundHighSolid
} from "@iconoir/vue"
---
<div class="video-controls">
@ -30,6 +31,13 @@ import {
<button id="vc-backwards"><RewindSolid /></button>
<button id="vc-forwards"><ForwardSolid /></button>
}
<div class="vc-volume-controller">
<button><SoundHighSolid/></button>
<div class="vc-volume-controller-input">
<span style={`background: lightblue`} class="vc-volume-bar"></span>
<input type="range" min="0" max="1.0" step="0.01"/>
</div>
</div>
</div>
<div class="vc-center">
{Live ?
@ -58,7 +66,6 @@ import {
</div>
</div>
<!-- HLS Script -->
<!-- Required to support live streaming -->
<!-- Script is not loaded if the video player is not set for a stream -->

View file

@ -81,6 +81,24 @@
width: max-content;
}
}
.vc-volume-controller, .vc-volume-controller-input {
display: flex;
align-items: center;
}
.vc-volume-controller:hover {
.vc-volume-controller-input {
width: auto;
opacity: 1;
pointer-events: all;
transition: 0.3s opacity, 0.4s width;
}
}
.vc-volume-controller-input {
width: 0px;
opacity: 0;
pointer-events: none;
transition: 0.3s opacity, 0.4s width;
}
.vc-seek {
background: rgb(255 255 255 / 10%);
width: 100%;

View file

@ -24,10 +24,10 @@ import { Settings } from '@iconoir/vue'
---
<div class="video-container">
<video class="main-video" {VideoAttributes} src={Video} poster={Poster} preload="auto"></video>
<video class="main-video" {VideoAttributes} disableremoteplayback src={Video} poster={Poster} preload="auto"></video>
{Audio ? <audio class="main-audio"><source {AudioAttributes} src={Audio} type="audio/mp3"/></audio> : null }
{Milieu ? <MilieuEffect/> : null }
{Audio ? <Sync/> : null }
{Milieu ? <MilieuEffect/> : null }
{SettingsMenu ?
<Controls Live={Live}>
<button id="open-zorn-settings-button" onclick="OpenZornMenu()"><Settings/></button>
@ -38,4 +38,20 @@ import { Settings } from '@iconoir/vue'
}
<Controller/>
<Seek/>
</div>
</div>
<!-- Needs control the correct source -->
{Audio ?
<script is:inline>
var ZornAudioSource = document.querySelector('.video-container audio')
var VolumeRange = document.querySelector('.vc-volume-controller-input input')
VolumeRange.addEventListener("input", (event) => {ZornAudioSource.volume = event.target.value})
</script>
:
<script is:inline>
var Player = document.querySelector('.video-container video')
var VolumeRange = document.querySelector('.vc-volume-controller-input input')
VolumeRange.addEventListener("input", (event) => {Player.volume = event.target.value})
</script>
}

View file

@ -15,7 +15,6 @@ import {Zorn} from '@minpluto/zorn'
Poster="https://md.sudovanilla.org/images/eay-p-v.jpg"
Video="https://md.sudovanilla.org/videos/webm/Ennie-and-Yoyki.webm"
CustomControlsWithMenu
Milieu
SettingsMenu
>
<div id="settings" class="vc-menu">