sdenv/browser/chrome/RTCPeerConnection.js

21 lines
853 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

module.exports = (sdenv) => {
const window = sdenv.memory.sdWindow;
function RTCPeerConnection() {
if (!(this instanceof RTCPeerConnection)) {
throw new TypeError("Uncaught TypeError: Failed to construct 'RTCPeerConnection': Please use the 'new' operator, this DOM object constructor cannot be called as a function.");
}
this.createDataChannel = function(...params) {
// window.console.log(`【RTCPeerConnection RTCPeerConnection】调用参数${params}`)
}
this.createOffer = function(...params) {
// window.console.log(`【RTCPeerConnection createOffer】调用参数${params}`)
}
}
sdenv.tools.setNativeFuncName(RTCPeerConnection, 'RTCPeerConnection');
sdenv.tools.setNativeObjName(RTCPeerConnection.prototype, 'RTCPeerConnection');
window.RTCPeerConnection = RTCPeerConnection;
}