mirror of
https://github.com/the1812/Bilibili-Evolved.git
synced 2025-11-04 21:22:45 +08:00
34 lines
619 B
Vue
34 lines
619 B
Vue
<template>
|
|
<DefaultWidget
|
|
name="画中画"
|
|
icon="mdi-picture-in-picture-bottom-right"
|
|
class="live-pip"
|
|
@click="togglePip()"
|
|
></DefaultWidget>
|
|
</template>
|
|
|
|
<script lang="ts">
|
|
import { DefaultWidget } from '@/ui'
|
|
|
|
export default Vue.extend({
|
|
components: {
|
|
DefaultWidget,
|
|
},
|
|
methods: {
|
|
async togglePip() {
|
|
if (document.pictureInPictureElement) {
|
|
document.exitPictureInPicture()
|
|
} else {
|
|
;(dq('video') as HTMLVideoElement)?.requestPictureInPicture()
|
|
}
|
|
},
|
|
},
|
|
})
|
|
</script>
|
|
|
|
<style lang="scss">
|
|
.live-pip .be-icon {
|
|
transform: scale(0.9);
|
|
}
|
|
</style>
|