吕地瓜
吕地瓜
  • 发布:2018-10-18 20:26
  • 更新:2018-10-18 20:26
  • 阅读:1454

全屏播放缓存中的视频地址,无法播放,求大神指导。。。

分类:uni-app

<template>
<view>
<view class="page-body">
<view class="page-section">
<video id="myVideo" :src="src" autoplay="true" @ended="replay"></video>
</view>
</view>
</view>
</template>
<script>
import pageHead from '../../components/page-head.vue'
export default {
data() {
return {
src: '',
height: '',
width: ''
}
},
onReady: function() {

        uni.getStorage({  
            key: 'src',  
            success: function(res) {  
                console.log(res.data);  
                if(res.data){  
                    this.src=res.data;  
                    this.videoContext = uni.createVideoContext('myVideo');  
                    this.videoContext.requestFullScreen();  
                }  
            }  
        });  
    },  
    methods: {  

        replay: function(e) {  
            if (e) {  
                this.videoContext.exitFullScreen({  

                })  
                uni.redirectTo({  
                    url: '../replay/replay'  
                });  
            }  
        }  

    },  
    components: {  
        pageHead  

    }  
}  

</script>

<style>
@import "../../common/uni.css";

button {  
    background-color: #007aff;  
    color: #ffffff;  
}  

.uni-list {  
    margin-top: 40px;  
}  

.uni-input {  
    text-align: left;  
}  

.page-section {  
    text-align: center;  
}  

</style>

2018-10-18 20:26 负责人:无 分享
已邀请:

该问题目前已经被锁定, 无法添加新回复