|
@@ -42,19 +42,17 @@ PCMPlayer.prototype.getTypedArray = function () {
|
|
|
|
|
|
PCMPlayer.prototype.createContext = function () {
|
|
|
this.audioCtx = new (window.AudioContext || window.webkitAudioContext)();
|
|
|
- $.alert({
|
|
|
- title: '提示',
|
|
|
- text: '开始使用云手机',
|
|
|
- onOK: () => {
|
|
|
- this.audioCtx.resume().then(() => {
|
|
|
- this.gainNode = this.audioCtx.createGain();
|
|
|
- this.gainNode.gain.value = 1;
|
|
|
- this.gainNode.connect(this.audioCtx.destination);
|
|
|
- this.startTime = this.audioCtx.currentTime;
|
|
|
- })
|
|
|
+ this.gainNode = this.audioCtx.createGain();
|
|
|
+ this.gainNode.gain.value = 1;
|
|
|
+ this.gainNode.connect(this.audioCtx.destination);
|
|
|
+ this.startTime = this.audioCtx.currentTime;
|
|
|
+ document.documentElement.addEventListener('mousedown', () => {
|
|
|
+ console.log(this.audioCtx.state);
|
|
|
+ if (this.audioCtx.state !== 'running') {
|
|
|
+ this.audioCtx.resume();
|
|
|
+ console.log(this.audioCtx.resume());
|
|
|
}
|
|
|
});
|
|
|
-
|
|
|
};
|
|
|
|
|
|
PCMPlayer.prototype.isTypedArray = function (data) {
|