社交电商APP测试背景音乐

2020-11-03 11:20:25 阅读:6 编辑

https://github.com/farwolf2010/record

<template>
  <div style="margin-top: 100px;">
    <text class="text" @click="click">播放</text>
  </div>
</template>
<style scoped>
  .text{
    font-size: 60px;
  }
</style>
<script>
    import wx from './../../common/wx'
    export default {
        data:function () {
            return {

            };
        },
        mixins: [require('./../../common/publish').publish],
        methods:{
            click(){

                const backgroundAudioManager = wx.getBackgroundAudioManager();
                backgroundAudioManager.title = '此时此刻'
                backgroundAudioManager.epname = '此时此刻'
                backgroundAudioManager.singer = '许巍'
                backgroundAudioManager.src = 'https://eeui.app/assets/samples/audio.mp3'
                backgroundAudioManager.play();
            }
        },
        mounted:function () {

        },
        created:function () {
        }
    }
</script>