This commit is contained in:
yumoqing 2024-02-21 13:20:59 +08:00
parent 1d1d654558
commit dac1e624d1

View File

@ -38,6 +38,9 @@ bricks.AudioPlayer = class oops extends bricks.JsWidget {
this.audio.src = url; this.audio.src = url;
console.log(this.audio.src,' new src seted'); console.log(this.audio.src,' new src seted');
} }
play(){
this.audio.play();
}
toggle_play(){ toggle_play(){
if (this.audio.paused){ if (this.audio.paused){
this.audio.play(); this.audio.play();
@ -45,6 +48,9 @@ bricks.AudioPlayer = class oops extends bricks.JsWidget {
this.audio.pause(); this.audio.pause();
} }
} }
set_url(url){
this.set_source(url);
}
} }