微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

为什么 MediaStream 对象是 {} JSON?

如何解决为什么 MediaStream 对象是 {} JSON?

我有一个指向实时流的 MediaStream 对象。它存储在一个名为 Create Table Veterinarians (vetName varchar2(20),vid Number(5) primary key); Create Table Dogs (dogName varchar2(20),did Number(5) primary key); Create Table Location (lid Number(5) primary key,locName varchar2(20),); Create Table examine (vid int foreign key references Veterinarians(vid),did int foreign key references Dogs(did),lid int foreign key references Location(lid),fee Number(5)); INSERT INTO Veterinarians VALUES ('Alice',112); INSERT INTO Veterinarians VALUES ('Mary',211); INSERT INTO Veterinarians VALUES ('Jim',111); INSERT INTO Dogs VALUES ('Spot',324); INSERT INTO Dogs VALUES ('Fido',582); INSERT INTO Dogs VALUES ('Tiger',731); INSERT INTO Location VALUES (1001,'St.Cloud'); INSERT INTO Location VALUES (1002,'Minneapolis'); INSERT INTO Location VALUES (1003,'Duluth'); INSERT INTO examine VALUES (111,324,1001,10); INSERT INTO examine VALUES (111,731,1003,20); INSERT INTO examine VALUES (112,30); INSERT INTO examine VALUES (112,582,50); INSERT INTO examine VALUES (112,1002,35); INSERT INTO examine VALUES (211,25); INSERT INTO examine VALUES (211,20); INSERT INTO examine VALUES (211,65); --Creating a stored procedure Create PROCEDURE display_Avg(vid int) AS BEGIN select v.vid,v.vetName,Avg(e.fee) as AverageFee from Veterinarians v INNER JOIN examine e ON v.vid=e.vid Where v.vid=display_Avg.vid Group By v.vid,v.vetName; END; --Executing stored procedure Execute display_Avg(112); CREATE PROCEDURE display_DogNames AS BEGIN select dogName from Dogs INNER JOIN examine ON examine.did=Dogs.did INNER JOIN Location On examine.lid=Location.lid Where Location.lid=1001 AND Location.lid=1002 AND Location.lid=1003 END; 的变量中。这是我的控制台:

vs

MediaStream 对象为什么是 JSON 中的 > vs < MediaStream {id: "MEDIASTREAMID",active: true,...} > JSON.stringify({Livestream:vs}) < "{"Livestream":{}}"

编辑:

这是一个例子:

{}
var canvas = document.querySelector("canvas");
var context = canvas.getContext("2d");
const video = document.querySelector('#myVidplayer');
var w,h;
canvas.style.display = "none";
function snapshot(){
    context.fillRect(0,w,h);
    context.drawImage(video,h);
    canvas.style.display = "block";
}
var vs;
window.navigator.mediaDevices.getUserMedia({ video: true,audio: true })
    .then(function(stream){
        video.srcObject = stream;
        vs=stream;
        console.log(JSON.stringify({Livestream:stream}));
        video.onloadedMetadata = (e) => {
            video.play();
            w = video.videoWidth;
            h = video.videoHeight
            canvas.width = w;
            canvas.height = h;
        };
    }).catch(function(e){
        alert('You have to enable the microphone and the camera');
    });

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。