Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Time.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
const setTime = throttle(
() => {
ft = formatTime(currentTime, hours);
getTime && getTime(ft);
},
250,
true
Expand Down
4 changes: 3 additions & 1 deletion src/VideoPlayer.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
export let skipSeconds = 5;
export let controlsOnPause = true;
export let timeDisplay = false;
export let getTime = false;

$: _width = parseInt(width);
$: _height = parseInt(height);
Expand Down Expand Up @@ -56,7 +57,8 @@
{skipSeconds}
{aspectRatio}
{controlsOnPause}
{timeDisplay} />
{timeDisplay}
{getTime} />
{:else}
<VideoPlayerServer {playerBgColor} {borderRadius} {aspectRatio} />
{/if}
3 changes: 2 additions & 1 deletion src/VideoPlayerClient.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
export let aspectRatio;
export let controlsOnPause;
export let timeDisplay;
export let getTime;

$: _sources = prepareVideoSources(source);
$: _skipSeconds = parseFloat(skipSeconds);
Expand Down Expand Up @@ -328,7 +329,7 @@
bind:isScrubbing
on:pointerup={onPlaybarPointerUp} />
{#if timeDisplay}
<Time {duration} {currentTime} />
<Time {getTime} {duration} {currentTime} />
{/if}
<VolumeButton on:pointerup={onVolumeButtonPointerUp} {muted} />
<VolumeControl bind:volume />
Expand Down