Fix layout in horizontal video orientation
This commit is contained in:
@@ -62,11 +62,6 @@ const download = () => { dispatch("download", {}) }
|
|||||||
|
|
||||||
const toggle_play = () => playing ? player.pause() : player.play()
|
const toggle_play = () => playing ? player.pause() : player.play()
|
||||||
|
|
||||||
// let video_seeker
|
|
||||||
// const seek = () => {
|
|
||||||
// player.fastSeek(player.duration * (video_seeker.value/1000))
|
|
||||||
// }
|
|
||||||
|
|
||||||
const seek_relative = delta => {
|
const seek_relative = delta => {
|
||||||
if (player.fastSeek) {
|
if (player.fastSeek) {
|
||||||
player.fastSeek(player.currentTime + delta)
|
player.fastSeek(player.currentTime + delta)
|
||||||
@@ -75,17 +70,10 @@ const seek_relative = delta => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// let volume_seeker
|
|
||||||
// const volume_seek = () => {
|
|
||||||
// player.volume = volume_seeker.value/100
|
|
||||||
// }
|
|
||||||
|
|
||||||
const mute = () => {
|
const mute = () => {
|
||||||
if (player.muted) {
|
if (player.muted) {
|
||||||
// volume_seeker.disabled = false
|
|
||||||
player.muted = false
|
player.muted = false
|
||||||
} else {
|
} else {
|
||||||
// volume_seeker.disabled = true
|
|
||||||
player.muted = true
|
player.muted = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -111,6 +99,7 @@ const fullscreen = () => {
|
|||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
|
<div class="player_and_controls">
|
||||||
<div class="player">
|
<div class="player">
|
||||||
<!-- svelte-ignore a11y-media-has-caption -->
|
<!-- svelte-ignore a11y-media-has-caption -->
|
||||||
<video
|
<video
|
||||||
@@ -119,7 +108,7 @@ const fullscreen = () => {
|
|||||||
playsinline
|
playsinline
|
||||||
autoplay
|
autoplay
|
||||||
loop={loop}
|
loop={loop}
|
||||||
class="video drop_shadow"
|
class="video"
|
||||||
on:pause={() => playing = false }
|
on:pause={() => playing = false }
|
||||||
on:play={() => playing = true }
|
on:play={() => playing = true }
|
||||||
on:ended={() => dispatch("next", {})}
|
on:ended={() => dispatch("next", {})}
|
||||||
@@ -167,6 +156,7 @@ const fullscreen = () => {
|
|||||||
<div class="spacer"></div>
|
<div class="spacer"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
{/if}
|
{/if}
|
||||||
{:else}
|
{:else}
|
||||||
@@ -202,6 +192,12 @@ h1 {
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
.player_and_controls {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
height: 100%;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
.player {
|
.player {
|
||||||
flex: 1 1 auto;
|
flex: 1 1 auto;
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -231,7 +227,7 @@ h1 {
|
|||||||
max-height: 100%;
|
max-height: 100%;
|
||||||
}
|
}
|
||||||
@media(max-height: 500px) {
|
@media(max-height: 500px) {
|
||||||
.container {
|
.player_and_controls {
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
}
|
}
|
||||||
.controls {
|
.controls {
|
||||||
|
@@ -60,10 +60,8 @@ const seek_relative = delta => {
|
|||||||
|
|
||||||
const mute = () => {
|
const mute = () => {
|
||||||
if (player.muted) {
|
if (player.muted) {
|
||||||
// volume_seeker.disabled = false
|
|
||||||
player.muted = false
|
player.muted = false
|
||||||
} else {
|
} else {
|
||||||
// volume_seeker.disabled = true
|
|
||||||
player.muted = true
|
player.muted = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -85,7 +83,7 @@ const fullscreen = () => {
|
|||||||
the video and watching it locally.
|
the video and watching it locally.
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
<div class="player_and_controls">
|
||||||
<div class="player">
|
<div class="player">
|
||||||
{#if loaded}
|
{#if loaded}
|
||||||
<!-- svelte-ignore a11y-media-has-caption -->
|
<!-- svelte-ignore a11y-media-has-caption -->
|
||||||
@@ -95,7 +93,7 @@ const fullscreen = () => {
|
|||||||
playsinline
|
playsinline
|
||||||
autoplay
|
autoplay
|
||||||
loop={loop}
|
loop={loop}
|
||||||
class="video drop_shadow"
|
class="video"
|
||||||
on:pause={() => playing = false }
|
on:pause={() => playing = false }
|
||||||
on:play={() => playing = true }
|
on:play={() => playing = true }
|
||||||
on:ended={() => dispatch("next", {})}
|
on:ended={() => dispatch("next", {})}
|
||||||
@@ -139,6 +137,7 @@ const fullscreen = () => {
|
|||||||
</button>
|
</button>
|
||||||
<div class="spacer"></div>
|
<div class="spacer"></div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
@@ -148,6 +147,12 @@ const fullscreen = () => {
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
.player_and_controls {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
height: 100%;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
.player {
|
.player {
|
||||||
flex: 1 1 auto;
|
flex: 1 1 auto;
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -177,7 +182,7 @@ const fullscreen = () => {
|
|||||||
max-height: 100%;
|
max-height: 100%;
|
||||||
}
|
}
|
||||||
@media(max-height: 500px) {
|
@media(max-height: 500px) {
|
||||||
.container {
|
.player_and_controls {
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
}
|
}
|
||||||
.controls {
|
.controls {
|
||||||
|
Reference in New Issue
Block a user