Initial implementation of "Next episode" button in player

This commit is contained in:
2025-08-12 23:56:52 +05:00
parent 8d21620295
commit 9b10258b22
2 changed files with 22 additions and 20 deletions

View File

@ -5,6 +5,7 @@ import Hls from "hls.js";
interface Props {
urls: any;
id: string;
nextEpisodeButton: boolean;
}
const props = withDefaults(defineProps<Props>(), {
@ -13,6 +14,23 @@ const props = withDefaults(defineProps<Props>(), {
const emit = defineEmits(['get-instance'])
const options = computed(() => {
const controls = []
if (props.nextEpisodeButton) {
controls.push(
{
name: 'next-episode',
index: 50,
position: 'left',
html: '<button>Test</button>',
tooltip: 'Next episode',
style: {
color: 'red',
},
click: function () {
},
},
)
}
return {
url: props.urls[0].url || '',
type: 'm3u8',
@ -30,6 +48,7 @@ const options = computed(() => {
autoOrientation: true,
autoPlayback: true,
id: props.id,
controls: controls,
}
})
const artplayerRef = ref();