wt-player.vue
Specs
Props
| Name | Required | Types | Default | Description | Example | Deprecated |
|---|---|---|---|---|---|---|
src |
union |
- | Media source. Accepts a URL string or { src, type } with an untypedMIME (API payloads); useVidstackSrc normalizes to a vidstack PlayerSrc. |
|||
id |
string |
- | Media id | |||
fileName |
string |
- | Media name | |||
autoplay |
boolean |
true |
Autoplay media on load | |||
loop |
boolean |
false |
Loop media playback | |||
download |
union |
() => (url: string) => url.replace('/stream', '/download') |
Download button configuration. If false, no download button will be shown | |||
resetOnEnd |
boolean |
false |
Resets player position to start after file has been played to the end | |||
countdownTimeMode |
boolean |
- | Show media time like duration with countdown. Example: "-00:12" | |||
hideVolumeSlider |
boolean |
false |
Hide volume slider | |||
hideMuteButton |
boolean |
false |
Hide mute button | |||
hideSettings |
boolean |
false |
Hide settings button | |||
closable |
boolean |
true |
Shows close button | |||
position |
string |
'sticky' |
Player position | |||
invertTime |
boolean |
true |
||||
resetVolume |
boolean |
false |
Events
| Name | Params | Description |
|---|---|---|
close |
||
initialized |
Example Player
Code
vue
<script setup>
import { ref } from 'vue';
const src = ref(
'https://cdn6.sefon.pro/files/prev/1/The%20Eagles%20-%20Hotel%20California%20%28192kbps%29.mp3',
);
</script>
<template>
<!-- <wt-button @click="src = 'https://cdn6.sefon.pro/files/prev/1/The%20Eagles%20-%20Hotel%20California%20%28192kbps%29.mp3'" />-->
<wt-player
:src="src"
:autoplay="false"
:download="true"
/>
</template>
<style scoped lang="scss"></style>