spz-video
When to Use
When you need to play local videos.
Code Demonstration
Basic Usage
The most basic usage, use role="pause" to tag the play button, role="play" to tag the pause button.
<spz-video
layout="responsive"
width="1280"
height="720"
hls="https://videodelivery.net/f0316062ddb9943617e309e848d71b93/manifest/video.m3u8"
mp4="https://videodelivery.net/f0316062ddb9943617e309e848d71b93/downloads/default.mp4"
poster="https://img.staticdj.com/63dc3070f040163824bc742cdad310dd.jpeg"
>
<svg role="pause" xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 24 24"><path d="M19.376 12.4158L8.77735 19.4816C8.54759 19.6348 8.23715 19.5727 8.08397 19.3429C8.02922 19.2608 8 19.1643 8 19.0656V4.93408C8 4.65794 8.22386 4.43408 8.5 4.43408C8.59871 4.43408 8.69522 4.4633 8.77735 4.51806L19.376 11.5838C19.6057 11.737 19.6678 12.0474 19.5146 12.2772C19.478 12.3321 19.4309 12.3792 19.376 12.4158Z" fill="currentColor"></path></svg>
<svg role="play" xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 24 24"><path d="M6 5H8V19H6V5ZM16 5H18V19H16V5Z" fill="currentColor"></path></svg>
</spz-video>
Custom Control Panel
Use the component's custom control panel style. Click to enter the global button, the video plays in full screen.
<div id="video-zoom-container">
<spz-video
layout="responsive"
width="1280"
height="720"
hls="https://videodelivery.net/f0316062ddb9943617e309e848d71b93/manifest/video.m3u8"
mp4="https://videodelivery.net/f0316062ddb9943617e309e848d71b93/downloads/default.mp4"
poster="https://img.staticdj.com/63dc3070f040163824bc742cdad310dd.jpeg"
zoom
loop
@enterFull="video-zoom-container.toggleClass(class='video-fullscreen', force=true);"
@exitFull="video-zoom-container.toggleClass(class='video-fullscreen', force=false);"
></spz-video>
</div>
Properties
Methods
play
Play the video, no parameters required.
pause
Pause video playback, no parameters required.
seekTo
Jump frame to a certain point in time.
Events
play
This event will automatically trigger when the video goes from a paused state to playing.
pause
This event will automatically trigger when the video goes from playing to paused.
ended
This event will automatically trigger when the video ends (non-looping).
enterFull
This event will automatically trigger when the video enters full-screen playback.
exitFull
This event will automatically trigger when the video exits full-screen playback.
AI Summary (LLM Ready)
- Component ID:
spz-video
- One-line purpose: Video player.
- Detected attribute rows: 0
- Detected method subsections: 3
- Detected event subsections: 5
- Top attribute names: none (needs manual completion)
- Top method names:
play, pause, seekTo
- Top event names:
play, pause, ended, enterFull, exitFull
- Reading order: start from usage/examples, then verify attributes, methods, and events.
- Related docs: /en/guide/actions-and-events/ , /en/guide/layouts/