Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var pc = new cordova.plugins.iosrtc.RTCPeerConnection({
- iceServers: []
- });
- cordova.plugins.iosrtc.getUserMedia(
- // constraints
- { audio: true, video: true },
- // success callback
- function (stream) {
- console.log('got local MediaStream: ', stream);
- pc.addStream(stream);
- },
- // failure callback
- function (error) {
- console.error('getUserMedia failed: ', error);
- }
- );
- var sessionDescriptionHandlerOptions = {
- constraints: {
- audio: audioId,
- video: videoId
- },
- media: {
- local: {
- audio: document.getElementById('localAudio')
- },
- remote: {
- audio: document.getElementById('remoteAudio')
- }
- },
- extraHeaders: extraHeaders
- }
- }
- userAgent.invite('sipusertocall', sessionDescriptionHandlerOptions);
- navigator.mediaDevices.getUserMedia(
- function (stream) {
- console.log('got local MediaStream: ', stream);
- window.stream = stream;
- },
- // failure callback
- function (error) {
- console.error('getUserMedia failed: ', error);
- }
- )
- var sessionDescriptionHandlerOptions = {
- constraints: {
- audio: audioId,
- video: videoId
- },
- media: {
- local: {
- audio: document.getElementById('localAudio')
- },
- remote: {
- audio: document.getElementById('remoteAudio')
- }
- },
- extraHeaders: extraHeaders
- }
- userAgent.invite('sipusertocall', sessionDescriptionHandlerOptions);
Add Comment
Please, Sign In to add comment