mirror of
https://github.com/openharmony/third_party_jsframework.git
synced 2026-07-19 14:33:33 -04:00
@@ -33,6 +33,9 @@ export function mockMultimediaAudio() {
|
||||
sampleRates: [paramMock.paramNumberMock],
|
||||
channelCounts: [paramMock.paramNumberMock],
|
||||
channelMasks: [paramMock.paramNumberMock],
|
||||
networkId: [paramMock.paramStringMock],
|
||||
interruptGroupId: [paramMock.paramNumberMock],
|
||||
volumeGroupId: [paramMock.paramNumberMock],
|
||||
}
|
||||
const DeviceChangeAction = {
|
||||
type: "[PC Preview] unknow type",
|
||||
@@ -94,6 +97,11 @@ export function mockMultimediaAudio() {
|
||||
capturerState: AudioState,
|
||||
deviceDescriptors: [AudioDeviceDescriptor],
|
||||
}
|
||||
const AudioRendererFilter = {
|
||||
uid: "[PC Preview] unknow uid",
|
||||
rendererInfo: AudioRendererInfo,
|
||||
rendererId: "[PC Preview] unknow rendererId",
|
||||
}
|
||||
const AudioCapturer = {
|
||||
state: "[PC Preview] unknow state",
|
||||
getCapturerInfo: function (...args) {
|
||||
@@ -641,6 +649,18 @@ export function mockMultimediaAudio() {
|
||||
resolve(AudioStreamManager);
|
||||
})
|
||||
}
|
||||
},
|
||||
getRoutingManager: function (...args) {
|
||||
console.warn("AudioManager.getRoutingManager interface mocked in the Previewer." +
|
||||
" How this interface works on the Previewer may be different from that on a real device.")
|
||||
const len = args.length
|
||||
if (typeof args[len - 1] === 'function') {
|
||||
args[len - 1].call(this, paramMock.businessErrorMock, AudioRoutingManager);
|
||||
} else {
|
||||
return new Promise((resolve, reject) => {
|
||||
resolve(AudioStreamManager);
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
const AudioStreamManager = {
|
||||
@@ -687,6 +707,42 @@ export function mockMultimediaAudio() {
|
||||
}
|
||||
}
|
||||
}
|
||||
const AudioRoutingManager = {
|
||||
on: function (...args) {
|
||||
const len = args.length
|
||||
if (typeof args[len - 1] === 'function') {
|
||||
if (args[0] == 'deviceChange') {
|
||||
console.warn("AudioRoutingManager.on_deviceChange interface mocked in the Previewer." +
|
||||
" How this interface works on the Previewer may be different from that on a real device.")
|
||||
}
|
||||
}
|
||||
},
|
||||
off: function (...args) {
|
||||
console.warn("AudioRoutingManager.off interface mocked in the Previewer." +
|
||||
" How this interface works on the Previewer may be different from that on a real device.")
|
||||
},
|
||||
getDevices: function (...args) {
|
||||
console.warn("AudioRoutingManager.getDevices interface mocked in the Previewer." +
|
||||
" How this interface works on the Previewer may be different from that on a real device.")
|
||||
var AudioDeviceDescriptors = new Array(AudioDeviceDescriptor)
|
||||
const len = args.length
|
||||
if (typeof args[len - 1] === 'function') {
|
||||
args[len - 1].call(this, paramMock.businessErrorMock, AudioDeviceDescriptors);
|
||||
} else {
|
||||
return new Promise((resolve, reject) => {
|
||||
resolve(AudioDeviceDescriptors);
|
||||
})
|
||||
}
|
||||
},
|
||||
selectOutputDevice: function (...args) {
|
||||
console.warn("AudioRoutingManager.selectOutputDevice interface mocked in the Previewer." +
|
||||
" How this interface works on the Previewer may be different from that on a real device.")
|
||||
},
|
||||
selectOutputDeviceByFilter: function (...args) {
|
||||
console.warn("AudioRoutingManager.selectOutputDeviceByFilter interface mocked in the Previewer." +
|
||||
" How this interface works on the Previewer may be different from that on a real device.")
|
||||
},
|
||||
}
|
||||
const audio = {
|
||||
AudioState: {
|
||||
STATE_INVALID: -1,
|
||||
|
||||
Reference in New Issue
Block a user