视频播放
This commit is contained in:
parent
21b9995c1c
commit
5c47aa8e5c
44
pageB/playVideo/index.nvue
Normal file
44
pageB/playVideo/index.nvue
Normal 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>
|
@ -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
BIN
static/image/clons.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.4 KiB |
Loading…
Reference in New Issue
Block a user