Minor improvements
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
export let audioMode = false;
|
||||
export let playlistVideos: PlaylistPageVideo[] | null = null;
|
||||
export let player: MediaPlayerElement;
|
||||
export let isSyncing: boolean = false;
|
||||
|
||||
let src: PlayerSrc = [];
|
||||
let categoryBeingSkipped = '';
|
||||
@@ -225,7 +226,7 @@
|
||||
|
||||
<media-player
|
||||
bind:this={player}
|
||||
autoPlay={$playerAutoPlay}
|
||||
autoPlay={$playerAutoPlay && !isSyncing}
|
||||
loop={$playerAlwaysLoop}
|
||||
title={data.video.title}
|
||||
streamType={data.video.hlsUrl ? 'live' : 'on-demand'}
|
||||
|
||||
@@ -78,6 +78,18 @@
|
||||
] as PlayerEvent[]);
|
||||
});
|
||||
|
||||
player.addEventListener('play', () => {
|
||||
conn.send([
|
||||
{
|
||||
type: 'play'
|
||||
},
|
||||
{
|
||||
type: 'seek',
|
||||
time: player.currentTime
|
||||
}
|
||||
] as PlayerEvent[]);
|
||||
});
|
||||
|
||||
player.addEventListener('waiting', () => {
|
||||
conn.send([
|
||||
{
|
||||
@@ -194,7 +206,15 @@
|
||||
<div class="grid">
|
||||
<div class="s12 m12 l10">
|
||||
{#key data.video.videoId}
|
||||
<Player {data} {audioMode} {playlistVideos} bind:seekTo bind:currentTime bind:player />
|
||||
<Player
|
||||
{data}
|
||||
{audioMode}
|
||||
{playlistVideos}
|
||||
isSyncing={!peer}
|
||||
bind:seekTo
|
||||
bind:currentTime
|
||||
bind:player
|
||||
/>
|
||||
{/key}
|
||||
|
||||
<h5>{data.video.title}</h5>
|
||||
|
||||
Reference in New Issue
Block a user