提交 4949883d authored 作者: 王鹏飞's avatar 王鹏飞

chore: 调整视频清晰度

上级 080a190e
......@@ -13,7 +13,14 @@ function fetchInfo() {
})
}
const playUrl = $computed(() => {
return playList[0]?.PlayURL || ''
const definitionUrl = playList.reduce(
(result: any, item: any) => {
result[item.Definition] = item.PlayURL
return result
},
{ SD: '', LD: '', FD: '' }
)
return definitionUrl.SD || definitionUrl.LD || definitionUrl.FD
})
onMounted(() => {
fetchInfo()
......
......@@ -9,15 +9,25 @@ interface Props {
const props = defineProps<Props>()
let detail = $ref<VideoItem | null>(null)
let playUrl = $ref<string | null>(null)
let playList = $ref<any>([])
function fetchInfo() {
if (!props.id) return
getVideo({ id: props.id }).then(res => {
detail = res.data
playUrl = res.data?.play_auth?.play_info_list[0]?.PlayURL || ''
playList = res.data?.play_auth?.play_info_list
})
}
const playUrl = $computed(() => {
const definitionUrl = playList.reduce(
(result: any, item: any) => {
result[item.Definition] = item.PlayURL
return result
},
{ SD: '', LD: '', FD: '' }
)
return definitionUrl.SD || definitionUrl.LD || definitionUrl.FD
})
onMounted(() => {
fetchInfo()
})
......@@ -39,8 +49,7 @@ onMounted(() => {
<div style="height: 600px" v-if="playUrl">
<AppVideoPlayer
:options="{ sources: [{ src: playUrl, type: 'application/x-mpegURL' }] }"
style="width: 100%; height: 100%"
></AppVideoPlayer>
style="width: 100%; height: 100%"></AppVideoPlayer>
</div>
</template>
</AppCard>
......
......@@ -28,7 +28,14 @@ function fetchInfo() {
})
}
const playUrl = $computed(() => {
return playList[0]?.PlayURL || ''
const definitionUrl = playList.reduce(
(result: any, item: any) => {
result[item.Definition] = item.PlayURL
return result
},
{ SD: '', LD: '', FD: '' }
)
return definitionUrl.SD || definitionUrl.LD || definitionUrl.FD
})
onMounted(() => {
fetchInfo()
......@@ -41,8 +48,7 @@ onMounted(() => {
<div style="height: 200px" v-if="playUrl">
<AppVideoPlayer
:options="{ sources: [{ src: playUrl, type: 'application/x-mpegURL' }] }"
style="width: 100%; height: 100%"
></AppVideoPlayer>
style="width: 100%; height: 100%"></AppVideoPlayer>
</div>
</div>
</template>
......
......@@ -29,7 +29,14 @@ function fetchInfo() {
})
}
const playUrl = $computed(() => {
return playList[0]?.PlayURL || ''
const definitionUrl = playList.reduce(
(result: any, item: any) => {
result[item.Definition] = item.PlayURL
return result
},
{ SD: '', LD: '', FD: '' }
)
return definitionUrl.SD || definitionUrl.LD || definitionUrl.FD
})
onMounted(() => {
fetchInfo()
......@@ -42,8 +49,7 @@ onMounted(() => {
<div style="height: 200px" v-if="playUrl">
<AppVideoPlayer
:options="{ sources: [{ src: playUrl, type: 'application/x-mpegURL' }] }"
style="width: 100%; height: 100%"
></AppVideoPlayer>
style="width: 100%; height: 100%"></AppVideoPlayer>
</div>
</div>
</template>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论