Fix critical browser phone shortcode issues
Issues Fixed: 1. 🎵 Audio Error: Removed missing ringtone.mp3 causing 404 error 2. 📡 Twilio SDK Loading: Added proper SDK availability checking and retry mechanism 3. 🎨 Contrast Issues: Improved readability with darker text colors Technical Changes: - Removed hardcoded ringtone.mp3 reference causing 404 errors - Added waitForTwilioSDK() function with 5-second timeout and retry logic - Changed Twilio SDK loading to head (false flag) for better availability - Enhanced error handling with specific Twilio SDK load failure messages - Improved text contrast: #6c757d → #495057, #495057 → #212529 - Enhanced dark mode colors for better accessibility UI Improvements: - Status text: font-weight 600, color #212529 for better visibility - Labels and selects: improved contrast ratios - Queue info: better text color for mobile readability - Call status: font-weight 600 for prominence - Dark mode: complete color scheme overhaul with proper contrast Error Handling: - Graceful SDK loading with visual feedback - Clear error messages for troubleshooting - Automatic retry mechanism for network issues - Timeout handling for slow connections 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -32,7 +32,7 @@ class TWP_Shortcodes {
|
||||
'https://sdk.twilio.com/js/voice/2.11.1/twilio.min.js',
|
||||
array(),
|
||||
'2.11.1',
|
||||
true
|
||||
false // Load in head to ensure it's available
|
||||
);
|
||||
|
||||
// Enqueue our browser phone script
|
||||
@@ -180,10 +180,8 @@ class TWP_Shortcodes {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Audio elements -->
|
||||
<audio id="twp-ringtone" preload="auto" loop>
|
||||
<source src="<?php echo TWP_PLUGIN_URL; ?>assets/audio/ringtone.mp3" type="audio/mpeg">
|
||||
</audio>
|
||||
<!-- Audio elements for incoming calls handled by browser -->
|
||||
<audio id="twp-ringtone" style="display: none;"></audio>
|
||||
|
||||
<!-- Error/Success Messages -->
|
||||
<div class="twp-messages" id="twp-messages"></div>
|
||||
|
Reference in New Issue
Block a user