видеовызов twilio JS/.Net MVC

Я реализую функцию видеозвонка twilio, используя Javascript и MVC .net. Когда я запускаю проект, веб-браузер запрашивает разрешения для камеры и микрофона, но не показывает камеру.

Я не могу найти ничего связанного с документацией. https://media.twiliocdn.com/sdk/js/video/releases/1.14.0/docs/index.html

Если кто-то может определить ошибку здесь, это было бы здорово. Спасибо

Index.cshtml

@model twilioTest.Models.twilioVideoCall

@{
    ViewBag.Title = "Index";
}

@{
    ViewBag.Title = "Home Page";
}


<div class="jumbotron">
    <p>test</p>

    <div id="myCall"></div>
</div>

@section Scripts {

    @Scripts.Render("~/bundles/jquery")
<script src="//media.twiliocdn.com/sdk/js/video/releases/2.7.0/twilio-video.min.js"></script>
    <script>

    const Video = Twilio.Video;
        Video.connect('@Model.twilioToken', { name: '@Model.room.UniqueName' }).then(room => {
           // debugger;
            console.log('Connected to Room "%s"', room.name);
            console.log('room.participants "%s"', JSON.stringify(room.localParticipant));
    room.participants.forEach(participantConnected);
    room.on('participantConnected', participantConnected);

    room.on('participantDisconnected', participantDisconnected);
    room.once('disconnected', error => room.participants.forEach(participantDisconnected));
        });

     
        function participantConnected(participant) {
            //  debugger;
    console.log('test')
    console.log('Participant "%s" connected', participant.identity);

    const div = document.createElement('div');
    div.id = participant.sid;
    div.innerText = participant.identity;

    participant.on('trackSubscribed', track => trackSubscribed(div, track));
    participant.on('trackUnsubscribed', trackUnsubscribed);

    participant.tracks.forEach(publication => {
    if (publication.isSubscribed) {
    trackSubscribed(div, publication.track);
    }
    });
    $("#myCall").html(div);
    //  document.body.appendChild(div);
    }

        function participantDisconnected(participant) {
           // debugger;
    console.log('Participant "%s" disconnected', participant.identity);
    document.getElementById(participant.sid).remove();
    }

        function trackSubscribed(div, track) {
           // debugger;
    div.appendChild(track.attach());
    }

        function trackUnsubscribed(track) {
         //   debugger;
    track.detach().forEach(element => element.remove());
    }
    </script>
}

HomeController.cs

using System;
using System.Collections.Generic;
using Twilio;
using Twilio.Rest.Video.V1.Room;
using Twilio.Base;
using Twilio.Rest.Video.V1;
using Twilio.Jwt.AccessToken;
using System.Web.Mvc;
using twilioTest.Models;

namespace twilioTest.Controllers
{
    public class HomeController : Controller
    {
        public ActionResult Index()

        {

            const string accountSid = "XXXXXXXXXX";
            const string authToken = "XXXXXXXXXX";
            var apiKeySid = "XXXXXXXXXX";
            var apiKeySecret = "XXXXXXXXXX";
            var identity = "test";
            string roomName = "TESTROOM";


            TwilioClient.Init(accountSid, authToken);
            //create a Room
            var room = RoomResource.Create(uniqueName: roomName);

            //access token
           
            var grant = new VideoGrant(); // Create a video grant for the token
            grant.Room = roomName;
            var grants = new HashSet<IGrant> { grant };

            // Create an Access Token generator
            var token = new Token(accountSid, apiKeySid, apiKeySecret, identity: identity, grants: grants);

            // Serialize the token as a JWT

            twilioVideoCall modelTwVidCall = new twilioVideoCall();
            modelTwVidCall.room = room;
            modelTwVidCall.twilioToken = token.ToJwt().ToString();

            return View(modelTwVidCall);
        }


    }
}

person stacker    schedule 27.07.2020    source источник