We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
我电脑端访问网址后,直接自动下载视频了,无法在线看,
The text was updated successfully, but these errors were encountered:
flv.js
Sorry, something went wrong.
如果你熟悉Vue/Node&JS,你可以这样。
"dependencies": { "hls.js": "^1.5.18", "vue": "^3.4.21", "vue-video-player": "^6.0.0" }
<template> <div class="video-container"> <video ref="videoPlayer" class="video-js" controls preload="auto" width="640" height="360"> </video> </div> </template> <script setup> import { onMounted, ref } from 'vue' import Hls from 'hls.js' const videoPlayer = ref(null) const props = defineProps({ src: { type: String, required: true } }) onMounted(() => { if (Hls.isSupported()) { const hls = new Hls() hls.loadSource(props.src) hls.attachMedia(videoPlayer.value) } // 对于原生支持 HLS 的浏览器(如 Safari) else if (videoPlayer.value.canPlayType('application/vnd.apple.mpegurl')) { videoPlayer.value.src = props.src } }) </script> <style scoped> .video-container { width: 100%; max-width: 640px; margin: 0 auto; } </style>
No branches or pull requests
我电脑端访问网址后,直接自动下载视频了,无法在线看,
The text was updated successfully, but these errors were encountered: