本地//data.js
var local_database = [
{
play_title: '01.西晋越窑青瓷双系罐',
play_img: '../../images/play_img.png',
time_img: '../../images/time_img.png',
time_wz: '00:55',
last_img: '../../images/last_img.jpg',
gelixian: '../../images/middle.png',
title_img_src: "../../../images/1.jpg",
xiangqing_play_img: "../../../images/play_img.png",
xiangqing_play_stop: "../../../images/play_stop.png",
xiangqing_play_wz: "01.西晋越窑青瓷双系罐",
xiangqing_play_wz_1: "西晋青瓷双系罐,1981年慈溪石堰公社立新大队出土。微信小程序数字计算的bug##微信小程序开发。直口,丰肩,圆鼓腹,平底内凹。肩部刻划弦纹数条,饰网格带纹一周,上置半环形竖系一对,贴印佛像铺首一对。通体施青釉,略偏黄,近底处无釉。贴印铺首、釉不及底等都是西晋越窑青瓷罐的特点之一。",
postId: 0,
music: {
url: "https://shanglinhu-1256137439.cos.ap-shanghai.myqcloud.com/yuyin/changzhan/01.%E8%A5%BF%E6%99%8B%E8%B6%8A%E7%AA%91%E9%9D%92%E7%93%B7%E5%8F%8C%E7%B3%BB%E7%BD%90.m4a",
title:"01.西晋越窑青瓷双系罐",
}
},
//xiangqing.js
onMusicTap: function (event) {
var currentPostId = this.data.currentPostId;
var xiangqing = post_play.post_list[currentPostId];
var isPlayingMusic = this.data.isPlayingMusic;
if (isPlayingMusic) {
wx.pauseBackgroundAudio();
this.setData({
isPlayingMusic: false
})
}
else {
wx.playBackgroundAudio({
dataUrl: 'xiangqing.music.url',
title:'xiangqing.music.title'
})
this.setData({
isPlayingMusic: true
})
}
}
播放不了
微信小程序开发相关问题解答;本文来自微信小程序工厂 http://www.xcxgc.com 转载请保留。
微信小程序开发者回答:
付***:
dataUrl是一个字符串?
本文网址:http://www.91bianli.com/kaifazhinan/74180.html