@@ -411,6 +411,7 @@ <h2 class="text-xl font-bold mb-4">System Diagnostics</h2>
411411 < button id ="run-system-test " class ="btn btn-blue "> Run System Test</ button >
412412 < button id ="refresh-log " class ="btn btn-blue "> Refresh App Log</ button >
413413 < button id ="refresh-mediamtx-log " class ="btn btn-blue "> MediaMTX Logs</ button >
414+ < button id ="test-mediamtx-config " class ="btn btn-blue "> Test MediaMTX Config</ button >
414415 < button id ="test-autostart " class ="btn btn-blue "> Test Auto-Start</ button >
415416 < button id ="test-update-connection " class ="btn btn-blue "> Test Update Connection</ button >
416417 < button id ="check-updates " class ="btn btn-green "> Check for Updates</ button >
@@ -655,6 +656,48 @@ <h3 class="font-bold mb-2">Application Log:</h3>
655656 } ) ;
656657 } ) ;
657658
659+ $ ( '#test-mediamtx-config' ) . click ( function ( ) {
660+ const button = $ ( this ) ;
661+ button . text ( 'Testing...' ) . prop ( 'disabled' , true ) ;
662+
663+ const testData = {
664+ srt_port : $ ( '#srt-port' ) . val ( ) || 8888 ,
665+ stream_name : $ ( '#stream-name' ) . val ( ) || 'live'
666+ } ;
667+
668+ $ . ajax ( {
669+ url : '/api/mediamtx/test-config' ,
670+ type : 'POST' ,
671+ contentType : 'application/json' ,
672+ data : JSON . stringify ( testData ) ,
673+ success : function ( data ) {
674+ let message = '🔧 MediaMTX Configuration Test:\n\n' ;
675+ message += `Configuration Valid: ${ data . config_valid ? '✅ Yes' : '❌ No' } \n` ;
676+ message += `MediaMTX Version: ${ data . mediamtx_version || 'Unknown' } \n` ;
677+ message += `Binary Path: ${ data . mediamtx_binary } \n` ;
678+ message += `Config File: ${ data . config_file } \n\n` ;
679+
680+ if ( data . config_valid ) {
681+ message += '✅ Configuration should work with your MediaMTX version.' ;
682+ } else {
683+ message += '❌ Configuration may have compatibility issues.' ;
684+ if ( data . error ) {
685+ message += `\nError: ${ data . error } ` ;
686+ }
687+ }
688+
689+ alert ( message ) ;
690+ } ,
691+ error : function ( xhr ) {
692+ const errorMessage = xhr . responseJSON ? xhr . responseJSON . error : 'Config test failed' ;
693+ alert ( `❌ MediaMTX config test failed: ${ errorMessage } ` ) ;
694+ } ,
695+ complete : function ( ) {
696+ button . text ( 'Test MediaMTX Config' ) . prop ( 'disabled' , false ) ;
697+ }
698+ } ) ;
699+ } ) ;
700+
658701 $ ( '#test-update-connection' ) . click ( function ( ) {
659702 const button = $ ( this ) ;
660703 button . text ( 'Testing...' ) . prop ( 'disabled' , true ) ;
0 commit comments