|
@@ -36,9 +36,9 @@ export const PageMusic = defineComponent({
|
|
|
preload: true,
|
|
|
HTML5: true,
|
|
|
});
|
|
|
+ controls.mediaCtrl.setMediasInstance(audioKey, audioBgm.value);
|
|
|
audioBgm.value.on("load", () => {
|
|
|
state.duration = audioBgm.value.duration();
|
|
|
- controls.mediaCtrl.setMediasInstance(audioKey, audioBgm.value);
|
|
|
if (!store.isEditMode) {
|
|
|
if (isWeixinBrowser()) {
|
|
|
WeixinJSBridge.invoke(
|
|
@@ -75,8 +75,19 @@ export const PageMusic = defineComponent({
|
|
|
audioRest();
|
|
|
}
|
|
|
});
|
|
|
+ setTimeout(() => {
|
|
|
+ checkAutoPlay();
|
|
|
+ }, 500);
|
|
|
+ };
|
|
|
+ const checkAutoPlay = () => {
|
|
|
+ if (!audioBgm.value || store.isEditMode) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ let playing = audioBgm.value.playing();
|
|
|
+ if (!playing) {
|
|
|
+ playAudio(true);
|
|
|
+ }
|
|
|
};
|
|
|
-
|
|
|
const playStep = () => {
|
|
|
if (!audioBgm.value) {
|
|
|
return;
|
|
@@ -100,6 +111,7 @@ export const PageMusic = defineComponent({
|
|
|
audioRest();
|
|
|
}
|
|
|
let playing = audioBgm.value.playing();
|
|
|
+ console.log(playing);
|
|
|
if (status && playing) {
|
|
|
state.playStatus = true;
|
|
|
return;
|