Commit e82d9ac0 authored by 李维's avatar 李维

Update package

parent d73963a7
......@@ -9,7 +9,6 @@
# dependencies
/node_modules
/publish
# profiling files
chrome-profiler-events*.json
......
......@@ -114,20 +114,30 @@ export class Cartoon {
const audio = this.audio.get(key);
audio.volume = volume
}
stopAllAudio(){
this._playingNow.forEach(audio=>{
try{
if(audio){
audio.onended && audio.onended()
audio.pause();
audio.currentTime = 0;
}else{
if(audio.src && this.audioCallback[audio.src] && this.audioCallback[audio.src]["onended"]){
this.audioCallback[audio.src]["onended"]()
stopAllAudio(audioAll?){
if(!audioAll){
audioAll = this._playingNow
}
audioAll.forEach(audio_URL=>{
if(audio_URL){
const audio = this.audio.get(audio_URL);
try{
if(audio){
audio.onended && audio.onended()
audio.pause && audio.pause();
audio.currentTime = 0;
}else{
if(this.audioCallback[audio_URL] && this.audioCallback[audio_URL]["onended"]){
this.audioCallback[audio_URL]["onended"]()
}
}
}catch(err){
console.log(err)
}
}catch(err){
console.log(err)
}
else if(this._currentPlayAudio){
this._currentPlayAudio.pause();
this._currentPlayAudio.currentTime = 0;
}
})
this._playingNow = []
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment