Requests continuous looping changes for the controlled media.
<nve-media-controller id="loop-example" style="max-width: 300px">
<video src="/static/video/particle.mp4" playsinline></video>
<div nve-layout="row gap:xs">
<nve-media-pause-button commandfor="loop-example"></nve-media-pause-button>
<nve-media-loop-button commandfor="loop-example"></nve-media-loop-button>
</div>
</nve-media-controller>
Installation
<script type="module">
import '@nvidia-elements/media/loop-button/define.js';
</script>
<nve-media-controller id="loop-example" style="max-width: 300px">
<video src="/static/video/particle.mp4" playsinline></video>
<div nve-layout="row gap:xs">
<nve-media-pause-button commandfor="loop-example"></nve-media-pause-button>
<nve-media-loop-button commandfor="loop-example"></nve-media-loop-button>
</div>
</nve-media-controller>
nve api.get nve-media-loop-button
Default
Loop button connected to a video controller. Use with playback controls to repeat a recording continuously until the user disables looping.
<nve-media-controller id="loop-example" style="max-width: 300px">
<video src="/static/video/particle.mp4" playsinline></video>
<div nve-layout="row gap:xs">
<nve-media-pause-button commandfor="loop-example"></nve-media-pause-button>
<nve-media-loop-button commandfor="loop-example"></nve-media-loop-button>
</div>
</nve-media-controller>
Initial State
Set loop on the native video or audio element to enable continuous replay before the first playback. The controller reads that setting and keeps the button in sync with changes to the native loop property or attribute.
Video with looping enabled in native markup. Use when a recording should repeat from the first playback and the loop button should show its current state.
<nve-media-controller id="initial-loop-example" style="max-width: 300px">
<video src="/static/video/particle.mp4" playsinline loop></video>
<div nve-layout="row gap:xs">
<nve-media-pause-button commandfor="initial-loop-example"></nve-media-pause-button>
<nve-media-loop-button commandfor="initial-loop-example"></nve-media-loop-button>
</div>
</nve-media-controller>
Commands
The controller supports --enable-loop, --disable-loop, and --toggle-loop. Use the button's command attribute to request a specific setting instead of toggling.
<nve-media-loop-button commandfor="controller" command="--enable-loop" aria-label="enable looping"></nve-media-loop-button>
Release Status
All elements and features go through 3 phases of stability, pre-release, beta and stable.
pre-release Docs Preview API Documentation Fully Themeable
beta Robust unit test coverages Passed API Review Passed Designer VQA Review Included in library package stable No known outstanding AA WCAG issues No known outstanding performance issues Adapts to different screen/container sizes No breaking API changes for at least 90 days