为什么 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 (将#修改为@)