0
0
Fork 0
mirror of https://github.com/VueTubeApp/VueTube synced 2024-11-09 04:55:07 +00:00
VueTube/NUXT/components/Player/quality.vue

80 lines
2 KiB
Vue
Raw Normal View History

2022-05-28 05:16:27 +00:00
<template>
2022-05-29 18:13:09 +00:00
<div>
<v-bottom-sheet
v-model="sheet"
:attach="$parent.$refs.vidcontainer"
scrollable
>
<template #activator="{ on, attrs }">
<v-btn
fab
text
2022-05-29 22:14:00 +00:00
small
2022-05-31 02:17:03 +00:00
color="white"
2022-05-29 22:14:00 +00:00
style="position: absolute; bottom: 0.25rem; right: 3rem"
2022-05-29 18:13:09 +00:00
v-bind="attrs"
v-on="on"
>
2022-05-29 18:42:39 +00:00
{{ sources.find((src) => src.url == video.src).qualityLabel }}
2022-05-29 18:13:09 +00:00
</v-btn>
</template>
2022-06-07 18:39:26 +00:00
<v-card class="background">
<v-subheader
v-touch="{
down: () => (sheet = false),
}"
>
Quality for current video
<v-btn
fab
text
small
color="white"
style="position: absolute; right: 0.25rem"
@click="sheet = false"
>
<v-icon>mdi-close</v-icon>
</v-btn>
</v-subheader>
<v-divider />
2022-05-29 18:42:39 +00:00
<v-card-text style="max-height: 50vh" class="pa-0">
<v-list-item
v-for="src in sources"
:key="src"
@click="(sheet = false), (video.src = src.url)"
>
<v-list-item-avatar>
<v-icon
:color="
video.src === src.url
? 'primary'
: $vuetify.theme.dark
? 'background lighten-2'
: 'background darken-2'
"
v-text="
video.src === src.url
2022-05-30 01:44:51 +00:00
? 'mdi-radiobox-marked'
: 'mdi-radiobox-blank'
2022-05-29 18:42:39 +00:00
"
></v-icon>
</v-list-item-avatar>
<v-list-item-title>
{{ src.qualityLabel }} ({{ src.quality }})
</v-list-item-title>
</v-list-item>
2022-05-29 18:13:09 +00:00
</v-card-text>
</v-card>
</v-bottom-sheet>
</div>
2022-05-28 05:16:27 +00:00
</template>
2022-05-29 18:13:09 +00:00
<script>
export default {
props: ["video", "sources"],
data: () => ({
sheet: false,
}),
};
</script>