5656 border-radius : 3px ;
5757 font-family : monospace;
5858 }
59- .clear-logs {
59+ .actions {
6060 margin-top : 10px ;
61- padding : 5px 10px ;
62- font-size : 12px ;
63- background-color : # f0f0f0 ;
64- border : 1px solid # ccc ;
65- border-radius : 3px ;
66- cursor : pointer;
6761 }
6862 </ style >
6963 </ head >
@@ -95,9 +89,12 @@ <h1>Improv Audio Player</h1>
9589 < div id ="connection-status "> Disconnected</ div >
9690 < div id ="available-groups "> </ div >
9791 < div id ="status-display " class ="status "> </ div >
98- < button id ="join-group-btn "> Join Group</ button >
99- < button id ="leave-group-btn "> Leave Group</ button >
100- < button class ="clear-logs " id ="clear-logs-btn "> Clear Logs</ button >
92+ < div class ="actions ">
93+ < button id ="stop-btn "> Stop</ button >
94+ < button id ="join-group-btn "> Join Group</ button >
95+ < button id ="leave-group-btn "> Leave Group</ button >
96+ < button class ="clear-logs " id ="clear-logs-btn "> Clear Logs</ button >
97+ </ div >
10198 </ div >
10299 < div id ="metadata " class ="metadata "> </ div >
103100 < div class ="artwork ">
@@ -118,6 +115,7 @@ <h1>Improv Audio Player</h1>
118115 const playerIdInput = document . getElementById ( "player-id-input" ) ;
119116 const urlInput = document . getElementById ( "url-input" ) ;
120117 const connectButton = document . getElementById ( "connect-button" ) ;
118+ const stopButton = document . getElementById ( "stop-btn" ) ;
121119 const availableGroups = document . getElementById ( "available-groups" ) ;
122120 const joinGroupButton = document . getElementById ( "join-group-btn" ) ;
123121 const leaveGroupButton = document . getElementById ( "leave-group-btn" ) ;
@@ -329,6 +327,17 @@ <h1>Improv Audio Player</h1>
329327 . map ( ( group ) => `<code>${ group . groupId } </code>` )
330328 . join ( ", " ) } `;
331329 } ) ;
330+ stopButton . addEventListener ( "click" , ( ) => {
331+ if ( ! client ) {
332+ logger . error ( "No client connected to stop playback" ) ;
333+ return ;
334+ }
335+ if ( ! client . sessionInfo ) {
336+ logger . error ( "No active session to stop" ) ;
337+ return ;
338+ }
339+ client . sendStreamCommand ( "stop" ) ;
340+ } ) ;
332341 </ script >
333342 </ body >
334343</ html >
0 commit comments