mirror of
https://github.com/gradio-app/gradio.git
synced 2025-01-30 11:00:11 +08:00
Mute examples videos (#1363)
* mute examples videos * set attrs onmount for safari Co-authored-by: Radames Ajna <radamajna@gmail.com>
This commit is contained in:
parent
e4b5d4c1b7
commit
0ab254b82f
@ -1,15 +1,27 @@
|
||||
<script lang="ts">
|
||||
import { playable } from "../../utils/helpers";
|
||||
import { onMount } from "svelte";
|
||||
|
||||
export let value: string;
|
||||
export let samples_dir: string;
|
||||
let video: HTMLVideoElement;
|
||||
|
||||
onMount(() => {
|
||||
video.muted = true;
|
||||
video.playsInline = true;
|
||||
video.controls = false;
|
||||
video.setAttribute("muted", "");
|
||||
video.play();
|
||||
video.pause();
|
||||
});
|
||||
</script>
|
||||
|
||||
<!-- svelte-ignore a11y-media-has-caption -->
|
||||
<!-- svelte-ignore a11y-mouse-events-have-key-events -->
|
||||
{#if playable(value)}
|
||||
<video
|
||||
muted
|
||||
playsinline
|
||||
bind:this={video}
|
||||
on:mouseover={video.play}
|
||||
on:mouseout={video.pause}
|
||||
|
Loading…
Reference in New Issue
Block a user