"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const react_native_1 = require("react-native");
const MediaStream_1 = __importDefault(require("./MediaStream"));
const MediaStreamError_1 = __importDefault(require("./MediaStreamError"));
const { WebRTCModule } = react_native_1.NativeModules;
function getDisplayMedia() {
    return new Promise((resolve, reject) => {
        WebRTCModule.getDisplayMedia().then(data => {
            const { streamId, track } = data;
            const info = {
                streamId: streamId,
                streamReactTag: streamId,
                tracks: [track]
            };
            const stream = new MediaStream_1.default(info);
            resolve(stream);
        }, error => {
            reject(new MediaStreamError_1.default(error));
        });
    });
}
exports.default = getDisplayMedia;
//# sourceMappingURL=getDisplayMedia.js.map