Help & Support

 

Launching the audio squawk service

According to tech experts WebRTC represents the most complete standardised collection of technologies needed to create reliable, high quality, open, and compatible real-time communication platform.

 

If you are using Google Chrome or Firefox as your browser, you already have WebRTC enabled.

 

For best experience use a Google Chrome browser if possible. Chrome has the best debugging and WebRTC support, followed by Firefox. Microsoft Edge and other platforms work well but are more prone to issues.

 

Random disconnections

Unlike the old Flash player that buffered the audio and wait for a reconnection, WebRTC players tend to simply stop trying to send the audio until a sufficient connection is re-established.

 

If this occurs there are a couple of steps to try:

 

  • Check your Wi-Fi connectivity and signal strength.
  • If the network or Wi-Fi is disconnected, you will need to get it back on the network then reconnect.
  • If a computer loses a Wi-Fi network and swaps to a new SSID or base station, then the gap can disconnect it. If the IP address stays the same, then it will come back automatically. If it fully swaps networks, then you will need new routing and should click reconnect.
  • Perform a hard refresh (Ctrl+F5)
  • Firewall blocks the connection (see below).

 

 

Resetting the Player

As is the case with Netflix or Disney+ players, if the player is left on overnight and the device it’s on goes into ‘sleep’ mode, the player will disconnect and discontinue the audio. However, it isn’t always apparent that connection has been lost. Therefore, it is always advisable to refresh the player at the start of every new session (Ctrl+F5).

 

Firewalls

If you work for a corporation you are more than likely going to have a firewall in place for security reasons. This can sometimes cause issues receiving the service.

 

Failed WebRTC connections can be caused by restrictive networks behind symmetric NATs, port blocks and even protocol blocks at the application & transport layers.

 

Check for firewalls - Try running on a different network - some corporate networks limit specific protocol's connectivity, so running on an ADSL line or a different network with normal connectivity may solve the issue.

 

To set up the new WebTRC player through a firewall make a secure sockets connection to the server IP 54.77.234.138 on port 443.

 

Once the connection is established a peer-to-peer session is created over UDP - if this is not available it will try TCP – using the port range 6970 to 9999 if outbound traffic is restricted then a firewall rule between the internal clients and the IP address 54.77.234.138 will need to be created for 443 and the range of ports above. This is a two-way connection.

 

If a proxy server is also implemented this may also need to be bypassed.

 

Issues to note

  • - Extremely high CPU usage does not allow compression on some machines. If it is starving other processes, this can lead to the compression algorithms not having enough CPU to function. You can check this in the System Measurement tab of your device.

 

Please note: The “squawk” is not constant commentary; it only delivers important news and data.

/*jshint esversion: 6 */ var socket; var assigned_server = 3001; var distributor_server = 3010; var publisher_channel = ''; var broadcaster_channel = ''; var remote_ip = ''; var session_info = {}; var logging_interval; var logging_interval_time = 120000; var socket_emits = 0; var session_start_time; var reconnectionDelayGrowFactor = 1.2; var reconnection_delay = 1000; var playing = false; var connected_to_assigned = false; var socket_close_timeout; self.onmessage = function (msg) { switch(msg.data.action) { case 'Reactivate': reactivate(); break; case 'ConnectDistributor': connect_to_distributor(msg); break; case 'SessionStaticInfo': session_static_info(msg); break; case 'SessionInfo': update_session_info(msg.data); break; case 'PauseLogging': clearTimeout(logging_interval); break; case 'RestartLogging': postMessage({action: 'RequestSessionStaticInfo' }); break; case 'JoinPublisherChannel': join_publisher_channel(msg.data); break; case 'JoinPlayerChannel': join_player_channel(msg.data); break; case 'CheckChannelStatus': check_channel_status(msg.data); break; case 'PlayerLogResponse': player_log_response(msg.data); break; case 'CloseSocket': close_socket(); break; } }; function reactivate() { playing = false; connect_to_assigned_server(); } function player_log_response(data) { var data_array = {}; data_array.type = 'PlayerLogResponse'; data_array.respond_to_socket_final = data.respond_to_socket_final; data_array.respond_to_socket = data.respond_to_socket; data_array.player_socket_id = data.player_socket_id; data_array.logs = data.logs; var msg_string = JSON.stringify(data_array); if (socket.readyState == 1) { socket.send(msg_string); } } function check_channel_status(data) { var data_array = {}; data_array.type = 'check_channel_status'; data_array.app_name = data.app_name; var msg_string = JSON.stringify(data_array); if (socket.readyState == 1 && connected_to_assigned) { socket.send(msg_string); } else { setTimeout(function() { check_channel_status(data); },500); } } function check_channel_status_response(data) { postMessage({ action: 'CheckChannelStatusReponse', stream_status: data.stream_status.status, onair: data.stream_status.onair, connected: data.stream_status.connected }); } function join_publisher_channel(data) { var data_array = {}; data_array.type = 'join_publisher_channel'; data_array.publisher_channel = data.publisher_channel; data_array.username = data.username; data_array.subscriber_group = data.subscriber_group; data_array.display_name = data.display_name; data_array.single_sign_on = data.single_sign_on; data_array.remote_ip = data.remote_ip; data_array.http_referrer = data.http_referrer; data_array.current_page = data.current_page; data_array.php_session_id = data.php_session_id; var msg_string = JSON.stringify(data_array); if (socket.readyState == 1) { socket.send(msg_string); } postMessage({action: 'PublisherChannelJoined' }); } function session_static_info(msg) { set_static_session_info(msg.data); start_log(); } function connect_to_distributor(msg) { publisher_channel = msg.data.publisher_channel; remote_ip = msg.data.remote_ip; socket = new WebSocket("wss://ws.livesquawk.com/ws"+distributor_server); socket.onopen = function(event) { request_server_assignment(); }; socket.onmessage = function(event) { var msg_string = event.data.toString(); var data = JSON.parse(msg_string); switch(data.type) { case 'server_assignment_response': server_assignment_response(data); break; } }; } function session_info_interval() { postMessage({action: 'RequestSessionInfo' }); logging_interval = setTimeout(session_info_interval,logging_interval_time); } function server_assignment_response(data) { assigned_server = data.selected_server; socket.close(); connect_to_assigned_server(); } function request_server_assignment() { var data_array = {}; data_array.type = 'request_server_assignment'; var msg_string = JSON.stringify(data_array); if (socket.readyState == 1) { socket.send(msg_string); } } function connect_to_assigned_server() { socket = new WebSocket("wss://ws.livesquawk.com/ws"+assigned_server); socket.onopen = function(event) { postMessage({ action: 'VisibleConsole',console_string: "Connected to server "+assigned_server }); console.log("Connected to server "+assigned_server); postMessage({ action: 'ConnectedToAssigned' }); connected_to_assigned = true; if (playing) { postMessage({ action: 'RejoinPlayerChannel' }); } }; socket.onmessage = function(event) { var msg_string = event.data.toString(); var data = JSON.parse(msg_string); if (data.type != 'server_ping') { /* console.log(data.type); */ } switch(data.type) { case 'reconnect': postMessage({ action: 'VisibleConsole',console_string: "Reconnected" }); break; case 'reload': postMessage({ action: 'Reload' }); break; case 'start_log_response': start_log_response(data); break; case 'application_refresh_start': application_refresh_start(data); break; case 'application_refresh_stop': application_refresh_stop(data); break; case 'player_log_request': case 'check_channel_status_response': check_channel_status_response(data); break; case 'PlayerLogRequest': case 'new_tweet': case 'new_latest_news': case 'delete_report': case 'add_report': case 'add_ref_doc': case 'calendar_change': case 'calendar_insert': case 'calendar_delete': case 'new_note': case 'AppStart': case 'AppStop': case 'BroadcasterStarted': case 'BroadcasterStopped': pass_straight_to_post_message(data); break; case 'output': case 'server_ping': case 'reconnect': case 'disconnect': break; } }; socket.onerror = function(event) { postMessage({ action: 'VisibleConsole',console_string: "LS Socket Error" + event.type }); console.log(event); postMessage({ action: 'LSSocketConnectionError' }); }; socket.onclose = function(event) { console.log('Socket is closed. Reconnect will be attempted in 1 second.', event.reason); socket_close_timeout = setTimeout(connect_to_assigned_server, reconnection_delay); reconnection_delay = reconnection_delay*reconnectionDelayGrowFactor; connected_to_assigned = false; }; } function close_socket() { clearTimeout(socket_close_timeout); socket_close_timeout = null; socket.onclose = function(event) {}; socket.onmessage = function(event) {}; socket.onerror = function(event) {}; socket.close(1000); console.log('Socket Closed'); } function pass_straight_to_post_message(data) { data.action = data.type; postMessage(data); } function join_player_channel(data) { var data_array = {}; data_array.type = 'join_player_channel'; data_array.player_channel = data.player_channel; data_array.remote_ip = data.remote_ip; data_array.username = data.username; data_array.app_name = data.app_name; data_array.onair_status = data.onair_status; data_array.http_referrer = data.http_referrer; data_array.current_page = data.current_page; data_array.php_session_id = data.php_session_id; var msg_string = JSON.stringify(data_array); if (socket.readyState == 1) { socket.send(msg_string); } postMessage({action: 'PlayerChannelJoined' }); playing = true; } function start_log_response(data) { session_info.session_id = data.log_record_id; session_info_interval(); } function application_refresh_start(data) { if (data.app_name == session_info.application_name) { postMessage({action: 'ApplicationRefreshStart' }); } } function application_refresh_stop(data) { if (data.app_name == session_info.application_name) { postMessage({action: 'ApplicationRefreshStop' }); } } function set_static_session_info(data) { session_info.browser_codename = data.browser_codename; session_info.browser_name = data.browser_name; session_info.user_agent = data.user_agent; session_info.browser_version = data.browser_version; session_info.cookies_enabled = data.cookies_enabled; session_info.platform = data.platform; session_info.player_version = data.player_version; session_info.stream = data.stream; session_info.connection_protocol = data.protocol; session_info.delay_target = data.delay_target; session_info.session_email = data.session_email; session_info.remote_ip = data.remote_ip; session_info.php_session_id = data.php_session_id; session_info.application_name = data.application_name; session_info.http_referrer = data.http_referrer; } function start_log() { var session_start_date = new Date(); session_start_time = session_start_date.getTime(); var months = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec']; var session_start_date_string = session_start_date.getDate() + " " + months[session_start_date.getMonth()] + " " + session_start_date.getFullYear(); var data_array = {}; data_array.type = 'webrtc_start_log'; data_array.remote_ip = session_info.remote_ip; data_array.username = session_info.session_email; data_array.php_session_id = session_info.php_session_id; data_array.webrtc_protocol = ''; data_array.session_start_time = (session_start_time/1000).toFixed(0); data_array.stream_name = session_info.stream; data_array.session_start_date = session_start_date_string; var msg_string = JSON.stringify(data_array); if (socket.readyState == 1) { socket.send(msg_string); } } function update_session_info(data) { var data_array = {}; var msg_string = ''; var current_date = new Date(); var current_time = current_date.getTime(); session_info.protocol = data.protocol; session_info.curr_delay = (data.effective_latency / 1000).toFixed(2); session_info.session_length = current_time - session_start_time; session_info.ping_time = data.ping_time; session_info.jitter = data.jitter; session_info.packet_loss = data.packet_loss; session_info.effective_latency = data.effective_latency; session_info.mean_opinion_score = data.mean_opinion_score; session_info.restarts = data.restarts; if (socket_emits == 0) { data_array = {}; data_array.type = 'webrtc_log_data_full'; data_array.connection_protocol = session_info.protocol; data_array.threshold = 0; data_array.curr_delay = session_info.curr_delay; data_array.session_length = session_info.session_length; data_array.date = current_time; data_array.browser_codename = session_info.browser_codename; data_array.browser_name = session_info.browser_name; data_array.user_agent = session_info.user_agent; data_array.browser_version = session_info.browser_version; data_array.cookies_enabled = session_info.cookies_enabled; data_array.platform = session_info.platform; data_array.player_version = session_info.player_version; data_array.stream = session_info.stream; data_array.restarts = session_info.restarts; data_array.delay_target = 0; data_array.op_sys = ''; data_array.flash_version = ''; data_array.remote_ip = session_info.remote_ip; data_array.http_referrer = session_info.http_referrer; data_array.php_session_id = session_info.php_session_id; data_array.user_email = session_info.session_email; data_array.webrtc_protocol = session_info.protocol; data_array.ping_time = session_info.ping_time; data_array.jitter = session_info.jitter; data_array.packet_loss = session_info.packet_loss; data_array.effective_latency = session_info.effective_latency; data_array.mean_opinion_score = session_info.mean_opinion_score; data_array.session_id = session_info.session_id; msg_string = JSON.stringify(data_array); if (socket.readyState == 1) { socket.send(msg_string); } } else { data_array = {}; data_array.type = 'webrtc_log_data'; data_array.session_id = session_info.session_id; data_array.php_session_id = session_info.php_session_id; data_array.connection_protocol = session_info.protocol; data_array.restarts = session_info.restarts; data_array.threshold = 0; data_array.curr_delay = session_info.curr_delay; data_array.session_length = session_info.session_length; data_array.date = current_time; data_array.webrtc_protocol = session_info.protocol; data_array.ping_time = session_info.ping_time; data_array.jitter = session_info.jitter; data_array.packet_loss = session_info.packet_loss; data_array.effective_latency = session_info.effective_latency; data_array.mean_opinion_score = session_info.mean_opinion_score; data_array.stream = session_info.stream; msg_string = JSON.stringify(data_array); if (socket.readyState == 1) { socket.send(msg_string); } } socket_emits++; if (socket_emits == 100) { socket_emits = 0; } }