Compare commits
1 Commits
feature/ne
...
9b10258b22
Author | SHA1 | Date | |
---|---|---|---|
9b10258b22 |
@ -5,6 +5,7 @@ import Hls from "hls.js";
|
|||||||
interface Props {
|
interface Props {
|
||||||
urls: any;
|
urls: any;
|
||||||
id: string;
|
id: string;
|
||||||
|
nextEpisodeButton: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
const props = withDefaults(defineProps<Props>(), {
|
const props = withDefaults(defineProps<Props>(), {
|
||||||
@ -13,6 +14,23 @@ const props = withDefaults(defineProps<Props>(), {
|
|||||||
const emit = defineEmits(['get-instance'])
|
const emit = defineEmits(['get-instance'])
|
||||||
|
|
||||||
const options = computed(() => {
|
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 {
|
return {
|
||||||
url: props.urls[0].url || '',
|
url: props.urls[0].url || '',
|
||||||
type: 'm3u8',
|
type: 'm3u8',
|
||||||
@ -30,6 +48,7 @@ const options = computed(() => {
|
|||||||
autoOrientation: true,
|
autoOrientation: true,
|
||||||
autoPlayback: true,
|
autoPlayback: true,
|
||||||
id: props.id,
|
id: props.id,
|
||||||
|
controls: controls,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
const artplayerRef = ref();
|
const artplayerRef = ref();
|
||||||
|
@ -8,7 +8,8 @@
|
|||||||
<p>Episode: {{ episode }}</p>
|
<p>Episode: {{ episode }}</p>
|
||||||
|
|
||||||
<div v-if="hlsUrls">
|
<div v-if="hlsUrls">
|
||||||
<Player :id="mediaId.toString().concat(episode?.toString() || '')" :urls="hlsUrls" />
|
<Player :id="mediaId.toString().concat(episode?.toString() || '')" :urls="hlsUrls" :episode="episode"
|
||||||
|
:nextEpisodeButton="true" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Loading and Error States -->
|
<!-- Loading and Error States -->
|
||||||
@ -24,7 +25,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { useRoute } from 'vue-router'
|
import { useRoute } from 'vue-router'
|
||||||
import { Player } from '~/components/ui/player'
|
import { Player } from '~/components/ui/player'
|
||||||
import { video, type KodikTranslationDTO, type KodikVideoLinks, type VideoParams } from '~/openapi/extractor'
|
import { video, type KodikVideoLinks } from '~/openapi/extractor'
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const mediaType = route.query.mediaType
|
const mediaType = route.query.mediaType
|
||||||
@ -35,20 +36,8 @@ const episode = route.query.episode
|
|||||||
const results = ref<KodikVideoLinks | null>(null)
|
const results = ref<KodikVideoLinks | null>(null)
|
||||||
const isLoading = ref(false)
|
const isLoading = ref(false)
|
||||||
const error = ref<unknown>(null)
|
const error = ref<unknown>(null)
|
||||||
const hlsUrl = ref<string | null>(null)
|
|
||||||
const hlsUrls = ref<any>(null)
|
const hlsUrls = ref<any>(null)
|
||||||
|
|
||||||
const playerOptions = ref({
|
|
||||||
autoplay: false,
|
|
||||||
controls: true,
|
|
||||||
responsive: true,
|
|
||||||
fluid: true,
|
|
||||||
sources: [{
|
|
||||||
src: hlsUrl.value,
|
|
||||||
type: 'application/x-mpegURL'
|
|
||||||
}]
|
|
||||||
})
|
|
||||||
|
|
||||||
watchEffect(async () => {
|
watchEffect(async () => {
|
||||||
if (!mediaType || !mediaId || !mediaHash || !episode) return
|
if (!mediaType || !mediaId || !mediaHash || !episode) return
|
||||||
|
|
||||||
@ -56,12 +45,6 @@ watchEffect(async () => {
|
|||||||
isLoading.value = true
|
isLoading.value = true
|
||||||
error.value = null
|
error.value = null
|
||||||
|
|
||||||
const translationDto: KodikTranslationDTO = {
|
|
||||||
mediaType: mediaType as string,
|
|
||||||
mediaId: mediaId as string,
|
|
||||||
mediaHash: mediaHash as string,
|
|
||||||
}
|
|
||||||
|
|
||||||
const videoParams: any = {
|
const videoParams: any = {
|
||||||
mediaType: mediaType as string,
|
mediaType: mediaType as string,
|
||||||
mediaId: mediaId as string,
|
mediaId: mediaId as string,
|
||||||
|
Reference in New Issue
Block a user