File tree Expand file tree Collapse file tree 3 files changed +6
-14
lines changed
Expand file tree Collapse file tree 3 files changed +6
-14
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,7 @@ const DanceItem = (props: DanceItemProps) => {
4949 viewer . model ?. disposeAll ( ) ;
5050 if ( isPlaying && isCurrentPlay ) {
5151 setIsPlaying ( false ) ;
52+ viewer . model ?. loadIdleAnimation ( ) ;
5253 } else {
5354 setCurrentPlayId ( danceItem . danceId ) ;
5455 setIsPlaying ( true ) ;
Original file line number Diff line number Diff line change @@ -7,11 +7,7 @@ export class AudioPlayer {
77 this . bufferSource = undefined ;
88 }
99
10- public async playFromArrayBuffer (
11- buffer : ArrayBuffer ,
12- onEnded ?: ( ) => void ,
13- onProgress ?: ( ) => void ,
14- ) {
10+ public async playFromArrayBuffer ( buffer : ArrayBuffer , onEnded ?: ( ) => void ) {
1511 const audioBuffer = await this . audio . decodeAudioData ( buffer ) ;
1612
1713 this . bufferSource = this . audio . createBufferSource ( ) ;
@@ -22,9 +18,6 @@ export class AudioPlayer {
2218 if ( onEnded ) {
2319 this . bufferSource . addEventListener ( 'ended' , onEnded ) ;
2420 }
25- if ( onProgress ) {
26- this . bufferSource . addEventListener ( 'time' , onProgress ) ;
27- }
2821 }
2922
3023 public stopPlay ( ) {
Original file line number Diff line number Diff line change @@ -163,12 +163,10 @@ export class Model {
163163 const clip = await loadVMDAnimation ( danceUrl , vrm ) ;
164164 const action = mixer . clipAction ( clip ) ;
165165 action . setLoop ( LoopOnce , 1 ) . play ( ) ; // play animation
166- if ( audioUrl ) {
167- this . _audioPlayer ?. playFromURL ( audioUrl , ( ) => {
168- onEnd ?.( ) ;
169- } ) ;
170- this . _audio = audioUrl ;
171- }
166+ this . _audioPlayer ?. playFromURL ( audioUrl , ( ) => {
167+ onEnd ?.( ) ;
168+ } ) ;
169+ this . _audio = audioUrl ;
172170
173171 this . _action = action ;
174172 this . _clip = clip ;
You can’t perform that action at this time.
0 commit comments