Add "ChangeEpisodeButton" and hook as player control
This commit is contained in:
@ -1,11 +1,14 @@
|
||||
<script setup lang="ts">
|
||||
import Artplayer from "artplayer";
|
||||
import Hls from "hls.js";
|
||||
import { createVueControlSmart } from "~/components/util/player-control";
|
||||
import { EpisodeChangeType } from "./ChangeEpisodeButton.vue";
|
||||
import { UiPlayerChangeEpisodeButton } from "#components";
|
||||
|
||||
interface Props {
|
||||
urls: any;
|
||||
id: string;
|
||||
nextEpisodeButton: boolean;
|
||||
episodeButton: boolean;
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
@ -15,20 +18,26 @@ const emit = defineEmits(['get-instance'])
|
||||
|
||||
const options = computed(() => {
|
||||
const controls = []
|
||||
if (props.nextEpisodeButton) {
|
||||
if (props.episodeButton) {
|
||||
controls.push(
|
||||
{
|
||||
name: 'next-episode',
|
||||
createVueControlSmart(UiPlayerChangeEpisodeButton, {
|
||||
name: "next-episode",
|
||||
index: 50,
|
||||
position: 'left',
|
||||
html: '<button>Test</button>',
|
||||
tooltip: 'Next episode',
|
||||
style: {
|
||||
color: 'red',
|
||||
},
|
||||
click: function () {
|
||||
},
|
||||
},
|
||||
tooltip: "Next episode",
|
||||
type: EpisodeChangeType.NEXT
|
||||
}, {
|
||||
click: () => console.log("NEXT")
|
||||
})
|
||||
)
|
||||
controls.push(
|
||||
createVueControlSmart(UiPlayerChangeEpisodeButton, {
|
||||
name: "previous-episode",
|
||||
index: 50,
|
||||
tooltip: "Previous episode",
|
||||
type: EpisodeChangeType.PREVIOUS
|
||||
}, {
|
||||
click: () => console.log("Previous")
|
||||
})
|
||||
)
|
||||
}
|
||||
return {
|
||||
|
Reference in New Issue
Block a user