|
|
@@ -2,8 +2,8 @@ |
|
|
|
<view class="page"> |
|
|
|
<!-- <image src="../../assets/img/homeImg.jpg" mode="scaleToFill" /> --> |
|
|
|
<video id="myVideo" |
|
|
|
ref="myVideo" |
|
|
|
src='https://video.metavatar.cc/sv/30f2d513-18c4739c509/30f2d513-18c4739c509.mp4' |
|
|
|
ref="myVideo" |
|
|
|
:src='videoUrl' |
|
|
|
autoplay |
|
|
|
muted |
|
|
|
loop |
|
|
@@ -23,12 +23,11 @@ |
|
|
|
|
|
|
|
<script setup> |
|
|
|
//#region 导入 |
|
|
|
import { getCurrentInstance, ref,nextTick } from "vue"; |
|
|
|
import { getCurrentInstance, ref,nextTick, onMounted } from "vue"; |
|
|
|
import { isPlainObject, onLoad, onUnload, onShow } from "@dcloudio/uni-app"; |
|
|
|
import { userInfoModules } from "@/store/modules/userInfo"; |
|
|
|
import { getVideoApi } from "@/api/login.js"; |
|
|
|
|
|
|
|
const myVideo = ref(null); |
|
|
|
|
|
|
|
const userInfoModulesPinia = userInfoModules(); |
|
|
|
//#endregion ---------------------------------- |
|
|
@@ -78,29 +77,35 @@ function fileReaderTest() { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// // 播放 |
|
|
|
// const handelPlay = () => { |
|
|
|
// const video = document.querySelector("video.uni-video-video"); |
|
|
|
// video.play(); |
|
|
|
// } |
|
|
|
|
|
|
|
const videoUrl = ref('') |
|
|
|
function getVideoFn() { |
|
|
|
// getVideoApi().then(res => { |
|
|
|
// debugger |
|
|
|
// }) |
|
|
|
nextTick(()=>{ |
|
|
|
const video = document.querySelector("video.uni-video-video"); |
|
|
|
video.muted = false |
|
|
|
video.play() |
|
|
|
getVideoApi().then(res => { |
|
|
|
videoUrl.value = res.data |
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
onShow(() => { |
|
|
|
getVideoFn() |
|
|
|
}) |
|
|
|
//#region 初始化 |
|
|
|
// const myVideo = ref(null); |
|
|
|
const { proxy } = getCurrentInstance(); |
|
|
|
onMounted(() => { |
|
|
|
// nextTick(()=>{ |
|
|
|
// proxy.$refs.myVideomuted = false |
|
|
|
// proxy.$refs.myVideo.play(); |
|
|
|
// }) |
|
|
|
}) |
|
|
|
|
|
|
|
onLoad(() => { |
|
|
|
getVideoFn() |
|
|
|
nextTick(()=>{ |
|
|
|
// const video = document.querySelector("video.uni-video-video"); |
|
|
|
// video.muted = false |
|
|
|
// video.play() |
|
|
|
}) |
|
|
|
getVideoFn() |
|
|
|
runGetAndroidId(); |
|
|
|
// fileReaderTest(); |
|
|
|
userInfoModulesPinia.clearStorage(); |
|
|
|