Skip to content

Commit

Permalink
相濡以沫,同舟共济
Browse files Browse the repository at this point in the history
  • Loading branch information
iammapping committed Apr 1, 2018
1 parent 716593f commit a3f4056
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
12 changes: 12 additions & 0 deletions assets/js/pm.js
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,19 @@
this.$btn.append(this.$audio);
this.initEvent();

var self = this;
if (this.options.autoplay) {
if (window.WeixinJSBridge) {
WeixinJSBridge.invoke('getNetworkType', {}, function (e) {
self.play();
}, false);
} else {
document.addEventListener("WeixinJSBridgeReady", function () {
WeixinJSBridge.invoke('getNetworkType', {}, function (e) {
self.play();
});
}, false);
}
this.play();
} else {
this.pause();
Expand Down
3 changes: 2 additions & 1 deletion views/layout.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@
<%- body %>

<!--TEMPLATES-->

<!--TEMPLATES END-->

<script src="https://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<!--SCRIPTS-->
<script src="/js/dependencies/jquery.min.js"></script>
<script src="/js/dependencies/comment.js"></script>
Expand Down

0 comments on commit a3f4056

Please sign in to comment.