mrchenanan@163.com
mrchenanan@163.com
  • 发布:4 天前
  • 更新:4 天前
  • 阅读:28

uni-app 怎么使用微信小程序原生组件自带的api

分类:uni-app
<style lang="less">  
    .video{width:100%;}  
</style>  

<template>  
    <div class="index">  
        <video class="video" src="http://video.520anan.com/2013-04-12-yuhoubutoucun.mp4"></video>  
        <button type="primary" size="mini" @click="videoPlay">播放</button>  
        <button type="primary" size="mini" @click="videoPause">暂停</button>  
        <button type="primary" size="mini" @click="videoPlayBackRate">1.25倍快进</button>  
        <button type="primary" size="mini" @click="videorequestFullScreen">全屏</button>  
        <button type="primary" size="mini" @click="videoSeek0">重新播放</button>  
    </div>  
</template>  

<script>  
    export default {  
        data() {  
            return {  
                videoList:[]  
            }  
        },  
        onLoad() {  

        },  
        methods: {  
          videoPlay(){  
            this.videoContext.play()  
          },  

          videoPause() {  
            this.videoContext.pause()  
          },  

          videoPlayBackRate() {  
            this.videoContext.playbackRate(1.5)  
          },  

          videorequestFullScreen() {  
            this.videoContext.requestFullScreen()  
          },  
        }  
    }  
</script>

报错,点击没有触发api 不知道怎么用

4 天前 分享
已邀请:
DCloud_UNI_陈晨

DCloud_UNI_陈晨 - DCloud前端开发工程师

条件编译,把微信api放在微信的条件编译里

要回复问题请先登录注册