diff --git a/CHANGELOG.md b/CHANGELOG.md index ab31b8e26f..b32f668f31 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ CHANGELOG ## HEAD (Unreleased) * @gkatsev pinned node-sass to 3.4 ([view](https://github.com/videojs/video.js/pull/3401)) +* @mister-ben added try catch to volume and playbackrate checks. Fixes #3315 ([view](https://github.com/videojs/video.js/pull/3320)) -------------------- diff --git a/src/js/tech/html5.js b/src/js/tech/html5.js index aaf84346ec..555fda817b 100644 --- a/src/js/tech/html5.js +++ b/src/js/tech/html5.js @@ -992,9 +992,14 @@ Html5.registerSourceHandler(Html5.nativeSourceHandler); * @return {Boolean} */ Html5.canControlVolume = function(){ - var volume = Html5.TEST_VID.volume; - Html5.TEST_VID.volume = (volume / 2) + 0.1; - return volume !== Html5.TEST_VID.volume; + // IE will error if Windows Media Player not installed #3315 + try { + var volume = Html5.TEST_VID.volume; + Html5.TEST_VID.volume = (volume / 2) + 0.1; + return volume !== Html5.TEST_VID.volume; + } catch(e) { + return false; + } }; /* @@ -1008,9 +1013,14 @@ Html5.canControlPlaybackRate = function(){ if (browser.IS_ANDROID && browser.IS_CHROME) { return false; } - var playbackRate = Html5.TEST_VID.playbackRate; - Html5.TEST_VID.playbackRate = (playbackRate / 2) + 0.1; - return playbackRate !== Html5.TEST_VID.playbackRate; + // IE will error if Windows Media Player not installed #3315 + try { + var playbackRate = Html5.TEST_VID.playbackRate; + Html5.TEST_VID.playbackRate = (playbackRate / 2) + 0.1; + return playbackRate !== Html5.TEST_VID.playbackRate; + } catch(e) { + return false; + } }; /*