[feature] Next episode button #4

Merged
bivashy merged 9 commits from feature/next-episode-button into main 2025-09-07 18:59:21 +00:00
9 changed files with 140 additions and 35 deletions
Showing only changes of commit 1e604922b9 - Show all commits

View File

@ -89,6 +89,7 @@ onBeforeUnmount(() => {
watch([instance, () => props.urls], async ([artplayer, urls]) => {
if (!artplayer) return;
urls = urls.reverse()
artplayer.quality = urls;
artplayer.switch = urls[0].url;
instance.value = artplayer;

View File

@ -55,11 +55,13 @@ watchEffect(async () => {
results.value = response?.data || null
if (results.value?.links) {
hlsUrls.value = Object.entries(results.value.links).map(([quality, links], index) => {
console.log(results.value.links)
hlsUrls.value = Object.entries(results.value.links).map(([quality, links], index, arr) => {
const isLatest = index === arr.length - 1
return {
html: quality,
url: links.find(link => link.src?.includes('.m3u8') || link.type?.includes('hls'))?.src,
default: index === 0
default: isLatest
}
})