{
                            var option = document.createElement("option");
                            option.text = device.label;
                            option.value = device.deviceId;
                            deviceSelector.appendChild(option);
                        })
                    );
                } else {
                    console.log("no devices available");
                }
            }

            populateDeviceMenu();

            //]]>

        </script>

    </ui:define>
