如何运行mediaStream [英] how to get running mediaStream

查看:391
本文介绍了如何运行mediaStream的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建了一个网络摄像头流

I've created a webCam Stream with

navigator.getUserMedia({ "video": true }, function(stream){
    videoTag.src = window.URL.createObjectURL(stream);
    videoTag.play();
}

我可以在全局范围内的stream中访问MediaStream对象吗?*

Can I access the MediaStream object in stream in global scope?*

(类似于navigator.getAllMediaStreams[0])

* edit:...无需向getUserMedia函数添加逻辑.我遇到的问题是一个qr-decoder-library,它为我获取数据流,我不想更改第三方代码

*edit: ...without adding logic to the getUserMedia function. My problem case is a qr-decoder-library, that gets the stream for me and I don't want to change the third party code

推荐答案

浏览器没有保留活动媒体流的列表.

There is no list of active media streams kept by the browser.

您可以将流保存到例如window.stream.

You can save the stream to for example window.stream.

这篇关于如何运行mediaStream的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆