2014-02-24 38 views
1

我被要求解决JavaScript中的一个简单任务,但我不太熟悉它。我需要一个IP摄像机流,并将其放到three.js画布上。在three.js画布上的IP摄像机流

我开始用这个例子,它使用一个摄像头,而不是一个IP摄像机: http://stemkoski.github.io/Three.js/Webcam-Texture.html

在这里面有一个视频标签,看起来像这样:

<video id="monitor" autoplay width="160" height="120" style="visibility: hidden; float:left;"></video> 

我相信这后来被称为:

video = document.getElementById('monitor'); 

所以,就像我说的,我不知道很多关于JavaScript的,但我希望这将是相对简单的重在本例中,将呼叫发送到网络摄像机,以呼叫IP摄像机。我试图用一个新的标签替换标签:

<video controls src="http://[wowza-address]:1935/live/camera.stream/playlist.m3u8"> 
</video> 

但这并没有奏效。显然这比我原先预料的更复杂。任何人都可以引导我走向正确的方向吗?

+0

您可能想要研究CORS ... http://enable-cors.org/ – mrdoob

回答

0

已解决。

var imageDetect = document.createElement('img'); 

imageDetect.src = BaseURL + File; 

      function render() { 

      imageContext.drawImage(imageDetect, 0, 0); 

      if (texture) texture.needsUpdate = true; 
      if (textureReflection) textureReflection.needsUpdate = true; 

      renderer.render(scene, camera); 

     }