File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ export class Player {
1919 private playing = false ;
2020 private speed = 500 ; // ms per step
2121 private mounted = false ;
22+ private showControls = true ;
2223
2324 // --- Element references ---
2425 private viewer : HTMLElement ;
@@ -110,6 +111,11 @@ export class Player {
110111 const handleMessage = ( event : MessageEvent ) => {
111112 if ( ! event . data ) return ;
112113
114+ if ( typeof event . data . controls === 'boolean' ) {
115+ this . showControls = event . data . controls ;
116+ this . renderControls ( ) ;
117+ }
118+
113119 let needsRender = false ;
114120
115121 // Update agents if provided
@@ -224,7 +230,7 @@ export class Player {
224230 } ;
225231
226232 private renderControls ( ) {
227- if ( ! this . replay ) {
233+ if ( ! this . replay || ! this . showControls ) {
228234 this . controls . style . display = 'none' ;
229235 return ;
230236 }
@@ -245,4 +251,4 @@ export class Player {
245251 this . stepSlider . value = this . step . toString ( ) ;
246252 this . stepCounter . textContent = `${ this . step + 1 } / ${ maxSteps + 1 } ` ;
247253 }
248- }
254+ }
You can’t perform that action at this time.
0 commit comments