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) => {
49
49
viewer . model ?. disposeAll ( ) ;
50
50
if ( isPlaying && isCurrentPlay ) {
51
51
setIsPlaying ( false ) ;
52
+ viewer . model ?. loadIdleAnimation ( ) ;
52
53
} else {
53
54
setCurrentPlayId ( danceItem . danceId ) ;
54
55
setIsPlaying ( true ) ;
Original file line number Diff line number Diff line change @@ -7,11 +7,7 @@ export class AudioPlayer {
7
7
this . bufferSource = undefined ;
8
8
}
9
9
10
- public async playFromArrayBuffer (
11
- buffer : ArrayBuffer ,
12
- onEnded ?: ( ) => void ,
13
- onProgress ?: ( ) => void ,
14
- ) {
10
+ public async playFromArrayBuffer ( buffer : ArrayBuffer , onEnded ?: ( ) => void ) {
15
11
const audioBuffer = await this . audio . decodeAudioData ( buffer ) ;
16
12
17
13
this . bufferSource = this . audio . createBufferSource ( ) ;
@@ -22,9 +18,6 @@ export class AudioPlayer {
22
18
if ( onEnded ) {
23
19
this . bufferSource . addEventListener ( 'ended' , onEnded ) ;
24
20
}
25
- if ( onProgress ) {
26
- this . bufferSource . addEventListener ( 'time' , onProgress ) ;
27
- }
28
21
}
29
22
30
23
public stopPlay ( ) {
Original file line number Diff line number Diff line change @@ -163,12 +163,10 @@ export class Model {
163
163
const clip = await loadVMDAnimation ( danceUrl , vrm ) ;
164
164
const action = mixer . clipAction ( clip ) ;
165
165
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 ;
172
170
173
171
this . _action = action ;
174
172
this . _clip = clip ;
You can’t perform that action at this time.
0 commit comments