diff --git a/lib/abr/simple_abr_manager.js b/lib/abr/simple_abr_manager.js index 1029333055..304d11eec2 100644 --- a/lib/abr/simple_abr_manager.js +++ b/lib/abr/simple_abr_manager.js @@ -52,7 +52,7 @@ shaka.abr.SimpleAbrManager = class { // retrieving information about a user's network connection. We listen // to the change event to be able to make quick changes in case the type // of connectivity changes. - if (navigator.connection) { + if (navigator.connection && navigator.connection.addEventListener) { this.onNetworkInformationChange_ = () => { if (this.config_.useNetworkInformation && this.enabled_) { this.bandwidthEstimator_ = new shaka.abr.EwmaBandwidthEstimator(); @@ -143,7 +143,7 @@ shaka.abr.SimpleAbrManager = class { release() { // stop() should already have been called for unload - if (navigator.connection) { + if (navigator.connection && navigator.connection.removeEventListener) { navigator.connection.removeEventListener( 'change', this.onNetworkInformationChange_); this.onNetworkInformationChange_ = null;