视频播放

This commit is contained in:
luyuan 2020-08-24 16:40:38 +08:00
parent 21b9995c1c
commit 5c47aa8e5c
Signed by: theluyuan
GPG Key ID: A7972FD973317FF3
3 changed files with 51 additions and 0 deletions

View File

@ -0,0 +1,44 @@
<template>
<view style="width:750rpx" :style="{'height':height}">
<image @click="calose()" style="width:30rpx;height:30rpx;position: fixed;top:80rpx;right:30rpx;" src="/static/image/clons.png"></image>
<video :src="url" class="video" :style="{'padding-top':top,'height': width}" :autoplay="true"></video>
</view>
</template>
<style>
.video{
width: 750rpx;
}
</style>
<script>
export default {
name:"video",
data(){
return {
url:"",
top:0,
height:0,
width:0
}
},
onLoad(a){
const res = uni.getSystemInfoSync();
let height = res.windowHeight
let width = res.windowWidth
this.width = width + ( (height - width) / 2) + 'px'
console.log(this.width)
this.top = (height - width) / 2+ 'px'
console.log(this.top)
this.height = height + 'px';
console.log(a)
this.url = a.url
},
methods:{
calose(){
uni.navigateBack({
delta: 1
});
}
}
}
</script>

View File

@ -79,6 +79,13 @@
{
"root": "pageB",
"pages": [
{
"path": "playVideo/index",
"style": {
"navigationStyle":"custom",
"backgroundColor":"#000000"
}
},
{
"path": "follow/index",
"style": {

BIN
static/image/clons.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB