Skip to content

Commit

Permalink
@mister-ben added try catch to volume and playbackrate checks. Fixes #…
Browse files Browse the repository at this point in the history
…3315. closes #3320
  • Loading branch information
mister-ben authored and gkatsev committed Jun 28, 2016
1 parent 0808f84 commit 9de215f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))

--------------------

Expand Down
22 changes: 16 additions & 6 deletions src/js/tech/html5.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
};

/*
Expand All @@ -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;
}
};

/*
Expand Down

0 comments on commit 9de215f

Please sign in to comment.