Skip to content

[Angular] Cannot read property 'PeerConnection' of undefined #35

@radarsu

Description

@radarsu

WebRTC module is included in NgModule. Creating new WebRTC object fails with error:
Cannot read property 'PeerConnection' of undefined

import { Component, OnInit } from '@angular/core'
import { WebRTC, WebRTCView, Quality } from 'nativescript-webrtc-plugin'
import { Page } from 'tns-core-modules/ui'

declare let frame: any

@Component({
  selector: 'app-video',
  moduleId: module.id,
  templateUrl: './video.html',
})
export class VideoComponent implements OnInit {
  constructor() {}

  async ngOnInit() {

    const webrtc = new WebRTC({
      iceServers: [
        {
          url: 'someServer'
          username: 'someUser',
          password: 'somePassword',
        },
      ],
    })
    let remoteStream: any
    let localStream: any
  }
}

Platform

  • Android Device

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions