45 lines
743 B
Plaintext
45 lines
743 B
Plaintext
<template>
|
|
<view class="">
|
|
<video :src="url" style="width: 750rpx;height: 1400rpx;" :autoplay='true' id="myvideo" controls></video>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
data() {
|
|
return {
|
|
url: ""
|
|
}
|
|
},
|
|
methods: {
|
|
videoPlay() {
|
|
console.log("开始播放了")
|
|
},
|
|
|
|
videoShow() {
|
|
this.videoContext = uni.createVideoContext("myvideo", this); // this这个是实例对象 必传
|
|
this.videoUrl = this.url;
|
|
this.videoContext.requestFullScreen({
|
|
// direction: 90
|
|
});
|
|
this.videoContext.play();
|
|
this.videoPlay = true; // 显示播放盒子
|
|
|
|
}
|
|
|
|
},
|
|
onLoad(option) {
|
|
this.url = option.url
|
|
setTimeout(() => {
|
|
this.videoShow()
|
|
})
|
|
|
|
}
|
|
|
|
|
|
}
|
|
</script>
|
|
|
|
<style>
|
|
|
|
</style> |