1
0
mirror of https://github.com/videojs/video.js.git synced 2024-11-24 08:42:25 +02:00

@mister-ben added try catch to volume and playbackrate checks. Fixes #3315. closes #3320

This commit is contained in:
mister-ben 2016-06-27 22:15:17 -04:00 committed by Gary Katsevman
parent 0808f843eb
commit 9de215fa4c
2 changed files with 17 additions and 6 deletions

View File

@ -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))
--------------------

View File

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