Authored by ityuany

自动播放

... ... @@ -7,7 +7,6 @@
:poster="coverImg"
controls
preload="auto"
:autoplay="isWifi ? 'autoplay':null"
muted="muted"
playsinline
x5-playsinline
... ... @@ -49,8 +48,7 @@ export default {
data() {
return {
showVideo: false,
player: null,
isWifi: 0
player: null
};
},
computed: {
... ... @@ -191,9 +189,9 @@ export default {
}
});
this.$yoho.getNetStatus({}, function(res) {
this.$yoho.getNetStatus({}, (res) => {
if (res?.wifi === 1) {
setTimeout(() => this.player.play(), 200);
this.player.autoplay('muted');
}
});
... ...