1

I am attempting to get the basic tutorial for the AWS Chime SDK to work in our application and the meetingSession.audioVideo.listVideoInputDevices() always returns nothing/null.

I am running this on lastest chrome, my operating system is a windows 10 workspace instance. I have headphones plugged in; but that shouldn't make a difference.

My expected result is to return at least one device for the video. Here is the output from the Logger.

2020-08-26T15:29:19.127Z [INFO] MyLogger - attempting to trigger media device labels since they are hidden
chime-bundle.js:1 2020-08-26T15:29:19.133Z [INFO] MyLogger - unable to get media device labels
chime-bundle.js:1 2020-08-26T15:29:19.134Z [INFO] MyLogger - API/DefaultDeviceController/listVideoInputDevices null -> []
chime-bundle.js:1 Uncaught (in promise) TypeError: Cannot read property 'deviceId' of undefined

*Note. The video and audio elements are not hidden.

I have tried the code snippits from various demos. Which are all just a copy of AWS's walkthrough. So pretty much zero information. I have researched how the audio devices work in html5 and looking through the files provided in the sdk-js, I am even more confused. Can someone point me in the right direction?

Here is the basic code, you can get it, and a description from the link above.

var fetchResult = await window.fetch(
            window.encodeURI("<our endpoint for backend (running c# instead of node)>",
            {
                method: 'POST'
            }
        );
        let result = await fetchResult.json();

        
        console.log("Result from Chime API:", result);

        const logger = new ConsoleLogger('MyLogger', LogLevel.INFO);
        const deviceController = new DefaultDeviceController(logger);

        const meetingResponse = result.JoinInfo.Meeting;
        const attendeeResponse = result.JoinInfo.Attendee;
        const configuration = new MeetingSessionConfiguration(meetingResponse, attendeeResponse);

        // In the usage examples below, you will use this meetingSession object.
        const meetingSession = new DefaultMeetingSession(
            configuration,
            logger,
            deviceController
        );
        console.log("MEETING SESSION", meetingSession);

        //SETUP AUDIO
        const audioElement = document.getElementById('notary-audio');
        meetingSession.audioVideo.bindAudioElement(audioElement);

        
        const videoElement = document.getElementById('notary-video');

        // Make sure you have chosen your camera. In this use case, you will choose the first device.
        const videoInputDevices = await meetingSession.audioVideo.listVideoInputDevices();

        // The camera LED light will turn on indicating that it is now capturing.
        // See the "Device" section for details.
        await meetingSession.audioVideo.chooseVideoInputDevice(videoInputDevices[0].deviceId);

        const observer = {
            audioVideoDidStart: () => {
                console.log('Started');
            },
            audioVideoDidStop: sessionStatus => {
                // See the "Stopping a session" section for details.
                console.log('Stopped with a session status code: ', sessionStatus.statusCode());
            },
            audioVideoDidStartConnecting: reconnecting => {
                if (reconnecting) {
                    // e.g. the WiFi connection is dropped.
                    console.log('Attempting to reconnect');
                }
            },

            // videoTileDidUpdate is called whenever a new tile is created or tileState changes.
            videoTileDidUpdate: tileState => {
                // Ignore a tile without attendee ID and other attendee's tile.
                if (!tileState.boundAttendeeId || !tileState.localTile) {
                    return;
                }

                // videoTileDidUpdate is also invoked when you call startLocalVideoTile or tileState changes.
                console.log(`If you called stopLocalVideoTile, ${tileState.active} is false.`);
                meetingSession.audioVideo.bindVideoElement(tileState.tileId, videoElement);
                localTileId = tileState.tileId;
            },
            videoTileWasRemoved: tileId => {
                if (localTileId === tileId) {
                    console.log(`You called removeLocalVideoTile. videoElement can be bound to another tile.`);
                    localTileId = null;
                }
            }
        };

        meetingSession.audioVideo.addObserver(observer);
        meetingSession.audioVideo.start();
J_sdev
  • 341
  • 1
  • 13
  • I was able to get the figure out that, first off, it was a permissions issue. So I have allowed permissions as per: https://answers.chime.aws/articles/580/amazon-chime-web-app-device-permission-management.html. BUT, I still cannot access any devices for video or audio. – J_sdev Aug 27 '20 at 21:20
  • Further progress. The audio is actually working. There is a log message saying that audio and video isn't connected. So I made a test sound and was able to not only hear it but, record it and my voice. – J_sdev Sep 03 '20 at 14:46

0 Answers0