Bug 1325553 - Sound of "take screenshot" button respects relevant preference now; r=ntim

This commit is contained in:
Towkir Ahmed 2016-12-28 08:45:00 +01:00
Родитель 81424a65e3
Коммит 95eb20ef5c
1 изменённых файлов: 5 добавлений и 2 удалений

Просмотреть файл

@ -15,6 +15,7 @@ const { getFormatStr } = require("../utils/l10n");
const { getToplevelWindow } = require("sdk/window/utils");
const { Task: { spawn } } = require("devtools/shared/task");
const e10s = require("../utils/e10s");
const Services = require("Services");
const CAMERA_AUDIO_URL = "resource://devtools/client/themes/audio/shutter.wav";
@ -54,8 +55,10 @@ function saveToFile(data, filename) {
}
function simulateCameraEffects(node) {
let cameraAudio = new window.Audio(CAMERA_AUDIO_URL);
cameraAudio.play();
if (Services.prefs.getBoolPref("devtools.screenshot.audio.enabled")) {
let cameraAudio = new window.Audio(CAMERA_AUDIO_URL);
cameraAudio.play();
}
node.animate({ opacity: [ 0, 1 ] }, 500);
}